AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTrackerData.h
Go to the documentation of this file.
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 
13 // Author Laurent Aphecetche, Subatech
14 
15 #ifndef ALIMUONVTRACKERDATA_H
16 # include "AliMUONVTrackerData.h"
17 #endif
18 
19 class AliMUONSparseHisto;
20 class AliMUONVCalibParam;
21 class AliMUONVStore;
22 class AliMpDetElement;
23 class AliMUONRejectList;
24 
26 {
27 public:
28  AliMUONTrackerData(const char* name="", const char* title="",
29  Int_t dimension=0,
30  Bool_t issingleevent=kFALSE);
31 
32  AliMUONTrackerData(const char* name, const char* title,
33  const AliMUONVStore& manuValues);
34 
35  AliMUONTrackerData(const char* name, const char* title,
36  const AliMUONVStore& deOrBpValues, Int_t val);
37 
38  AliMUONTrackerData(const char* name, const char* title,
39  const AliMUONRejectList& rejectList);
40 
41  virtual ~AliMUONTrackerData();
42 
43  Bool_t Add(const AliMUONTrackerData& data);
44 
45  virtual Bool_t Add(const AliMUONVStore& channelValues, TArrayI* nofEventsPerDDL=0x0);
46 
47  virtual Bool_t Replace(const AliMUONVStore& channelValues);
48 
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  enum EDiffType
59  {
64  kAll = 5
65  };
66 
68  const AliMUONVTrackerData& d2,
69  const char* outname,
70  Double_t(*diff)(Double_t,Double_t));
71 
73  const AliMUONVTrackerData& d2,
74  const char* outnamebase,
76 
77  virtual Double_t Count(Int_t detElemId, Int_t manuId, Int_t manuChannel) const;
78 
79  virtual Double_t DetectionElement(Int_t detElemId, Int_t dim=0) const;
80 
81  virtual TString DimensionName(Int_t dim) const;
82 
83  virtual TString ExternalDimensionName(Int_t dim) const;
84 
85  virtual Bool_t HasChamber(Int_t chamberId) const;
86 
87  virtual Bool_t HasBusPatch(Int_t busPatchId) const;
88 
89  virtual Bool_t HasDetectionElement(Int_t detElemId) const;
90 
91  virtual Bool_t HasManu(Int_t detElemId, Int_t manuId) const;
92 
93  virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const;
94 
96  virtual Bool_t IsSingleEvent() const { return fIsSingleEvent; }
97 
98  virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const;
99 
101  virtual Int_t NumberOfDimensions() const;
102 
104  virtual Int_t ExternalDimension() const { return fExternalDimension; }
105 
107  virtual Int_t InternalToExternal(Int_t dim) const { return dim/2; }
108 
110  virtual Int_t NumberOfEvents(Int_t ddlNumber) const;
111 
112  virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const;
113 
114  using TObject::Print;
115 
117  virtual void Print(Option_t* wildcard, Option_t* opt) const;
118 
119  virtual void SetDimensionName(Int_t index, const char* value);
120 
121  Bool_t CanHistogram() const { return kTRUE; }
122 
123  void MakeHistogramForDimension(Int_t index, Bool_t value, Double_t xmin=0.0, Double_t xmax=4096.0);
124 
125  virtual void HistogramRange(Double_t& xmin, Double_t& xmax) const { xmin = fXmin; xmax = fXmax; }
126 
127  AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId,
128  Int_t dim=0);
129 
130  AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId,
131  Int_t dim=0) const;
132 
133  AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
134  Int_t manuChannel, Int_t dim=0);
135 
136  virtual AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
137  Int_t manuChannel, Int_t dim=0) const;
138 
140  virtual void DisableChannelLevel();
141 
143  virtual Bool_t IsChannelLevelEnabled() const { return fIsChannelLevelEnabled; }
144 
146  virtual void DisableManuLevel();
147 
149  virtual Bool_t IsManuLevelEnabled() const { return fIsManuLevelEnabled; }
150 
152  virtual Bool_t IsBusPatchLevelEnabled() const { return fIsBustPatchLevelEnabled; }
153 
155  virtual Bool_t IsPCBLevelEnabled() const { return fIsPCBLevelEnabled; }
156 
158  virtual Long64_t Merge(TCollection* list);
159 
160  Bool_t ExportAsASCIIOccupancyFile(const char* filename, Int_t runNumber) const;
161 
162 private:
163 
164  void BuildFromDEStore(const AliMUONVStore& deStore);
165 
166  void BuildFromBPStore(const AliMUONVStore& bpStore);
167 
168  void FillHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel,
169  Int_t dim, Double_t value);
170 
171  AliMUONVCalibParam* BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const;
172 
173  AliMUONVCalibParam* CreateBusPatchParam(Int_t busPatch) const;
174 
175  AliMUONVCalibParam* ChamberParam(Int_t chamberId, Bool_t create=kFALSE) const;
176 
177  AliMUONVCalibParam* CreateChamberParam(Int_t chamberId) const;
178 
179  AliMUONVCalibParam* ChannelParam(Int_t detElemId, Int_t manuId,
180  const AliMUONVCalibParam* external=0x0) const;
181 
182  AliMUONVCalibParam* DetectionElementParam(Int_t detElemId, Bool_t create=kFALSE) const;
183 
184  AliMUONVCalibParam* CreateDetectionElementParam(Int_t detElemId) const;
185 
186  AliMUONVCalibParam* ManuParam(Int_t detElemId, Int_t manuId, Bool_t create=kFALSE) const;
187 
188  AliMUONVCalibParam* CreateManuParam(Int_t detElemInd, Int_t manuId) const;
189 
190  AliMUONVCalibParam* PCBParam(Int_t detElemId, Int_t pcbIndex, Bool_t create=kFALSE) const;
191 
192  AliMUONVCalibParam* CreatePCBParam(Int_t detElemId, Int_t pcbIndex) const;
193 
195  virtual Int_t IndexOfNumberDimension() const { return fDimension - 1; }
196 
198  virtual Int_t IndexOfOccupancyDimension() const { return fDimension - 2; }
199 
201  virtual Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); }
202 
203  Int_t DdlIdFromBusPatchId(Int_t buspatchid) const;
204  Int_t DdlIdFromDetElemId(Int_t detelemid) const;
205  Int_t DdlIdFromChamberId(Int_t chamberid) const;
206 
211 
212  AliMUONVCalibParam* CreateDouble(const AliMUONVCalibParam& param, Int_t detElemId, Int_t manuId) const;
213 
214  Int_t GetParts(AliMUONVCalibParam* external,
215  AliMUONVCalibParam*& chamber,
216  AliMUONVCalibParam*& de,
217  AliMUONVCalibParam*& busPatch,
218  AliMUONVCalibParam*& pcb,
219  AliMUONVCalibParam*& manu,
220  AliMUONVCalibParam*& channel,
221  AliMpDetElement*& mpde);
222 
224  Int_t External2Internal(Int_t index) const;
225 
226  void SetInternalDimensionName(Int_t index, const char* value);
227 
228  void SetExternalDimensionName(Int_t index, const char* value);
229 
230  Double_t Value(const AliMUONVCalibParam& param, Int_t i, Int_t dim, Int_t ddlId) const;
231 
233  Int_t Dimension() const { return fDimension; }
234 
235  Bool_t InternalAdd(const AliMUONVStore& store, TArrayI* nevents);
236 
237  void GetDEManu(const AliMUONVCalibParam& param,
238  Int_t& detElemId, Int_t& manuId) const;
239 
240  void AddCalibParams(const AliMUONVCalibParam& src, AliMUONVCalibParam& dest) const;
241 
242  void Add2D(const AliMUONVStore& src, AliMUONVStore& dest) const;
243 
244  void Add1D(const AliMUONVStore& src, AliMUONVStore& dest) const;
245 
246  void AssertStores();
247 
248  Bool_t UpdateNumberOfEvents(TArrayI* nevents);
249 
250  static void DispatchValue(AliMUONVCalibParam& param, Int_t index, Double_t y, Double_t ey, Int_t nchannels);
251 
252 private:
253 
254  Bool_t fIsSingleEvent;
261  Int_t fDimension;
262  Int_t fNevents;
266  Int_t* fHistogramming; //[fExternalDimension] whether we should histogram the dimension(s)
269  Double_t fXmin;
270  Double_t fXmax;
271  static const Int_t fgkExtraDimension;
272  static const Int_t fgkVirtualExtraDimension;
277  Int_t fNofDDLs;
278  Int_t* fNofEventsPerDDL; //[fNofDDLs] the number of events treated (per DDL)
280 
281  ClassDef(AliMUONTrackerData,8) // Implementation of AliMUONVTrackerData
282 };
283 
284 #endif
Implementation of AliMUONVTrackerData.
virtual TString ExternalDimensionName(Int_t dim) const
Get the name of a given (external) dimension.
Bool_t fIsSingleEvent
whether we can deal with more than one event
virtual Int_t NumberOfEvents(Int_t ddlNumber) const
Returns the number of events we have seen so far.
Bool_t fIsManuLevelEnabled
whether we allow storing of manu (fManuValues) values
Int_t External2Internal(Int_t index) const
Convert from external to internal index.
Double_t fXmin
min x value for histograms
virtual Double_t Channel(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t dim=0) const
Get the value for a given channel and given dimension.
virtual Int_t IndexOfOccupancyDimension() const
Index of the dimension containing the occupancy number.
#define TObjArray
Int_t DdlIdFromBusPatchId(Int_t buspatchid) const
void SetExternalDimensionName(Int_t index, const char *value)
AliMUONVCalibParam * CreatePCBParam(Int_t detElemId, Int_t pcbIndex) const
Bool_t UpdateNumberOfEvents(TArrayI *nevents)
Int_t fDimension
the dimension of the data
virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const
Get the value for a given buspatch and given dimension.
virtual Bool_t IsManuLevelEnabled() const
Whether we store values at the manu level or not.
AliMUONVStore * fHistos
the lowest histograms we have
AliMUONVStore * fBusPatchValues
the bus patch store
AliMUONVCalibParam * ChannelParam(Int_t detElemId, Int_t manuId, const AliMUONVCalibParam *external=0x0) const
virtual void SetDimensionName(Int_t index, const char *value)
Set the name of a given dimension.
void BuildFromBPStore(const AliMUONVStore &bpStore)
Int_t * fHistogramming
whether we should histogram the dimension(s)
TObjArray * fExternalDimensionNames
the names of the external (i.e. original) dimensions
virtual Bool_t HasChamber(Int_t chamberId) const
Whether we have data for a given chamber.
void Add2D(const AliMUONVStore &src, AliMUONVStore &dest) const
virtual Bool_t Replace(const AliMUONVStore &channelValues)
Replace values.
AliMUONVCalibParam * CreateDouble(const AliMUONVCalibParam &param, Int_t detElemId, Int_t manuId) const
Double_t Value(const AliMUONVCalibParam &param, Int_t i, Int_t dim, Int_t ddlId) const
void BuildFromDEStore(const AliMUONVStore &deStore)
virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const
Whether we have data for a given PCB.
Int_t Dimension() const
The number of values we actually store for each item.
The class defines the electronics properties of detection element.
AliMUONVCalibParam * CreateChamberParam(Int_t chamberId) const
AliMUONVStore * fChamberValues
the chamber store
void Print(const char *method, TStopwatch &timer, Int_t n)
AliMUONVStore * fPCBValues
the pcb store
All four differences at once.
virtual Bool_t HasBusPatch(Int_t busPatchId) const
Whether we have data for a given buspath.
Container of calibration values for a given number of channels.
virtual void Print(Option_t *wildcard, Option_t *opt) const
Print, with option, all objects whose name matches wildcard.
virtual void DisableManuLevel()
Disable storing values at the manu level.
virtual TString DimensionName(Int_t dim) const
Get the name of a given (internal) dimension.
virtual Bool_t IsSingleEvent() const
Whether we can be run.
virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const
Get the value for a given PCDB and given dimension.
TObjArray * fDimensionNames
the names of the (internal) dimensions
virtual Bool_t IsPCBLevelEnabled() const
Whether we store values at the PCB level or not.
void SetInternalDimensionName(Int_t index, const char *value)
Bool_t fIsBustPatchLevelEnabled
whether we allow storing of bus patches (fBusPatchValues) values
AliMUONTrackerData & operator=(const AliMUONTrackerData &rhs)
Not implemented.
virtual Double_t Chamber(Int_t chamberId, Int_t dim=0) const
Get the value for a given chamber and given dimension.
virtual Bool_t IsHistogrammed(Int_t dim) const
Whether we have histograms for a given dimension, or not.
void AddCalibParams(const AliMUONVCalibParam &src, AliMUONVCalibParam &dest) const
Int_t DdlIdFromDetElemId(Int_t detelemid) const
AliMUONVCalibParam * CreateBusPatchParam(Int_t busPatch) const
virtual Int_t InternalToExternal(Int_t dim) const
Convert from internal to external dimension.
Int_t DdlIdFromChamberId(Int_t chamberid) const
Int_t GetParts(AliMUONVCalibParam *external, AliMUONVCalibParam *&chamber, AliMUONVCalibParam *&de, AliMUONVCalibParam *&busPatch, AliMUONVCalibParam *&pcb, AliMUONVCalibParam *&manu, AliMUONVCalibParam *&channel, AliMpDetElement *&mpde)
virtual Int_t IndexOfNumberDimension() const
Index of the dimension containing the number of time an item was hit.
virtual Double_t DetectionElement(Int_t detElemId, Int_t dim=0) const
Get the value for a given DE and given dimension.
virtual void DisableChannelLevel()
Disable storing values at the channel level.
Bool_t CanHistogram() const
Whether or not we can make histograms.
AliMUONVCalibParam * BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const
A very memory compact histogram to hold some tracker distributions.
virtual Double_t Count(Int_t detElemId, Int_t manuId, Int_t manuChannel) const
Get the number of times a given channel was hit.
void MakeHistogramForDimension(Int_t index, Bool_t value, Double_t xmin=0.0, Double_t xmax=4096.0)
Select a dimension to be histogrammed (if CanHistogram==kTRUE) only.
AliMUONVStore * fChannelValues
the channel store
AliMUONVStore * fDEValues
the detection element store
Bool_t Add(const AliMUONTrackerData &data)
void Add1D(const AliMUONVStore &src, AliMUONVStore &dest) const
virtual Bool_t HasManu(Int_t detElemId, Int_t manuId) const
Whether we have data for a given manu.
static void DispatchValue(AliMUONVCalibParam &param, Int_t index, Double_t y, Double_t ey, Int_t nchannels)
void FillHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t dim, Double_t value)
Double_t fXmax
max x value for histograms
AliMUONVCalibParam * DetectionElementParam(Int_t detElemId, Bool_t create=kFALSE) const
virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const
Get the value for a given manu and given dimension.
static const Int_t fgkExtraDimension
to hold extra information
AliMUONVCalibParam * CreateDetectionElementParam(Int_t detElemId) const
Int_t fNevents
the number of events treated
virtual Int_t NumberOfDimensions() const
Returns the number of dimensions (i.e. the number of values) each element has.
virtual Bool_t HasDetectionElement(Int_t detElemId) const
Whether we have data for a given detection element.
AliMUONVCalibParam * CreateManuParam(Int_t detElemInd, Int_t manuId) const
static AliMUONVTrackerData * CompareData(const AliMUONVTrackerData &d1, const AliMUONVTrackerData &d2, const char *outname, Double_t(*diff)(Double_t, Double_t))
Object to hold the list of elements we want to reject from the reconstruction.
virtual void Clear(Option_t *opt="")
Reset the data.
virtual Int_t ExternalDimension() const
The number of values we are inputting.
virtual Bool_t IsBusPatchLevelEnabled() const
Whether we store values at the bus patch level or not.
virtual Bool_t IsChannelLevelEnabled() const
Whether we store values at the channel level or not.
AliMUONVCalibParam * ManuParam(Int_t detElemId, Int_t manuId, Bool_t create=kFALSE) const
AliMUONSparseHisto * GetManuSparseHisto(Int_t detElemId, Int_t manuId, Int_t dim=0)
virtual Long64_t Merge(TCollection *list)
To allow merging of different objects.
Bool_t InternalAdd(const AliMUONVStore &store, TArrayI *nevents)
Bool_t ExportAsASCIIOccupancyFile(const char *filename, Int_t runNumber) const
Int_t * fNofEventsPerDDL
the number of events treated (per DDL)
Base class for MUON data stores.
Definition: AliMUONVStore.h:22
void GetDEManu(const AliMUONVCalibParam &param, Int_t &detElemId, Int_t &manuId) const
static const Int_t fgkVirtualExtraDimension
to give access to information not stored, but computed on the fly
AliMUONVCalibParam * ChamberParam(Int_t chamberId, Bool_t create=kFALSE) const
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
AliMUONSparseHisto * GetChannelSparseHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel, Int_t dim=0)
AliMUONVStore * fManuValues
the manu store
AliMUONTrackerData(const char *name="", const char *title="", Int_t dimension=0, Bool_t issingleevent=kFALSE)
virtual void HistogramRange(Double_t &xmin, Double_t &xmax) const
Get histogram range.
Bool_t fIsPCBLevelEnabled
whether we allow storing of PCB values (fPCBValues)
AliMUONVCalibParam * PCBParam(Int_t detElemId, Int_t pcbIndex, Bool_t create=kFALSE) const
Bool_t fIsChannelLevelEnabled
whether we allow storing of channel (fChannelValues) values