1 #ifndef ALIMUONTRACKERDATA_H
2 #define ALIMUONTRACKERDATA_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONTrackerData
11 /// \brief Implementation of AliMUONVTrackerData
13 // Author Laurent Aphecetche, Subatech
15 #ifndef ALIMUONVTRACKERDATA_H
16 # include "AliMUONVTrackerData.h"
19 class AliMUONSparseHisto;
20 class AliMUONVCalibParam;
22 class AliMpDetElement;
24 class AliMUONTrackerData : public AliMUONVTrackerData
27 AliMUONTrackerData(const char* name="", const char* title="",
29 Bool_t issingleevent=kFALSE);
30 virtual ~AliMUONTrackerData();
32 virtual Bool_t Add(const AliMUONVStore& channelValues);
34 virtual Bool_t Replace(const AliMUONVStore& channelValues);
36 virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const;
38 virtual Double_t Chamber(Int_t chamberId, Int_t dim=0) const;
40 virtual Double_t Channel(Int_t detElemId, Int_t manuId, Int_t manuChannel,
43 virtual void Clear(Option_t* opt="");
45 virtual Double_t Count(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
47 virtual Double_t DetectionElement(Int_t detElemId, Int_t dim=0) const;
49 virtual TString DimensionName(Int_t dim) const;
51 virtual TString ExternalDimensionName(Int_t dim) const;
53 virtual Bool_t HasChamber(Int_t chamberId) const;
55 virtual Bool_t HasBusPatch(Int_t busPatchId) const;
57 virtual Bool_t HasDetectionElement(Int_t detElemId) const;
59 virtual Bool_t HasManu(Int_t detElemId, Int_t manuId) const;
61 virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const;
63 /// Whether we can be run
64 virtual Bool_t IsSingleEvent() const { return fIsSingleEvent; }
66 virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const;
68 /// Returns the number of dimensions (i.e. the number of values) each element has
69 virtual Int_t NumberOfDimensions() const;
71 /// The number of values we are inputting
72 virtual Int_t ExternalDimension() const { return fExternalDimension; }
74 /// Convert from internal to external dimension
75 virtual Int_t InternalToExternal(Int_t dim) const { return dim/2; }
77 /// Returns the number of events we have seen so far
78 virtual Int_t NumberOfEvents() const { return fNevents; }
80 virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const;
84 /// Print, with option, all objects whose name matches wildcard
85 virtual void Print(Option_t* wildcard, Option_t* opt) const;
87 virtual void SetDimensionName(Int_t index, const char* value);
89 Bool_t CanHistogram() const { return kTRUE; }
91 void MakeHistogramForDimension(Int_t index, Bool_t value, Double_t xmin=0.0, Double_t xmax=4096.0);
93 virtual void HistogramRange(Double_t& xmin, Double_t& xmax) const { xmin = fXmin; xmax = fXmax; }
95 AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
96 Int_t manuChannel, Int_t dim=0);
98 virtual AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
99 Int_t manuChannel, Int_t dim=0) const;
101 /// Disable storing values at the channel level
102 virtual void DisableChannelLevel();
104 /// Whether we store values at the channel level or not
105 virtual Bool_t IsChannelLevelEnabled() const { return fIsChannelLevelEnabled; }
109 void FillChannel(Int_t detElemId, Int_t manuId, Int_t manuChannel,
110 Int_t dim, Double_t value);
112 AliMUONVCalibParam* BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const;
114 AliMUONVCalibParam* CreateBusPatchParam(Int_t busPatch) const;
116 AliMUONVCalibParam* ChamberParam(Int_t chamberId, Bool_t create=kFALSE) const;
118 AliMUONVCalibParam* CreateChamberParam(Int_t chamberId) const;
120 AliMUONVCalibParam* ChannelParam(Int_t detElemId, Int_t manuId,
121 AliMUONVCalibParam* external=0x0) const;
123 AliMUONVCalibParam* DetectionElementParam(Int_t detElemId, Bool_t create=kFALSE) const;
125 AliMUONVCalibParam* CreateDetectionElementParam(Int_t detElemId) const;
127 AliMUONVCalibParam* ManuParam(Int_t detElemId, Int_t manuId, Bool_t create=kFALSE) const;
129 AliMUONVCalibParam* CreateManuParam(Int_t detElemInd, Int_t manuId) const;
131 AliMUONVCalibParam* PCBParam(Int_t detElemId, Int_t pcbIndex, Bool_t create=kFALSE) const;
133 AliMUONVCalibParam* CreatePCBParam(Int_t detElemId, Int_t pcbIndex) const;
135 /// Index of the dimension containing the number of time an item was hit
136 virtual Int_t IndexOfNumberDimension() const { return fDimension - 1; }
138 /// Index of the dimension containing the occupancy number
139 virtual Int_t IndexOfOccupancyDimension() const { return fDimension - 2; }
141 /// Whether we have histograms for a given dimension, or not
142 virtual Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); }
144 /// To allow merging of different objects
145 virtual Long64_t Merge(TCollection* list);
149 AliMUONTrackerData(const AliMUONTrackerData& rhs);
151 AliMUONTrackerData& operator=(const AliMUONTrackerData& rhs);
153 AliMUONVCalibParam* CreateDouble(const AliMUONVCalibParam& param, Int_t detElemId, Int_t manuId) const;
155 Int_t GetParts(AliMUONVCalibParam* external,
156 AliMUONVCalibParam*& chamber,
157 AliMUONVCalibParam*& de,
158 AliMUONVCalibParam*& busPatch,
159 AliMUONVCalibParam*& pcb,
160 AliMUONVCalibParam*& manu,
161 AliMUONVCalibParam*& channel,
162 AliMpDetElement*& mpde);
164 /// Convert from external to internal index
165 Int_t External2Internal(Int_t index) const;
167 void SetInternalDimensionName(Int_t index, const char* value);
169 void SetExternalDimensionName(Int_t index, const char* value);
171 Double_t Value(const AliMUONVCalibParam& param, Int_t i, Int_t dim) const;
173 /// The number of values we actually *store* for each item
174 Int_t Dimension() const { return fDimension; }
178 Bool_t InternalAdd(const AliMUONVStore& store, Bool_t replace);
180 Bool_t fIsSingleEvent; ///< whether we can deal with more than one event
181 AliMUONVStore* fChannelValues; ///< the channel store
182 AliMUONVStore* fManuValues; ///< the manu store
183 AliMUONVStore* fBusPatchValues; ///< the bus patch store
184 AliMUONVStore* fDEValues; ///< the detection element store
185 AliMUONVStore* fChamberValues; ///< the chamber store
186 AliMUONVStore* fPCBValues; ///< the pcb store
187 Int_t fDimension; ///< the dimension of the data
188 Int_t fNevents; ///< the number of events treated
189 TObjArray* fDimensionNames; ///< the names of the (internal) dimensions
190 TObjArray* fExternalDimensionNames; ///< the names of the external (i.e. original) dimensions
191 Int_t fExternalDimension; ///< number of interface values per item
192 /// whether we should histogram the dimension(s)
193 Int_t* fHistogramming; //[fExternalDimension] whether we should histogram the dimension(s)
194 AliMUONVStore* fChannelHistos; ///< the channel histograms
195 Double_t fXmin; ///< min x value for histograms
196 Double_t fXmax; ///< max x value for histograms
197 static const Int_t fgkExtraDimension; ///< to hold extra information
198 static const Int_t fgkVirtualExtraDimension; ///< to give access to information not stored, but computed on the fly
199 Bool_t fIsChannelLevelEnabled; //< whether we allow storing of channel (fChannelValues) values
201 ClassDef(AliMUONTrackerData,5) // Implementation of AliMUONVTrackerData