13 #include "FairRootManager.h"
15 #include "FairRuntimeDb.h"
18 #include "FairVolume.h"
20 #include "TClonesArray.h"
21 #include "TGeoManager.h"
23 #include "TObjArray.h"
24 #include "TParticle.h"
26 #include "TVirtualMC.h"
27 #include "TVirtualMCStack.h"
41 , fPosIn(0.0, 0.0, 0.0, 0.0)
42 , fPosOut(0.0, 0.0, 0.0, 0.0)
43 , fMomIn(0.0, 0.0, 0.0, 0.0)
44 , fMomOut(0.0, 0.0, 0.0, 0.0)
49 , fCollection(new TClonesArray(
"CbmMvdPoint"))
51 , fGeoPar(new TList())
53 , fmvdHandler(nullptr) {
68 , fPosIn(0.0, 0.0, 0.0, 0.0)
69 , fPosOut(0.0, 0.0, 0.0, 0.0)
70 , fMomIn(0.0, 0.0, 0.0, 0.0)
71 , fMomOut(0.0, 0.0, 0.0, 0.0)
76 , fCollection(new TClonesArray(
"CbmMvdPoint"))
78 , fGeoPar(new TList())
80 , fmvdHandler(nullptr) {
107 if (gMC->IsTrackEntering()) {
108 fPdg = gMC->TrackPid();
110 fTime = gMC->TrackTime() * 1.0e09;
112 gMC->TrackPosition(
fPosIn);
113 gMC->TrackMomentum(
fMomIn);
120 if (gMC->IsTrackExiting() || gMC->IsTrackStop()
121 || gMC->IsTrackDisappeared()) {
122 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
125 const char* address = gMC->CurrentVolPath();
127 TString stAdd(address);
129 if (stAdd.Contains(
"/MVDscripted_0")) {
134 if (
fELoss == 0.)
return kFALSE;
165 if (fVerboseLevel)
Print();
175 FairRootManager::Instance()->Register(
194 LOG(info) << fName <<
": " << nHits <<
" points registered in this event.";
210 Int_t nEntries = cl1->GetEntriesFast();
211 LOG(info) <<
"CbmMvd: " << nEntries <<
" entries to add.";
212 TClonesArray& clref = *cl2;
214 for (Int_t
i = 0;
i < nEntries;
i++) {
216 Int_t index = oldpoint->GetTrackID() + offset;
217 oldpoint->SetTrackID(index);
221 LOG(info) <<
"CbmMvd: " << cl2->GetEntriesFast() <<
" merged entries.";
227 TString fileName = GetGeometryFileName();
228 if (fileName.EndsWith(
".root")) {
229 LOG(info) <<
"Constructing MVD geometry from ROOT file "
232 }
else if (fileName.EndsWith(
".geo")) {
233 LOG(fatal) <<
"Don't use old .geo style geometrys for the MVD. Please use "
237 LOG(fatal) <<
"Geometry format of MVD file " << fileName.Data()
238 <<
" not supported.";
250 FairDetector::ConstructRootGeometry();
256 <<
"Tried to load MVD Geometry, but didn't succeed to load Sensors";
257 LOG(debug) <<
"filled mvd StationMap with: " <<
fStationMap.size()
275 Int_t size = clref.GetEntriesFast();
277 LOG(debug2) <<
"CbmMvd: Adding Point at (" << posIn.X() <<
", " << posIn.Y()
278 <<
", " << posIn.Z() <<
") cm, sensor " << sensorNr <<
", track "
279 << trackID <<
", energy loss " << eLoss * 1e06 <<
" keV";
281 trackID, pdg, sensorNr, posIn, posOut, momIn, momOut, time, length, eLoss);
286 TString tsname = name;
287 if (tsname.Contains(
"sensorActive") || tsname.Contains(
"MimosaActive")
288 || (tsname.Contains(
"mvdstation") && !(tsname.Contains(
"PartAss")))) {
289 LOG(debug) <<
"*** Register " << tsname <<
" as active volume.";
291 }
else if (tsname.EndsWith(
"-P0")) {
293 LOG(debug) <<
"*** Register " << tsname <<
" as active volume.";