]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONAlignmentRecord.h
Fix for ESD analysis
[u/mrichter/AliRoot.git] / MUON / AliMUONAlignmentRecord.h
1 #ifndef ALIMUONALIGNMENTRECORD_H
2 #define ALIMUONALIGNMENTRECORD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 /// \ingroup rec
9 /// \class AliMUONAlignmentClusterRecord
10 /// \brief Class to store alignment local and global derivatives of muon spectrometer
11 //
12 // Author: Hugo Pereira Da Costa
13
14 #include <TClonesArray.h>
15 #include <TObject.h>
16 #include <cassert>
17
18 class AliMUONAlignmentClusterRecord:public TObject
19 {
20
21 public:
22
23   /// constructor
24   AliMUONAlignmentClusterRecord( void );
25
26   /// destructor
27   virtual ~AliMUONAlignmentClusterRecord( void )
28   {}
29
30   /// Print
31   virtual void  Print(Option_t* = "") const;
32
33   ///@name modifiers
34   ///@{
35
36   /// detetion element Id
37   void SetDetElemId( Int_t value )
38   {
39     fDetElemId = value;
40     fDetElemNumber = fDetElemId%100;
41   }
42
43   /// detection element number
44   void SetDetElemNumber( Int_t value )
45   { fDetElemNumber = value; }
46
47   /// measurement
48   void SetMeas( Double_t value )
49   { fMeas = value; }
50
51   /// error on measurement
52   void SetSigma( Double_t value )
53   { fSigma = value; }
54
55   /// local derivative
56   void SetLocalDerivative( Int_t index, Double_t value )
57   {
58     // todo: bound check ?
59     fLocalDerivatives[index] = value;
60   }
61
62   /// global derivative
63   void SetGlobalDerivative( Int_t index, Double_t value )
64   {
65     // todo: bound check ?
66     fGlobalDerivatives[index] = value;
67   }
68
69   ///@}
70
71   ///@name accessors
72   ///@{
73
74   /// detection element id
75   Int_t GetDetElemId( void ) const
76   { return fDetElemId; }
77
78   /// detection element number
79   Int_t GetDetElemNumber( void ) const
80   { return fDetElemNumber; }
81
82   /// measurement
83   Double_t GetMeas( void ) const
84   { return fMeas; }
85
86   /// error on measurement
87   Double_t GetSigma( void ) const
88   { return fSigma; }
89
90   /// local derivative
91   Double_t GetLocalDerivative( Int_t index ) const
92   {
93     // todo: bound check ?
94     return fLocalDerivatives[index];
95   }
96
97   /// global derivative
98   Double_t GetGlobalDerivative( Int_t index ) const
99   {
100     // todo: bound check ?
101     return fGlobalDerivatives[index];
102   }
103
104   /// @}
105
106 private:
107
108   /// Detection element Id
109   Int_t fDetElemId;
110
111   /// Detection element number
112   Int_t fDetElemNumber;
113
114   /// measurement
115   Double_t fMeas;
116
117   /// error on measurement
118   Double_t fSigma;
119
120   /// local derivatives
121   Double_t fLocalDerivatives[4];
122
123   /// global derivatives
124   Double_t fGlobalDerivatives[4];
125
126 ClassDef(AliMUONAlignmentClusterRecord, 1)
127
128 };
129
130 /// \ingroup rec
131 /// \class AliMUONAlignmentTrackRecord
132 /// \brief Class to store alignment local and global derivatives of muon spectrometer
133 //
134 // Author: Hugo Pereira Da Costa
135 class AliMUONAlignmentTrackRecord:public TObject
136 {
137
138 public:
139
140         /// constructor
141   AliMUONAlignmentTrackRecord(TRootIOCtor* dummy);
142         
143   /// constructor
144   AliMUONAlignmentTrackRecord( void );
145
146   /// destructor
147   virtual ~AliMUONAlignmentTrackRecord( void );
148
149   /// copy constructor
150   AliMUONAlignmentTrackRecord (const AliMUONAlignmentTrackRecord& );
151
152   /// assignment operator
153   AliMUONAlignmentTrackRecord& operator=(const AliMUONAlignmentTrackRecord& );
154
155   /// Print
156   virtual void  Print(Option_t* option = "") const;
157
158   ///@name accessors
159   //@{
160
161   /// cluster records
162   TClonesArray* GetClusterRecords( void ) const
163   { return fClusterRecords; }
164
165   /// number of records
166   Int_t GetNRecords( void ) const
167   { return fClusterCount; }
168
169   /// return record for given index
170   AliMUONAlignmentClusterRecord* GetRecord( Int_t index ) const
171   { return fClusterRecords ? static_cast<AliMUONAlignmentClusterRecord*>(fClusterRecords->UncheckedAt( index )) : 0x0; }
172
173   //@}
174
175   ///@name modifiers
176   //@{
177
178   /// add cluster record
179   void AddClusterRecord( const AliMUONAlignmentClusterRecord& );
180
181   /// remove cluster record
182   void RemoveClusterRecord( AliMUONAlignmentClusterRecord* );
183
184   /// clear memory
185   virtual void Clear( Option_t* ="" );
186
187   //@}
188
189 private:
190
191   /// default clonesarray size
192   enum { fSize = 20 };
193
194   /// alignment parameters at cluster
195   TClonesArray* fClusterRecords;
196
197   /// number of cluster records in array
198   Int_t fClusterCount;
199
200 ClassDef(AliMUONAlignmentTrackRecord, 1)
201
202 };
203
204 #endif