BmnRoot
Loading...
Searching...
No Matches
BmnNdet_simple_allHits_timeCut_12x12cm_9mods_15sect.cxx
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Class BmnNdet
4 *
5 * Adopted for BMN by: Elena Litvinenko (EL)
6 * e-mail: litvin@nf.jinr.ru
7 * Version: 06-11-2015
8 * Last update: 22-Feb-2012 (EL)
9 *
10 * Modified by M.Golubeva July 2022
11 *
12 *****************************************************************************/
13
14#include <iostream>
15
16#include "TClonesArray.h"
17#include "TGeoMCGeometry.h"
18#include "TGeoManager.h"
19#include "TLorentzVector.h"
20#include "TParticle.h"
21#include "TVirtualMC.h"
22#include "TGeoArb8.h"
23
24#include "FairGeoInterface.h"
25#include "FairGeoLoader.h"
26#include "FairGeoNode.h"
27#include "BmnNdetGeo.h"
28#include "FairGeoRootBuilder.h"
29//#include "FairStack.h"
30#include "CbmStack.h"
31#include "BmnNdet.h"
32#include "BmnNdetPoint.h"
33
34#include "FairRootManager.h"
35#include "FairVolume.h"
36// add on for debug
37//#include "FairGeoG3Builder.h"
38#include "FairRuntimeDb.h"
39#include "TObjArray.h"
40#include "FairRun.h"
41
42#include "TParticlePDG.h"
43
44// ----- Default constructor -------------------------------------------
46 fNdetCollection = new TClonesArray("BmnNdetPoint");
47 volDetector = 0;
48 fPosIndex = 0;
49 //fEventID=-1;
50 fHitNb=0;
51 fVSCVolId=0;
52 fVSCNICAVolId=0;
53 fVSCVETOVolId=0;
54 fVerboseLevel = 1;
55 //fNHits=0;
56
57}
58
59// ----- Standard constructor ------------------------------------------
60BmnNdet::BmnNdet(const char* name, Bool_t active)
61 : FairDetector(name, active) {
62 fNdetCollection = new TClonesArray("BmnNdetPoint");
63 fPosIndex = 0;
64 volDetector = 0;
65 //fEventID=-1;
66 fHitNb=0;
67 fVSCVolId=0;
68 fVSCNICAVolId=0;
69 fVSCVETOVolId=0;
70 fVerboseLevel = 1;
71 //fNHits=0;
72}
73
74// ----- Destructor ----------------------------------------------------
76 if (fNdetCollection) {
77 fNdetCollection->Delete();
78 delete fNdetCollection;
79 }
80
81}
82
83// ----- Public method Intialize ---------------------------------------
85 // Init function
86
87 FairDetector::Initialize();
88 FairRun* sim = FairRun::Instance();
89 FairRuntimeDb* rtdb=sim->GetRuntimeDb();
90
91 fVSCVolId = gMC->VolId("ndet01s");
92 fVSCNICAVolId = gMC->VolId("ndet01s_NICA");
93 fVSCVETOVolId = gMC->VolId("ndet01s_VETO");
94
95 Int_t nbMods=9;
96 Int_t nbSect=15;
97
98 Double_t modX[nbMods], modY[nbMods], sectZ[nbSect];
99 // Get nDet module mapping (if mapping file is set)
100
101 for (int i = 0; i < nbMods; i++) { modX[i] = -10000; modY[i] = -10000; }
102
103 if (!(fMappingFile_modules == "nofile")) {
104
105 TString dummy;
106 ifstream in;
107
108 TString dir = getenv("VMCWORKDIR");
109 TString path = dir + "/input/";
110 in.open((path + fMappingFile_modules).Data());
111 if (!in.is_open())
112 {
113 printf("Loading nDet modules Map from file: %s - file open error!\n", fMappingFile_modules.Data());
114 //return kFATAL;
115 return;
116 }
117 printf("Loading nDet modules Map from file: %s\n", fMappingFile_modules.Data());
118 in >> dummy >> dummy >> dummy;
119 while (!in.eof()) {
120 int id;
121 float x,y;
122 in >> id >> x >> y;
123 if (!in.good()) break;
124 printf("%d %f %f\n",id,x,y);
125 modX[id] = x;
126 modY[id] = y;
127 }
128
129 in.close();
130
131 }// if (!(fMappingFile_modules == "nofile"))
132
133 // Get nDet sectio mapping (if mapping file is set)
134 for (int i = 0; i <nbSect; i++) { sectZ[i] = -10000; }
135
136 if (!(fMappingFile_sections == "nofile")) {
137
138 TString dummy;
139 ifstream in;
140
141 TString dir = getenv("VMCWORKDIR");
142 TString path = dir + "/input/";
143 in.open((path + fMappingFile_sections).Data());
144 if (!in.is_open())
145 {
146 printf("Loading nDet sections Map from file: %s - file open error!\n", fMappingFile_sections.Data());
147 //return kFATAL;
148 return;
149 }
150 printf("Loading nDet sections_Map from file: %s\n", fMappingFile_sections.Data());
151 in >> dummy >> dummy;
152 while (!in.eof()) {
153 int id;
154 float z;
155 in >> id >> z;
156 if (!in.good()) break;
157 printf("%d %f\n",id,z);
158 sectZ[id] = z;
159 }
160
161 in.close();
162
163 }// if (!(fMappingFile_sections == "nofile"))
164
165 for (Int_t im=0; im<nbMods; im++) {//mmods
166 for (Int_t iv=0; iv<nbSect; iv++) {//14slices + Veto
167 scintPos_X[im][iv] = modX[im+1];
168 scintPos_Y[im][iv] = modY[im+1];
169 scintPos_Z[im][iv] = sectZ[iv+1];
170 }
171 }
172
173 for (Int_t im=0; im<nbMods; im++) {
174 for (Int_t iv=0; iv<nbSect; iv++) {//14slices + Veto
175 if(iv==0) cout <<"MODULE " <<im+1 <<" " <<scintPos_X[im][iv] <<" " <<scintPos_Y[im][iv] <<endl;
176 cout <<scintPos_Z[im][iv] <<" ";
177 }//sect
178 cout <<endl;
179 }//mods
180
181}
182
183// -------------------------------------------------------------------------
185 // Begin of the event
186 //fNHits = 0;
187 //fEvNb++;
188 //evNbCheck = -1;
189 for (Int_t i=0; i<70; i++) //slice
190 //for (Int_t ii=0; ii<50; ii++)
191 for (Int_t ii=0; ii<1000; ii++) //mod
192 fTofArray[i][ii] = 100000;
193
194}
195
196//_____________________________________________________________________________
197BmnNdetPoint* BmnNdet::GetHit(Int_t i) const
198{
199// Returns the hit for the specified layer.
200// ---
201
202 return (BmnNdetPoint*)fNdetCollection->At(i);
203}
204
205//_____________________________________________________________________________
206BmnNdetPoint* BmnNdet::GetHit(Int_t vsc, Int_t mod) const
207{
208// Returns the hit for the specified vsc and module.
209// ---
210
211 BmnNdetPoint *hit;
212 Int_t nofHits = fNdetCollection->GetEntriesFast();
213 for (Int_t i=0; i<nofHits; i++) {
214 hit = GetHit(i);
215 //cout <<"fEdep " <<i <<" " <<hit->GetEdep() <<endl;
216 //int iVSCId = hit->GetVSCId();
217 //int iMODId = hit->GetMODId();
218 //if(iVSCId == vsc && iMODId == mod)
219 if(hit->GetCopy() == vsc && hit->GetCopyMother() == mod)
220 return hit;
221 }
222 return 0;
223}
224
225//_____________________________________________________________________________
226BmnNdetPoint* BmnNdet::GetHitPrint(Int_t vsc, Int_t mod) const
227{
228// Returns the hit for the specified vsc and module.
229// ---
230
231 BmnNdetPoint *hit;
232 Int_t nofHits = fNdetCollection->GetEntriesFast();
233
234 for (Int_t i=0; i<nofHits; i++) {
235 hit = GetHit(i);
236 if(hit->GetCopy() == vsc && hit->GetCopyMother() == mod)
237 cout <<"GetHitPrint method " <<hit->GetCopyMother() <<" " <<hit->GetCopy() <<" " <<hit->GetEnergyLoss() <<" " <<hit->GetZ() <<endl;
238 //cout <<"GetHitPrint method " <<hit->GetCopyMother() <<" " <<hit->GetCopy() <<" " <<hit->GetEnergyLoss() <<" " <<hit->GetNHits() <<" " <<hit->GetZ() <<endl;
239 }
240 return 0;
241}
242
243// ----- Public method ProcessHits --------------------------------------
244Bool_t BmnNdet::ProcessHits(FairVolume* vol) {
245 // if (TMath::Abs(gMC->TrackCharge()) <= 0) return kFALSE;
246
247 Int_t copyNoVSC,copyNoVTYVEC,copyNoVMOD,copyNoVZDC;
248 Int_t copyNoVSCNICA,copyNoVTYVECNICA,copyNoVMODNICA,copyNoVZDCNICA;
249 Int_t copyNoVSCVETO,copyNoVTYVECVETO,copyNoVMODVETO,copyNoVZDCVETO;
250 Int_t copyNoVSCCom,copyNoVTYVECCom,copyNoVMODCom,copyNoVZDCCom;
251
252 Int_t ivol;
253 TLorentzVector tPos1, tMom1;
254 TLorentzVector tPos, tMom;
255
256 Int_t module, module_nica;
257 Int_t slice, slice_nica;
258
259 Double_t time=0;
260 Double_t length =0;
261
262 TParticle* part;
263 Double_t charge;
264
265 //Double_t timeCut = 45;
266 Double_t timeCut = 55;
267 Double_t QCF=1; //quenching for Birk
268 Double_t BirkConst = 12.6; //0.126 mm/MeV for polystyrene
269 //0.126 *(0.1/0.001) = 12.6 cm/GeV
270 //(0.126 mm/MeV - from Wikipedia, 0.07943mm/MeV є– in Geant4)
271
272#ifdef EDEBUG
273 static Int_t lEDEBUGcounter=0;
274 if (lEDEBUGcounter<1)
275 std::cout << "EDEBUG-- BmnNdet::ProcessHits: entered" << gMC->CurrentVolPath() << endl;
276#endif
277
278 if (gMC->CurrentVolID(copyNoVSC) != fVSCVolId &&
279 gMC->CurrentVolID(copyNoVSCNICA) != fVSCNICAVolId &&
280 gMC->CurrentVolID(copyNoVSCVETO) != fVSCVETOVolId) {
281 return kFALSE;
282 }
283
284 ivol = vol->getMCid();
285 //cout <<"fEvNb " <<gMC->CurrentEvent() <<endl;
286 fEventID = gMC->CurrentEvent();
287
288 if (gMC->CurrentVolID(copyNoVSC) == fVSCVolId || gMC->CurrentVolID(copyNoVSCNICA) == fVSCNICAVolId || gMC->CurrentVolID(copyNoVSCVETO) == fVSCVETOVolId) {
289 gMC->CurrentVolOffID(0, slice); //no tyvec
290 gMC->CurrentVolOffID(1, module);
291 copyNoVTYVECCom = slice; copyNoVMODCom = module;
292 }
293 //cout <<"TEST " <<slice <<" " <<module <<" " <<fTofArray[slice][module] <<endl;
294
295 if (gMC->IsTrackEntering()) {
296
297 ResetParameters();
298 fELoss = 0.;
299 time = 0.;
300 length = 0.;
301 gMC->TrackPosition(tPos);
302 gMC->TrackMomentum(tMom);
303
304 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
305 part = gMC->GetStack()->GetCurrentTrack();
306 //if(slice==15) std::cout << "ENTER " << gMC->CurrentVolPath() << " " <<part->GetPdgCode() <<" " << fTrackID <<" " <<gMC->Edep() <<" " <<module <<" " <<slice <<" " <<tMom.Pz() <<std::endl;
307
308#ifdef EDEBUG
309 gMC->TrackPosition(tPos1);
310 gMC->TrackMomentum(tMom1);
311#endif
312
313 }//if (gMC->IsTrackEntering())
314
315 if ( gMC->IsTrackInside()) {
316
317 gMC->TrackPosition(tPos);
318 gMC->TrackMomentum(tMom);
319 //length += gMC->TrackStep();
320
321 //time += gMC->TrackTime() * 1.0e09;
322 time = gMC->TrackTime() * 1.0e09;//nsec
323
324 //fELoss +=gMC->Edep();
325//Birk corrections
326
327 //time cut
328 if(time<timeCut) {
329 if(gMC->TrackStep()>0) QCF = 1.+(BirkConst/gMC->TrackStep())*gMC->Edep();
330 else QCF=1;
331 fELoss +=(gMC->Edep())/QCF;
332 }
333
334 part = gMC->GetStack()->GetCurrentTrack();
335
336 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
338 //if(gMC->TrackTime() * 1.0e09 < fTofArray[slice][module]) fTofArray[slice][module] = gMC->TrackTime() * 1.0e09;
339
340 //time cut
341 if(time<timeCut) {
342 if(gMC->TrackTime() * 1.0e09 < fTofArray[slice][module]) fTofArray[slice][module] = gMC->TrackTime() * 1.0e09;
343 }
344
345 //cout <<"TTT INSIDE_2 " <<slice <<" " <<module <<" " <<gMC->TrackTime() * 1.0e09 <<" " <<fTofArray[slice][module] <<endl;
346
347 if ( gMC->IsTrackStop() || gMC->IsTrackDisappeared() ) {
348
349 part = gMC->GetStack()->GetCurrentTrack();
350 charge = part->GetPDG()->Charge() / 3. ;
351
352// Create BmnNdetPoint
353 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
354 //if(slice==15) std::cout << "STOP_DIS " << gMC->CurrentVolPath() << " " <<part->GetPdgCode() <<" " << fTrackID <<" " <<gMC->Edep() <<" " <<module <<" " <<slice <<" " <<tMom.Pz() <<std::endl;
355
356 if(fELoss>0) {
357 /*
358//VETO //if not to wtite events with Veto
359 //if(slice==15) return kFALSE;
360 if(slice==15) {
361 //std::cout << "STOP_DIS_slice15 " <<part->GetPdgCode() <<" " << fTrackID <<" " <<gMC->Edep() <<" " <<module <<" " <<slice<<std::endl;
362 gMC->StopTrack();
363 return kFALSE;
364 }
365 */
366
367 length = 1; //nb of hits in slice
368
369 //std::cout << "INSIDE MpdNdet::ProcessHits: TrackID: " <<part->GetPdgCode() <<" " << fTrackID << " " <<fELoss <<" " <<length <<" " << gMC->CurrentVolPath() << " " << tPos.Z() <<" " <<tMom.Pz() <<" " << ivol <<" " <<gMC->CurrentVolOffName(2) << " " <<gMC->CurrentVolOffName(1) << " " << gMC->CurrentVolOffName(0) <<" " <<module <<" " <<slice <<std::endl;
370 if(copyNoVTYVECCom==slice && copyNoVMODCom==module) {//module
371 //if ( !GetHit(slice,module) ) {
372 //AddHit(fTrackID, ivol, slice, module, TVector3(tPos.X(), tPos.Y(), tPos.Z()),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
373 AddHit(fTrackID, ivol, slice, module, TVector3(scintPos_X[module-1][slice-1], scintPos_Y[module-1][slice-1], scintPos_Z[module-1][slice-1]),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), fTofArray[slice][module], length, fELoss, fEventID );//with coord
374 //}
375 /*
376 else {
377 //GetHit(slice,module)->AddVSC(fTrackID, ivol, slice, module, TVector3(tPos.X(), tPos.Y(), tPos.Z()),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
378 GetHit(slice,module)->AddVSC(fTrackID, ivol, slice, module, TVector3(scintPos_X[module-1][slice-1], scintPos_Y[module-1][slice-1], scintPos_Z[module-1][slice-1]),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), fTofArray[slice][module], length, fELoss, fEventID );//with coord
379 }
380 */
381 }//if(copyNoVTYVECCom==slice && copyNoVMODCom==module)
382
383 }//if(fELoss>0)
384 }//if ( gMC->IsTrackStop() || gMC->IsTrackDisappeared() )
385 }//if ( gMC->IsTrackInside())
386
387 if ( gMC->IsTrackExiting()) {
388
389 gMC->TrackPosition(tPos);
390 gMC->TrackMomentum(tMom);
391 part = gMC->GetStack()->GetCurrentTrack();
392 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
394
395// Create BmnNdetPoint
396 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
397 //time += gMC->TrackTime() * 1.0e09;
398 time = gMC->TrackTime() * 1.0e09;
399 //length += gMC->TrackLength();
400
402
403 //time cut
404 if(time<timeCut) {
405 if(gMC->TrackTime() * 1.0e09 < fTofArray[slice][module]) fTofArray[slice][module] = gMC->TrackTime() * 1.0e09;
406 }
408
409 //fELoss +=gMC->Edep();
410//Birk corrections
411 if(time<timeCut) {
412 if(gMC->TrackStep()>0) QCF = 1.+(BirkConst/gMC->TrackStep())*gMC->Edep();
413 else QCF = 1;
414 fELoss +=(gMC->Edep())/QCF;
415 }
416
417 if(fELoss>0) {
418 /*
419//VETO
420 //if(slice==15) return kFALSE;
421 if(slice==15) {
422 //std::cout << "EXIT_Edep>0_slice15 " <<part->GetPdgCode() <<" " << fTrackID <<" " <<gMC->Edep() <<" " <<module <<" " <<slice<<std::endl;
423 gMC->StopTrack();
424 return kFALSE;
425 }
426 */
427
428 length = 1; //nb of hits in slice
429
430 //cout <<"TTT EXIT_2 " <<slice <<" " <<module <<" " <<gMC->TrackTime() * 1.0e09 <<" " <<fTofArray[slice][module] <<" " <<length <<" " <<gMC->Edep() <<endl;
431 if(copyNoVTYVECCom==slice && copyNoVMODCom==module) {
432 //if ( !GetHit(slice,module) ) {
433 //AddHit(fTrackID, ivol, slice, module, TVector3(tPos.X(), tPos.Y(), tPos.Z()),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
434 AddHit(fTrackID, ivol, slice, module, TVector3(scintPos_X[module-1][slice-1], scintPos_Y[module-1][slice-1], scintPos_Z[module-1][slice-1]),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), fTofArray[slice][module], length, fELoss, fEventID );//with coord
435 //}
436 /*
437 else {
438 //GetHit(slice,module)->AddVSC(fTrackID, ivol, slice, module, TVector3(tPos.X(), tPos.Y(), tPos.Z()),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), time, length, fELoss);
439 GetHit(slice,module)->AddVSC(fTrackID, ivol, slice, module, TVector3(scintPos_X[module-1][slice-1], scintPos_Y[module-1][slice-1], scintPos_Z[module-1][slice-1]),TVector3(tMom.Px(), tMom.Py(), tMom.Pz()), fTofArray[slice][module], length, fELoss, fEventID );//with coord
440 }
441 */
442 }//if(copyNoVTYVECCom==slice && copyNoVMODCom==module)
443
444 }//if(fELoss>0)
445 }//if ( gMC->IsTrackExiting()) {
446
447 Int_t points = gMC->GetStack()->GetCurrentTrack()->GetMother(1);
448
449 points = ( points & ( ~ (1<<30) ) ) | (1 << 30);
450
451 gMC->GetStack()->GetCurrentTrack()->SetMother(1,points);
452
453 ((CbmStack*)gMC->GetStack())->AddPoint(kNDET);
454
455 return kTRUE;
456
457}
458
459// ----- Public method EndOfEvent -----------------------------------------
460void BmnNdet::EndOfEvent() {
461 if (fVerboseLevel) Print();
462 Reset();
463}
464
465
466// ----- Public method Register -------------------------------------------
467void BmnNdet::Register() {
468 FairRootManager::Instance()->Register("NdetPoint","Ndet", fNdetCollection, kTRUE);
469}
470
471// ----- Public method GetCollection --------------------------------------
472TClonesArray* BmnNdet::GetCollection(Int_t iColl) const {
473 if (iColl == 0) return fNdetCollection;
474
475 return NULL;
476}
477
478// ----- Public method Print ----------------------------------------------
479void BmnNdet::Print() const {
480 Int_t nHits = fNdetCollection->GetEntriesFast();
481 cout << "-I- BmnNdet: " << nHits << " points registered in this event."
482 << endl;
483
484 if (fVerboseLevel>1)
485 for (Int_t i=0; i<nHits; i++) (*fNdetCollection)[i]->Print();
486}
487
488// ----- Public method Reset ----------------------------------------------
489void BmnNdet::Reset() {
490 fNdetCollection->Delete();
491
492 fPosIndex = 0;
493}
494
495// guarda in FairRootManager::CopyClones
496// ----- Public method CopyClones -----------------------------------------
497void BmnNdet::CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset ) {
498 Int_t nEntries = cl1->GetEntriesFast();
499 //cout << "-I- BmnNdet: " << nEntries << " entries to add." << endl;
500 TClonesArray& clref = *cl2;
501 BmnNdetPoint* oldpoint = NULL;
502 for (Int_t i=0; i<nEntries; i++) {
503 oldpoint = (BmnNdetPoint*) cl1->At(i);
504 Int_t index = oldpoint->GetTrackID() + offset;
505 oldpoint->SetTrackID(index);
506 new (clref[fPosIndex]) BmnNdetPoint(*oldpoint);
507 fPosIndex++;
508 }
509 cout << " -I- BmnNdet: " << cl2->GetEntriesFast() << " merged entries."
510 << endl;
511}
512
513 // ----- Public method ConstructGeometry ---------------------------------
515
516 TString fileName = GetGeometryFileName();
517 if(fileName.EndsWith(".root"))
518 {
519 FairLogger::GetLogger()->Info(MESSAGE_ORIGIN, "Constructing NDET geometry from ROOT file %s", fileName.Data());
520 ConstructRootGeometry();
521 }
522 /*
523 else if ( fileName.EndsWith(".geo") )
524 {
525 FairLogger::GetLogger()->Info(MESSAGE_ORIGIN, "Constructing NDET geometry from ASCII file %s", fileName.Data());
526 ConstructAsciiGeometry();
527 }
528 else FairLogger::GetLogger()->Fatal(MESSAGE_ORIGIN, "Geometry format of NDET file %S not supported.", fileName.Data());
529 */
530
531 FairGeoLoader* geoLoad = FairGeoLoader::Instance();
532 FairGeoInterface* geoFace = geoLoad->getGeoInterface();
533 BmnNdetGeo* ndetGeo = new BmnNdetGeo();
534 ndetGeo->setGeomFile(GetGeometryFileName());
535 geoFace->addGeoModule(ndetGeo);
536
537 Bool_t rc = geoFace->readSet(ndetGeo);
538 if (rc) ndetGeo->create(geoLoad->getGeoBuilder());
539 TList* volList = ndetGeo->getListOfVolumes();
540
541 // store geo parameter
542 FairRun *fRun = FairRun::Instance();
543 FairRuntimeDb *rtdb= FairRun::Instance()->GetRuntimeDb();
544 BmnNdetGeoPar* par=(BmnNdetGeoPar*)(rtdb->getContainer("BmnNdetGeoPar"));
545 TObjArray *fSensNodes = par->GetGeoSensitiveNodes();
546 TObjArray *fPassNodes = par->GetGeoPassiveNodes();
547
548 TListIter iter(volList);
549 FairGeoNode* node = NULL;
550 FairGeoVolume *aVol=NULL;
551
552 while( (node = (FairGeoNode*)iter.Next()) ) {
553 aVol = dynamic_cast<FairGeoVolume*> ( node );
554
555
556 if ( node->isSensitive() ) {
557 fSensNodes->AddLast( aVol );
558 }else{
559 fPassNodes->AddLast( aVol );
560 }
561 }
562 par->setChanged();
563 par->setInputVersion(fRun->GetRunId(),1);
564
565 ProcessNodes ( volList );
566}
567
568//Check if Sensitive-----------------------------------------------------------
569Bool_t BmnNdet::CheckIfSensitive(std::string name) {
570 TString tsname = name;
571 if (tsname.Contains("ndet01s") || tsname.Contains("ndet01s_NICA") || tsname.Contains("ndet01s_VETO")) {
572 return kTRUE;
573 }
574 return kFALSE;
575}
576
577// ----- Private method AddHit --------------------------------------------
578//BmnNdetPoint* BmnNdet::AddHit(Int_t trackID, Int_t detID, Int_t copyNo, Int_t copyNoMother, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss) {
579BmnNdetPoint* BmnNdet::AddHit(Int_t trackID, Int_t detID, Int_t copyNo, Int_t copyNoMother, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, UInt_t EventId) {
580 TClonesArray& clref = *fNdetCollection;
581 Int_t size = clref.GetEntriesFast();
582
583 //return new(clref[size]) BmnNdetPoint(trackID, detID, copyNo, copyNoMother, pos, mom, time, length, eLoss);
584 return new(clref[size]) BmnNdetPoint(trackID, detID, copyNo, copyNoMother, pos, mom, time, length, eLoss, EventId);
585
586}
int i
Definition P4_F32vec4.h:22
@ kNDET
TObjArray * GetGeoSensitiveNodes()
TObjArray * GetGeoPassiveNodes()
virtual Bool_t ProcessHits(FairVolume *vol=nullptr)
Definition BmnNdet.cxx:93
virtual ~BmnNdet()
Definition BmnNdet.cxx:35
virtual void EndOfEvent()
Definition BmnNdet.cxx:197
BmnNdet()
Definition BmnNdet.cxx:17
BmnNdetPoint * AddHit(BmnNdetPoint *point)
Definition BmnNdet.cxx:302
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition BmnNdet.cxx:214
virtual Bool_t CheckIfSensitive(std::string name)
Definition BmnNdet.cxx:289
virtual void ConstructGeometry()
Definition BmnNdet.cxx:244
virtual void Reset()
Definition BmnNdet.cxx:237
virtual void Register()
Definition BmnNdet.cxx:204
BmnNdetPoint * GetHit(int trackID, uint32_t address)
Definition BmnNdet.cxx:76
virtual void Initialize()
Definition BmnNdet.cxx:49
virtual void BeginEvent()
Definition BmnNdet.cxx:57
virtual void Print(Option_t *) const
Definition BmnNdet.cxx:224
name
Definition setup.py:7