PandaRoot
PndHyp.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- CbmHyp header file -----
3 // ----- created by A. Sanchez -----
4 // -------------------------------------------------------------------------
5 
6 #ifndef PNDHYP_H
7 #define PNDHYP_H
8 
9 #include "TClonesArray.h"
10 #include "TVector3.h"
11 #include "TLorentzVector.h"
12 #include "FairDetector.h"
13 #include "PndGeoHypPar.h"
14 
15 #include "TRandom.h"
16 
17 #include "PndHypGeoHandling.h"
18 //#include "PndHypDecayer.h"
19 #include "HypStatDecay.h"
20 using namespace std;
21 
22 class TClonesArray;
23 class PndHypPoint;
24 class PndHypSecTarPoint;
25 // class PndHypSTMatBudPoint;
26 class FairVolume;
27 
28 class PndHyp : public FairDetector {
29 
30  public:
32  PndHyp();
33 
38  PndHyp(const char *name, Bool_t active);
39 
41  virtual ~PndHyp();
42 
46  virtual void Initialize();
47 
55  virtual Bool_t ProcessHits(FairVolume *vol = 0);
56 
57  virtual void SetSpecialPhysicsCuts();
63  virtual void EndOfEvent();
64 
65  virtual void BeginEvent();
70  virtual void Register();
71 
73  virtual TClonesArray *GetCollection(Int_t iColl) const;
74 
79  virtual void Print() const;
80 
85  virtual void Reset();
86 
94  virtual void CopyClones(TClonesArray *cl1, TClonesArray *cl2, Int_t offset);
95 
99  virtual void ConstructGeometry();
100  // void ConstructASCIIGeometry();
101  virtual void FinishRun();
102 
103  PndHypPoint *AddHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout,
104  // TVector3 posInLocal,
105  // TVector3 posOutLocal,
106  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);
107 
108  PndHypPoint *AddSecTarHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout,
109  // TVector3 posInLocal,
110  // TVector3 posOutLocal,
111  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);
112 
113  PndHypPoint *AddSTMatBudHit(Int_t trackID, Int_t evtID, Int_t detID, TString detName, TVector3 posin, TVector3 momin, TVector3 posout, TVector3 momout,
114  // TVector3 posInLocal,
115  // TVector3 posOutLocal,
116  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);
117 
118  void PreTrack();
119 
120  void SetHypSDtoFile(bool onf, bool val)
121  {
122  fUseRAZHOption = onf; // **switch On/Off HypStatDecay**
123  fUseFileOption = val;
124  };
125 
126  void SetHypGamFEm(bool gam) { fUseGamOption = gam; }
127 
128  void SetMatbud(bool mbud) { fMatBud = mbud; }
129 
130  void SetTreeFName(const Char_t *Name) { fFileName = Name; };
131 
132  void SetSensorVol(TString VolSi) { fVolNamSi = VolSi.Data(); }
133  void SetAbsorberVol(TString VolAb) { fVolNamAb = VolAb.Data(); }
134 
135  void SetStartEvID(Int_t EvID = 0)
136  {
137  fStartEvID = EvID;
138  cout << " starting value for EvId " << fStartEvID << endl;
139  }
140 
141  void SetGeoVersion(TString vers = "standard") { fVers = vers; }
142 
143  void SetAbsMat(TString abmat = "HYPdiamond") { fAbsMat = abmat; }
144 
145  void SetBPipeMat(TString bpmat = "HYPcarbon") { fBPipeMat = bpmat; }
146 
147  void SetListMat(TString mat = "carbon")
148  {
149  fListMat = kTRUE;
150  fListOfMaterials.push_back(mat.Data());
151  }
152 
153  private:
154  std::vector<std::string> fListOfSensitives;
155  std::vector<TString> fListOfMaterials;
156 
157  bool CheckIfSensitive(std::string name);
158 
159  TString fVolNamSi, fVolNamAb, fVers, fAbsMat, fSiMat, fBPipeMat;
160  Bool_t fRootSensVol, fListMat, fStandard, fCurrent;
161  Int_t fStartEvID;
162  // PndGeoHypPar *par;
163  Int_t fTrackID; // track index
164  Int_t fVolumeID; // volume id
165  Int_t fEventID; // event id
166  TLorentzVector fPosIn; // position
167  TLorentzVector fMomIn; // momentum
168  TLorentzVector fPosOut; // position
169  TLorentzVector fMomOut; // momentum
170  /* TLorentzVector fPosInLocal; // entry position in module frame */
171  /* TLorentzVector fPosOutLocal; // exit position in module frame */
172  Double_t fPLout, fPLin; // total momentum
173 
174  TClonesArray *fEvt;
175  TFile *fFile;
176  TTree *ft;
177 
178  Int_t activeCnt;
179  Double_t weight;
180  Double_t seed;
181  Int_t fcount;
182 
183  Double32_t fTime; // time
184  Double32_t fLength; // length
185  Double32_t fELoss; // energy loss
186  Int_t fPosIndex; //
187  Int_t fpdgCode; // MC volume ID of MUO
188  Int_t SiId, CId, alId, beId, CpipeId;
189 
190  Double_t fcharge;
191  Double_t fmass, fdist;
192 
193  const Char_t *fFileName;
194 
195  PndHypGeoHandling *fGeoH;
196 
197  // PndHypDecayer* fread; //! Gives Access to the Statistical decay products
198  // HypStatDecay* fread; //! Gives Access to the Statistical decay products
199 
200  TClonesArray *fHypCollection;
201  TClonesArray *fHypSecTarCollection; // Hit collection(Absorver)
202  TClonesArray *fHypSTMatBudCollection; // Hit collection(pipehyp)
203 
204  // reset all parameters
205  void ResetParameters();
206  Bool_t fTrackStopNxtStep;
207  Bool_t fUseFileOption;
208  Bool_t fUseRAZHOption;
209  Bool_t fUseGamOption;
210  Bool_t fMatBud;
211  void SetHypStatDecay(bool cal, bool active);
212 
213  ClassDef(PndHyp, 15)
214 };
215 
216 inline void PndHyp::ResetParameters()
217 {
218  fTrackID = fVolumeID = fEventID = -1;
219  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
220  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
221  fMomIn.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
222  fMomOut.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
223  /* fPosInLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); */
224  /* fPosOutLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); */
225  fTime = fLength = fELoss = 0;
226 };
227 
228 #endif
void SetListMat(TString mat="carbon")
Definition: PndHyp.h:147
Definition: PndHyp.h:28
STL namespace.
Class to access the naming information of the MVD.
void SetSensorVol(TString VolSi)
Definition: PndHyp.h:132
void SetMatbud(bool mbud)
Definition: PndHyp.h:128
void SetHypSDtoFile(bool onf, bool val)
Definition: PndHyp.h:120
void SetHypGamFEm(bool gam)
Definition: PndHyp.h:126
void SetAbsorberVol(TString VolAb)
Definition: PndHyp.h:133
void SetTreeFName(const Char_t *Name)
Definition: PndHyp.h:130
void SetStartEvID(Int_t EvID=0)
Definition: PndHyp.h:135
void SetGeoVersion(TString vers="standard")
Definition: PndHyp.h:141
void SetAbsMat(TString abmat="HYPdiamond")
Definition: PndHyp.h:143
void SetBPipeMat(TString bpmat="HYPcarbon")
Definition: PndHyp.h:145