20 #include <TClonesArray.h>
21 #include <TGeoManager.h>
22 #include <TGeoMatrix.h>
23 #include <TGeoPhysicalNode.h>
25 #include <TVirtualMC.h>
26 #include <TVirtualMCStack.h>
41 , fPixelPointCollection(new TClonesArray(
"PixelPoint"))
53 , fPixelPointCollection(new TClonesArray(
"PixelPoint"))
65 , fPixelPointCollection(new TClonesArray(
"PixelPoint"))
70 if (fPixelPointCollection) {
71 fPixelPointCollection->Delete();
72 delete fPixelPointCollection;
82 if (TVirtualMC::GetMC()->IsTrackEntering()) {
84 fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09;
85 fLength = TVirtualMC::GetMC()->TrackLength();
86 TVirtualMC::GetMC()->TrackPosition(fPos);
87 TVirtualMC::GetMC()->TrackMomentum(fMom);
91 fELoss += TVirtualMC::GetMC()->Edep();
94 if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop()
95 || TVirtualMC::GetMC()->IsTrackDisappeared()) {
96 fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber();
108 TString detPath = TVirtualMC::GetMC()->CurrentVolPath();
109 detPath.Remove(0, detPath.Last(
'/') + 1);
110 detPath.Remove(0, detPath.First(
"Pixel") + 5);
111 Int_t stationNr = detPath.Atoi();
112 detPath.Remove(0, detPath.First(
"_") + 1);
113 Int_t sectorNr = detPath.Atoi();
114 fVolumeID = stationNr * 256 + sectorNr;
119 TVector3(fPos.X(), fPos.Y(), fPos.Z()),
120 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
149 return fPixelPointCollection;
164 ConstructASCIIGeometry<PixelGeo, PixelGeoPar>(Geo,
"PixelGeoPar");
169 if (name.find(
"Pixel") != std::string::npos) {
183 TClonesArray& clref = *fPixelPointCollection;
184 Int_t size = clref.GetEntriesFast();
185 return new (clref[size])
PixelPoint(trackID, detID, pos, mom, time, length, eLoss);
195 cout <<
"-- ExternCreateDetector() START --" << endl;
198 Pixel* det =
new Pixel(
"PixelDetector", kTRUE);
201 cout <<
"-- ExternCreateDetector(" << det->GetName() <<
") DONE --" << endl;
virtual void SetGeometryFileName(TString fname, TString geoVer="0")
virtual FairModule * CloneModule() const
virtual Bool_t ProcessHits(FairVolume *v=0)
static FairRootManager * Instance()
static FairRunSim * Instance()
ClassImp(FairEventBuilder)
virtual Bool_t IsSensitive(const std::string &name)
virtual TClonesArray * GetCollection(Int_t iColl) const
virtual void Initialize()
virtual void Initialize()
virtual void EndOfEvent()
PixelPoint * 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 ExternCreateDetector()
void AddModule(FairModule *Mod)
void AddPoint(DetectorId iDet)