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