FairRoot/PandaRoot
PndHypGe.cxx
Go to the documentation of this file.
1 //
3 // CbmHypGe
4 //
5 // Filler of CbmHypGePoint
6 //
7 // By A.Sanchez
8 //
10 
11 #include <iostream>
12 
13 #include "PndHypGe.h"
14 #include "PndHypGePoint.h"
15 
16 #include "FairGeoInterface.h"
17 #include "FairGeoLoader.h"
18 #include "FairGeoMedia.h"
19 #include "FairGeoNode.h"
20 #include "PndGeoHypGe.h"
21 #include "FairGeoRootBuilder.h"
22 #include "PndStack.h"
23 #include "FairGeoMedium.h"
24 #include "FairRootManager.h"
25 #include "FairModule.h"
26 #include "FairVolume.h"
27 #include "GeCluster.h"
28 // add on for debug
29 //#include "FairGeoG3Builder.h"
30 #include "FairRuntimeDb.h"
31 #include "TObjArray.h"
32 #include "FairRun.h"
33 
34 #include "TClonesArray.h"
35 #include "TGeoMCGeometry.h"
36 #include "TGeoManager.h"
37 #include "TLorentzVector.h"
38 #include "TParticle.h"
39 #include "TVirtualMC.h"
40 #include "TGeoSphere.h"
41 #include "TGeoTube.h"
42 #include "TGeoPgon.h"
43 #include "TGeoCompositeShape.h"
44 #include "TGeoVoxelFinder.h"
45 #include "TGeoMatrix.h"
46 
47 #include "TString.h"
48 
49 
50 // ----- Default constructor -------------------------------------------
52 {
53  fHypGeCollection = new TClonesArray("PndHypGePoint");
54  fHypGeAlCollection = new TClonesArray("PndHypGePoint");
55 
56  fPosIndex = 0;
57  fEventID=-1; fdist=-78.;
58 
59  fListOfSensitives.push_back("Crystal");//Root_Test.root
60  fListOfSensitives.push_back("Capsule");//Root_Test.root
61  //fListOfSensitives.push_back("DeckelVol");//Root_Test.root
62  //fListOfSensitives.push_back("Kappe");//Root_Test.root
63  fListOfSensitives.push_back("Cryostat");
64 }
65 // -------------------------------------------------------------------------
66 
67 // ----- Standard constructor ------------------------------------------
68 PndHypGe::PndHypGe(const char* name, Bool_t active)
69  : FairDetector(name, active)
70 {
71  fHypGeCollection = new TClonesArray("PndHypGePoint");
72  fHypGeAlCollection = new TClonesArray("PndHypGePoint");
73 
74  fPosIndex = 0;
75  fEventID=-1;fdist=-78.;
76 
77  fListOfSensitives.push_back("Crystal");//Root_Test.root
78  fListOfSensitives.push_back("Capsule");//Root_Test.root
79  //fListOfSensitives.push_back("DeckelVol");//Root_Test.root
80  //fListOfSensitives.push_back("Kappe");//Root_Test.root
81  fListOfSensitives.push_back("Cryostat");
82 
83 
84 }
85 // -------------------------------------------------------------------------
86 
87 
88 
89 // ----- Destructor ----------------------------------------------------
91 {
92  if (fHypGeCollection)
93  {
94  fHypGeCollection->Delete();
95  delete fHypGeCollection;
96  }
97  if (fHypGeAlCollection)
98  {
99  fHypGeAlCollection->Delete();
100  delete fHypGeAlCollection;
101  }
102 
103  /*if (fHypGecapCollection) {
104  fHypGecapCollection->Delete();
105  delete fHypGecapCollection;
106  }*/
107 
108 }
109 // -------------------------------------------------------------------------
110 
111 
112 
113 // ----- Public method Intialize ---------------------------------------
115 {
116  // Init function
117 
119  FairRun* sim = FairRun::Instance();
120  FairRuntimeDb* rtdb=sim->GetRuntimeDb();
121  // par=(PndGeoHypGePar*)(rtdb->getContainer("PndGeoHypGePar"));
122 
123  // TObjArray *fSensNodes = par->GetGeoSensitiveNodes();
124 }
125 
126 // -------------------------------------------------------------------------
128 {
129  // Begin of the event
130 
131 }
132 
133 
134 
135 // ----- Public method ProcessHits --------------------------------------
136 Bool_t PndHypGe::ProcessHits(FairVolume* vol)
137 {
138  Int_t pdgCode ;
139  Int_t copyNo = -1, id = -1;
140  //TLorentzVector P;
141 
142  fcharge= gMC->TrackCharge();
143  //TString nam = gMC->CurrentVolName();
144 
145  TString nam = gMC->CurrentVolName();
146  if ((nam.BeginsWith("Crystal")))
147  //cout << "Error <CbmEmc::ProcessHits> : " << nam << " not EMC volume" << endl;
148  //else
149  {
150  if ( gMC->IsTrackEntering() )
151  {
152  fTrackID = gMC->GetStack()->GetCurrentTrackNumber(); // trk ID
153  fEventID = gMC->CurrentEvent();
154 
155  fpdgCode = gMC->TrackPid();
156 
157  fELoss = 0.;//GeV
158  fLength = gMC->TrackLength();
159  fTime = gMC->TrackTime()* 1.0e09;
160  gMC->TrackPosition(fPos); // cm
161  gMC->TrackMomentum(fMom); // GeV
162  //if (fpdgCode==2112)cout<<" proton "<<fMom.E()<<endl;
163 
164  }
165  //P=gMC->TrackMomentum(fMom);
166  // Sum energy loss for all steps in the active volume
167  fELoss += gMC->Edep();
168 
169  //if(gMC->Edep()>0.5)cout<<"energy loss"<<fELoss<<" TID= "<<fTrackID
170  //<<" pdg "<<fpdgCode<<" "<<fMom.E()<<endl;
171  //if (fpdgCode==2112)cout<<" proton step "<<gMC->Edep()<<endl;
172 
173  // Set additional parameters at exit of active volume. Create CbmDrcPoint.
174  if ( gMC->IsTrackExiting() ||
175  gMC->IsTrackStop() ||
176  gMC->IsTrackDisappeared())
177  {
178 
179  //if (fpdgCode==2112)cout<<" neutron out "<<fELoss<<endl;
180  if ((fELoss == 0.)&&(fpdgCode!=2112 ))
181  {
182  //ResetParameters();
183  return kFALSE;
184  }
185 
186  //id = gMC->CurrentVolOffID(1,copyNo);
187  //gMC->TrackPosition(fPos); // cm
188  //gMC->TrackMomentum(fMom); // GeV
189 
190  //cout <<"energy loss"<<fMom.Px()<<endl;
191  // sscanf(nam,"GeCrystal%dc", &copyNo);
192  // fnCopy = copyNo;
193  fnCopy = vol->getCopyNo();
194  cout << " Vol Name: " << gMC->CurrentVolPath() <<" vol id "<<vol->getMCid()<<" copyNo "<<vol->getCopyNo()<< endl;
195  //if ( pdgCode )
196  //{
198  TVector3(fPos.X(), fPos.Y(), fPos.Z()),
199  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
201  //}
202 
203  ResetParameters();
204  }
205  }
206 
207  //if (nam.BeginsWith("Kappe")|| nam.BeginsWith("Capsule") || nam.BeginsWith("Deckel"))
208  if (nam.BeginsWith("Cryostat")|| nam.BeginsWith("Capsule") )
209  //cout << "Error <CbmEmc::ProcessHits> : " << nam << " not EMC volume" << endl;
210  //else
211  {// if ( gMC->IsTrackEntering() )
212  if ( gMC->IsTrackEntering() )
213  {
214  fTrackID = gMC->GetStack()->GetCurrentTrackNumber(); // trk ID
215  fEventID = gMC->CurrentEvent();
216 
217  fpdgCode = gMC->TrackPid();
218 
219  fELoss = gMC->Edep();
220  fLength = gMC->TrackLength();
221  fTime = gMC->TrackTime()* 1.0e09;
222  gMC->TrackPosition(fPos); // cm
223  gMC->TrackMomentum(fMom); // GeV
224  }
225 
226 
227  // Sum energy loss for all steps in the active volume
228  fELoss += gMC->Edep();
229  //cout <<"enrgy loss"<<fELoss<<endl;
230 
231 
232  // Set additional parameters at exit of active volume. Create CbmDrcPoint.
233  if ( gMC->IsTrackExiting() ||
234  gMC->IsTrackStop() ||
235  gMC->IsTrackDisappeared())
236  {
237  if ((fELoss == 0.)&&(fpdgCode!=2112 ) )
238  {
239  //ResetParameters();
240  return kFALSE;
241  }
242 
243  //id = gMC->CurrentVolOffID(1,copyNo);
244  //gMC->TrackPosition(fPos); // cm
245  //gMC->TrackMomentum(fMom); // GeV
246 
247  //cout <<"energy loss"<<fMom.Px()<<endl;
248  //sscanf(nam,"laySci%04d", &copyNo);
249  //fnCopy = copyNo;
250  fnCopy = vol->getCopyNo();
251  cout << " Vol Name: " << gMC->CurrentVolPath() <<" vol id "
252  <<vol->getMCid()<<" copyNo "<<vol->getCopyNo()<< endl;
253 
254  TVector3 pos(fPos.X(), fPos.Y(), fPos.Z());
255  //if ( pdgCode ) {
256 
258  TVector3(fPos.X(), fPos.Y(), fPos.Z()),
259  TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
261  //}
262 
263  ResetParameters();
264  }
265  }
266  return kTRUE;
267 }
268 // ----------------------------------------------------------------------------
269 
270 // ----- Public method EndOfEvent -----------------------------------------
272 {
273  if (fVerboseLevel) Print();
274  Reset();
275 }
276 // ----------------------------------------------------------------------------
277 
278 // ----- Public method Register -------------------------------------------
280 {
281  FairRootManager::Instance()->Register("HypGePoint","HypGe", fHypGeCollection, kTRUE);
282  FairRootManager::Instance()->Register("HypGeAlPoint","HypGeAl", fHypGeAlCollection, kTRUE);
283 
284 }
285 // ----------------------------------------------------------------------------
286 
287 // ----- Public method GetCollection --------------------------------------
288 TClonesArray* PndHypGe::GetCollection(Int_t iColl) const
289 {
290  if (iColl == 0) return fHypGeCollection;
291  if (iColl == 1) return fHypGeAlCollection;
292 
293  return NULL;
294 }
295 // ----------------------------------------------------------------------------
296 
297 // ----- Public method Print ----------------------------------------------
298 void PndHypGe::Print() const
299 {
300  Int_t nHits = fHypGeCollection->GetEntriesFast();
301  cout << "-I- PndHypGe: " << nHits << " points registered in this event."
302  << endl;
303 
304  if (fVerboseLevel>1)
305  for (Int_t i=0; i<nHits; i++) (*fHypGeCollection)[i]->Print();
306 }
307 // ----------------------------------------------------------------------------
308 
309 
310 
311 // ----- Public method Reset ----------------------------------------------
313 {
314  fHypGeCollection->Delete();
315  fHypGeAlCollection->Delete();
316  //fHypGecapCollection->Delete();
317  fPosIndex = 0;
318 }
319 // ----------------------------------------------------------------------------
320 
321 
322 // guarda in FairRootManager::CopyClones
323 // ----- Public method CopyClones -----------------------------------------
324 void PndHypGe::CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset )
325 {
326  Int_t nEntries = cl1->GetEntriesFast();
327  //cout << "-I- PndHypGe: " << nEntries << " entries to add." << endl;
328  TClonesArray& clref = *cl2;
329  PndHypGePoint* oldpoint = NULL;
330  for (Int_t i=0; i<nEntries; i++) {
331  oldpoint = (PndHypGePoint*) cl1->At(i);
332  Int_t index = oldpoint->GetTrackID() + offset;
333  oldpoint->SetTrackID(index);
334  new (clref[fPosIndex]) PndHypGePoint(*oldpoint);
335  fPosIndex++;
336  }
337  cout << " -I- PndHypGe: " << cl2->GetEntriesFast() << " merged entries."
338  << endl;
339 }
340 // ----------------------------------------------------------------------------
341  // ----- Public method ConstructGeometry ----------------------------------
343 {
344  TString fileName=GetGeometryFileName();
345 
346  if(fileName.EndsWith(".root"))
347  {
348  ConstructRootGeometry();
349  }
350  else
351  {
353  }
354 
355 }
356 
358 {
359  cout<<"----- constructing HPGe Geometry default -----"<<endl;
360  Double_t deg = TMath::Pi()/180.;
361 
362  //vacuum = gGeoManager->Medium("vacuum");
363  FairGeoLoader*geoLoad = FairGeoLoader::Instance();
364  FairGeoInterface *geoFace = geoLoad->getGeoInterface();
365  FairGeoMedia *Media = geoFace->getMedia();
366  FairGeoBuilder *geobuild=geoLoad->getGeoBuilder();
367 
368  FairGeoMedium *medGe = Media->getMedium("germanium");
369  Int_t nmedGe=geobuild->createMedium(medGe);
370 
371  //Scintillator plate
372  FairGeoMedium *medsci = Media->getMedium("polypropylene");
373  Int_t nmedsci=geobuild->createMedium(medsci);
374 
375  // aluminum capsule
376  FairGeoMedium *medcap = Media->getMedium("HYPaluminium");
377  Int_t nmedcap=geobuild->createMedium(medcap);
378 
379 
380  //TGeoSphere* logicWorld= new TGeoSphere(0.,50.,90.,180.,0.,360.);
381 
382  // TGeoVolume* sphere = new TGeoVolume("sphere",logicWorld, medPWO);
383 
384  TGeoVolume *sphere = new TGeoVolumeAssembly("sphere");
385 
386  TGeoTube* Crystal_Tube = new TGeoTube("tube",0.,7.0/2.,7.8/2.);
387 
388  cout<< "tube fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f"<<" "
389  <<" "<<Crystal_Tube->GetDZ()<<" "
390  <<Crystal_Tube->GetRmin()<<" "
391  <<Crystal_Tube->GetRmax()<<endl;
392 
393  TGeoPgon* Crystal_Polyhedra = new TGeoPgon("Pgon",0., 360., 6,2);
394 
395  Crystal_Polyhedra->DefineSection(0,-3.9,0.,3.50*cos(30.*deg));
396  Crystal_Polyhedra->DefineSection(1,3.9,0.,(3.50));
397 
398  // scintillator plate
399  TGeoPgon* lay_sci = new TGeoPgon("PgLay",0., 360., 6,2);
400  //first thickness 0.5 cm,
401  //second 1.cm
402  lay_sci->DefineSection(0,-0.25,0.,3.50*cos(30.*deg));
403  lay_sci->DefineSection(1,0.25,0.,(3.50)*cos(30.*deg));
404  //TGeoPgon* lay_sci ;
405 
406  //aluminum capsule
407  TGeoPgon* lay_capl = new TGeoPgon("PgcapL",0., 360., 6,2);
408  //first thickness 0.5 cm,
409  //second 1.cm
410  lay_capl->DefineSection(0,-4.2,0.,3.144);
411  lay_capl->DefineSection(1,4.2,0.,(3.627));
412 
413  TGeoPgon* lay_caps = new TGeoPgon("PgcapS",0., 360., 6,2);
414  //first thickness 0.5 cm,
415  //second 1.cm
416  lay_caps->DefineSection(0,-3.95,0.,3.078);
417  lay_caps->DefineSection(1,3.95,0.,(3.553));
418 
419  for (Int_t j=0; j<Crystal_Polyhedra->GetNz(); j++) {
420 
421  cout<< "fZ[%i]=%5.2f fRmin[%i]=%5.2f fRmax[%i]=%5.2f"<<" "
422  << j<<" "<<Crystal_Polyhedra->GetZ()[j]<<" "
423  <<Crystal_Polyhedra->GetRmin()[j]<<" "
424  <<Crystal_Polyhedra->GetRmax()[j]<<endl;
425 
426  }
427 
428  //###real geometry
429  //###TGeoCompositeShape* logicCrystal_test = new TGeoCompositeShape("test","Pgon*tube");
430 
431  TGeoPgon* logicCrystal_test;
432  logicCrystal_test = Crystal_Polyhedra ;
433  TGeoCompositeShape* lay_cap = new TGeoCompositeShape("test","(PgcapL)-(PgcapS)");
434 
435  TList *ClusterList=0;
436  TList *ClusterList1=0;
437  TList *ClusterList2=0;
438  TList *ClusterList3=0;
439  TList *ClusterList4=0;
440  TList *ClusterList5=0;
441  TList *ClusterList6=0;
442  TList *ClusterList7=0;
443  TList *ClusterList8=0;
444  TList *ClusterList9=0;
445  TList *ClusterList10=0;
446  TList *ClusterList11=0;
447  TList *ClusterList12=0;
448  TList *ClusterList13=0;
449  TList *ClusterList14=0;
450  //TList *ClusterList15=0;
451 
452  GeCluster* HypGe= new GeCluster();
453 
454  HypGe->SetPathGeo(fPathGeo.Data());
455 
456 
457  ClusterList=HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
458  30.0, 168.0, 90., 2.0,1000); // L
459  //ClusterList->Dump();
460  for(Int_t i=0;i<ClusterList->GetSize();i++){
461  AddSensitiveVolume((TGeoVolume *) ClusterList->At(i));
462  }
463 
464  ClusterList1 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
465  30.0, 168.0,18, 2.0,1200); // N
466 
467  for(Int_t i=0;i<ClusterList1->GetSize();i++)
468  {
469  AddSensitiveVolume((TGeoVolume *) ClusterList1->At(i));
470  }
471 
472  ClusterList2 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
473  30.1, 168.0, 162, 2.0,400); // D
474 
475  for(Int_t i=0;i<ClusterList2->GetSize();i++)
476  {
477  AddSensitiveVolume((TGeoVolume *) ClusterList2->At(i));
478  }
479 
480  ClusterList3 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
481  30.3, 168.0, 234, 2.0,600); // F
482 
483  for(Int_t i=0;i<ClusterList3->GetSize();i++)
484  {
485  AddSensitiveVolume((TGeoVolume *) ClusterList3->At(i));
486  }
487 
488  ClusterList9 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
489  30., 168.0, 306., 2.0,1400); // Q
490 
491  for(Int_t i=0;i<ClusterList9->GetSize();i++)
492  {
493  AddSensitiveVolume((TGeoVolume *) ClusterList9->At(i));
494  }
495  ClusterList4 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,32.2,
496  148.0, 54.0, 2.0,1100); // M
497  for(Int_t i=0;i<ClusterList4->GetSize();i++)
498  {
499  AddSensitiveVolume((TGeoVolume *) ClusterList4->At(i));
500  }
501 
502  ClusterList5 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,32.9,
503  148.0, 126.0, 2.0,300); // C
504  for(Int_t i=0;i<ClusterList5->GetSize();i++)
505  {
506  AddSensitiveVolume((TGeoVolume *) ClusterList5->At(i));
507  }
508 
509  ClusterList6 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,31.4,
510  148.0, 198.0, 2.0,500); // E
511  for(Int_t i=0;i<ClusterList6->GetSize();i++)
512  {
513  AddSensitiveVolume((TGeoVolume *) ClusterList6->At(i));
514  }
515 
516  ClusterList7 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,32.6,
517  148.0, 270.0, 2.0,1500); // R
518  for(Int_t i=0;i<ClusterList7->GetSize();i++)
519  {
520  AddSensitiveVolume((TGeoVolume *) ClusterList7->At(i));
521  }
522  ClusterList8 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,30.3,
523  148.0, 342.0, 2.0,1300); // P
524  for(Int_t i=0;i<ClusterList8->GetSize();i++)
525  {
526  AddSensitiveVolume((TGeoVolume *) ClusterList8->At(i));
527  }
528 
529  ClusterList10=HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
530  30.0, 140.0, 90., 2.0,700); // G
531  //ClusterList->Dump();
532  for(Int_t i=0;i<ClusterList10->GetSize();i++){
533  AddSensitiveVolume((TGeoVolume *) ClusterList10->At(i));
534  }
535 
536  ClusterList11 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
537  30.2, 140.0,18., 2.0,800); // J
538 
539  for(Int_t i=0;i<ClusterList11->GetSize();i++)
540  {
541  AddSensitiveVolume((TGeoVolume *) ClusterList11->At(i));
542  }
543 
544  ClusterList12 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
545  30.15, 140.0, 162., 2.0,100); // A
546 
547  for(Int_t i=0;i<ClusterList12->GetSize();i++)
548  {
549  AddSensitiveVolume((TGeoVolume *) ClusterList12->At(i));
550  }
551 
552  ClusterList13 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
553  30.15, 140.0, 234., 2.0,200); // B
554 
555  for(Int_t i=0;i<ClusterList13->GetSize();i++)
556  {
557  AddSensitiveVolume((TGeoVolume *) ClusterList13->At(i));
558  }
559 
560  ClusterList14 = HypGe->CreateCluster(logicCrystal_test,lay_sci,lay_cap,*sphere,
561  30.2, 140.0, 306., 2.0,900); // K
562 
563  for(Int_t i=0;i<ClusterList14->GetSize();i++)
564  {
565  AddSensitiveVolume((TGeoVolume *) ClusterList14->At(i));
566  }
567 
568  TString vname = "cave";
569 
570  TGeoVolume* vcave = gGeoManager->FindVolumeFast(vname);
571 
572  vcave->AddNode(sphere, 1,new TGeoCombiTrans(0., 0., fdist, new TGeoRotation (0)));
573 
574 
575 
576 }
577 
578 
579 // -------------------------------------------------------------------------
581 {
582  for (Int_t i = 0; i < fListOfSensitives.size(); i++){
583  if (name.find(fListOfSensitives[i]) != std::string::npos)
584  return true;
585  }
586  return false;
587 }
588 
589 
590 
591 // ----- Private method AddHit --------------------------------------------
592 PndHypGePoint* PndHypGe::AddHit(Int_t trackID, Int_t evtID, Int_t pdgCode,Int_t charge,
593  TVector3 pos, TVector3 mom, Double_t time,
594  Double_t length, Double_t eLoss, Short_t copy) {
595  TClonesArray& clref = *fHypGeCollection;
596  Int_t size = clref.GetEntriesFast();
597  if (fVerboseLevel>1)
598  cout << "-I- PndHypGe: Adding Point at IN (" << pos.X() << ", " << pos.Y()
599  << ", " << pos.Z() << ") cm, evt " << evtID << ", track "
600  << trackID <<", energy loss " << eLoss*1e06 << " keV " << " copy " << copy << endl;
601 
602  return new(clref[size]) PndHypGePoint(trackID, evtID,pdgCode,charge, pos, mom,
603  time, length, eLoss,copy);
604 }
605 PndHypGePoint* PndHypGe::AddGeAlHit(Int_t trackID, Int_t evtID, Int_t pdgCode,Int_t charge,
606  TVector3 pos, TVector3 mom, Double_t time,
607  Double_t length, Double_t eLoss,
608  Short_t copy) {
609  TClonesArray& clref = *fHypGeAlCollection;
610  Int_t size = clref.GetEntriesFast();
611  if (fVerboseLevel>1)
612  cout << "-I- PndHypGe: Adding Point at IN (" << pos.X() << ", " << pos.Y()
613  << ", " << pos.Z() << ") cm, evt " << evtID << ", track "
614  << trackID <<", energy loss " << eLoss*1e06 << " keV " << " copy " << copy << endl;
615 
616  return new(clref[size]) PndHypGePoint(trackID, evtID, pdgCode,charge,pos, mom,
617  time, length, eLoss,copy);
618 }
619 
620 
622  fTrackID = 0;
623  fVolumeID = 0;
624  fEventID = 0;fnCopy = 0;
625 
626  fPos.SetXYZT(0., 0., 0., 0.);
627  fMom.SetXYZT(0., 0., 0., 0.) ;
628  fTime = 0;
629  fLength = 0;
630  fELoss = 0;
631 }
632 
633 // ----
634 
635 
637 
TVector3 pos
Double32_t fELoss
Definition: PndHypGe.h:157
TLorentzVector fPos
Definition: PndHypGe.h:153
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
PndHypGe * HypGe
Definition: sim_hypGe.C:47
sim(Int_t nEvents=1, TString SimEngine="TGeant4", Float_t mom=6.231552)
virtual void Register()
Definition: PndHypGe.cxx:279
void ResetParameters()
Definition: PndHypGe.cxx:621
FairGeoLoader * geoLoad
Int_t i
Definition: run_full.C:25
FairGeoMedia * Media
virtual void Initialize()
Definition: PndHypGe.cxx:114
bool CheckIfSensitive(std::string name)
Definition: PndHypGe.cxx:580
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition: PndHypGe.cxx:324
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
virtual void ConstructGeometry()
Definition: PndHypGe.cxx:342
Int_t GetTrackID() const
Definition: PndHypGePoint.h:51
virtual void Print() const
Definition: PndHypGe.cxx:298
virtual void EndOfEvent()
Definition: PndHypGe.cxx:271
void SetPathGeo(TString path)
Definition: GeCluster.h:35
Double_t mom
Definition: plot_dirc.C:14
TVector3 offset(2, 0, 0)
TGeoManager * gGeoManager
PndHypGe()
Definition: PndHypGe.cxx:51
virtual ~PndHypGe()
Definition: PndHypGe.cxx:90
Double32_t fTime
Definition: PndHypGe.h:155
void ConstructHPGeGeometry()
Definition: PndHypGe.cxx:357
Int_t fPosIndex
Definition: PndHypGe.h:158
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
FairGeoBuilder * geobuild
int nHits
Definition: RiemannTest.C:16
Double_t
virtual void Reset()
Definition: PndHypGe.cxx:312
std::vector< std::string > fListOfSensitives
Definition: PndHypGe.h:143
Double32_t fLength
Definition: PndHypGe.h:156
TString fPathGeo
Definition: PndHypGe.h:161
Int_t fpdgCode
Definition: PndHypGe.h:147
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Int_t fEventID
Definition: PndHypGe.h:152
TList * CreateCluster(TGeoPgon *logicCrystal_test, TGeoPgon *lay_sci, TGeoCompositeShape *lay_cap, TGeoVolume &sphere, double distance, double theta, double phi, double depth_first_interaction, int id_start)
Definition: GeCluster.cxx:52
Int_t fVolumeID
Definition: PndHypGe.h:151
TString name
Short_t fnCopy
Definition: PndHypGe.h:159
TLorentzVector fMom
Definition: PndHypGe.h:154
Int_t fcharge
Definition: PndHypGe.h:148
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: PndHypGe.cxx:288
ClassImp(PndAnaContFact)
virtual void BeginEvent()
Definition: PndHypGe.cxx:127
Double_t fdist
Definition: PndHypGe.h:160
FairGeoInterface * geoFace
TString nam
Definition: sim_hypGe.C:48
Int_t fTrackID
Definition: PndHypGe.h:150
Double_t Pi
Mvd Initialize()
void SetTrackID(Int_t id)
Definition: PndHypGePoint.h:69
PndHypGePoint * AddHit(Int_t trackID, Int_t evtID, Int_t pdgCode, Int_t charge, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, Short_t copy)
Definition: PndHypGe.cxx:592
virtual Bool_t ProcessHits(FairVolume *vol=0)
Definition: PndHypGe.cxx:136
PndHypGePoint * AddGeAlHit(Int_t trackID, Int_t evtID, Int_t pdgCode, Int_t charge, TVector3 pos, TVector3 mom, Double_t tof, Double_t length, Double_t eLoss, Short_t copy)
Definition: PndHypGe.cxx:605