24 #include "TClonesArray.h"
25 #include "TGeoManager.h"
26 #include "TGeoMatrix.h"
27 #include "TGeoPhysicalNode.h"
29 #include "TObjArray.h"
31 #include "TVirtualMC.h"
32 #include "TVirtualMCStack.h"
46 , fPointsArrayName(
"FairTutPropPoint")
54 , fFairTutPropPointCollection(new TClonesArray(
"FairTutPropPoint"))
59 if (fFairTutPropPointCollection) {
60 fFairTutPropPointCollection->Delete();
61 delete fFairTutPropPointCollection;
72 if (TVirtualMC::GetMC()->IsTrackEntering()) {
74 fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09;
75 fLength = TVirtualMC::GetMC()->TrackLength();
76 TVirtualMC::GetMC()->TrackPosition(fPos);
77 TVirtualMC::GetMC()->TrackMomentum(fMom);
81 fELoss += TVirtualMC::GetMC()->Edep();
84 if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop()
85 || TVirtualMC::GetMC()->IsTrackDisappeared()) {
86 fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber();
95 TString detPath = TVirtualMC::GetMC()->CurrentVolPath();
96 detPath.Remove(0, detPath.Last(
'/') + 1);
97 detPath.Remove(0, detPath.First(
"Pixel") + 5);
98 Int_t stationNr = detPath.Atoi();
99 fVolumeID = stationNr;
104 TVector3(fPos.X(), fPos.Y(), fPos.Z()),
105 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
130 fPointsArrayName.data(),
"FairTutPropDet", fFairTutPropPointCollection, kTRUE);
136 return fFairTutPropPointCollection;
150 ConstructASCIIGeometry<FairTutPropGeo, FairTutPropGeoPar>(Geo,
"FairTutPropGeoPar");
161 Int_t size = fFairTutPropPointCollection->GetEntriesFast();
162 return new ((*fFairTutPropPointCollection)[size])
FairTutPropPoint(trackID, detID, pos, mom, time, length, eLoss);
virtual void Initialize()
virtual ~FairTutPropDet()
virtual TClonesArray * GetCollection(Int_t iColl) const
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
virtual void EndOfEvent()
virtual void Initialize()
FairTutPropPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
void AddPoint(DetectorId iDet)
virtual Bool_t ProcessHits(FairVolume *v=0)