KaliVeda
Toolkit for HIC analysis
KVTarget.h
1 /***************************************************************************
2  KVTarget.h - description
3  -------------------
4  begin : 2/12/2003
5  copyright : (C) 2003 by J.D. Frankland
6  email : frankland@ganil.fr
7 
8 $Id: KVTarget.h,v 1.23 2008/12/11 16:39:47 ebonnet Exp $
9  ***************************************************************************/
10 #ifndef _KV_TARGET_H_
11 #define _KV_TARGET_H_
12 
13 #include "KVMaterial.h"
14 #include "KVList.h"
15 
16 class KVEvent;
17 class KVParticle;
18 
128 class KVTarget: public KVMaterial {
129 
130 private:
131 
132  enum {
133  kRandom = BIT(14), //random interaction depth or half-way ?
134  kIncoming = BIT(15), //calculate only energy loss from entrance up to interaction depth
135  kOutgoing = BIT(16) //calculate energy loss from interaction depth to exit
136  };
137 
138 protected:
139 
144 
145  void init();
146 
147 public:
148 
149  KVTarget();
150  KVTarget(const KVTarget&);
151  ROOT_COPY_ASSIGN_OP(KVTarget)
152  KVTarget(const Char_t* material, Double_t thick = 0.0);
153  virtual ~ KVTarget();
154 
156  {
158  return fNormal;
159  }
160  void SetAngleToBeam(Double_t a);
162 
163  void SetMaterial(const Char_t* type) override;
164  void SetLayerThickness(Float_t thick, Int_t ilayer = 1);
165 
166  void AddLayer(const Char_t* material, Double_t thick);
168  {
169  return fNLayers;
170  };
171  KVList* GetLayers() const
172  {
173  return fTargets;
174  };
176  {
177  return (ilayer >
178  0 ? (ilayer <=
180  At(ilayer - 1) : 0) : 0);
181  };
182  KVMaterial* GetLayer(TVector3& depth);
183  Int_t GetLayerIndex(TVector3& depth);
186  KVMaterial* GetLayer(const Char_t* name);
187  Int_t GetLayerIndex(const Char_t* name);
188 
191  Double_t GetThickness() const override
192  {
193  return const_cast <KVTarget* >(this)->GetTotalThickness();
194  }
197  1, Int_t lay2 = 0);
198  Double_t GetEffectiveThickness(KVParticle* part = 0, Int_t ilayer = 1);
199  Double_t GetEffectiveThickness(TVector3& direction, Int_t ilayer = 1);
200  Double_t GetThickness(Int_t ilayer) const;
201 
203  void SetInteractionLayer(Int_t ilayer, TVector3& dir);
204  void SetInteractionLayer(const Char_t* name, TVector3& dir);
205  void SetInteractionLayer(const Char_t* name, KVParticle* part);
206 
208  {
209  return TestBit(kIncoming);
210  };
218  void SetIncoming(Bool_t r = kTRUE)
219  {
220  if (r) {
221  SetBit(kIncoming);
223  }
224  else
226  };
228  {
229  return TestBit(kOutgoing);
230  };
239  void SetOutgoing(Bool_t r = kTRUE)
240  {
241  if (r) {
242  SetBit(kOutgoing);
244  }
245  else
247  };
248 
250  {
251  return TestBit(kRandom);
252  };
253  void SetRandomized(Bool_t r = kTRUE)
254  {
255  if (r)
256  SetBit(kRandom);
257  else
258  ResetBit(kRandom);
259  };
260 
261  void DetectParticle(KVNucleus*, TVector3* norm = 0) override;
262  Double_t GetELostByParticle(KVNucleus*, TVector3* norm = 0) override;
263  Double_t GetParticleEIncFromERes(KVNucleus*, TVector3* norm = 0) override;
265  Double_t Eres) override;
266  void DetectEvent(KVEvent*);
267 
268  void Print(Option_t* opt = "") const override;
269  void Clear(Option_t* opt = "") override;
270 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
271  void Copy(TObject& obj) const override;
272 #else
273  virtual void Copy(TObject& obj);
274 #endif
276 
277  Double_t GetAtomsPerCM2() const;
278 
279  ClassDefOverride(KVTarget, 1) //Simulate targets for experiments
280 };
281 
282 
283 
284 #endif
int Int_t
ROOT::R::TRInterface & r
bool Bool_t
char Char_t
float Float_t
double Double_t
const char Option_t
#define BIT(n)
#define ClassDefOverride(name, id)
Abstract base class container for multi-particle events.
Definition: KVEvent.h:67
Extended TList class which owns its objects by default.
Definition: KVList.h:28
Description of physical materials used to construct detectors & targets; interface to range tables.
Definition: KVMaterial.h:89
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:123
Base class for relativistic kinematics of massive particles.
Definition: KVParticle.h:396
Calculation/correction of energy losses of particles through an experimental target.
Definition: KVTarget.h:128
void DetectParticle(KVNucleus *, TVector3 *norm=0) override
Definition: KVTarget.cpp:486
Bool_t IsIncoming() const
Definition: KVTarget.h:207
Double_t GetThickness() const override
Definition: KVTarget.h:191
void SetIncoming(Bool_t r=kTRUE)
Definition: KVTarget.h:218
KVTarget()
Default costructor.
Definition: KVTarget.cpp:36
void Print(Option_t *opt="") const override
Definition: KVTarget.cpp:737
void SetAngleToBeam(Double_t a)
Definition: KVTarget.cpp:179
void Copy(TObject &obj) const override
Copy this to obj.
Definition: KVTarget.cpp:82
void init()
Default initialisations.
Definition: KVTarget.cpp:16
Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0) override
Definition: KVTarget.cpp:594
Int_t NumberOfLayers() const
Definition: KVTarget.h:167
KVList * fTargets
list of layers
Definition: KVTarget.h:140
Bool_t IsOutgoing() const
Definition: KVTarget.h:227
TVector3 & GetInteractionPoint(KVParticle *part=0)
Definition: KVTarget.cpp:768
void SetRandomized(Bool_t r=kTRUE)
Definition: KVTarget.h:253
Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0) override
Definition: KVTarget.cpp:958
Int_t fNLayers
number of layers
Definition: KVTarget.h:141
Double_t GetEffectiveThickness(KVParticle *part=0, Int_t ilayer=1)
Definition: KVTarget.cpp:215
void SetMaterial(const Char_t *type) override
Set material of first layer.
Definition: KVTarget.cpp:900
KVMaterial * GetLayer(TVector3 &depth)
Definition: KVTarget.cpp:273
KVMaterial * GetLayerByDepth(Double_t depth)
Definition: KVTarget.cpp:322
void AddLayer(const Char_t *material, Double_t thick)
Definition: KVTarget.cpp:112
virtual ~ KVTarget()
Double_t GetTotalEffectiveThickness(KVParticle *part=0)
Definition: KVTarget.cpp:413
void SetInteractionLayer(Int_t ilayer, TVector3 &dir)
Definition: KVTarget.cpp:810
void DetectEvent(KVEvent *)
Definition: KVTarget.cpp:717
TVector3 fNormal
normal to target - (0,0,1) by default
Definition: KVTarget.h:142
Bool_t IsRandomized() const
Definition: KVTarget.h:249
@ kOutgoing
Definition: KVTarget.h:135
@ kRandom
Definition: KVTarget.h:133
@ kIncoming
Definition: KVTarget.h:134
KVList * GetLayers() const
Definition: KVTarget.h:171
const TVector3 & GetNormal()
Definition: KVTarget.h:155
void SetOutgoing(Bool_t r=kTRUE)
Definition: KVTarget.h:239
Double_t GetTotalThickness()
Definition: KVTarget.cpp:139
Double_t GetAtomsPerCM2() const
virtual UInt_t GetUnits() const;
Definition: KVTarget.cpp:927
Double_t GetAngleToBeam()
Gives angle of target to incident beam direction in degrees.
Definition: KVTarget.cpp:194
void SetLayerThickness(Float_t thick, Int_t ilayer=1)
Set 'thickness' in mg/cm**2 of a layer, by default this is the first layer.
Definition: KVTarget.cpp:913
Int_t GetLayerIndex(TVector3 &depth)
Definition: KVTarget.cpp:293
TVector3 fIntPoint
last randomly generated interaction point
Definition: KVTarget.h:143
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres) override
Definition: KVTarget.cpp:1096
KVMaterial * GetLayerByIndex(Int_t ilayer) const
Definition: KVTarget.h:175
void Clear(Option_t *opt="") override
Definition: KVTarget.cpp:748
void SetBit(UInt_t f)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void ResetBit(UInt_t f)