]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtrackletMCM.h
Bug fix (Alessandro)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletMCM.h
CommitLineData
52c19022 1#ifndef ALITRDTRACKLETMCM_H
2#define ALITRDTRACKLETMCM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliTRDtrackletMCM.h 27496 2008-07-22 08:35:45Z cblume $ */
7
8//-----------------------------------
9//
10// TRD tracklet word (as from FEE)
11// only 32-bit of information + detector ID
12//
13//----------------------------------
14
15#include "AliTRDtrackletBase.h"
4cc89512 16#include "AliTRDgeometry.h"
17#include "AliTRDpadPlane.h"
52c19022 18
19class AliTRDtrackletMCM : public AliTRDtrackletBase {
20 public:
4cc89512 21 AliTRDtrackletMCM(UInt_t trackletWord = 0);
22 AliTRDtrackletMCM(UInt_t trackletWword, Int_t hcid);
b0a41e80 23 AliTRDtrackletMCM(UInt_t trackletWword, Int_t hcid, Int_t rob, Int_t mcm);
52c19022 24 AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs);
25 ~AliTRDtrackletMCM();
26
27 // ----- Getters for contents of tracklet word -----
28 Int_t GetYbin() const;
29 Int_t GetdY() const;
30 Int_t GetZbin() const { return ((fTrackletWord >> 20) & 0xf); }
31 Int_t GetPID() const { return ((fTrackletWord >> 24) & 0xff); }
32
33 // ----- Getters for MCM-tracklet information -----
34 Int_t GetMCM() const { return fMCM; }
35 Int_t GetROB() const { return fROB; }
4cc89512 36 Int_t GetLabel() const { return fLabel; }
52c19022 37
38 // ----- Getters for offline corresponding values -----
39 Bool_t CookPID() { return kFALSE; }
36dc3337 40 Double_t GetPID(Int_t /* is */) const { return GetPID()/255.; }
52c19022 41 Int_t GetDetector() const { return fHCId / 2; }
42 Int_t GetHCId() const { return fHCId; }
43 Float_t GetdYdX() const { return (GetdY() * 140e-4 / 3.); }
4cc89512 44 Float_t GetX() const { return fGeo->GetTime0((fHCId % 12) / 2); }
52c19022 45 Float_t GetY() const { return (GetYbin() * 160e-4); }
f061fb9d 46 Float_t GetZ() const { return fGeo->GetPadPlane((fHCId % 12) / 2, (fHCId / 12) % 5)->GetRowPos( 4 * (fROB / 2) + fMCM / 4) -
47 fGeo->GetPadPlane((fHCId % 12) / 2, (fHCId /12) % 5)->GetRowSize(4 * (fROB / 2) + fMCM / 4) * .5; }
48 Float_t GetLocalZ() const { return GetZ() - fGeo->GetPadPlane((fHCId % 12) / 2, (fHCId / 12) % 5)->GetRowPos(8); }
52c19022 49
48e5462a 50 Int_t GetQ0() const { return fQ0; }
51 Int_t GetQ1() const { return fQ1; }
4ff7ed2b 52 Int_t GetNHits() const { return fNHits; }
53 Int_t GetNHits0() const { return fNHits0; }
54 Int_t GetNHits1() const { return fNHits1; }
48e5462a 55
52c19022 56 UInt_t GetTrackletWord() const { return fTrackletWord; }
57 void SetTrackletWord(UInt_t trackletWord) { fTrackletWord = trackletWord; }
58
59 void SetDetector(Int_t id) { fHCId = 2 * id + (GetYbin() < 0 ? 0 : 1); }
60 void SetHCId(Int_t id) { fHCId = id; }
61 void SetMCM(Int_t mcm) { fMCM = mcm; }
62 void SetROB(Int_t rob) { fROB = rob; }
4cc89512 63 void SetLabel(Int_t label) { fLabel = label; }
48e5462a 64 void SetQ0(Int_t charge) { fQ0 = charge; }
65 void SetQ1(Int_t charge) { fQ1 = charge; }
4ff7ed2b 66 void SetNHits(Int_t nhits) { fNHits = nhits; }
67 void SetNHits0(Int_t nhits) { fNHits0 = nhits; }
68 void SetNHits1(Int_t nhits) { fNHits1 = nhits; }
52c19022 69
ce51199c 70 void SetSlope(Float_t slope) { fSlope = slope; }
71 void SetOffset(Float_t offset) { fOffset = offset; }
72 void SetError(Float_t error) { fError = error; }
73 void SetClusters(Float_t *res, Float_t *q, Int_t n);
74
75 Float_t GetSlope() const { return fSlope; }
76 Float_t GetOffset() const { return fOffset; }
77 Float_t GetError() const { return fError; }
78 Int_t GetNClusters() const { return fNClusters; }
79 Float_t *GetResiduals() const { return fResiduals; }
80 Float_t *GetClsCharges() const { return fClsCharges; }
81
52c19022 82 protected:
4cc89512 83 AliTRDgeometry *fGeo; //! TRD geometry
84
52c19022 85 Int_t fHCId; // half-chamber ID (only transient)
86 UInt_t fTrackletWord; // tracklet word: PID | Z | deflection length | Y
87 // bits: 12 4 7 13
4cc89512 88 Int_t fMCM; // MCM no. in which the tracklet was found
89 Int_t fROB; // ROB no. on which the tracklet was found
90
48e5462a 91 Int_t fQ0; // accumulated charge in the first time window
92 Int_t fQ1; // accumulated charge in the second time window
93
4ff7ed2b 94 Int_t fNHits; // no. of contributing clusters
95 Int_t fNHits0; // no. of contributing clusters in window 0
96 Int_t fNHits1; // no. of contributing clusters in window 1
97
4cc89512 98 Int_t fLabel; // label for MC track
ce51199c 99
100 Float_t fSlope; // tracklet slope
101 Float_t fOffset; // tracklet offset
102 Float_t fError; // tracklet error
103 Int_t fNClusters; // no. of clusters
104 Float_t *fResiduals; //[fNClusters] cluster to tracklet residuals
105 Float_t *fClsCharges; //[fNClusters] cluster charge
4cc89512 106
107 private:
108 AliTRDtrackletMCM& operator=(const AliTRDtrackletMCM &rhs); // not implemented
52c19022 109
48e5462a 110 ClassDef(AliTRDtrackletMCM, 2);
52c19022 111};
112
113#endif