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