KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVTarget.h
Go to the documentation of this file.
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 "KVNucleus.h"
14 #include "KVMaterial.h"
15 
16 class KVEvent;
17 
126 class KVTarget: public KVMaterial {
127 
128 private:
129 
130  enum {
131  kRandom = BIT(14), //random interaction depth or half-way ?
132  kIncoming = BIT(15), //calculate only energy loss from entrance up to interaction depth
133  kOutgoing = BIT(16) //calculate energy loss from interaction depth to exit
134  };
135 
136 protected:
137 
142 
143  void init();
144 
145 public:
146 
147  KVTarget();
148  KVTarget(const KVTarget&);
149  ROOT_COPY_ASSIGN_OP(KVTarget)
150  KVTarget(const Char_t* material, Double_t thick = 0.0);
151  virtual ~ KVTarget();
152 
154  {
156  return fNormal;
157  }
158  void SetAngleToBeam(Double_t a);
160 
161  virtual void SetMaterial(const Char_t* type);
162  void SetLayerThickness(Float_t thick, Int_t ilayer = 1);
163 
164  void AddLayer(const Char_t* material, Double_t thick);
166  {
167  return fNLayers;
168  };
169  KVList* GetLayers() const
170  {
171  return fTargets;
172  };
174  {
175  return (ilayer >
176  0 ? (ilayer <=
178  At(ilayer - 1) : 0) : 0);
179  };
180  KVMaterial* GetLayer(TVector3& depth);
181  Int_t GetLayerIndex(TVector3& depth);
184  KVMaterial* GetLayer(const Char_t* name);
185  Int_t GetLayerIndex(const Char_t* name);
186 
190  {
191  return const_cast <KVTarget* >(this)->GetTotalThickness();
192  };
195  1, Int_t lay2 = 0);
196  Double_t GetEffectiveThickness(KVParticle* part = 0, Int_t ilayer = 1);
197  Double_t GetEffectiveThickness(TVector3& direction, Int_t ilayer = 1);
198  Double_t GetThickness(Int_t ilayer) const;
199 
201  void SetInteractionLayer(Int_t ilayer, TVector3& dir);
202  void SetInteractionLayer(const Char_t* name, TVector3& dir);
203  void SetInteractionLayer(const Char_t* name, KVParticle* part);
204 
206  {
207  return TestBit(kIncoming);
208  };
216  void SetIncoming(Bool_t r = kTRUE)
217  {
218  if (r) {
219  SetBit(kIncoming);
221  }
222  else
224  };
226  {
227  return TestBit(kOutgoing);
228  };
237  void SetOutgoing(Bool_t r = kTRUE)
238  {
239  if (r) {
240  SetBit(kOutgoing);
242  }
243  else
245  };
246 
248  {
249  return TestBit(kRandom);
250  };
251  void SetRandomized(Bool_t r = kTRUE)
252  {
253  if (r)
254  SetBit(kRandom);
255  else
256  ResetBit(kRandom);
257  };
258 
259  virtual void DetectParticle(KVNucleus*, TVector3* norm = 0);
260  virtual Double_t GetELostByParticle(KVNucleus*, TVector3* norm = 0);
261  virtual Double_t GetParticleEIncFromERes(KVNucleus*, TVector3* norm = 0);
263  Double_t Eres);
264  void DetectEvent(KVEvent*);
265 
266  void Print(Option_t* opt = "") const;
267  void Clear(Option_t* opt = "");
268 #if ROOT_VERSION_CODE >= ROOT_VERSION(3,4,0)
269  virtual void Copy(TObject& obj) const;
270 #else
271  virtual void Copy(TObject& obj);
272 #endif
274 
275  Double_t GetAtomsPerCM2() const;
276 
277  ClassDef(KVTarget, 1) //Simulate targets for experiments
278 };
279 
280 
281 
282 #endif
int Int_t
ROOT::R::TRInterface & r
char Char_t
bool Bool_t
double Double_t
float Float_t
const char Option_t
#define ClassDef(name, id)
#define BIT(n)
Base class container for multi-particle events.
Definition: KVEvent.h:176
Extended TList class which owns its objects by default.
Definition: KVList.h:27
Description of physical materials used to construct detectors; interface to range tables.
Definition: KVMaterial.h:41
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
Base class for relativistic kinematics of massive particles.
Definition: KVParticle.h:398
Calculation/correction of energy losses of particles through an experimental target.
Definition: KVTarget.h:126
void Print(Option_t *opt="") const
Show information on this material.
Definition: KVTarget.cpp:742
Bool_t IsIncoming() const
Definition: KVTarget.h:205
void SetIncoming(Bool_t r=kTRUE)
Definition: KVTarget.h:216
KVTarget()
Default costructor.
Definition: KVTarget.cpp:35
void SetAngleToBeam(Double_t a)
Definition: KVTarget.cpp:178
void init()
Default initialisations.
Definition: KVTarget.cpp:15
virtual void Copy(TObject &obj) const
Copy this to obj.
Definition: KVTarget.cpp:81
virtual void DetectParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVTarget.cpp:485
virtual Double_t GetELostByParticle(KVNucleus *, TVector3 *norm=0)
Definition: KVTarget.cpp:594
@ kOutgoing
Definition: KVTarget.h:133
@ kRandom
Definition: KVTarget.h:131
@ kIncoming
Definition: KVTarget.h:132
Int_t NumberOfLayers() const
Definition: KVTarget.h:165
virtual Double_t GetParticleEIncFromERes(KVNucleus *, TVector3 *norm=0)
Definition: KVTarget.cpp:963
KVList * fTargets
list of layers
Definition: KVTarget.h:138
Bool_t IsOutgoing() const
Definition: KVTarget.h:225
virtual Double_t GetIncidentEnergyFromERes(Int_t Z, Int_t A, Double_t Eres)
Definition: KVTarget.cpp:1094
void Clear(Option_t *opt="")
Reset absorber - set energy lost by particles to zero.
Definition: KVTarget.cpp:753
TVector3 & GetInteractionPoint(KVParticle *part=0)
Definition: KVTarget.cpp:773
void SetRandomized(Bool_t r=kTRUE)
Definition: KVTarget.h:251
Int_t fNLayers
number of layers
Definition: KVTarget.h:139
Double_t GetEffectiveThickness(KVParticle *part=0, Int_t ilayer=1)
Definition: KVTarget.cpp:214
KVMaterial * GetLayer(TVector3 &depth)
Definition: KVTarget.cpp:272
KVMaterial * GetLayerByDepth(Double_t depth)
Definition: KVTarget.cpp:321
void AddLayer(const Char_t *material, Double_t thick)
Definition: KVTarget.cpp:111
virtual ~ KVTarget()
Double_t GetTotalEffectiveThickness(KVParticle *part=0)
Definition: KVTarget.cpp:412
Double_t GetThickness() const
Definition: KVTarget.h:189
void SetInteractionLayer(Int_t ilayer, TVector3 &dir)
Definition: KVTarget.cpp:815
void DetectEvent(KVEvent *)
Definition: KVTarget.cpp:721
virtual void SetMaterial(const Char_t *type)
Set material of first layer.
Definition: KVTarget.cpp:905
TVector3 fNormal
normal to target - (0,0,1) by default
Definition: KVTarget.h:140
Bool_t IsRandomized() const
Definition: KVTarget.h:247
KVList * GetLayers() const
Definition: KVTarget.h:169
const TVector3 & GetNormal()
Definition: KVTarget.h:153
void SetOutgoing(Bool_t r=kTRUE)
Definition: KVTarget.h:237
Double_t GetTotalThickness()
Definition: KVTarget.cpp:138
Double_t GetAtomsPerCM2() const
virtual UInt_t GetUnits() const;
Definition: KVTarget.cpp:932
Double_t GetAngleToBeam()
Gives angle of target to incident beam direction in degrees.
Definition: KVTarget.cpp:193
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:918
Int_t GetLayerIndex(TVector3 &depth)
Definition: KVTarget.cpp:292
TVector3 fIntPoint
last randomly generated interaction point
Definition: KVTarget.h:141
KVMaterial * GetLayerByIndex(Int_t ilayer) const
Definition: KVTarget.h:173
void SetBit(UInt_t f)
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void ResetBit(UInt_t f)