FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndHypGe Class Reference

#include <PndHypGe.h>

Inheritance diagram for PndHypGe:

Public Member Functions

 PndHypGe ()
 
 PndHypGe (const char *name, Bool_t active)
 
virtual ~PndHypGe ()
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *vol=0)
 
virtual void EndOfEvent ()
 
virtual void BeginEvent ()
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Print () const
 
virtual void Reset ()
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void ConstructGeometry ()
 
void ConstructHPGeGeometry ()
 
PndHypGePointAddHit (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)
 
PndHypGePointAddGeAlHit (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)
 
void SetDisIP (Double_t dist)
 
void SetPathGeo (TString pgeo)
 

Private Member Functions

bool CheckIfSensitive (std::string name)
 
void ResetParameters ()
 

Private Attributes

std::vector< std::string > fListOfSensitives
 
Int_t fpdgCode
 
Int_t fcharge
 
Int_t fTrackID
 
Int_t fVolumeID
 
Int_t fEventID
 
TLorentzVector fPos
 
TLorentzVector fMom
 
Double32_t fTime
 
Double32_t fLength
 
Double32_t fELoss
 
Int_t fPosIndex
 
Short_t fnCopy
 
Double_t fdist
 
TString fPathGeo
 
TClonesArray * fHypGeCollection
 
TClonesArray * fHypGeAlCollection
 

Detailed Description

Definition at line 26 of file PndHypGe.h.

Constructor & Destructor Documentation

PndHypGe::PndHypGe ( )

Default constructor

Definition at line 51 of file PndHypGe.cxx.

References fdist, fEventID, fHypGeAlCollection, fHypGeCollection, fListOfSensitives, and fPosIndex.

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 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
Int_t fPosIndex
Definition: PndHypGe.h:158
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
std::vector< std::string > fListOfSensitives
Definition: PndHypGe.h:143
Int_t fEventID
Definition: PndHypGe.h:152
Double_t fdist
Definition: PndHypGe.h:160
PndHypGe::PndHypGe ( const char *  name,
Bool_t  active 
)

Standard constructor.

Parameters
namedetetcor name
activesensitivity flag

Definition at line 68 of file PndHypGe.cxx.

References fdist, fEventID, fHypGeAlCollection, fHypGeCollection, fListOfSensitives, and fPosIndex.

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 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
Int_t fPosIndex
Definition: PndHypGe.h:158
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
std::vector< std::string > fListOfSensitives
Definition: PndHypGe.h:143
Int_t fEventID
Definition: PndHypGe.h:152
TString name
Double_t fdist
Definition: PndHypGe.h:160
PndHypGe::~PndHypGe ( )
virtual

Destructor

Definition at line 90 of file PndHypGe.cxx.

References fHypGeAlCollection, and fHypGeCollection.

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 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166

Member Function Documentation

PndHypGePoint * PndHypGe::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 at line 605 of file PndHypGe.cxx.

References fHypGeAlCollection.

Referenced by ProcessHits().

608  {
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 }
TVector3 pos
Double_t mom
Definition: plot_dirc.C:14
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
PndHypGePoint * PndHypGe::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 at line 592 of file PndHypGe.cxx.

References fHypGeCollection.

Referenced by ProcessHits().

594  {
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 }
TVector3 pos
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
Double_t mom
Definition: plot_dirc.C:14
void PndHypGe::BeginEvent ( )
virtual

Definition at line 127 of file PndHypGe.cxx.

128 {
129  // Begin of the event
130 
131 }
bool PndHypGe::CheckIfSensitive ( std::string  name)
private

Definition at line 580 of file PndHypGe.cxx.

References fListOfSensitives, and i.

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 }
Int_t i
Definition: run_full.C:25
std::vector< std::string > fListOfSensitives
Definition: PndHypGe.h:143
TString name
void PndHypGe::ConstructGeometry ( )
virtual

Virtual method Construct geometry

Definition at line 342 of file PndHypGe.cxx.

References ConstructHPGeGeometry(), and TString.

343 {
344  TString fileName=GetGeometryFileName();
345 
346  if(fileName.EndsWith(".root"))
347  {
348  ConstructRootGeometry();
349  }
350  else
351  {
353  }
354 
355 }
void ConstructHPGeGeometry()
Definition: PndHypGe.cxx:357
void PndHypGe::ConstructHPGeGeometry ( )

Definition at line 357 of file PndHypGe.cxx.

References cos(), GeCluster::CreateCluster(), Double_t, fdist, fPathGeo, geobuild, geoFace, geoLoad, gGeoManager, HypGe, i, Media, Pi, GeCluster::SetPathGeo(), and TString.

Referenced by ConstructGeometry().

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 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
PndHypGe * HypGe
Definition: sim_hypGe.C:47
FairGeoLoader * geoLoad
Int_t i
Definition: run_full.C:25
FairGeoMedia * Media
void SetPathGeo(TString path)
Definition: GeCluster.h:35
TGeoManager * gGeoManager
FairGeoBuilder * geobuild
Double_t
TString fPathGeo
Definition: PndHypGe.h:161
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
Double_t fdist
Definition: PndHypGe.h:160
FairGeoInterface * geoFace
Double_t Pi
void PndHypGe::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
virtual

Virtual method CopyClones

Copies the hit collection with a given track index offset

Parameters
cl1Origin
cl2Target
offsetIndex offset

Definition at line 324 of file PndHypGe.cxx.

References fPosIndex, PndHypGePoint::GetTrackID(), i, offset(), and PndHypGePoint::SetTrackID().

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 }
Int_t i
Definition: run_full.C:25
Int_t GetTrackID() const
Definition: PndHypGePoint.h:51
TVector3 offset(2, 0, 0)
Int_t fPosIndex
Definition: PndHypGe.h:158
void SetTrackID(Int_t id)
Definition: PndHypGePoint.h:69
void PndHypGe::EndOfEvent ( )
virtual

Virtual method EndOfEvent

If verbosity level is set, print hit collection at the end of the event and resets it afterwards.

Definition at line 271 of file PndHypGe.cxx.

References Print(), and Reset().

272 {
273  if (fVerboseLevel) Print();
274  Reset();
275 }
virtual void Print() const
Definition: PndHypGe.cxx:298
virtual void Reset()
Definition: PndHypGe.cxx:312
TClonesArray * PndHypGe::GetCollection ( Int_t  iColl) const
virtual

Accessor to the hit collection

Definition at line 288 of file PndHypGe.cxx.

References fHypGeAlCollection, and fHypGeCollection.

289 {
290  if (iColl == 0) return fHypGeCollection;
291  if (iColl == 1) return fHypGeAlCollection;
292 
293  return NULL;
294 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
void PndHypGe::Initialize ( )
virtual

Virtual method Initialize Initialises detector. Stores volume IDs for MUO detector and mirror.

Definition at line 114 of file PndHypGe.cxx.

References Initialize(), rtdb, and sim().

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 }
sim(Int_t nEvents=1, TString SimEngine="TGeant4", Float_t mom=6.231552)
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
Mvd Initialize()
void PndHypGe::Print ( ) const
virtual

Virtual method Print

Screen output of hit collection.

Definition at line 298 of file PndHypGe.cxx.

References fHypGeCollection, i, and nHits.

Referenced by EndOfEvent().

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 }
Int_t i
Definition: run_full.C:25
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
int nHits
Definition: RiemannTest.C:16
Bool_t PndHypGe::ProcessHits ( FairVolume *  vol = 0)
virtual

Virtual method ProcessHits

Defines the action to be taken when a step is inside the active volume. Creates PndHypGePoints and PndHypGeMirrorPoints and adds them to the collections.

Parameters
volPointer to the active volume

Definition at line 136 of file PndHypGe.cxx.

References AddGeAlHit(), AddHit(), fcharge, fELoss, fEventID, fLength, fMom, fnCopy, fpdgCode, fPos, fTime, fTrackID, nam, pos, ResetParameters(), and TString.

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 }
TVector3 pos
Double32_t fELoss
Definition: PndHypGe.h:157
TLorentzVector fPos
Definition: PndHypGe.h:153
void ResetParameters()
Definition: PndHypGe.cxx:621
Double32_t fTime
Definition: PndHypGe.h:155
Double32_t fLength
Definition: PndHypGe.h:156
Int_t fpdgCode
Definition: PndHypGe.h:147
Int_t fEventID
Definition: PndHypGe.h:152
Short_t fnCopy
Definition: PndHypGe.h:159
TLorentzVector fMom
Definition: PndHypGe.h:154
Int_t fcharge
Definition: PndHypGe.h:148
TString nam
Definition: sim_hypGe.C:48
Int_t fTrackID
Definition: PndHypGe.h:150
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
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
void PndHypGe::Register ( )
virtual

Virtual method Register

Registers the hit collection in the ROOT manager.

Definition at line 279 of file PndHypGe.cxx.

References fHypGeAlCollection, and fHypGeCollection.

280 {
281  FairRootManager::Instance()->Register("HypGePoint","HypGe", fHypGeCollection, kTRUE);
282  FairRootManager::Instance()->Register("HypGeAlPoint","HypGeAl", fHypGeAlCollection, kTRUE);
283 
284 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
void PndHypGe::Reset ( )
virtual

Virtual method Reset

Clears the hit collection

Definition at line 312 of file PndHypGe.cxx.

References fHypGeAlCollection, fHypGeCollection, and fPosIndex.

Referenced by EndOfEvent().

313 {
314  fHypGeCollection->Delete();
315  fHypGeAlCollection->Delete();
316  //fHypGecapCollection->Delete();
317  fPosIndex = 0;
318 }
TClonesArray * fHypGeCollection
Definition: PndHypGe.h:165
Int_t fPosIndex
Definition: PndHypGe.h:158
TClonesArray * fHypGeAlCollection
Definition: PndHypGe.h:166
void PndHypGe::ResetParameters ( )
inlineprivate

Definition at line 621 of file PndHypGe.cxx.

References fELoss, fEventID, fLength, fMom, fnCopy, fPos, fTime, fTrackID, and fVolumeID.

Referenced by ProcessHits().

621  {
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 }
Double32_t fELoss
Definition: PndHypGe.h:157
TLorentzVector fPos
Definition: PndHypGe.h:153
Double32_t fTime
Definition: PndHypGe.h:155
Double32_t fLength
Definition: PndHypGe.h:156
Int_t fEventID
Definition: PndHypGe.h:152
Int_t fVolumeID
Definition: PndHypGe.h:151
Short_t fnCopy
Definition: PndHypGe.h:159
TLorentzVector fMom
Definition: PndHypGe.h:154
Int_t fTrackID
Definition: PndHypGe.h:150
void PndHypGe::SetDisIP ( Double_t  dist)
inline

Setting distance to interaction point

Definition at line 131 of file PndHypGe.h.

132  {
133  fdist = dist; // cm
134  }
Double_t fdist
Definition: PndHypGe.h:160
void PndHypGe::SetPathGeo ( TString  pgeo)
inline

Member Data Documentation

Int_t PndHypGe::fcharge
private

Definition at line 148 of file PndHypGe.h.

Referenced by ProcessHits().

Double_t PndHypGe::fdist
private

Definition at line 160 of file PndHypGe.h.

Referenced by ConstructHPGeGeometry(), and PndHypGe().

Double32_t PndHypGe::fELoss
private

Definition at line 157 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

Int_t PndHypGe::fEventID
private

Definition at line 152 of file PndHypGe.h.

Referenced by PndHypGe(), ProcessHits(), and ResetParameters().

TClonesArray* PndHypGe::fHypGeAlCollection
private

Definition at line 166 of file PndHypGe.h.

Referenced by AddGeAlHit(), GetCollection(), PndHypGe(), Register(), Reset(), and ~PndHypGe().

TClonesArray* PndHypGe::fHypGeCollection
private

Definition at line 165 of file PndHypGe.h.

Referenced by AddHit(), GetCollection(), PndHypGe(), Print(), Register(), Reset(), and ~PndHypGe().

Double32_t PndHypGe::fLength
private

Definition at line 156 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

std::vector<std::string> PndHypGe::fListOfSensitives
private

Definition at line 143 of file PndHypGe.h.

Referenced by CheckIfSensitive(), and PndHypGe().

TLorentzVector PndHypGe::fMom
private

Definition at line 154 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

Short_t PndHypGe::fnCopy
private

Definition at line 159 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

TString PndHypGe::fPathGeo
private

Definition at line 161 of file PndHypGe.h.

Referenced by ConstructHPGeGeometry().

Int_t PndHypGe::fpdgCode
private

Definition at line 147 of file PndHypGe.h.

Referenced by ProcessHits().

TLorentzVector PndHypGe::fPos
private

Definition at line 153 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

Int_t PndHypGe::fPosIndex
private

Definition at line 158 of file PndHypGe.h.

Referenced by CopyClones(), PndHypGe(), and Reset().

Double32_t PndHypGe::fTime
private

Definition at line 155 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

Int_t PndHypGe::fTrackID
private

Definition at line 150 of file PndHypGe.h.

Referenced by ProcessHits(), and ResetParameters().

Int_t PndHypGe::fVolumeID
private

Definition at line 151 of file PndHypGe.h.

Referenced by ResetParameters().


The documentation for this class was generated from the following files: