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