Allow to reject clusters with less than n cells
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackletMCM.cxx
CommitLineData
52c19022 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/* $Id: AliTRDtrackletMCM.cxx 28397 2008-09-02 09:33:00Z cblume $ */
17
18////////////////////////////////////////////////////////////////////////////
19// //
20// MCM tracklet //
21// //
22// Author: J. Klein (Jochen.Klein@cern.ch) //
23// //
24////////////////////////////////////////////////////////////////////////////
25
26#include "AliTRDtrackletMCM.h"
27#include "AliLog.h"
28
29ClassImp(AliTRDtrackletMCM)
30
31AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord) :
32 AliTRDtrackletBase(),
4cc89512 33 fGeo(0x0),
52c19022 34 fHCId(-1),
35 fTrackletWord(trackletWord),
36 fMCM(-1),
4cc89512 37 fROB(-1),
48e5462a 38 fQ0(0),
39 fQ1(0),
36dc3337 40 fNHits(0),
41 fNHits0(0),
42 fNHits1(0),
4cc89512 43 fLabel(-1)
52c19022 44{
4cc89512 45 fGeo = new AliTRDgeometry();
52c19022 46}
47
48AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
49 AliTRDtrackletBase(),
4cc89512 50 fGeo(0x0),
52c19022 51 fHCId(hcid),
52 fTrackletWord(trackletWord),
53 fMCM(-1),
4cc89512 54 fROB(-1),
48e5462a 55 fQ0(0),
56 fQ1(0),
36dc3337 57 fNHits(0),
58 fNHits0(0),
59 fNHits1(0),
4cc89512 60 fLabel(-1)
52c19022 61{
4cc89512 62 fGeo = new AliTRDgeometry();
52c19022 63}
64
b0a41e80 65AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid, Int_t rob, Int_t mcm) :
66 AliTRDtrackletBase(),
67 fGeo(0x0),
68 fHCId(hcid),
69 fTrackletWord(trackletWord),
70 fMCM(mcm),
71 fROB(rob),
48e5462a 72 fQ0(0),
73 fQ1(0),
36dc3337 74 fNHits(0),
75 fNHits0(0),
76 fNHits1(0),
b0a41e80 77 fLabel(-1)
78{
79 fGeo = new AliTRDgeometry();
80}
81
52c19022 82AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
83 AliTRDtrackletBase(rhs),
4cc89512 84 fGeo(0x0),
52c19022 85 fHCId(rhs.fHCId),
86 fTrackletWord(rhs.fTrackletWord),
87 fMCM(rhs.fMCM),
4cc89512 88 fROB(rhs.fROB),
48e5462a 89 fQ0(rhs.fQ0),
90 fQ1(rhs.fQ1),
36dc3337 91 fNHits(rhs.fNHits),
92 fNHits0(rhs.fNHits0),
93 fNHits1(rhs.fNHits1),
4cc89512 94 fLabel(rhs.fLabel)
52c19022 95{
4cc89512 96 fGeo = new AliTRDgeometry();
52c19022 97}
98
99AliTRDtrackletMCM::~AliTRDtrackletMCM()
100{
4cc89512 101 delete fGeo;
52c19022 102}
103
104Int_t AliTRDtrackletMCM::GetYbin() const {
105 // returns (signed) value of Y
106 if (fTrackletWord & 0x1000) {
107 return -((~(fTrackletWord-1)) & 0x1fff);
108 }
109 else {
110 return (fTrackletWord & 0x1fff);
111 }
112}
113
114Int_t AliTRDtrackletMCM::GetdY() const
115{
116 // returns (signed) value of the deflection length
117 if (fTrackletWord & (1 << 19)) {
118 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
119 }
120 else {
121 return ((fTrackletWord >> 13) & 0x7f);
122 }
123}