FairRoot/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 
10 #include "TClonesArray.h"
11 #include "TVector3.h"
12 #include "TLorentzVector.h"
13 #include "FairDetector.h"
14 #include "PndGeoHypPar.h"
15 
16 #include "TRandom.h"
17 
18 #include "PndHypGeoHandling.h"
19 //#include "PndHypDecayer.h"
20 #include "HypStatDecay.h"
21 using namespace std;
22 
23 
24 class TClonesArray;
25 class PndHypPoint;
26 class PndHypSecTarPoint;
27 //class PndHypSTMatBudPoint;
28 class FairVolume;
29 
30 class PndHyp : public FairDetector
31 {
32 
33  public:
34 
36  PndHyp();
37 
38 
43  PndHyp(const char* name, Bool_t active);
44 
45 
47  virtual ~PndHyp();
48 
49 
53  virtual void Initialize();
54 
55 
63  virtual Bool_t ProcessHits(FairVolume* vol = 0);
64 
65  virtual void SetSpecialPhysicsCuts();
71  virtual void EndOfEvent();
72 
73 
74  virtual void BeginEvent();
79  virtual void Register();
80 
81 
83  virtual TClonesArray* GetCollection(Int_t iColl) const;
84 
85 
90  virtual void Print() const;
91 
92 
97  virtual void Reset();
98 
99 
107  virtual void CopyClones(TClonesArray* cl1, TClonesArray* cl2,
108  Int_t offset);
109 
110 
114  virtual void ConstructGeometry();
115  //void ConstructASCIIGeometry();
116  virtual void FinishRun();
117 
118  PndHypPoint* AddHit(Int_t trackID,Int_t evtID,
119  Int_t detID, TString detName,
120  TVector3 posin,
121  TVector3 momin,
122  TVector3 posout,
123  TVector3 momout,
124  //TVector3 posInLocal,
125  //TVector3 posOutLocal,
126  Double_t tof,
127  Double_t length,
128  Double_t eLoss,
129  Double_t charge,
130  Double_t mass,
131  Int_t pdgCode,
132  Double_t dist,
133  Double_t PLin,
134  Double_t PLout);
135 
136  PndHypPoint* AddSecTarHit(Int_t trackID, Int_t evtID,
137  Int_t detID,TString detName,
138  TVector3 posin,
139  TVector3 momin,
140  TVector3 posout,
141  TVector3 momout,
142  //TVector3 posInLocal,
143  //TVector3 posOutLocal,
144  Double_t tof,
145  Double_t length,
146  Double_t eLoss,
147  Double_t charge,
148  Double_t mass,
149  Int_t pdgCode,
150  Double_t dist,
151  Double_t PLin,
152  Double_t PLout);
153 
154 
155  PndHypPoint* AddSTMatBudHit(Int_t trackID, Int_t evtID,
156  Int_t detID,TString detName,
157  TVector3 posin,
158  TVector3 momin,
159  TVector3 posout,
160  TVector3 momout,
161  //TVector3 posInLocal,
162  //TVector3 posOutLocal,
163  Double_t tof,
164  Double_t length,
165  Double_t eLoss,
166  Double_t charge,
167  Double_t mass,
168  Int_t pdgCode,
169  Double_t dist,
170  Double_t PLin,
171  Double_t PLout);
172 
173 
174 
175  void PreTrack();
176 
177  void SetHypSDtoFile(bool onf,bool val)
178  {
179  fUseRAZHOption = onf;// **switch On/Off HypStatDecay**
180  fUseFileOption = val;
181  };
182 
183  void SetHypGamFEm(bool gam )
184  {
185  fUseGamOption = gam;
186  }
187 
188  void SetMatbud(bool mbud )
189  {
190  fMatBud = mbud;
191  }
192 
193  void SetTreeFName(const Char_t* Name){ fFileName = Name; };
194 
195  void SetSensorVol(TString VolSi){
196  fVolNamSi=VolSi.Data();
197 
198  }
199  void SetAbsorberVol(TString VolAb){
200  fVolNamAb=VolAb.Data();
201 
202  }
203 
204  void SetStartEvID(Int_t EvID=0){
205  fStartEvID=EvID;
206  cout<<" starting value for EvId "<<fStartEvID<<endl;
207 
208  }
209 
210  void SetGeoVersion(TString vers="standard"){
211  fVers=vers;
212  }
213 
214  void SetAbsMat(TString abmat="HYPdiamond"){
215  fAbsMat=abmat;
216  }
217 
218  void SetBPipeMat(TString bpmat="HYPcarbon"){
219  fBPipeMat=bpmat;
220  }
221 
222  void SetListMat(TString mat="carbon"){
223  fListMat=kTRUE;
224  fListOfMaterials.push_back(mat.Data());
225  }
226 
227 
228  private:
229 
230  std::vector<std::string> fListOfSensitives;
231  std::vector<TString> fListOfMaterials;
232 
233  bool CheckIfSensitive(std::string name);
234 
235  TString fVolNamSi,fVolNamAb,fVers,fAbsMat,fSiMat,fBPipeMat;
236  Bool_t fRootSensVol,fListMat,fStandard,fCurrent;
237  Int_t fStartEvID;
238  //PndGeoHypPar *par;
239  Int_t fTrackID; // track index
240  Int_t fVolumeID; // volume id
241  Int_t fEventID; // event id
242  TLorentzVector fPosIn; // position
243  TLorentzVector fMomIn; // momentum
244  TLorentzVector fPosOut; // position
245  TLorentzVector fMomOut; // momentum
246  /* TLorentzVector fPosInLocal; // entry position in module frame */
247  /* TLorentzVector fPosOutLocal; // exit position in module frame */
248  Double_t fPLout,fPLin; // total momentum
249 
250 
251  TClonesArray* fEvt;
252  TFile* fFile;
253  TTree* ft;
254 
255 
256  Int_t activeCnt;
259  Int_t fcount;
260 
261  Double32_t fTime; // time
262  Double32_t fLength; // length
263  Double32_t fELoss; // energy loss
264  Int_t fPosIndex; //
265  Int_t fpdgCode; // MC volume ID of MUO
266  Int_t SiId,CId,alId,beId,CpipeId ;
267 
269  Double_t fmass, fdist;
270 
271  const Char_t* fFileName;
272 
274 
275  //PndHypDecayer* fread; //! Gives Access to the Statistical decay products
276  //HypStatDecay* fread; //! Gives Access to the Statistical decay products
277 
278  TClonesArray* fHypCollection;
279  TClonesArray* fHypSecTarCollection; // Hit collection(Absorver)
280  TClonesArray* fHypSTMatBudCollection; // Hit collection(pipehyp)
281  TRandom r;
282 
283  // reset all parameters
284  void ResetParameters();
290  void SetHypStatDecay(bool cal,bool active);
291 
292  ClassDef(PndHyp,15)
293 
294 };
295 
296 
297 inline void PndHyp::ResetParameters() {
298  fTrackID = fVolumeID = fEventID =-1;
299  fPosIn.SetXYZM(0.0, 0.0, 0.0, 0.0);
300  fPosOut.SetXYZM(0.0, 0.0, 0.0, 0.0);
301  fMomIn.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
302  fMomOut.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);
303  /* fPosInLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); */
304 /* fPosOutLocal.SetXYZM(0.0, 0.0, 0.0, 0.0); */
305  fTime = fLength = fELoss = 0;
306 
307 };
308 
309 
310 
311 #endif
MechFsc Print()
TClonesArray * fHypSecTarCollection
Hit collection.
Definition: PndHyp.h:279
void SetListMat(TString mat="carbon")
Definition: PndHyp.h:222
Double_t weight
Definition: PndHyp.h:257
TLorentzVector fMomOut
Definition: PndHyp.h:245
Definition: PndHyp.h:30
Bool_t fUseFileOption
Definition: PndHyp.h:286
TLorentzVector fMomIn
Definition: PndHyp.h:243
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
Int_t SiId
Definition: PndHyp.h:266
Double32_t fTime
Definition: PndHyp.h:261
Class to access the naming information of the MVD.
TVector3 offset(2, 0, 0)
Int_t fStartEvID
Definition: PndHyp.h:237
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
Double_t fmass
Definition: PndHyp.h:269
void SetSensorVol(TString VolSi)
Definition: PndHyp.h:195
PndHypGeoHandling * fGeoH
Input file name.
Definition: PndHyp.h:273
const Char_t * fFileName
Definition: PndHyp.h:271
Int_t fVolumeID
Definition: PndHyp.h:240
void SetMatbud(bool mbud)
Definition: PndHyp.h:188
TRandom r
Definition: PndHyp.h:281
Double_t seed
Definition: PndHyp.h:258
void SetHypSDtoFile(bool onf, bool val)
Definition: PndHyp.h:177
Double_t
void SetHypGamFEm(bool gam)
Definition: PndHyp.h:183
void SetAbsorberVol(TString VolAb)
Definition: PndHyp.h:199
Int_t activeCnt
Definition: PndHyp.h:256
void SetTreeFName(const Char_t *Name)
Definition: PndHyp.h:193
std::vector< std::string > fListOfSensitives
Definition: PndHyp.h:230
Bool_t fMatBud
Definition: PndHyp.h:289
CandList gam
Bool_t fStandard
Definition: PndHyp.h:236
TString name
TClonesArray * fHypSTMatBudCollection
Definition: PndHyp.h:280
void SetStartEvID(Int_t EvID=0)
Definition: PndHyp.h:204
void SetGeoVersion(TString vers="standard")
Definition: PndHyp.h:210
Int_t fcount
Definition: PndHyp.h:259
Int_t fEventID
Definition: PndHyp.h:241
Bool_t fUseGamOption
Definition: PndHyp.h:288
TString fVolNamSi
Definition: PndHyp.h:235
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
void SetAbsMat(TString abmat="HYPdiamond")
Definition: PndHyp.h:214
Double_t fPLout
Definition: PndHyp.h:248
std::vector< TString > fListOfMaterials
Definition: PndHyp.h:231
Double_t fcharge
Definition: PndHyp.h:268
Mvd Initialize()
TLorentzVector fPosIn
Definition: PndHyp.h:242
void ResetParameters()
Definition: PndHyp.h:297
TTree * ft
Definition: PndHyp.h:253
void SetBPipeMat(TString bpmat="HYPcarbon")
Definition: PndHyp.h:218
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
gROOT Reset()