Bug fix for like sign V0s
[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),
38 fLabel(-1)
52c19022 39{
4cc89512 40 fGeo = new AliTRDgeometry();
52c19022 41}
42
43AliTRDtrackletMCM::AliTRDtrackletMCM(UInt_t trackletWord, Int_t hcid) :
44 AliTRDtrackletBase(),
4cc89512 45 fGeo(0x0),
52c19022 46 fHCId(hcid),
47 fTrackletWord(trackletWord),
48 fMCM(-1),
4cc89512 49 fROB(-1),
50 fLabel(-1)
52c19022 51{
4cc89512 52 fGeo = new AliTRDgeometry();
52c19022 53}
54
55AliTRDtrackletMCM::AliTRDtrackletMCM(const AliTRDtrackletMCM &rhs) :
56 AliTRDtrackletBase(rhs),
4cc89512 57 fGeo(0x0),
52c19022 58 fHCId(rhs.fHCId),
59 fTrackletWord(rhs.fTrackletWord),
60 fMCM(rhs.fMCM),
4cc89512 61 fROB(rhs.fROB),
62 fLabel(rhs.fLabel)
52c19022 63{
4cc89512 64 fGeo = new AliTRDgeometry();
52c19022 65}
66
67AliTRDtrackletMCM::~AliTRDtrackletMCM()
68{
4cc89512 69 delete fGeo;
52c19022 70}
71
72Int_t AliTRDtrackletMCM::GetYbin() const {
73 // returns (signed) value of Y
74 if (fTrackletWord & 0x1000) {
75 return -((~(fTrackletWord-1)) & 0x1fff);
76 }
77 else {
78 return (fTrackletWord & 0x1fff);
79 }
80}
81
82Int_t AliTRDtrackletMCM::GetdY() const
83{
84 // returns (signed) value of the deflection length
85 if (fTrackletWord & (1 << 19)) {
86 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
87 }
88 else {
89 return ((fTrackletWord >> 13) & 0x7f);
90 }
91}