17 #include "G4RunManager.hh" 18 #include "G4SDManager.hh" 22 #include "G4ClassificationOfNewTrack.hh" 23 #include "G4TrackStatus.hh" 40 #include "TClonesArray.h" 80 sprintf(newDirName,
"%s%i",
"Histos",aRun->GetRunID());
85 sprintf(
dirName,
"%s",
"silRing");
114 G4int hitsCollectionID =
115 G4SDManager::GetSDMpointer()->GetCollectionID(
"SilRingCollection");
117 G4HCofThisEvent* HCofEvent = anEvent->GetHCofThisEvent();
123 G4int NbHits = hitsCollection->entries();
127 trackIDtable =
new G4int[NbHits];
129 detIDtable =
new G4int[NbHits];
131 IDtable =
new G4int[NbHits];
133 for (G4int i=0;i<NbHits;i++) {
134 if((*hitsCollection)[i]->GetParentID()==0) {
136 trackIDtable[indepHits] = (*hitsCollection)[i]->GetTrackID();
137 detIDtable[indepHits] = (*hitsCollection)[i]->GetDetID();
138 IDtable[i] = indepHits;
142 for(G4int j=0; j<indepHits;j++) {
143 if( (*hitsCollection)[i]->GetTrackID() == trackIDtable[j] &&
144 (*hitsCollection)[i]->GetDetID() == detIDtable[j]) {
149 trackIDtable[indepHits] = (*hitsCollection)[i]->GetTrackID();
150 detIDtable[indepHits] = (*hitsCollection)[i]->GetDetID();
151 IDtable[i] = indepHits;
161 for (G4int i=0;i<indepHits;i++)
169 existing =
new G4int[indepHits];
170 for(G4int i=0;i<indepHits;i++) existing[i] = 0;
172 for(G4int i=0;i<NbHits;i++) {
173 if( (*hitsCollection)[i]->GetParentID()==0 ) {
175 if( existing[IDtable[i]]==0) {
177 existing[IDtable[i]] = 1;
185 for (G4int i=0;i<indepHits;i++)
188 delete [] trackIDtable;
191 delete [] detIDtable;
void SetParticleCharge(Double_t pdgCharge)
void SetDetectorID(Int_t det)
void SetTime(Double_t ti)
G4THitsCollection< ActarSimSilRingGeantHit > ActarSimSilRingGeantHitsCollection
ActarSimROOTAnalSilRing()
Constructor.
void BeginOfRunAction(const G4Run *)
Actions to perform in the silicon anal at the begining of the run.
void SetStepsContributing(UInt_t step)
void SetParticleMass(Double_t pdgMass)
G4double GetParticleCharge()
G4ThreeVector GetLocalPrePos()
~ActarSimROOTAnalSilRing()
Destructor. Makes nothing.
void SetEAfterSil(Double_t ea)
void AddSilRingHit(ActarSimSilRingHit *cHit, ActarSimSilRingGeantHit *gHit, G4int mode)
void BeginOfEventAction(const G4Event *)
Actions to perform in the silicon anal at the begining of the event.
void SetEBeforeSil(Double_t eb)
void SetEnergy(Double_t ed)
TFile * simFile
Local pointer to simFile.
void SetRunID(UInt_t run)
void SetEventID(UInt_t ev)
ActarSimROOTAnalysis * gActarSimROOTAnalysis
Global pointer to this soliton.
void FillingHits(const G4Event *)
TBranch * silRingHitsBranch
Local branch for the silicon hits.
UInt_t GetStepsContributing()
ActarSimSilRingHit ** theSilRingHit
Pointer to the hits in the silicon ring.
void SetTheRunID(G4int id)
void EndOfEventAction(const G4Event *)
void UserSteppingAction(const G4Step *)
Actions to perform in the ACTAR gas detector analysis after each step.
void GeneratePrimaries(const G4Event *)
Actions to perform in the silicon anal when generating the primaries.
TTree * eventTree
Local pointer to the event tree.
void SetTheEventID(G4int id)
void SetTrackID(UInt_t tr)
TClonesArray * silRingHitCA
ClonesArray of the hits in the silicon ring.
G4double GetParticleMass()
void SetParticleID(UInt_t pdgID)