AliPhysics  8d00e07 (8d00e07)
AliFMDMCTrackELoss.h
Go to the documentation of this file.
1 #ifndef ALIFMDMCTRACKELOSS_MC
2 #define ALIFMDMCTRACKELOSS_MC
3 #include "AliForwardUtil.h"
5 #include "AliFMDFloatMap.h"
6 class TH1D;
7 class TH2;
8 class TH2D;
9 class AliESDFMD;
10 class TClonesArray;
11 class TTree;
12 
38 {
39 public:
49  AliFMDMCTrackELoss(const char* name);
67  virtual ~AliFMDMCTrackELoss() {}
68 
78  void SetUseTree(Bool_t use=true) { fUseTree = use; }
85  /* @} */
86 
105  Bool_t Calculate(const AliESDFMD& esd,
106  const AliMCEvent& event,
107  const TVector3& ip,
108  Double_t cent);
114  void CreateOutputObjects(TList* list);
115 
123  void Clear(Option_t* opt="");
129  AliFMDFloatMap& GetPrimaries() { return fPrimaries; }
135  const AliFMDFloatMap& GetPrimaries() const { return fPrimaries; }
141  AliFMDFloatMap& GetSecondaries() { return fSecondaries; }
147  const AliFMDFloatMap& GetSecondaries() const { return fSecondaries; }
153  AliFMDFloatMap& GetAll() { return fAll; }
159  const AliFMDFloatMap& GetAll() const { return fAll; }
165  AliFMDFloatMap& GetEta() { return fEta; }
171  const AliFMDFloatMap& GetEta() const { return fEta; }
172 
178  TTree* GetTree() const { return fTree; }
179  TClonesArray* GetHits() const { return fHits; }
180 
181  TH2* GetBetaGammadEdx() const { return fBetaGammadEdx; }
182  TH2* GetBetaGammaEta() const { return fBetaGammaEta; }
183  TH2* GetDEdxEta() const { return fDEdxEta; }
184  /* @} */
185 
191  void Print(Option_t* option="") const;
192 
193 
197  struct Hit : public TObject {
206  mutable UShort_t fDetector;
207  mutable Char_t fRing;
208  mutable UShort_t fSector;
209  mutable UShort_t fStrip;
210 
211  Hit();
212  void Decode() const;
213  UShort_t D() const { Decode(); return fDetector; }
214  Char_t R() const { Decode(); return fRing; }
215  UShort_t S() const { Decode(); return fSector; }
216  UShort_t T() const { Decode(); return fStrip; }
217  Double_t DeDx() const { return (fDx > 0 ? fDe/fDx : 0); }
218  Double_t Eta() const { return fEta; }
219  Double_t BetaGamma() const { return fBeta*fGamma; }
220  UInt_t AbsPdg() const;
221  Bool_t IsPrimary() const { return fPrimary; }
222  Bool_t IsPion() const { return AbsPdg() == 211; }
223  Bool_t IsKaon() const { return AbsPdg() == 321; }
224  Bool_t IsProton() const { return AbsPdg() == 2212; }
225  Bool_t IsElectron() const { return AbsPdg() == 11 || AbsPdg() == 13; }
226 
227  ClassDef(Hit,1);
228  };
232  struct Event {
235  };
236 
237 protected:
243  Int_t GetDetectorId() const;
254  AliTrackReference* ProcessRef(AliMCParticle* particle,
255  const AliMCParticle* mother,
256  AliTrackReference* ref);
261  void BeginTrackRefs();
267  void EndTrackRefs(Int_t nRefs);
278  Double_t StoreParticle(AliMCParticle* particle,
279  const AliMCParticle* mother,
280  AliTrackReference* ref) const;
281  //__________________________________________________________________
286  mutable struct State
287  {
288  Double_t angle; // Angle
289  UShort_t oldDetector; // Last detector
290  Char_t oldRing; // Last ring
291  UShort_t oldSector; // Last sector
292  UShort_t oldStrip; // Last strip
293  UShort_t startStrip; // First strip
294  UShort_t nRefs; // Number of references
295  UShort_t nStrips; // Number of strips
296  UShort_t count; // Count of hit strips
297  Double_t de; // Summed energy loss
298  Double_t dx; // Summed dx
299  AliTrackReference* longest;
300 
305  void Clear(Bool_t alsoCount=false);
313  State& operator=(const State& o);
314  } fState;
316 
317 
318  UShort_t fMaxConsequtiveStrips; // Max 'cluster' size
319  Bool_t fUseTree; // Whether to make an nTree
320  TClonesArray* fHits;
322  TH1D* fNr; // Number of track-refs per cluster
323  TH1D* fNt; // Size of cluster in strips
324  TH1D* fNc; // Number of clusters per track
325  TH2D* fNcr; // Number of clusters per track
329  mutable AliFMDFloatMap fPrimaries; // Cache of eloss per primary
330  mutable AliFMDFloatMap fSecondaries; // Cache of eloss per secondary
331  mutable AliFMDFloatMap fAll; // Cache of eloss for all
332  AliFMDFloatMap fEta; // Cache of pseudo-rapidity
333 
334 
335  ClassDef(AliFMDMCTrackELoss,1); // Calculate track-ref density
336 };
337 
338 #endif
339 // Local Variables:
340 // mode: C++
341 // End:
double Double_t
Definition: External.C:58
AliFMDFloatMap fPrimaries
Double_t StoreParticle(AliMCParticle *particle, const AliMCParticle *mother, AliTrackReference *ref) const
Double_t BetaGamma() const
TH2 * GetBetaGammadEdx() const
void SetMaxConsequtiveStrips(UShort_t n)
AliTrackReference * longest
char Char_t
Definition: External.C:18
const AliFMDFloatMap & GetSecondaries() const
void Print(Option_t *option="") const
struct AliFMDMCTrackELoss::State fState
AliFMDFloatMap & GetPrimaries()
TH2 * GetBetaGammaEta() const
void SetUseTree(Bool_t use=true)
AliFMDFloatMap & GetEta()
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
Various utilities used in PWGLF/FORWARD.
const AliFMDFloatMap & GetEta() const
Definition: External.C:228
Definition: External.C:212
TClonesArray * GetHits() const
AliFMDMCTrackELoss & operator=(const AliFMDMCTrackELoss &o)
void Clear(Option_t *opt="")
Definition: External.C:220
Bool_t Calculate(const AliESDFMD &esd, const AliMCEvent &event, const TVector3 &ip, Double_t cent)
void EndTrackRefs(Int_t nRefs)
const AliFMDFloatMap & GetAll() const
AliFMDFloatMap & GetSecondaries()
const AliFMDFloatMap & GetPrimaries() const
AliFMDMCTrackELoss(const AliFMDMCTrackELoss &o)
unsigned short UShort_t
Definition: External.C:28
const char Option_t
Definition: External.C:48
Int_t GetDetectorId() const
bool Bool_t
Definition: External.C:53
TH2 * GetDEdxEta() const
AliFMDFloatMap fSecondaries
void CreateOutputObjects(TList *list)
TTree * GetTree() const
AliTrackReference * ProcessRef(AliMCParticle *particle, const AliMCParticle *mother, AliTrackReference *ref)
AliFMDFloatMap & GetAll()