]>
Commit | Line | Data |
---|---|---|
0145e89a | 1 | #ifndef ALIMUONTRACKERDATA_H |
2 | #define ALIMUONTRACKERDATA_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | // $Id$ | |
8 | ||
e41c38cf | 9 | /// \ingroup calib |
0145e89a | 10 | /// \class AliMUONTrackerData |
11 | /// \brief Implementation of AliMUONVTrackerData | |
12 | /// | |
13 | // Author Laurent Aphecetche, Subatech | |
14 | ||
15 | #ifndef ALIMUONVTRACKERDATA_H | |
16 | # include "AliMUONVTrackerData.h" | |
17 | #endif | |
18 | ||
8741815f | 19 | class AliMUONSparseHisto; |
0145e89a | 20 | class AliMUONVCalibParam; |
21 | class AliMUONVStore; | |
8741815f | 22 | class AliMpDetElement; |
0145e89a | 23 | |
24 | class AliMUONTrackerData : public AliMUONVTrackerData | |
25 | { | |
26 | public: | |
27 | AliMUONTrackerData(const char* name="", const char* title="", | |
28 | Int_t dimension=0, | |
49419555 | 29 | Bool_t issingleevent=kFALSE); |
0145e89a | 30 | virtual ~AliMUONTrackerData(); |
31 | ||
e83120bd | 32 | Bool_t Add(const AliMUONTrackerData& data); |
33 | ||
34 | virtual Bool_t Add(const AliMUONVStore& channelValues, TArrayI* nofEventsPerDDL=0x0); | |
1ffbeb9d | 35 | |
36 | virtual Bool_t Replace(const AliMUONVStore& channelValues); | |
37 | ||
0145e89a | 38 | virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const; |
39 | ||
40 | virtual Double_t Chamber(Int_t chamberId, Int_t dim=0) const; | |
41 | ||
42 | virtual Double_t Channel(Int_t detElemId, Int_t manuId, Int_t manuChannel, | |
43 | Int_t dim=0) const; | |
44 | ||
45 | virtual void Clear(Option_t* opt=""); | |
46 | ||
47 | virtual Double_t Count(Int_t detElemId, Int_t manuId, Int_t manuChannel) const; | |
48 | ||
49 | virtual Double_t DetectionElement(Int_t detElemId, Int_t dim=0) const; | |
50 | ||
51 | virtual TString DimensionName(Int_t dim) const; | |
8741815f | 52 | |
53 | virtual TString ExternalDimensionName(Int_t dim) const; | |
0145e89a | 54 | |
55 | virtual Bool_t HasChamber(Int_t chamberId) const; | |
56 | ||
57 | virtual Bool_t HasBusPatch(Int_t busPatchId) const; | |
58 | ||
59 | virtual Bool_t HasDetectionElement(Int_t detElemId) const; | |
60 | ||
61 | virtual Bool_t HasManu(Int_t detElemId, Int_t manuId) const; | |
62 | ||
63 | virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const; | |
64 | ||
9016a84e | 65 | /// Whether we can be run |
49419555 | 66 | virtual Bool_t IsSingleEvent() const { return fIsSingleEvent; } |
0145e89a | 67 | |
68 | virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const; | |
69 | ||
70 | /// Returns the number of dimensions (i.e. the number of values) each element has | |
71 | virtual Int_t NumberOfDimensions() const; | |
72 | ||
10eb3d17 | 73 | /// The number of values we are inputting |
74 | virtual Int_t ExternalDimension() const { return fExternalDimension; } | |
75 | ||
76 | /// Convert from internal to external dimension | |
77 | virtual Int_t InternalToExternal(Int_t dim) const { return dim/2; } | |
78 | ||
0145e89a | 79 | /// Returns the number of events we have seen so far |
e83120bd | 80 | virtual Int_t NumberOfEvents(Int_t ddlNumber) const; |
0145e89a | 81 | |
82 | virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const; | |
83 | ||
84 | using TObject::Print; | |
85 | ||
86 | /// Print, with option, all objects whose name matches wildcard | |
87 | virtual void Print(Option_t* wildcard, Option_t* opt) const; | |
88 | ||
89 | virtual void SetDimensionName(Int_t index, const char* value); | |
90 | ||
8741815f | 91 | Bool_t CanHistogram() const { return kTRUE; } |
92 | ||
10eb3d17 | 93 | void MakeHistogramForDimension(Int_t index, Bool_t value, Double_t xmin=0.0, Double_t xmax=4096.0); |
8741815f | 94 | |
10eb3d17 | 95 | virtual void HistogramRange(Double_t& xmin, Double_t& xmax) const { xmin = fXmin; xmax = fXmax; } |
8741815f | 96 | |
0edb62c4 | 97 | AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId, |
98 | Int_t dim=0); | |
99 | ||
100 | AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId, | |
101 | Int_t dim=0) const; | |
102 | ||
10eb3d17 | 103 | AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId, |
104 | Int_t manuChannel, Int_t dim=0); | |
8741815f | 105 | |
10eb3d17 | 106 | virtual AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId, |
107 | Int_t manuChannel, Int_t dim=0) const; | |
8741815f | 108 | |
e13620cd | 109 | /// Disable storing values at the channel level |
110 | virtual void DisableChannelLevel(); | |
111 | ||
112 | /// Whether we store values at the channel level or not | |
113 | virtual Bool_t IsChannelLevelEnabled() const { return fIsChannelLevelEnabled; } | |
114 | ||
0edb62c4 | 115 | /// Disable storing values at the manu level |
116 | virtual void DisableManuLevel(); | |
117 | ||
118 | /// Whether we store values at the manu level or not | |
119 | virtual Bool_t IsManuLevelEnabled() const { return fIsManuLevelEnabled; } | |
120 | ||
6c35944e | 121 | /// To allow merging of different objects |
122 | virtual Long64_t Merge(TCollection* list); | |
123 | ||
8741815f | 124 | private: |
125 | ||
0edb62c4 | 126 | void FillHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel, |
127 | Int_t dim, Double_t value); | |
8741815f | 128 | |
8741815f | 129 | AliMUONVCalibParam* BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const; |
130 | ||
131 | AliMUONVCalibParam* CreateBusPatchParam(Int_t busPatch) const; | |
132 | ||
133 | AliMUONVCalibParam* ChamberParam(Int_t chamberId, Bool_t create=kFALSE) const; | |
134 | ||
135 | AliMUONVCalibParam* CreateChamberParam(Int_t chamberId) const; | |
136 | ||
137 | AliMUONVCalibParam* ChannelParam(Int_t detElemId, Int_t manuId, | |
138 | AliMUONVCalibParam* external=0x0) const; | |
0145e89a | 139 | |
8741815f | 140 | AliMUONVCalibParam* DetectionElementParam(Int_t detElemId, Bool_t create=kFALSE) const; |
0145e89a | 141 | |
8741815f | 142 | AliMUONVCalibParam* CreateDetectionElementParam(Int_t detElemId) const; |
0145e89a | 143 | |
8741815f | 144 | AliMUONVCalibParam* ManuParam(Int_t detElemId, Int_t manuId, Bool_t create=kFALSE) const; |
0145e89a | 145 | |
8741815f | 146 | AliMUONVCalibParam* CreateManuParam(Int_t detElemInd, Int_t manuId) const; |
0145e89a | 147 | |
8741815f | 148 | AliMUONVCalibParam* PCBParam(Int_t detElemId, Int_t pcbIndex, Bool_t create=kFALSE) const; |
0145e89a | 149 | |
8741815f | 150 | AliMUONVCalibParam* CreatePCBParam(Int_t detElemId, Int_t pcbIndex) const; |
0145e89a | 151 | |
9016a84e | 152 | /// Index of the dimension containing the number of time an item was hit |
0145e89a | 153 | virtual Int_t IndexOfNumberDimension() const { return fDimension - 1; } |
154 | ||
9016a84e | 155 | /// Index of the dimension containing the occupancy number |
0145e89a | 156 | virtual Int_t IndexOfOccupancyDimension() const { return fDimension - 2; } |
157 | ||
10eb3d17 | 158 | /// Whether we have histograms for a given dimension, or not |
159 | virtual Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); } | |
160 | ||
e83120bd | 161 | Int_t DdlIdFromBusPatchId(Int_t buspatchid) const; |
162 | Int_t DdlIdFromDetElemId(Int_t detelemid) const; | |
163 | Int_t DdlIdFromChamberId(Int_t chamberid) const; | |
164 | ||
0145e89a | 165 | /// Not implemented |
166 | AliMUONTrackerData(const AliMUONTrackerData& rhs); | |
167 | /// Not implemented | |
168 | AliMUONTrackerData& operator=(const AliMUONTrackerData& rhs); | |
169 | ||
7b6684fe | 170 | AliMUONVCalibParam* CreateDouble(const AliMUONVCalibParam& param, Int_t detElemId, Int_t manuId) const; |
0145e89a | 171 | |
8741815f | 172 | Int_t GetParts(AliMUONVCalibParam* external, |
173 | AliMUONVCalibParam*& chamber, | |
174 | AliMUONVCalibParam*& de, | |
175 | AliMUONVCalibParam*& busPatch, | |
176 | AliMUONVCalibParam*& pcb, | |
177 | AliMUONVCalibParam*& manu, | |
178 | AliMUONVCalibParam*& channel, | |
179 | AliMpDetElement*& mpde); | |
180 | ||
0145e89a | 181 | /// Convert from external to internal index |
49419555 | 182 | Int_t External2Internal(Int_t index) const; |
0145e89a | 183 | |
0145e89a | 184 | void SetInternalDimensionName(Int_t index, const char* value); |
185 | ||
8741815f | 186 | void SetExternalDimensionName(Int_t index, const char* value); |
187 | ||
e83120bd | 188 | Double_t Value(const AliMUONVCalibParam& param, Int_t i, Int_t dim, Int_t ddlId) const; |
8741815f | 189 | |
190 | /// The number of values we actually *store* for each item | |
191 | Int_t Dimension() const { return fDimension; } | |
10eb3d17 | 192 | |
e83120bd | 193 | Bool_t InternalAdd(const AliMUONVStore& store, TArrayI* nevents, Bool_t replace); |
194 | ||
195 | void GetDEManu(const AliMUONVCalibParam& param, | |
196 | Int_t& detElemId, Int_t& manuId) const; | |
197 | ||
198 | void AddCalibParams(const AliMUONVCalibParam& src, AliMUONVCalibParam& dest) const; | |
199 | ||
200 | void Add2D(const AliMUONVStore& src, AliMUONVStore& dest) const; | |
201 | ||
202 | void Add1D(const AliMUONVStore& src, AliMUONVStore& dest) const; | |
203 | ||
0145e89a | 204 | private: |
1ffbeb9d | 205 | |
49419555 | 206 | Bool_t fIsSingleEvent; ///< whether we can deal with more than one event |
0145e89a | 207 | AliMUONVStore* fChannelValues; ///< the channel store |
208 | AliMUONVStore* fManuValues; ///< the manu store | |
209 | AliMUONVStore* fBusPatchValues; ///< the bus patch store | |
210 | AliMUONVStore* fDEValues; ///< the detection element store | |
211 | AliMUONVStore* fChamberValues; ///< the chamber store | |
212 | AliMUONVStore* fPCBValues; ///< the pcb store | |
213 | Int_t fDimension; ///< the dimension of the data | |
214 | Int_t fNevents; ///< the number of events treated | |
8741815f | 215 | TObjArray* fDimensionNames; ///< the names of the (internal) dimensions |
216 | TObjArray* fExternalDimensionNames; ///< the names of the external (i.e. original) dimensions | |
0145e89a | 217 | Int_t fExternalDimension; ///< number of interface values per item |
8741815f | 218 | /// whether we should histogram the dimension(s) |
219 | Int_t* fHistogramming; //[fExternalDimension] whether we should histogram the dimension(s) | |
0edb62c4 | 220 | AliMUONVStore* fHistos; ///< the lowest histograms we have |
10eb3d17 | 221 | Double_t fXmin; ///< min x value for histograms |
222 | Double_t fXmax; ///< max x value for histograms | |
0145e89a | 223 | static const Int_t fgkExtraDimension; ///< to hold extra information |
224 | static const Int_t fgkVirtualExtraDimension; ///< to give access to information not stored, but computed on the fly | |
113ad708 | 225 | Bool_t fIsChannelLevelEnabled; ///< whether we allow storing of channel (fChannelValues) values |
226 | Bool_t fIsManuLevelEnabled; ///< whether we allow storing of manu (fManuValues) values | |
e83120bd | 227 | Int_t fNofDDLs; ///< nof of DDLs we're dealing with |
ea49e931 | 228 | /// the number of events treated (per DDL) |
e83120bd | 229 | Int_t* fNofEventsPerDDL; //[fNofDDLs] the number of events treated (per DDL) |
230 | ||
231 | ClassDef(AliMUONTrackerData,7) // Implementation of AliMUONVTrackerData | |
0145e89a | 232 | }; |
233 | ||
234 | #endif |