17 #include "G4RunManager.hh" 18 #include "G4SDManager.hh" 22 #include "G4ClassificationOfNewTrack.hh" 23 #include "G4TrackStatus.hh" 40 #include "TClonesArray.h" 54 silHitCA =
new TClonesArray(
"ActarSimSilHit",2);
80 sprintf(newDirName,
"%s%i",
"Histos",aRun->GetRunID());
114 G4int hitsCollectionID =
115 G4SDManager::GetSDMpointer()->GetCollectionID(
"SilCollection");
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++){
190 delete [] trackIDtable;
193 delete [] detIDtable;
194 for (G4int i=0;i<indepHits;i++)
delete theSilHit[i];
TClonesArray * silHitCA
ClonesArray of the hits in the silicons.
void SetTheRunID(G4int id)
G4ThreeVector GetLocalPrePos()
void SetRunID(UInt_t run)
void SetStepsContributing(UInt_t step)
void BeginOfEventAction(const G4Event *)
Actions to perform in the silicon anal at the begining of the event.
void SetTrackID(UInt_t tr)
void SetEventID(UInt_t ev)
ActarSimROOTAnalSil()
Constructor.
void SetEAfterSil(Double_t ea)
void EndOfEventAction(const G4Event *)
~ActarSimROOTAnalSil()
Destructor. Makes nothing.
TFile * simFile
Local pointer to simFile.
void SetParticleMass(Double_t pdgMass)
G4THitsCollection< ActarSimSilGeantHit > ActarSimSilGeantHitsCollection
void SetTheEventID(G4int id)
TBranch * silHitsBranch
Local branch for the silicon hits.
void SetEBeforeSil(Double_t eb)
void SetParticleID(UInt_t pdgID)
ActarSimROOTAnalysis * gActarSimROOTAnalysis
Global pointer to this soliton.
TTree * eventTree
Local pointer to the event tree.
void AddSilHit(ActarSimSilHit *cHit, ActarSimSilGeantHit *gHit, G4int mode)
G4double GetParticleCharge()
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.
UInt_t GetStepsContributing()
void FillingHits(const G4Event *)
ActarSimSilHit ** theSilHit
Pointer to the hits in the silicons.
void SetDetectorID(Int_t det)
void BeginOfRunAction(const G4Run *)
Actions to perform in the silicon anal at the begining of the run.
void SetParticleCharge(Double_t pdgCharge)
G4double GetParticleMass()
void SetEnergy(Double_t ed)
void SetTime(Double_t ti)