18 #include <TClonesArray.h>
19 #include <TVirtualMC.h>
20 #include <TVirtualMCStack.h>
37 , fFairTutorialDet2PointCollection(new TClonesArray(
"FairTutorialDet2Point"))
38 , fCustomData(new Det2PointContainer())
50 , fFairTutorialDet2PointCollection(new TClonesArray(
"FairTutorialDet2Point"))
51 , fCustomData(new Det2PointContainer())
63 , fFairTutorialDet2PointCollection(new TClonesArray(
"FairTutorialDet2Point"))
64 , fCustomData(new Det2PointContainer())
69 if (fFairTutorialDet2PointCollection) {
70 fFairTutorialDet2PointCollection->Delete();
71 delete fFairTutorialDet2PointCollection;
89 if (TVirtualMC::GetMC()->IsTrackEntering()) {
91 fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09;
92 fLength = TVirtualMC::GetMC()->TrackLength();
93 TVirtualMC::GetMC()->TrackPosition(fPos);
94 TVirtualMC::GetMC()->TrackMomentum(fMom);
98 fELoss += TVirtualMC::GetMC()->Edep();
101 if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop()
102 || TVirtualMC::GetMC()->IsTrackDisappeared()) {
103 fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber();
110 TVector3(fPos.X(), fPos.Y(), fPos.Z()),
111 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
135 mgr->Register(
"TutorialDetPoint",
"TutorialDet", fFairTutorialDet2PointCollection, kTRUE);
138 mgr->RegisterAny(
"TutorialCustomData", fCustomData, kTRUE);
144 return fFairTutorialDet2PointCollection;
152 fFairTutorialDet2PointCollection->Clear();
153 fCustomData->clear();
162 ConstructASCIIGeometry<FairTutorialDet2Geo, FairTutorialDet2GeoPar>(fgGeo,
"FairTutorialDet2GeoPar");
173 TClonesArray& clref = *fFairTutorialDet2PointCollection;
174 Int_t size = clref.GetEntriesFast();
177 fCustomData->emplace_back(pos.X(), size);
virtual FairModule * CloneModule() const
static FairRootManager * Instance()
virtual ~FairTutorialDet2()
virtual void EndOfEvent()
ClassImp(FairEventBuilder)
virtual void Initialize()
virtual TClonesArray * GetCollection(Int_t iColl) const
FairTutorialDet2Point * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss)
void AddPoint(DetectorId iDet)
virtual Bool_t ProcessHits(FairVolume *v=0)
virtual void Initialize()