21 #include <TClonesArray.h>
22 #include <TVirtualMC.h>
23 #include <TVirtualMCStack.h>
37 , fFairTestDetectorPointCollection(new TClonesArray(
"FairTestDetectorPoint"))
52 , fFairTestDetectorPointCollection(new TClonesArray(
"FairTestDetectorPoint"))
57 if (fFairTestDetectorPointCollection) {
58 fFairTestDetectorPointCollection->Delete();
59 delete fFairTestDetectorPointCollection;
75 if (TVirtualMC::GetMC()->IsTrackEntering()) {
77 fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09;
78 fLength = TVirtualMC::GetMC()->TrackLength();
79 TVirtualMC::GetMC()->TrackPosition(fPos);
80 TVirtualMC::GetMC()->TrackMomentum(fMom);
84 fELoss += TVirtualMC::GetMC()->Edep();
87 if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop()
88 || TVirtualMC::GetMC()->IsTrackDisappeared()) {
89 fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber();
91 TVirtualMC::GetMC()->TrackPosition(fPosOut);
92 TVirtualMC::GetMC()->TrackMomentum(fMomOut);
98 TVector3(fPos.X(), fPos.Y(), fPos.Z()),
99 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
100 TVector3(fPosOut.X(), fPosOut.Y(), fPosOut.Z()),
101 TVector3(fMomOut.Px(), fMomOut.Py(), fMomOut.Pz()),
117 fFairTestDetectorPointCollection->Clear();
131 "FairTestDetectorPoint",
"FairTestDetector", fFairTestDetectorPointCollection, kTRUE);
137 return fFairTestDetectorPointCollection;
152 ConstructASCIIGeometry<FairTestDetectorGeo, FairTestDetectorGeoPar>(Geo,
"FairTestDetectorGeoPar");
165 TClonesArray& clref = *fFairTestDetectorPointCollection;
166 Int_t size = clref.GetEntriesFast();
168 new (clref[size])
FairTestDetectorPoint(trackID, detID, pos, mom, posOut, momOut, time, length, eLoss);
virtual Bool_t ProcessHits(FairVolume *v=0)
list of container factories
virtual void Initialize()
void SetLink(FairLink link)
Sets the Links with a single FairLink.
virtual void EndOfEvent()
static FairRun * Instance()
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
FairParSet * getContainer(const Text_t *)
virtual void Initialize()
virtual ~FairTestDetector()
FairRuntimeDb * GetRuntimeDb(void)
void Register(const char *name, const char *Foldername, TNamed *obj, Bool_t toFile)
virtual TClonesArray * GetCollection(Int_t iColl) const
FairTestDetectorPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, TVector3 posOut, TVector3 momOut, Double_t time, Double_t length, Double_t eLoss)
void AddPoint(DetectorId iDet)