11 #include "TClonesArray.h" 12 #include "TVirtualMC.h" 14 #include "TLorentzVector.h" 16 #include "FairRootManager.h" 18 #include "FairRuntimeDb.h" 19 #include "FairLogger.h" 21 #include "ERGadastGeoPar.h" 26 fCsIPoints(new TClonesArray(
"ERGadastCsIPoint")),
27 fLaBrPoints(new TClonesArray(
"ERGadastLaBrPoint")),
28 fGadastSteps(new TClonesArray(
"ERGadastStep")),
31 flGeoPar->SetName( GetName());
32 flGeoPar =
new TList();
39 fCsIPoints(new TClonesArray(
"ERGadastCsIPoint")),
44 flGeoPar->SetName( GetName());
45 flGeoPar =
new TList();
46 fVerboseLevel = verbose;
67 FairDetector::Initialize();
68 FairRuntimeDb* rtdb= FairRun::Instance()->GetRuntimeDb();
75 if ( gMC->IsTrackEntering() ) {
83 fELoss += gMC->Edep() * 1e3;
86 if (gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()) {
97 TLorentzVector pos, mom;
99 gMC->TrackPosition(pos);
100 gMC->TrackMomentum(mom);
104 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
105 fTime = gMC->TrackTime() * 1.0e09;
107 fMot0TrackID = gMC->GetStack()->GetCurrentTrack()->GetMother(0);
108 fMass = gMC->ParticleMass(gMC->TrackPid());
110 if (TString(gMC->CurrentVolName()).Contains(
"LaBrcell_cell"))
115 fPDG = gMC->TrackPid();
129 TLorentzVector pos, mom;
131 gMC->TrackPosition(pos);
132 gMC->TrackMomentum(mom);
146 if (fVerboseLevel > 1) {
155 FairRootManager* ioman = FairRootManager::Instance();
157 LOG(FATAL) <<
"IO manager is not set" << FairLogger::endl;
158 ioman->Register(
"GadastCsIPoint",
"ERGadast",
fCsIPoints, kTRUE);
159 ioman->Register(
"GadastLaBrPoint",
"ERGadast",
fLaBrPoints, kTRUE);
160 ioman->Register(
"GadastStep",
"ERGadast",
fGadastSteps, kTRUE);
175 LOG(INFO) <<
"======== CsI Points ==================" << FairLogger::endl;
176 for (Int_t i_point = 0; i_point <
fCsIPoints->GetEntriesFast(); i_point++){
183 LOG(INFO) <<
"======== LaBr Points =================" << FairLogger::endl;
184 for (Int_t i_point = 0; i_point <
fLaBrPoints->GetEntriesFast(); i_point++){
200 Int_t nEntries = cl1->GetEntriesFast();
201 LOG(DEBUG) <<
"ERGadast: " << nEntries <<
" entries to add" << FairLogger::endl;
202 TClonesArray& clref = *cl2;
204 for (Int_t i=0; i<nEntries; i++) {
206 Int_t index = oldpoint->GetTrackID() + offset;
207 oldpoint->SetTrackID(index);
210 LOG(DEBUG) <<
"ERGadast: " << cl2->GetEntriesFast() <<
" merged entries" << FairLogger::endl;
216 Int_t size = clref.GetEntriesFast();
229 Int_t size = clref.GetEntriesFast();
245 ExpertTrackingStatus trackStatus = ERGadastStep::GetTrackStatus();
247 gMC->StepProcesses(processesID);
248 TLorentzVector curPosIn;
249 TLorentzVector curMomIn;
250 gMC->TrackPosition(curPosIn);
251 gMC->TrackMomentum(curMomIn);
256 TVector3(curPosIn.X(), curPosIn.Y(), curPosIn.Z()),
257 TVector3(curMomIn.X(), curMomIn.Y(), curMomIn.Z()),
258 gMC->TrackTime() * 1.0e09, gMC->TrackStep(), gMC->TrackPid(),
259 fMass,trackStatus,gMC->Edep(),gMC->TrackCharge(),processesID);
264 TString volName = name;
265 if(volName.Contains(
"LaBrcell_cell")) {
268 if(volName.Contains(
"onecell_cell")) {
void FinishPoint()
Finish point creation. Call AddCsIPoint() or AddLaBrPoint()
virtual void Print(const Option_t *opt=0) const
Print point information to screen.
Class for the MC transport of the Gadast.
Int_t fStepNr
current step numb in this active volumes
virtual Bool_t ProcessHits(FairVolume *vol=0)
Virtual method Defines the action to be taken when a step is inside the active volume. Creates a ERGadastPoint and adds it to the collection.
Int_t fCsIBlock
CsI Block number.
Int_t fCsICell
CsI Cell number.
TClonesArray * fLaBrPoints
The LaBr point collection.
virtual void EndOfEvent()
Action at end of event Short status log and Reset(). Virtual from FairDetector.
void StartPoint()
Start new point creation. Reinit current point data.
virtual void Initialize()
Initialisation class method FairDetector::Initialize() is called. GadastGeoPar init from RuntimeDB Vi...
TClonesArray * fGadastSteps
The all steps collection.
virtual void Print(Option_t *option="") const
Screen log Prints GadastPoint information Virtual from TObject.
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Copies the points collection with a given track index offset.
virtual void Print(const Option_t *opt=0) const
SensetiveType fDetectorType
CsI or LaBr point.
Double32_t fLength
track length from his origin
Int_t fTrackID
track index
The data class for storing pieces of charged tracks in sensitive volumes in CsI crystall.
virtual Bool_t CheckIfSensitive(std::string name)
Check whether a volume is sensitive.
Int_t fLaBrCell
laBr Cell number
virtual void Reset()
Clears the point and steps collections Virtual from FairDetector.
ERGadastStep * AddStep()
Adds a GadastStep to the Step Collection.
Int_t fEventID
event index
TClonesArray * fCsIPoints
The CsI point collection.
TVector3 fPosIn
point start position
Bool_t fStoreSteps
Flag to storing all steps in sensetive volume.
TVector3 fMomOut
point finish momentum
Int_t fMot0TrackID
0th mother track index
virtual ~ERGadast()
Destructor.
Double32_t fELoss
energy loss
ERGadastLaBrPoint * AddLaBrPoint()
Adds a GadastLaBrPoint to the Point Collection.
ERGadastCsIPoint * AddCsIPoint()
Adds a GadastCsIPoint to the Point Collection.
TVector3 fPosOut
point finish position
virtual TClonesArray * GetCollection(Int_t iColl) const
Get array of ERGadastPoint.
TVector3 fMomIn
point start momentum
ERGadast()
Default constructor.
The base class for detector simulation in er sim.
virtual void Register()
Register output array (NeuRadPoint) to the I/O manager Abstract from FairDetector.
Double32_t fTime
point start time
Int_t fCsIWall
CsI Wall number.