FairRoot/PandaRoot
PndHyp.cxx
Go to the documentation of this file.
1 //
3 // PndHyp
4 //
5 // Filler of PndHypPoint
6 //
7 // created by A. Sanchez
8 //
10 
11 #include <iostream>
12 //#include "ostringstream.h"
13 
14 #include "TClonesArray.h"
15 #include "TGeoManager.h"
16 #include "TLorentzVector.h"
17 #include "TParticle.h"
18 #include "THParticle.h"
19 #include "TVirtualMC.h"
20 #include "TString.h"
21 #include "FairGeoTransform.h"
22 
23 #include "TGeoBBox.h"
24 #include "FairGeoInterface.h"
25 #include "FairGeoLoader.h"
26 #include "TGeoMCGeometry.h"
27 #include "FairGeoNode.h"
28 #include "FairGeoMedium.h"
29 #include "FairGeoMedia.h"
30 #include "PndGeoHyp.h"
31 #include "FairGeoRootBuilder.h"
32 #include "TGeoVoxelFinder.h"
33 #include "PndStack.h"
34 #include "PndHyp.h"
35 #include "PndHypPoint.h"
36 
37 #include "FairRootManager.h"
38 #include "FairVolume.h"
39 // add on for debug
40 
41 #include "FairRuntimeDb.h"
42 #include "TObjArray.h"
43 #include "FairRun.h"
44 #include "FairRunSim.h"
45 
46 #include "PndHypGeoHandling.h"
47 
48 //#include "PndHypDecayer.h"
49 //#include "HypStatDecay.h"
50 #include "TArrayI.h"
51 #include "TMCProcess.h"
52 
53 #include "TList.h"
54 #include "TFile.h"
55 #include "TGenPhaseSpace.h"
56 
57 #include <string>
58 #include <sstream>
59 using std::cout;
60 using std::endl;
61 using std::ostringstream;
62 class FairVolume;
63 
64 // ----- Default constructor -------------------------------------------
66  fcount(0),fUseFileOption(false),fUseRAZHOption(false),fUseGamOption(false),fMatBud(false){
67  fHypCollection = new TClonesArray("PndHypPoint");
68  fHypSecTarCollection = new TClonesArray("PndHypPoint");
69  fHypSTMatBudCollection = new TClonesArray("PndHypPoint");
70 
71  // if(fUseRAZHOption==true && fUseFileOption==true){
72 
73  fFile = NULL;//new TFile(fFileName,"RECREATE");//gam+nucfrag "hypBupDecay2.root"
74  fEvt = NULL;//new TClonesArray("THParticle",50);
75  ft = NULL;//new TTree("data","hypernuclei");
76 
77  // activeCnt=0;
78  // weight =1.0;
79 
80  // // define the tree branches
81  // ft->Branch("Npart",&activeCnt,"Npart/I");
82  // ft->Branch("Weigth",&weight,"Weight/D");
83  // ft->Branch("Seed",&seed,"Seed/D");
84  // ft->Branch("Particles",&fEvt,32000);
85  // }
86 
87  SiId = 0;
88  CId = 0;
89  CpipeId = 0;
90  alId = 0;
91  beId = 0;
92  fPosIndex = 0;
93 
94  fEventID=-1;
95  fListMat = kFALSE;
96 
97  fListOfSensitives.push_back(fVolNamAb.Data());//"stglAb");
98  fListOfSensitives.push_back(fVolNamSi.Data());//"stglSi");
99  fListOfSensitives.push_back("stglpipe");
100 
101 
102 }
103 // -------------------------------------------------------------------------
104 
105 // ----- Standard constructor ------------------------------------------
106 PndHyp::PndHyp(const char* name, Bool_t active)
107  : FairDetector(name, active),fcount(0),fUseFileOption(false),fUseRAZHOption(false),fUseGamOption(false),fMatBud(false){
108  fHypCollection = new TClonesArray("PndHypPoint");
109  fHypSecTarCollection = new TClonesArray("PndHypPoint");
110  fHypSTMatBudCollection = new TClonesArray("PndHypPoint");
111 
112  // if(fUseRAZHOption==true && fUseFileOption==true){
113 
114  fFile = NULL;//new TFile(fFileName,"RECREATE");//gam+nucfrag "hypBupDecay2.root"
115  fEvt = NULL;//new TClonesArray("THParticle",50);
116  ft = NULL;//new TTree("data","hypernuclei");
117 
118  // activeCnt=0;
119  // weight =1.0;
120 
121  // // define the tree branches
122  // ft->Branch("Npart",&activeCnt,"Npart/I");
123  // ft->Branch("Weigth",&weight,"Weight/D");
124  // ft->Branch("Seed",&seed,"Seed/D");
125  // ft->Branch("Particles",&fEvt,32000);
126  // }
127 
128 
129  SiId = 0;
130  CId = 0;
131  alId = 0;
132  beId = 0;
133  fPosIndex = 0;
134  fListMat = kFALSE;
135  fEventID=-1;
136 
137 
138  fListOfSensitives.push_back(fVolNamAb.Data());//"stglAb");
139  fListOfSensitives.push_back(fVolNamSi.Data());//"stglSi");
140  fListOfSensitives.push_back("stglpipe");
141 
142 
143 }
144 // -------------------------------------------------------------------------
145 
146 
147 
148 // ----- Destructor ----------------------------------------------------
150  if (fHypCollection) {
151  fHypCollection->Delete();
152  delete fHypCollection;
153  }
154  if (fHypSecTarCollection) {
155  fHypSecTarCollection->Delete();
156  delete fHypSecTarCollection;
157  }
158 
160  fHypSTMatBudCollection->Delete();
161  delete fHypSTMatBudCollection;
162  }
163 
164  delete fGeoH;
165 
166  if (fEvt){
167  fEvt->Delete();
168  delete fEvt;}
169  if (fFile){
170 
171  delete fFile;}
172 
173  if (ft){
174  delete ft;}
175 
176  // delete r;
177  //delete fread;
178 
179 }
180 // -------------------------------------------------------------------------
181 
182 
183 
184 // ----- Public method Intialize ---------------------------------------
186  // Init function
187 
189 
190 
191 
192  if(0==gGeoManager) {
193  std::cout<<" -E- No gGeoManager in PndHyp Detector::Initialize()!"<<std::endl;
194  abort();
195  }
197 
198  // --- Opening output file for hypernuclei formation/decay
199 
200  // fread = new HypStatDecay("12C");
201 
202  if(fUseRAZHOption==true && fUseFileOption==true){
203 
204  fFile = new TFile(fFileName,"RECREATE");//gam+nucfrag "hypBupDecay2.root"
205  fEvt = new TClonesArray("THParticle",50);
206  ft = new TTree("data","hypernuclei");
207 
208  activeCnt=0;
209  weight =1.0;
210 
211  // define the tree branches
212  ft->Branch("Npart",&activeCnt,"Npart/I");
213  ft->Branch("Weigth",&weight,"Weight/D");
214  ft->Branch("Seed",&seed,"Seed/D");
215  ft->Branch("Particles",&fEvt,32000);
216  }
217 
218 
219  //-----------------------------------------------------------//
220 
221 
222  TGeoMedium *Si= gGeoManager->GetMedium("HYPsilicon");//fSiMat.Data());
223  if(Si)SiId= Si->GetId();
224 
225  //----disactivated when geo file is block
226 
227  if(fVers.Contains("standard")){
228 
229  fStandard=kTRUE;
230  fCurrent=kFALSE;
231 
232  TGeoMedium *C= gGeoManager->GetMedium(fAbsMat.Data());
233 
234  if(CId)CId= C->GetId();
235 
236  TGeoMedium *Cpipe= gGeoManager->GetMedium(fBPipeMat.Data());
237  if(CpipeId)CpipeId= Cpipe->GetId();
238 
239  }else if(fVers.Contains("List")){
240 
241  fStandard=kTRUE;//sebastian fVolumeID
242  fCurrent=kFALSE;
243 
244  for(size_t m=0;m<fListOfMaterials.size();m++){
245  gGeoManager->GetMedium(fListOfMaterials[m].Data());
246  }
247 
248  }
249 
250 }
251 // -------------------------------------------------------------------------
253  // Begin of the event
254 
255 }
256 
257 
258 // -------------------------------------------------------------------------
260  // Begin of the event
261 
262  fTrackStopNxtStep=kFALSE;
263  // cout << " PndHyp::PreTrack() "<< endl;
264 
265 }
266 
267 
269  // FairRun* fRun = FairRun::Instance();
270 
271  //Int_t mat = gGeoManager->GetMaterialIndex("HYPdiamond");
272  //gMC->Gstpar(mat,"HADR",1.0e-9);
273 }
274 
275 
276 // ----- Public method ProcessHits --------------------------------------
277 
278 Bool_t PndHyp::ProcessHits(FairVolume* vol)
279 
280 
281 {
282 
283 
284  Double_t beta; TString nam; //Double_t gamma; //[R.K. 01/2017] unused variable
285  Int_t nSiL = -1,nAbL = -1;
286  ostringstream FullName,matName;
287 
288  Int_t medId = gMC->CurrentMedium();
289  TVector3 radt;
290  fpdgCode=-1;
291  fpdgCode = gMC->TrackPid();
292 
293  if(fTrackStopNxtStep) {
294  //if( gMC->TrackPid()==3312)//&&(medId==SiId||medId==CId))
295  //cout<<"particle "<< gMC->TrackPid() << " " <<fTrackStopNxtStep <<endl;
296  gMC->StopTrack();
297  return kTRUE;
298  }
299 
300  TString nam2 = gMC->CurrentVolName();
301 
302 
303  /*gMC->TrackMomentum(PiL);
304  if (gMC->TrackPid()>1010000000 ||gMC->TrackPid()>1020000000 ||gMC->TrackPid()==-211) cout<<"ProcessHits : Energy Loss hyp "<< gMC->TrackPid() << " "<<vol->getName() <<" "<<PiL.P()<<" "<<gMC->Edep()<<endl;
305  if(PiL.P()>3.)cout<<"ProcessHits : Energy Loss "<< gMC->TrackPid() << " "
306  <<vol->getName() <<" "<<PiL.P()<<" "<<gMC->Edep()<<endl;
307  */
308 
309  if (medId==SiId)
310  { //hola
311 
312  if ( gMC->IsTrackEntering() )
313  {
314  fELoss = 0.;
315  fTime = gMC->TrackTime() * 1.0e09;
316  fLength = gMC->TrackLength();
317  fmass = gMC->TrackMass(); // mass (GeV)
318  fcharge = gMC->TrackCharge(); // charge?
319 
320  if(fStartEvID>0)
321  {
322  fEventID = gMC->CurrentEvent()+fStartEvID;
323  }else fEventID = gMC->CurrentEvent();
324 
325  gMC->TrackPosition(fPosIn);
326  gMC->TrackMomentum(fMomIn);
327 
328 
329  }
330 
331  // Sum energy loss for all steps in the active volume
332 
333  fELoss += gMC->Edep();
334 
335  // Set additional parameters at exit of active volume. Create CbmStsPoint.
336 
337  TLorentzVector PL;
338  gMC->TrackMomentum(PL);
339 
340  if ( (gMC->IsTrackExiting() ||
341  gMC->IsTrackStop() ||
342  gMC->IsTrackDisappeared() )&& gMC->TrackCharge() )
343  {
344  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
345 
346 
347 
348 
349  //*** now the volume is through the layer number characterised.(X-Z,Z-Y)
350 
351  if (fCurrent) {
352  if ((nam2.Contains("Sensor"))) {
353  sscanf(nam2,"Sensor%d", &nSiL);
354  fVolumeID=nSiL;
355  }
356  }else fVolumeID = vol->getCopyNo();
357 
358 
359  //**************///
360 
361  //FullName << gGeoManager->GetPath();
362 
363 
364 
365  //cout << "******* Info from gMC *************" << endl;
366  //Int_t cp=-1; //[R.K.02/2017] Unused variable?
367  //Int_t fVolid = gMC->CurrentVolID(cp); //[R.K.02/2017] Unused variable?
368 
369 
370  //cout << " Vol Name: " << gMC->CurrentVolPath() <<" vol id "<<vol->getMCid()<< endl;
371 
372  /* TString nam2 = gMC->CurrentVolName();
373  if ((nam2.Contains("Si"))) {
374  sscanf(nam2,"stglSi%d#01", &nSiL);
375  cout << "hyp::ProcessHits> : " << nam2 <<" # "
376  <<nSiL<<" "<<"Hit in "<< gGeoManager->GetPath()<<endl;
377  } */
378 
379  FullName <<gMC->CurrentVolPath();
380 
381  if(0==fGeoH) {
382  std::cout<<" -E- No PndHypGeoHandling loaded."<<std::endl;
383  abort();
384  }
385 
386 
387  gMC->TrackPosition(fPosOut);
388  gMC->TrackMomentum(fMomOut);
389 
390  if (fELoss == 0. ) return kFALSE;
391 
392  radt= fPosOut.Vect();
393  fdist=radt.Perp();
394  beta = fMomOut.Beta();
395  //gamma = fMomOut.Gamma();
396  fPLin = beta;
397  //fPLin = fMomIn.P();
398  fPLout = fMomOut.P();
399 
401  fGeoH->GetID(gMC->CurrentVolPath()),
402  TVector3(fPosIn.X(), fPosIn.Y(), fPosIn.Z()),
403  TVector3(fMomIn.Px(), fMomIn.Py(), fMomIn.Pz()),
404  TVector3(fPosOut.X(), fPosOut.Y(), fPosOut.Z()),
405  TVector3(fMomOut.Px(), fMomOut.Py(), fMomOut.Pz()),
407  fdist,fPLin,fPLout);
408 
409  // Increment number of PndMvd points for TParticle
410  // PndStack* stack = (PndStack*) gMC->GetStack();
411  // stack->AddPoint(kHYP);
412 
413  ResetParameters();
414  }
415 
416  //return kTRUE;
417 
418 
419 
420  }//volSi
421 
422 
423 
424  // -----
425 
426  else if(fMatBud && (!nam2.Contains("Absorber"))&&(!nam2.Contains("Sensor")))
427  {
428 
429  // std::cout<<nam2.Data()<<std::endl;
430 
431  if ( gMC->IsTrackEntering() )
432  {
433  fELoss = 0.;
434  fTime = gMC->TrackTime() * 1.0e09;
435  fLength = gMC->TrackLength();
436  fmass = gMC->TrackMass(); // mass (GeV)
437  fcharge = gMC->TrackCharge(); // charge?
438 
439  if(fStartEvID>0)
440  {
441  fEventID = gMC->CurrentEvent()+fStartEvID;
442  }else fEventID = gMC->CurrentEvent();
443 
444  gMC->TrackPosition(fPosIn);
445  gMC->TrackMomentum(fMomIn);
446 
447 
448  }
449 
450  // Sum energy loss for all steps in the active volume
451 
452  fELoss += gMC->Edep();
453 
454  // Set additional parameters at exit of active volume.
455 
456 
457 
458  if ( (gMC->IsTrackExiting() ||
459  gMC->IsTrackStop() ||
460  gMC->IsTrackDisappeared() )&& gMC->TrackCharge() )
461  {
462  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
463 
465 
466  fVolumeID = vol->getCopyNo();
467 
468  gMC->TrackPosition(fPosOut);
469  gMC->TrackMomentum(fMomOut);
470 
471  if (fELoss == 0. ) return kFALSE;
472 
473  radt= fPosOut.Vect();
474  fdist=radt.Perp();
475  beta = fMomOut.Beta();
476 
477  fPLin = beta;
478 
479  fPLout = fMomOut.P();
480 
482  TVector3(fPosIn.X(), fPosIn.Y(), fPosIn.Z()),
483  TVector3(fMomIn.Px(), fMomIn.Py(), fMomIn.Pz()),
484  TVector3(fPosOut.X(), fPosOut.Y(), fPosOut.Z()),
485  TVector3(fMomOut.Px(), fMomOut.Py(), fMomOut.Pz()),
487  fdist,fPLin,fPLout);
488 
489  // Increment number of PndMvd points for TParticle
490  // PndStack* stack = (PndStack*) gMC->GetStack();
491  // stack->AddPoint(kHYP);
492 
493  ResetParameters();
494 
495  }
496 
497 
498 
499  }
500 
501  //--------
502  else if ((fpdgCode==3312)&&(nam2.Contains("Ab")))//||nam2.Contains("Si")))
503  { //absorber
504 
505  if ( gMC->IsTrackEntering() )
506  {
507  fELoss = 0.;
508  fTime = gMC->TrackTime() * 1.0e09;
509  fLength = gMC->TrackLength();
510  fmass = gMC->TrackMass(); // mass (GeV)
511  fcharge = gMC->TrackCharge(); // charge?
512 
513 
514  if(fStartEvID>0)
515  {
516  fEventID = gMC->CurrentEvent()+fStartEvID;
517  }else fEventID = gMC->CurrentEvent();
518 
519 
520  gMC->TrackPosition(fPosIn);
521  gMC->TrackMomentum(fMomIn);
522 
523  }
524 
525  // Sum energy loss for all steps in the active volume
526 
527  fELoss += gMC->Edep();
528  // Gamma, Beta, tau(proper time) of ximnus
529  TLorentzVector PL;
530  gMC->TrackMomentum(PL);
531  beta = PL.Beta();
532 
533 
534  if (beta==0.0)
535  {
536  fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
537 
538  if (fCurrent) {
539 
540  if ((nam2.Contains("Absorber"))) {
541  sscanf(nam2,"Absorber%d", &nAbL);
542  cout << "hyp::ProcessHits> : " << nam2 <<" # "
543  <<nAbL<<" "<<"Hit in "<< gGeoManager->GetPath()<<endl;
544  fVolumeID = nAbL;
545  }
546  }else fVolumeID = vol->getMCid();
547 
548  gMC->TrackPosition(fPosOut);
549  gMC->TrackMomentum(fMomOut);
550 
551  //ostringstream matName;
552  TString mat[4]={"CAbs","Si","Be","Al"};
553  if (medId==CId) matName<<"CAbs";
554  if (medId==SiId) matName<<"Si";
555  // cout << "Hit in fullname " << matName.str() <<endl;
556  if (fELoss == 0. ) return kFALSE;
557 
558  //---Kinetic energy:###(PL.P())^2 + Mass^2 -Mass##
559  radt= fPosOut.Vect();
560  fdist=radt.Perp();
561  //beta = fMomOut.Beta();
562  //gamma = fMomOut.Gamma();
563  fPLin = beta;
564  //fPLin = fMomIn.P();
565  fPLout = fMomOut.P();
566 
567 
568 
569  AddSecTarHit(fTrackID, fEventID,fVolumeID,matName.str(),
570  TVector3(fPosIn.X(), fPosIn.Y(), fPosIn.Z()),
571  TVector3(fMomIn.Px(), fMomIn.Py(), fMomIn.Pz()),
572  TVector3(fPosOut.X(), fPosOut.Y(), fPosOut.Z()),
573  TVector3(fMomOut.Px(), fMomOut.Py(), fMomOut.Pz()),
575  fdist,fPLin,fPLout);
576 
577  // ***** Statistical Decay of a compound hyperfragment********
579 
580 
581  fTrackStopNxtStep=kTRUE;
582 
583  // Increment number of PndMvd points for TParticle
584  //PndStack* stack = (PndStack*) gMC->GetStack();
585  //stack->AddPoint(kHYP);
586 
587  ResetParameters();
588 
589  } //
590 
591 
592  }//no volSi
593 
594 
595 
596  return kTRUE;
597 
598 
599 } //ProcessHits
600 
601 // ----------------------------------------------------------------------------
602 
603 // ----- Public method EndOfEvent -----------------------------------------
605  if (fVerboseLevel) Print();
606  Reset();
607 }
608 // ----------------------------------------------------------------------------
609 
610 // ----- Public method Register -------------------------------------------
612  FairRootManager::Instance()->Register("HypPoint","Hyp", fHypCollection, kTRUE);
613  FairRootManager::Instance()->Register("HypSegTarPoint","HypSecTarg",
614  fHypSecTarCollection, kTRUE);
615  FairRootManager::Instance()->Register("HypSTMatBudPoint","HypMatBud",
617 
618 }
619 // ----------------------------------------------------------------------------
620 
621 // ----- Public method GetCollection --------------------------------------
622 TClonesArray* PndHyp::GetCollection(Int_t iColl) const {
623  if (iColl == 0) return fHypCollection;
624  if (iColl == 1) return fHypSecTarCollection;
625  if (iColl == 2) return fHypSTMatBudCollection;
626 
627  return NULL;
628 }
629 // ----------------------------------------------------------------------------
630 
631 // ----- Public method Print ----------------------------------------------
632 void PndHyp::Print() const {
633  Int_t nHits = fHypCollection->GetEntriesFast();
634  cout << "-I- PndHyp: " << nHits << " points registered in this event."
635  << endl;
636 
637  if (fVerboseLevel>1)
638  for (Int_t i=0; i<nHits; i++) (*fHypCollection)[i]->Print();
639 }
640 // ----------------------------------------------------------------------------
641 
642 
643 
644 // ----- Public method Reset ----------------------------------------------
646  fHypCollection->Clear();
647  fHypSecTarCollection->Clear();
649 
650  fPosIndex = 0;
651 }
652 // ----------------------------------------------------------------------------
653 
654 
655 // guarda in FairRootManager::CopyClones
656 // ----- Public method CopyClones -----------------------------------------
657 void PndHyp::CopyClones(TClonesArray* cl1, TClonesArray* cl2, Int_t offset ) {
658  Int_t nEntries = cl1->GetEntriesFast();
659  //cout << "-I- PndHyp: " << nEntries << " entries to add." << endl;
660  TClonesArray& clref = *cl2;
661  PndHypPoint* oldpoint = NULL;
662  for (Int_t i=0; i<nEntries; i++) {
663  oldpoint = (PndHypPoint*) cl1->At(i);
664  Int_t index = oldpoint->GetTrackID() + offset;
665  oldpoint->SetTrackID(index);
666  new (clref[fPosIndex]) PndHypPoint(*oldpoint);
667  fPosIndex++;
668  }
669  cout << " -I- PndHyp: " << cl2->GetEntriesFast() << " merged entries."
670  << endl;
671 }
672 // ----------------------------------------------------------------------------
673  // ----- Public method ConstructGeometry ----------------------------------
675 
676 TString fileName=GetGeometryFileName();
677 
678  if(fileName.EndsWith(".geo")){
679  std::cout<< "Geometry format not supported " <<std::endl;
680  // ConstructASCIIGeometry();
681 
682  }else if (fileName.EndsWith(".root")){
683  fRootSensVol= kTRUE;
684 
685  ConstructRootGeometry();
686 }else{
687  std::cout<< "Geometry format not supported " <<std::endl;
688 
689 }
690 
691 }
692 
693 // -------------------------------------------------------------
694 
695 // -------------------------------------------------------------------------
697 {
698  for (size_t i = 0; i < fListOfSensitives.size(); i++){
699 
700  if (name.find(fListOfSensitives[i]) != std::string::npos)
701  return true;
702  }
703  return false;
704 }
705 // ----- Public method FinishRun -------------------------------------------
707  if (fUseRAZHOption==true && fUseFileOption==true ){
708  fFile->Write();
709  fFile->Close();
710  //delete fEvt;
711 
712 
713  cout<<" -I PndHyp::FinishRun():closing and deleting fFile fEvt "<<endl;
714  }
715 
716 }
717 
718 // ------ Private method SetHypStatDecay -----------------------------------
719 
720 void PndHyp:: SetHypStatDecay(bool cal,bool active) {
721 // ***** Sequential Decay of a compound hyperfragment********
722 
723 if(cal==true){
724 
725 
726 if(active==true){
727 fEvt->Clear();
728 
729 }
730  Int_t cnt = 0;
731 
732  cout<<" increment count "<<fcount<<endl;
733 
734  if(fUseGamOption){
735  //default gamma emission THParticle object
736  //for calibration from Xi- stopping vertex
737  //momentum is given via generator
738 
739 
740  TLorentzVector PG(0.,0.,0., 1.);//
741 
742 
743  TLorentzVector VG;
744 
745  // std::cout<<fPosOut.X()<<" "<<fPosOut.Y()<<" "<<fPosOut.Z()<<std::endl;
746 
747  VG.SetX( fPosOut.X()); VG.SetY(fPosOut.Y()); VG.SetZ(fPosOut.Z());
748  std::cout<<VG.X()<<" "<<VG.Y()<<" "<<VG.Z()<<std::endl;
749 
750  if(active==true){
751  THParticle fGamma(22,1,0,0,0,0,0,0,PG,VG);
752 
753  new((*fEvt)[cnt++]) THParticle(fGamma);
754  }
755 
756  }else
757  {
758  //emission of two pions from mesonic weak decay of DHP
759 
760 
761  TLorentzVector target4(0.0, 0.0, 0., 5.95137);//He6LL
762  TLorentzVector target5(0.0, 0.0, 0., 5.7789);//Li6L
763 
764  TLorentzVector target6(0.,0.,0., 10.60335);//Be11LL
765  TLorentzVector target7(0.,0.,0., 10.41176);//B11L
766 
767  TLorentzVector W6 = target6;
768  TLorentzVector W7 = target7;
769 
770  Double_t mass4[2] = { 10.41176, 0.139};//B11L
771  Double_t mass5[2] = { 10.25409, 0.139};//C11
772 
773  TGenPhaseSpace ev6;
774  ev6.SetDecay(W6, 2, mass4);//two-body kinematics assumption
775  TGenPhaseSpace ev7;
776  ev7.SetDecay(W7, 2, mass5);
777 
778  ev6.Generate();//Double_t weight7 = //[R.K.03/2017] unused variable
779  TLorentzVector *pPi6 = ev6.GetDecay(1);
780  ev7.Generate();//Double_t weight8 = //[R.K.03/2017] unused variable
781  TLorentzVector *pPi7 = ev7.GetDecay(1);
782 
783  TLorentzVector V;
784  // std::cout<<fPosOut.X()<<" "<<fPosOut.Y()<<" "<<fPosOut.Z()<<std::endl;
785  V.SetX( fPosOut.X()); V.SetY(fPosOut.Y()); V.SetZ(fPosOut.Z());
786  std::cout<<V.X()<<" "<<V.Y()<<" "<<V.Z()<<std::endl;
787  if(active==true){
788  THParticle fpion_H(-211,1,0,0,0,0,0,0,*pPi6,V);
789 
790  new((*fEvt)[cnt++]) THParticle(fpion_H);
791 
792  THParticle fpion_L(-211,1,0,0,0,0,0,0,*pPi7,V);
793 
794  new((*fEvt)[cnt++]) THParticle(fpion_L);
795  cout<<cnt<<endl;
796  }
797  }
798 
799  if(active==true){
800  activeCnt = cnt;
801  ft->Fill();
802  }
803 
804  }
805 
806 
807 
808 }
809 
810 // ----- Private method AddHit --------------------------------------------
811 
812 PndHypPoint* PndHyp::AddHit(Int_t trackID, Int_t evtID,
813  Int_t detID, TString detName,
814  TVector3 pos, TVector3 mom,
815  TVector3 posout,
816  TVector3 momout,
817  Double_t time,
818  Double_t length,
819  Double_t eLoss,
820  Double_t charge, Double_t mass,
821  Int_t pdgCode,
822  Double_t dist,
823  Double_t PLin,Double_t PLout) {
824  TClonesArray& clref = *fHypCollection;
825  Int_t size = clref.GetEntriesFast();
826  return new(clref[size]) PndHypPoint(trackID, evtID,detID, detName,pos, mom,
827  posout, momout,
828  time, length, eLoss,charge,
829  mass,pdgCode,
830  dist,PLin,PLout);
831  }
832 
833 
834 
835 // ----
836 
837 // ----- Private method AddSecTarHit --------------------------------------------
838 
839 PndHypPoint* PndHyp::AddSecTarHit(Int_t trackID, Int_t evtID,
840  Int_t detID, TString detName,
841  TVector3 pos, TVector3 mom,
842  TVector3 posout,
843  TVector3 momout,
844  Double_t time,
845  Double_t length,
846  Double_t eLoss,
847  Double_t charge, Double_t mass,
848  Int_t pdgCode,Double_t dist,
849  Double_t PLin,Double_t PLout) {
850  TClonesArray& clref = *fHypSecTarCollection;
851  Int_t size = clref.GetEntriesFast();
852  return new(clref[size]) PndHypPoint(trackID, evtID,detID, detName, pos,
853  mom, posout, momout,
854  time, length, eLoss,charge, mass, pdgCode,
855  dist,PLin,PLout);
856  }
857 
858 
859 
860 // ----
861 
862 // ----- Private method AddSecTarHit --------------------------------------------
863 
864 PndHypPoint* PndHyp::AddSTMatBudHit(Int_t trackID, Int_t evtID,
865  Int_t detID, TString detName,
866  TVector3 pos, TVector3 mom,
867  TVector3 posout,
868  TVector3 momout,
869  Double_t time,
870  Double_t length,
871  Double_t eLoss,
872  Double_t charge, Double_t mass,
873  Int_t pdgCode,Double_t dist,
874  Double_t PLin,Double_t PLout) {
875  TClonesArray& clref = *fHypSTMatBudCollection;
876  Int_t size = clref.GetEntriesFast();
877  return new(clref[size]) PndHypPoint(trackID, evtID,detID, detName, pos,
878  mom, posout, momout,
879  time, length, eLoss,charge, mass, pdgCode,
880  dist,PLin,PLout);
881  }
882 
883 // ----
884 
885 
TVector3 pos
Int_t CId
Definition: PndHyp.h:266
TClonesArray * fHypSecTarCollection
Hit collection.
Definition: PndHyp.h:279
virtual void Initialize()
Definition: PndHyp.cxx:185
virtual void SetSpecialPhysicsCuts()
Definition: PndHyp.cxx:268
Double_t weight
Definition: PndHyp.h:257
TLorentzVector fMomOut
Definition: PndHyp.h:245
Definition: PndHyp.h:30
Bool_t fUseFileOption
Definition: PndHyp.h:286
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TLorentzVector fMomIn
Definition: PndHyp.h:243
TString fBPipeMat
Definition: PndHyp.h:235
PndHypPoint * AddHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, Double_t tof, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Int_t pdgCode, Double_t dist, Double_t PLin, Double_t PLout)
Definition: PndHyp.cxx:812
TString fVolNamAb
Definition: PndHyp.h:235
virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
Definition: PndHyp.cxx:657
Int_t SiId
Definition: PndHyp.h:266
Double32_t fTime
Definition: PndHyp.h:261
virtual void EndOfEvent()
Definition: PndHyp.cxx:604
Class to access the naming information of the MVD.
virtual void FinishRun()
Definition: PndHyp.cxx:706
TString fVers
Definition: PndHyp.h:235
Double_t mom
Definition: plot_dirc.C:14
void PreTrack()
Definition: PndHyp.cxx:259
TVector3 offset(2, 0, 0)
Int_t fStartEvID
Definition: PndHyp.h:237
TGeoManager * gGeoManager
Bool_t fUseRAZHOption
Definition: PndHyp.h:287
Double32_t fELoss
Definition: PndHyp.h:263
Int_t fpdgCode
Definition: PndHyp.h:265
Bool_t fTrackStopNxtStep
Definition: PndHyp.h:285
virtual void Register()
Definition: PndHyp.cxx:611
Double_t fmass
Definition: PndHyp.h:269
TString fAbsMat
Definition: PndHyp.h:235
Bool_t fRootSensVol
Definition: PndHyp.h:236
PndHypGeoHandling * fGeoH
Input file name.
Definition: PndHyp.h:273
virtual Bool_t ProcessHits(FairVolume *vol=0)
Definition: PndHyp.cxx:278
const Char_t * fFileName
Definition: PndHyp.h:271
int Pic_FED Eff_lEE C()
Double_t fPLin
Definition: PndHyp.h:248
Double_t fdist
Definition: PndHyp.h:269
PndHypPoint * AddSecTarHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, Double_t tof, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Int_t pdgCode, Double_t dist, Double_t PLin, Double_t PLout)
Definition: PndHyp.cxx:839
Int_t fVolumeID
Definition: PndHyp.h:240
virtual TClonesArray * GetCollection(Int_t iColl) const
Definition: PndHyp.cxx:622
Double_t seed
Definition: PndHyp.h:258
int nHits
Definition: RiemannTest.C:16
Double_t
virtual void Print() const
Definition: PndHyp.cxx:632
virtual void ConstructGeometry()
Definition: PndHyp.cxx:674
Int_t CpipeId
Definition: PndHyp.h:266
Int_t beId
Definition: PndHyp.h:266
PndHypPoint * AddSTMatBudHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout, Double_t tof, Double_t length, Double_t eLoss, Double_t charge, Double_t mass, Int_t pdgCode, Double_t dist, Double_t PLin, Double_t PLout)
Definition: PndHyp.cxx:864
Int_t activeCnt
Definition: PndHyp.h:256
virtual ~PndHyp()
Definition: PndHyp.cxx:149
std::vector< std::string > fListOfSensitives
Definition: PndHyp.h:230
Bool_t fMatBud
Definition: PndHyp.h:289
Bool_t fListMat
Definition: PndHyp.h:236
Bool_t fStandard
Definition: PndHyp.h:236
TString name
TClonesArray * fHypSTMatBudCollection
Definition: PndHyp.h:280
TString GetID(TString path)
for a given TGeoManager-path the ID is returned
Int_t fcount
Definition: PndHyp.h:259
Int_t fEventID
Definition: PndHyp.h:241
void SetHypStatDecay(bool cal, bool active)
Definition: PndHyp.cxx:720
Int_t alId
Definition: PndHyp.h:266
Int_t cnt
Definition: hist-t7.C:106
virtual void BeginEvent()
Definition: PndHyp.cxx:252
ClassImp(PndAnaContFact)
Bool_t fUseGamOption
Definition: PndHyp.h:288
TString fVolNamSi
Definition: PndHyp.h:235
Bool_t fCurrent
Definition: PndHyp.h:236
Double32_t fLength
Definition: PndHyp.h:262
TClonesArray * fEvt
Definition: PndHyp.h:251
TLorentzVector fPosOut
Definition: PndHyp.h:244
TFile * fFile
Definition: PndHyp.h:252
bool CheckIfSensitive(std::string name)
Definition: PndHyp.cxx:696
Double_t fPLout
Definition: PndHyp.h:248
std::vector< TString > fListOfMaterials
Definition: PndHyp.h:231
virtual void Reset()
Definition: PndHyp.cxx:645
Double_t fcharge
Definition: PndHyp.h:268
TString nam
Definition: sim_hypGe.C:48
PndHyp()
Definition: PndHyp.cxx:65
Mvd Initialize()
TLorentzVector fPosIn
Definition: PndHyp.h:242
void ResetParameters()
Definition: PndHyp.h:297
TTree * ft
Definition: PndHyp.h:253
TClonesArray * fHypCollection
Gives Access to the Path info of a hit.
Definition: PndHyp.h:278
Int_t fTrackID
Definition: PndHyp.h:239
Int_t fPosIndex
Definition: PndHyp.h:264