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

#include <PndHypGeHitProducerIdeal.h>

Inheritance diagram for PndHypGeHitProducerIdeal:

Public Member Functions

 PndHypGeHitProducerIdeal ()
 
 ~PndHypGeHitProducerIdeal ()
 
virtual void SetParContainers ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *opt)
 
void smear (Double_t &ener, Double_t &den)
 

Private Member Functions

void Register ()
 
void Reset ()
 
void ProduceHits ()
 
 ClassDef (PndHypGeHitProducerIdeal, 3)
 

Private Attributes

TString fBranchName
 
TClonesArray * fPointArray
 
TClonesArray * fHitArray
 
PndGeoHypGeParfGeoPar
 

Detailed Description

Definition at line 30 of file PndHypGeHitProducerIdeal.h.

Constructor & Destructor Documentation

PndHypGeHitProducerIdeal::PndHypGeHitProducerIdeal ( )

Default constructor

Definition at line 19 of file PndHypGeHitProducerIdeal.cxx.

References fBranchName.

19  :
20  FairTask("Ideal HYPGE Hit Producer")
21 {//
22  fBranchName = "HypGePoint";
23 }
PndHypGeHitProducerIdeal::~PndHypGeHitProducerIdeal ( )

Destructor

Definition at line 29 of file PndHypGeHitProducerIdeal.cxx.

30 {
31 }

Member Function Documentation

PndHypGeHitProducerIdeal::ClassDef ( PndHypGeHitProducerIdeal  ,
 
)
private
void PndHypGeHitProducerIdeal::Exec ( Option_t *  opt)
virtual

Virtual method Exec

energy resolution of 3 keV

Definition at line 75 of file PndHypGeHitProducerIdeal.cxx.

References Double_t, fHitArray, fPointArray, PndHypGePoint::GetDetectorID(), PndHypGePoint::GetEnergyLoss(), PndHypGePoint::GetTrackID(), point, and smear().

76 {
77  // Reset output array
78  if ( ! fHitArray )
79  Fatal("Exec", "No HitArray");
80 
81  fHitArray->Delete();
82 
83  // Declare some variables
84  PndHypGePoint *point = 0;
85 
86  Int_t
87  detID = 0, // Detector ID
88  trackID = 0; // Track index
89 
90  Double_t
91  ener, den; // Position and error vectors
92 
93  // Loop over HypGePoints
94  Int_t
95  nPoints = fPointArray->GetEntriesFast();
96 
97  for (Int_t iPoint = 0; iPoint < nPoints; iPoint++)
98  {
99  point = (PndHypGePoint*) fPointArray->At(iPoint);
100  cout << " Ideal Hit Producer -Point-: " << point << endl;
101  if ( ! point)
102  continue;
103 
104  // Detector ID
105  detID = point->GetDetectorID();
106 
107  // MCTrack ID
108  trackID = point->GetTrackID();
109  ener=point->GetEnergyLoss();
110  den=0.000003;
111  smear(ener,den);
112 
113 
114  // Create new hit
115  new ((*fHitArray)[iPoint]) PndHypGeHit(trackID, detID, ener, den);
116  cout << "Hit created for module: "<< std::endl;
117 
118 
119 
120  } // Loop over MCPoints
121 
122  // Event summary
123  cout << "-I- PndHypGeHitProducerIdeal: " << nPoints << " HypGePoints, "
124  << nPoints << " Hits created." << endl;
125 
126 }
void smear(Double_t &ener, Double_t &den)
Int_t GetTrackID() const
Definition: PndHypGePoint.h:51
Double_t
TClonesArray * point
Definition: anaLmdDigi.C:29
Int_t GetDetectorID() const
Definition: PndHypGePoint.h:53
Double_t GetEnergyLoss() const
Definition: PndHypGePoint.h:62
InitStatus PndHypGeHitProducerIdeal::Init ( )
virtual

Definition at line 34 of file PndHypGeHitProducerIdeal.cxx.

References fBranchName, fHitArray, and fPointArray.

35 {
36  // Get RootManager
37  FairRootManager* ioman = FairRootManager::Instance();
38 
39  if ( ! ioman )
40  {
41  cout << "-E- PndHypGeHitProducerIdeal::Init: "
42  << "RootManager not instantiated!" << endl;
43  return kFATAL;
44  }
45 
46  // Get input array
47  fPointArray = (TClonesArray*) ioman->GetObject(fBranchName);
48 
49  if ( ! fPointArray )
50  {
51  cout << "-W- PndHypGeHitProducerIdeal::Init: "
52  << "No HYPGEPoint array!" << endl;
53  return kERROR;
54  }
55 
56  // Create and register output array
57  fHitArray = new TClonesArray("PndHypGeHit");
58  ioman->Register("HypGeHit", "HypGe", fHitArray, kTRUE);
59 
60  cout << "-I- PndHypGeHitProducerIdeal: Intialisation successfull" << endl;
61  return kSUCCESS;
62 }
void PndHypGeHitProducerIdeal::ProduceHits ( )
private
void PndHypGeHitProducerIdeal::Register ( )
private
void PndHypGeHitProducerIdeal::Reset ( )
private
void PndHypGeHitProducerIdeal::SetParContainers ( )
virtual

Virtual method Init

Definition at line 64 of file PndHypGeHitProducerIdeal.cxx.

References fGeoPar, and rtdb.

65 {
66  // Get Base Container
67  FairRun* ana = FairRun::Instance();
68  FairRuntimeDb* rtdb=ana->GetRuntimeDb();
69  fGeoPar = (PndGeoHypGePar*)(rtdb->getContainer("PndGeoHypGePar"));
70 
71 }
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void PndHypGeHitProducerIdeal::smear ( Double_t ener,
Double_t den 
)

smear a 3d vector

Definition at line 128 of file PndHypGeHitProducerIdeal.cxx.

References Double_t.

Referenced by Exec().

129 {
131 
132  Double_t e = ener;
133 
134  //y=pos.y(),
135  //z=pos.z(),
136  Double_t sige = den;
137 
138  //sigy=dpos.y();
139  //sigz=dpos.z();
140 
141  sige=gRandom->Gaus(0,sige);
142  // sigy=gRandom->Gaus(0,sigy);
143  //sigz=gRandom->Gaus(0,sigz);
144 
145  e += sige;
146  //y += sigy;
147  //z += sigz;
148 
149  ener = e;
150  return ;
151 }
Double_t

Member Data Documentation

TString PndHypGeHitProducerIdeal::fBranchName
private

Definition at line 55 of file PndHypGeHitProducerIdeal.h.

Referenced by Init(), and PndHypGeHitProducerIdeal().

PndGeoHypGePar* PndHypGeHitProducerIdeal::fGeoPar
private

Definition at line 62 of file PndHypGeHitProducerIdeal.h.

Referenced by SetParContainers().

TClonesArray* PndHypGeHitProducerIdeal::fHitArray
private

Output array of PndHypGeHits

Definition at line 60 of file PndHypGeHitProducerIdeal.h.

Referenced by Exec(), and Init().

TClonesArray* PndHypGeHitProducerIdeal::fPointArray
private

Input array of PndHypGePoints

Definition at line 57 of file PndHypGeHitProducerIdeal.h.

Referenced by Exec(), and Init().


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