35#include "G4HCofThisEvent.hh"
37#include "G4ThreeVector.hh"
38#include "G4SDManager.hh"
49 collectionName.insert(HCname);
50 G4cout << collectionName.size() <<
" CalorimeterSD name: " << name <<
" collection Name: "
67 (SensitiveDetectorName,collectionName[0]);
69 G4cout <<
"CalorimeterSD::Initialize: " << SensitiveDetectorName <<
" "
70 << collectionName[0] << G4endl;
71 fHCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
81 G4double edep = aStep->GetTotalEnergyDeposit();
83 if(edep==0.)
return false;
86 newHit->
SetTrackID (aStep->GetTrack()->GetTrackID());
87 newHit->
SetChamberNb(aStep->GetPreStepPoint()->GetTouchable()
88 ->GetReplicaNumber());
90 newHit->
SetPos (aStep->GetPostStepPoint()->GetPosition());
105 std::vector<ExP01TrackerHit*> hitsVector;
108 G4cout <<
"\n-------->Storing hits in the ROOT file: in this event there are " << NbHits
109 <<
" hits in the tracker chambers: " << G4endl;
114 for (G4int i=0;i<NbHits;i++)
G4THitsCollection< ExP01TrackerHit > ExP01TrackerHitsCollection
Definition of the ExP01TrackerSD class.
Definition of the RootIO class.
Hit implementation for the persistency example.
void SetTrackID(G4int track)
void SetPos(G4ThreeVector xyz)
void SetEdep(G4double de)
void SetChamberNb(G4int chamb)
virtual void EndOfEvent(G4HCofThisEvent *)
virtual G4bool ProcessHits(G4Step *, G4TouchableHistory *)
ExP01TrackerHitsCollection * fTrackerCollection
virtual void Initialize(G4HCofThisEvent *)
static RootIO * GetInstance()
void Write(std::vector< ExP01TrackerHit * > *)