]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtrackletWord.h
Bug fix in the constructor (thanks to A.Marin)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletWord.h
CommitLineData
52c19022 1#ifndef ALITRDTRACKLETWORD_H
2#define ALITRDTRACKLETWORD_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id: AliTRDtrackletWord.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"
85c32c86 16#include "AliTRDgeometry.h"
17#include "AliTRDpadPlane.h"
52c19022 18
19class AliTRDtrackletWord : public AliTRDtrackletBase {
20 public:
4cc89512 21 AliTRDtrackletWord(UInt_t trackletWord = 0);
22 AliTRDtrackletWord(UInt_t trackletWord, Int_t hcid);
52c19022 23 AliTRDtrackletWord(const AliTRDtrackletWord &rhs);
24 ~AliTRDtrackletWord();
25
26 // ----- Getters for contents of tracklet word -----
5f006bd7 27 Int_t GetYbin() const;
28 Int_t GetdY() const;
52c19022 29 Int_t GetZbin() const { return ((fTrackletWord >> 20) & 0xf); }
30 Int_t GetPID() const { return ((fTrackletWord >> 24) & 0xff); }
31
f061fb9d 32 Int_t GetROB() const;
5f006bd7 33 Int_t GetMCM() const;
f061fb9d 34
52c19022 35 // ----- Getters for offline corresponding values -----
36 Bool_t CookPID() { return kFALSE; }
cb8b99ee 37 Double_t GetPID(Int_t /* is */) const { return (Double_t) GetPID()/256.; }
52c19022 38 Int_t GetDetector() const { return fHCId / 2; }
39 Int_t GetHCId() const { return fHCId; }
40 Float_t GetdYdX() const { return (GetdY() * 140e-4 / 3.); }
85c32c86 41 Float_t GetX() const { return fgGeo->GetTime0((fHCId%12)/2); }
52c19022 42 Float_t GetY() const { return (GetYbin() * 160e-4); }
f061fb9d 43 Float_t GetZ() const { return fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowPos(GetZbin()) -
44 fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowSize(GetZbin()); }
45 Float_t GetLocalZ() const { return GetZ() - fgGeo->GetPadPlane((fHCId % 12) / 2, (fHCId/12) % 5)->GetRowPos(8); }
52c19022 46
47 UInt_t GetTrackletWord() const { return fTrackletWord; }
48 void SetTrackletWord(UInt_t trackletWord) { fTrackletWord = trackletWord; }
49
50 void SetDetector(Int_t id) { fHCId = 2 * id + (GetYbin() < 0 ? 0 : 1); }
51 void SetHCId(Int_t id) { fHCId = id; }
52
53 protected:
f061fb9d 54 Int_t fHCId; // half-chamber ID
5f006bd7 55 UInt_t fTrackletWord; // tracklet word: PID | Z | deflection length | Y
cb8b99ee 56 // bits: 8 4 7 13
85c32c86 57 static AliTRDgeometry *fgGeo; // pointer to TRD geometry for coordinate calculations
52c19022 58
4cc89512 59 private:
60 AliTRDtrackletWord& operator=(const AliTRDtrackletWord &rhs); // not implemented
61
f061fb9d 62 ClassDef(AliTRDtrackletWord, 2);
52c19022 63};
64
65#endif