19 #include "G4RunManager.hh" 20 #include "G4SDManager.hh" 24 #include "G4ClassificationOfNewTrack.hh" 25 #include "G4TrackStatus.hh" 41 #include "TClonesArray.h" 56 plaHitCA =
new TClonesArray(
"ActarSimPlaHit",2);
82 sprintf(newDirName,
"%s%i",
"Histos",aRun->GetRunID());
116 G4int hitsCollectionID =
117 G4SDManager::GetSDMpointer()->GetCollectionID(
"PlaCollection");
119 G4HCofThisEvent* HCofEvent = anEvent->GetHCofThisEvent();
125 G4int NbHits = hitsCollection->entries();
131 trackIDtable =
new G4int[NbHits];
133 detIDtable =
new G4int[NbHits];
135 IDtable =
new G4int[NbHits];
138 for (G4int i=0;i<NbHits;i++) {
139 if((*hitsCollection)[i]->GetParentID()==0) {
141 trackIDtable[indepHits] = (*hitsCollection)[i]->GetTrackID();
142 detIDtable[indepHits] = (*hitsCollection)[i]->GetDetID();
143 IDtable[i] = indepHits;
147 for(G4int j=0; j<indepHits;j++) {
148 if( (*hitsCollection)[i]->GetTrackID() == trackIDtable[j] &&
149 (*hitsCollection)[i]->GetDetID() == detIDtable[j]) {
154 trackIDtable[indepHits] = (*hitsCollection)[i]->GetTrackID();
155 detIDtable[indepHits] = (*hitsCollection)[i]->GetDetID();
156 IDtable[i] = indepHits;
166 for (G4int i=0;i<indepHits;i++)
174 existing =
new G4int[indepHits];
175 for(G4int i=0;i<indepHits;i++) existing[i] = 0;
177 for(G4int i=0;i<NbHits;i++) {
178 if( (*hitsCollection)[i]->GetParentID()==0 ) {
180 if( existing[IDtable[i]]==0) {
182 existing[IDtable[i]] = 1;
190 for (G4int i=0;i<indepHits;i++)
193 delete [] trackIDtable;
196 delete [] detIDtable;
197 for (G4int i=0;i<indepHits;i++)
delete thePlaHit[i];
406 else G4cout <<
"ERROR in R3BROOTAnalCal::AddCalCrystalHit()." << G4endl
407 <<
"Unknown Detector Name: "<< gHit->
GetDetName() << G4endl << G4endl;
G4THitsCollection< ActarSimPlaGeantHit > ActarSimPlaGeantHitsCollection
void SetEBeforePla(Double_t eb)
void SetParticleCharge(Double_t pdgCharge)
void SetStepsContributing(UInt_t step)
UInt_t GetStepsContributing()
void SetEnergy(Double_t ed)
void SetEAfterPla(Double_t ea)
void SetTheRunID(G4int id)
G4double GetParticleMass()
void SetEventID(UInt_t ev)
TBranch * plaHitsBranch
Local branch for plastics.
void SetTheEventID(G4int id)
ActarSimROOTAnalPla()
Constructor.
ActarSimROOTAnalysis * gActarSimROOTAnalysis
Global pointer to this soliton.
void FillingHits(const G4Event *anEvent)
Defining the ActarSimSciHits from the ActarSimSciGeantHits.
void SetDetectorID(Int_t det)
TTree * eventTree
Local pointer to the event tree.
void SetRunID(UInt_t run)
void AddCalPlaHit(ActarSimPlaHit *, ActarSimPlaGeantHit *, G4int)
void SetParticleMass(Double_t pdgMass)
TFile * simFile
Local pointer to simFile.
TClonesArray * plaHitCA
ClonesArray of the hits in the plastic.
void SetTrackID(UInt_t track)
void BeginOfEventAction(const G4Event *)
Actions to perform in the scintillator anal at the begining of the event.
ActarSimPlaHit ** thePlaHit
Pointer to the hits in the plastic.
void GeneratePrimaries(const G4Event *)
Actions to perform in the scintillator anal when generating the primaries.
~ActarSimROOTAnalPla()
Destructor. Makes nothing.
void UserSteppingAction(const G4Step *)
Actions to perform in the scintillator detector analysis after each step.
G4ThreeVector GetLocalPrePos()
void BeginOfRunAction(const G4Run *)
Actions to perform in the scintillator anal at the begining of the run.
void SetParticleID(UInt_t pdgID)
G4double GetParticleCharge()
void SetTime(Double_t ti)
void EndOfEventAction(const G4Event *)
Actions to perform in the scintillator anal at the beginning of the run.