// $Id$
-/// \ingroup graphics
+/// \ingroup calib
/// \class AliMUONTrackerData
/// \brief Implementation of AliMUONVTrackerData
///
class AliMUONVCalibParam;
class AliMUONVStore;
class AliMpDetElement;
-class TH1;
class AliMUONTrackerData : public AliMUONVTrackerData
{
public:
AliMUONTrackerData(const char* name="", const char* title="",
Int_t dimension=0,
- Bool_t runnable=kTRUE);
+ Bool_t issingleevent=kFALSE);
+
+ AliMUONTrackerData(const char* name, const char* title,
+ const AliMUONVStore& manuValues);
+
virtual ~AliMUONTrackerData();
- virtual Bool_t Add(const AliMUONVStore& channelValues);
+ Bool_t Add(const AliMUONTrackerData& data);
+ virtual Bool_t Add(const AliMUONVStore& channelValues, TArrayI* nofEventsPerDDL=0x0);
+
+ virtual Bool_t Replace(const AliMUONVStore& channelValues);
+
virtual Double_t BusPatch(Int_t busPatchId, Int_t dim=0) const;
virtual Double_t Chamber(Int_t chamberId, Int_t dim=0) const;
virtual Bool_t HasPCB(Int_t detElemId, Int_t pcbIndex) const;
/// Whether we can be run
- virtual Bool_t IsRunnable() const { return fIsRunnable; }
+ virtual Bool_t IsSingleEvent() const { return fIsSingleEvent; }
virtual Double_t Manu(Int_t detElemId, Int_t manuId, Int_t dim=0) const;
/// Returns the number of dimensions (i.e. the number of values) each element has
virtual Int_t NumberOfDimensions() const;
+ /// The number of values we are inputting
+ virtual Int_t ExternalDimension() const { return fExternalDimension; }
+
+ /// Convert from internal to external dimension
+ virtual Int_t InternalToExternal(Int_t dim) const { return dim/2; }
+
/// Returns the number of events we have seen so far
- virtual Int_t NumberOfEvents() const { return fNevents; }
+ virtual Int_t NumberOfEvents(Int_t ddlNumber) const;
virtual Double_t PCB(Int_t detElemId, Int_t pcbIndex, Int_t dim=0) const;
Bool_t CanHistogram() const { return kTRUE; }
- void SetHistogramDimension(Int_t index, Bool_t value);
+ void MakeHistogramForDimension(Int_t index, Bool_t value, Double_t xmin=0.0, Double_t xmax=4096.0);
- TH1* CreateChannelHisto(Int_t detElemId, Int_t manuId,
- Int_t manuChannel, Int_t dim=0);
+ virtual void HistogramRange(Double_t& xmin, Double_t& xmax) const { xmin = fXmin; xmax = fXmax; }
+
+ AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId,
+ Int_t dim=0);
- TH1* CreateBusPatchHisto(Int_t busPatchId, Int_t dim=0);
+ AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId,
+ Int_t dim=0) const;
- TH1* CreateDEHisto(Int_t detElemId, Int_t dim=0);
+ AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
+ Int_t manuChannel, Int_t dim=0);
+
+ virtual AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId,
+ Int_t manuChannel, Int_t dim=0) const;
- TH1* CreateManuHisto(Int_t detElemId, Int_t manuId, Int_t dim=0);
+ /// Disable storing values at the channel level
+ virtual void DisableChannelLevel();
+
+ /// Whether we store values at the channel level or not
+ virtual Bool_t IsChannelLevelEnabled() const { return fIsChannelLevelEnabled; }
- TH1* CreatePCBHisto(Int_t detElemId, Int_t pcbIndex, Int_t dim=0);
+ /// Disable storing values at the manu level
+ virtual void DisableManuLevel();
+
+ /// Whether we store values at the manu level or not
+ virtual Bool_t IsManuLevelEnabled() const { return fIsManuLevelEnabled; }
- TH1* CreateChamberHisto(Int_t chamberId, Int_t dim=0);
+ /// To allow merging of different objects
+ virtual Long64_t Merge(TCollection* list);
+
+ Bool_t ExportAsASCIIOccupancyFile(const char* filename, Int_t runNumber) const;
private:
- void FillChannel(Int_t detElemId, Int_t manuId, Int_t manuChannel,
- Int_t dim, Double_t value);
+ void FillHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel,
+ Int_t dim, Double_t value);
- AliMUONSparseHisto* GetChannelHisto(Int_t detElemId, Int_t manuId,
- Int_t manuChannel, Int_t dim=0);
-
AliMUONVCalibParam* BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const;
AliMUONVCalibParam* CreateBusPatchParam(Int_t busPatch) const;
/// Index of the dimension containing the occupancy number
virtual Int_t IndexOfOccupancyDimension() const { return fDimension - 2; }
-private:
+ /// Whether we have histograms for a given dimension, or not
+ virtual Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); }
+
+ Int_t DdlIdFromBusPatchId(Int_t buspatchid) const;
+ Int_t DdlIdFromDetElemId(Int_t detelemid) const;
+ Int_t DdlIdFromChamberId(Int_t chamberid) const;
+
/// Not implemented
AliMUONTrackerData(const AliMUONTrackerData& rhs);
/// Not implemented
AliMUONTrackerData& operator=(const AliMUONTrackerData& rhs);
- void Add(TH1& h, const AliMUONSparseHisto& sh);
-
- void AddManuHisto(TH1& h, Int_t detElemId, Int_t manuId, Int_t dim);
-
- void AddBusPatchHisto(TH1& h, Int_t busPatchId, Int_t dim);
-
- void AddDEHisto(TH1& h, Int_t detElemId, Int_t dim);
-
- TH1* CreateHisto(const char* name, Int_t dim) const;
-
- AliMUONVCalibParam* CreateDouble(const AliMUONVCalibParam& param) const;
+ AliMUONVCalibParam* CreateDouble(const AliMUONVCalibParam& param, Int_t detElemId, Int_t manuId) const;
Int_t GetParts(AliMUONVCalibParam* external,
AliMUONVCalibParam*& chamber,
AliMpDetElement*& mpde);
/// Convert from external to internal index
- Int_t External2Internal(Int_t index) const { return index*2; }
+ Int_t External2Internal(Int_t index) const;
void SetInternalDimensionName(Int_t index, const char* value);
void SetExternalDimensionName(Int_t index, const char* value);
- Double_t Value(const AliMUONVCalibParam& param, Int_t i, Int_t dim) const;
+ Double_t Value(const AliMUONVCalibParam& param, Int_t i, Int_t dim, Int_t ddlId) const;
/// The number of values we actually *store* for each item
Int_t Dimension() const { return fDimension; }
+
+ Bool_t InternalAdd(const AliMUONVStore& store, TArrayI* nevents, Bool_t replace);
- /// The number of values we are inputting
- Int_t ExternalDimension() const { return fExternalDimension; }
+ void GetDEManu(const AliMUONVCalibParam& param,
+ Int_t& detElemId, Int_t& manuId) const;
- /// Whether we have histograms for a given dimension, or not
- Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); }
+ void AddCalibParams(const AliMUONVCalibParam& src, AliMUONVCalibParam& dest) const;
+
+ void Add2D(const AliMUONVStore& src, AliMUONVStore& dest) const;
+
+ void Add1D(const AliMUONVStore& src, AliMUONVStore& dest) const;
+
+ void AssertStores();
+
+ Bool_t UpdateNumberOfEvents(TArrayI* nevents);
private:
-
+
+ Bool_t fIsSingleEvent; ///< whether we can deal with more than one event
AliMUONVStore* fChannelValues; ///< the channel store
AliMUONVStore* fManuValues; ///< the manu store
AliMUONVStore* fBusPatchValues; ///< the bus patch store
TObjArray* fDimensionNames; ///< the names of the (internal) dimensions
TObjArray* fExternalDimensionNames; ///< the names of the external (i.e. original) dimensions
Int_t fExternalDimension; ///< number of interface values per item
- Bool_t fIsRunnable; ///< whether we can deal with more than one event
/// whether we should histogram the dimension(s)
Int_t* fHistogramming; //[fExternalDimension] whether we should histogram the dimension(s)
- AliMUONVStore* fChannelHistos; ///< the channel histograms
-
+ AliMUONVStore* fHistos; ///< the lowest histograms we have
+ Double_t fXmin; ///< min x value for histograms
+ Double_t fXmax; ///< max x value for histograms
static const Int_t fgkExtraDimension; ///< to hold extra information
static const Int_t fgkVirtualExtraDimension; ///< to give access to information not stored, but computed on the fly
-
- ClassDef(AliMUONTrackerData,2) // Implementation of AliMUONVTrackerData
+ Bool_t fIsChannelLevelEnabled; ///< whether we allow storing of channel (fChannelValues) values
+ Bool_t fIsManuLevelEnabled; ///< whether we allow storing of manu (fManuValues) values
+ Int_t fNofDDLs; ///< nof of DDLs we're dealing with
+ /// the number of events treated (per DDL)
+ Int_t* fNofEventsPerDDL; //[fNofDDLs] the number of events treated (per DDL)
+
+ ClassDef(AliMUONTrackerData,7) // Implementation of AliMUONVTrackerData
};
#endif