1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 /* $Id: AliTRDtrackletWord.cxx 28397 2008-09-02 09:33:00Z cblume $ */
18 ////////////////////////////////////////////////////////////////////////////
20 // A tracklet word as from FEE //
22 // Author: J. Klein (Jochen.Klein@cern.ch) //
24 ////////////////////////////////////////////////////////////////////////////
26 #include "AliTRDtrackletWord.h"
27 #include "AliTRDgeometry.h"
28 #include "AliTRDpadPlane.h"
31 ClassImp(AliTRDtrackletWord)
33 AliTRDgeometry* AliTRDtrackletWord::fgGeo = new AliTRDgeometry;
35 AliTRDtrackletWord::AliTRDtrackletWord(UInt_t trackletWord) :
38 fTrackletWord(trackletWord)
43 AliTRDtrackletWord::AliTRDtrackletWord(UInt_t trackletWord, Int_t hcid) :
46 fTrackletWord(trackletWord)
51 AliTRDtrackletWord::AliTRDtrackletWord(const AliTRDtrackletWord &rhs) :
52 AliTRDtrackletBase(rhs),
54 fTrackletWord(rhs.fTrackletWord)
59 AliTRDtrackletWord::~AliTRDtrackletWord()
64 Int_t AliTRDtrackletWord::GetYbin() const {
65 // returns (signed) value of Y
66 if (fTrackletWord & 0x1000) {
67 return -((~(fTrackletWord-1)) & 0x1fff);
70 return (fTrackletWord & 0x1fff);
74 Int_t AliTRDtrackletWord::GetdY() const
76 // returns (signed) value of the deflection length
77 if (fTrackletWord & (1 << 19)) {
78 return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
81 return ((fTrackletWord >> 13) & 0x7f);
85 Int_t AliTRDtrackletWord::GetROB() const
87 return 2 * (GetZbin() / 4) + (GetY() > 0 ? 1 : 0);
90 Int_t AliTRDtrackletWord::GetMCM() const
92 AliTRDpadPlane *pp = fgGeo->GetPadPlane(GetDetector());
93 return (((Int_t) ((GetY()) / pp->GetWidthIPad()) + 72) / 18) % 4
94 + 4 * (GetZbin() % 4);