Line data Source code
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: AliTRDtrackletWord.cxx 28397 2008-09-02 09:33:00Z cblume $ */
17 :
18 : ////////////////////////////////////////////////////////////////////////////
19 : // //
20 : // A tracklet word as from FEE //
21 : // //
22 : // Author: J. Klein (Jochen.Klein@cern.ch) //
23 : // //
24 : ////////////////////////////////////////////////////////////////////////////
25 :
26 : #include "AliTRDtrackletWord.h"
27 : #include "AliTRDgeometry.h"
28 : #include "AliTRDpadPlane.h"
29 : #include "AliLog.h"
30 :
31 48 : ClassImp(AliTRDtrackletWord)
32 :
33 : AliTRDgeometry* AliTRDtrackletWord::fgGeo = 0x0;
34 :
35 : AliTRDtrackletWord::AliTRDtrackletWord(UInt_t trackletWord) :
36 2 : AliTRDtrackletBase(),
37 2 : fHCId(-1),
38 2 : fTrackletWord(trackletWord)
39 10 : {
40 2 : if (!fgGeo)
41 6 : fgGeo = new AliTRDgeometry;
42 4 : }
43 :
44 : AliTRDtrackletWord::AliTRDtrackletWord(UInt_t trackletWord, Int_t hcid) :
45 359 : AliTRDtrackletBase(),
46 359 : fHCId(hcid),
47 359 : fTrackletWord(trackletWord)
48 1795 : {
49 359 : if (!fgGeo)
50 3 : fgGeo = new AliTRDgeometry;
51 718 : }
52 :
53 : AliTRDtrackletWord::AliTRDtrackletWord(const AliTRDtrackletWord &rhs) :
54 0 : AliTRDtrackletBase(rhs),
55 0 : fHCId(rhs.fHCId),
56 0 : fTrackletWord(rhs.fTrackletWord)
57 0 : {
58 :
59 0 : if (!fgGeo)
60 0 : fgGeo = new AliTRDgeometry;
61 0 : }
62 :
63 : AliTRDtrackletWord::~AliTRDtrackletWord()
64 576 : {
65 :
66 576 : }
67 :
68 : Int_t AliTRDtrackletWord::GetYbin() const {
69 : // returns (signed) value of Y
70 0 : if (fTrackletWord & 0x1000) {
71 0 : return -((~(fTrackletWord-1)) & 0x1fff);
72 : }
73 : else {
74 0 : return (fTrackletWord & 0x1fff);
75 : }
76 0 : }
77 :
78 : Int_t AliTRDtrackletWord::GetdY() const
79 : {
80 : // returns (signed) value of the deflection length
81 0 : if (fTrackletWord & (1 << 19)) {
82 0 : return -((~((fTrackletWord >> 13) - 1)) & 0x7f);
83 : }
84 : else {
85 0 : return ((fTrackletWord >> 13) & 0x7f);
86 : }
87 0 : }
88 :
89 : Int_t AliTRDtrackletWord::GetROB() const
90 : {
91 0 : return 2 * (GetZbin() / 4) + (GetY() > 0 ? 1 : 0);
92 : }
93 :
94 : Int_t AliTRDtrackletWord::GetMCM() const
95 : {
96 0 : AliTRDpadPlane *pp = fgGeo->GetPadPlane(GetDetector());
97 0 : return (((Int_t) ((GetY()) / pp->GetWidthIPad()) + 72) / 18) % 4
98 0 : + 4 * (GetZbin() % 4);
99 : }
100 :
|