]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTrackerData.h
Adding PiKP-only histograms and eliminating a number of switches where histograms...
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerData.h
index fac0d5390b6fb3a9fd196eb844546bc04f899c92..80b8566c1c0b8902ee04c69a0f9935fc737d3003 100644 (file)
@@ -20,6 +20,7 @@ class AliMUONSparseHisto;
 class AliMUONVCalibParam;
 class AliMUONVStore;
 class AliMpDetElement;
+class AliMUONRejectList;
 
 class AliMUONTrackerData : public AliMUONVTrackerData
 {
@@ -27,9 +28,21 @@ public:
   AliMUONTrackerData(const char* name="", const char* title="", 
                      Int_t dimension=0,
                      Bool_t issingleevent=kFALSE);
+  
+  AliMUONTrackerData(const char* name, const char* title,
+                     const AliMUONVStore& manuValues);
+
+  AliMUONTrackerData(const char* name, const char* title,
+                     const AliMUONVStore& deOrBpValues, Int_t val);
+
+  AliMUONTrackerData(const char* name, const char* title,
+                     const AliMUONRejectList& rejectList);
+
   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);
 
@@ -75,7 +88,7 @@ public:
   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;
 
@@ -92,6 +105,12 @@ public:
   
   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);
+
+  AliMUONSparseHisto* GetManuSparseHisto(Int_t detElemId, Int_t manuId, 
+                                         Int_t dim=0) const;
+  
   AliMUONSparseHisto* GetChannelSparseHisto(Int_t detElemId, Int_t manuId, 
                                             Int_t manuChannel, Int_t dim=0);
   
@@ -104,10 +123,31 @@ public:
        /// Whether we store values at the channel level or not
        virtual Bool_t IsChannelLevelEnabled() const { return fIsChannelLevelEnabled; }
 
+  /// 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; }
+  
+  /// Whether we store values at the bus patch level or not
+  virtual Bool_t IsBusPatchLevelEnabled() const { return fIsBustPatchLevelEnabled; }
+
+  /// Whether we store values at the PCB level or not
+  virtual Bool_t IsPCBLevelEnabled() const { return fIsPCBLevelEnabled; }
+
+  /// 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 BuildFromDEStore(const AliMUONVStore& deStore);
+
+  void BuildFromBPStore(const AliMUONVStore& bpStore);
+
+  void FillHisto(Int_t detElemId, Int_t manuId, Int_t manuChannel,
+                 Int_t dim, Double_t value);
 
   AliMUONVCalibParam* BusPatchParam(Int_t busPatch, Bool_t create=kFALSE) const;
 
@@ -118,7 +158,7 @@ private:
   AliMUONVCalibParam* CreateChamberParam(Int_t chamberId) const;
   
   AliMUONVCalibParam* ChannelParam(Int_t detElemId, Int_t manuId,
-                                   AliMUONVCalibParam* external=0x0) const;
+                                   const AliMUONVCalibParam* external=0x0) const;
 
   AliMUONVCalibParam* DetectionElementParam(Int_t detElemId, Bool_t create=kFALSE) const;
 
@@ -141,10 +181,10 @@ private:
   /// Whether we have histograms for a given dimension, or not
   virtual Bool_t IsHistogrammed(Int_t dim) const { return ( fHistogramming[dim] > 0 ); }
 
-  /// To allow merging of different objects
-  virtual Long64_t Merge(TCollection* list);
-
-private:
+  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
@@ -168,14 +208,29 @@ private:
 
   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);
+
+  void GetDEManu(const AliMUONVCalibParam& param,
+                  Int_t& detElemId, Int_t& manuId) const;
+  
+  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);
+  
+  static void DispatchValue(AliMUONVCalibParam& param, Int_t index, Double_t y, Double_t ey, Int_t nchannels);
+  
 private:
-    
-    Bool_t InternalAdd(const AliMUONVStore& store, Bool_t replace);
   
   Bool_t fIsSingleEvent; ///< whether we can deal with more than one event
   AliMUONVStore* fChannelValues; ///< the channel store
@@ -191,14 +246,20 @@ private:
   Int_t fExternalDimension; ///< number of interface values per item 
   /// 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
-  Bool_t fIsChannelLevelEnabled; //< whether we allow storing of channel (fChannelValues) values
-       
-  ClassDef(AliMUONTrackerData,5) // 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
+  Bool_t fIsBustPatchLevelEnabled; ///< whether we allow storing of bus patches (fBusPatchValues) values
+  Bool_t fIsPCBLevelEnabled; ///< whether we allow storing of PCB values (fPCBValues)
+  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,8) // Implementation of AliMUONVTrackerData
 };
 
 #endif