]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONPedestal.h
Fixed memory leak
[u/mrichter/AliRoot.git] / MUON / AliMUONPedestal.h
index 73b2351c7695786178158b18d28f93f3e8b1af8f..d0023b5b279e4c2812f0a66d7760ea48eaa99461 100644 (file)
 /// 
 //  Author Alberto Baldisseri, JL Charvet 
 
-#include <TObject.h>
-
-#include "AliMpConstants.h"
+#ifndef ROOT_TObject
+#  include <TObject.h>
+#endif
+#ifndef ROOT_TString
+#  include <TString.h>
+#endif
 
 class AliMUONVStore;
 
 class TTimeStamp;
+class TTree;
+class TFile;
 
-// global variables
-const Int_t kNChannels = AliMpConstants::ManuNofChannels();
-const Int_t kADCMax    = 4095;
+using std::ofstream;
+using std::ostream;
 
 class AliMUONPedestal : public TObject
 {
   public:
     AliMUONPedestal();
+    AliMUONPedestal(TRootIOCtor* dummy);
     virtual ~AliMUONPedestal();
     
+    /// return the number of current events
+    void SetAliNCurrentEvents(Int_t events) {fNCurrentEvents = events;}
     /// return the number of events
     void SetAliNEvents(Int_t events) {fNEvents = events;}
     /// return the Run number
@@ -39,55 +46,81 @@ class AliMUONPedestal : public TObject
     /// output .log file of DAs
     void SetAlifilcout(ofstream* stream) {fFilcout = stream;}
     /// return date and time
-    TTimeStamp* GetDate() {return fDate;}
+    TTimeStamp* GetDate() const {return fDate;}
     /// Count parity errors per Buspatch
-    AliMUONVStore* GetErrorBuspatchTable() {return fErrorBuspatchTable;}
+    AliMUONVStore* GetErrorBuspatchTable() const {return fErrorBuspatchTable;}
     /// return the name of DAPedestal .root file
-    Char_t* GetHistoFileName() {return fHistoFileName;}
+    const char* GetHistoFileName() const;
     /// load MuonTrk configuration from ascii dbfile
-    void Load_config(char* dbfile);
+    void LoadConfig(const char* dbfile);
     /// sum pedestal values for mean and sigma determination
     void MakePed(Int_t bp,Int_t manu,Int_t ch,Int_t charge);
 
     /// set config flag
     void SetconfigDA(Int_t ind) {fConfig = ind;}
+     /// set Histos flag
+    void SetHistos(Int_t ind) {fHistos = ind;}
+   /// set Nb of evt threshold to calculate pedestal
+    void SetnEvthreshold(Int_t ind) {fNEvthreshold = ind;}
+    /// set DA status (return code)
+    void SetStatusDA(Int_t ind) {fStatusDA = ind;}
+    /// get DA status (return code)
+    Int_t GetStatusDA() const {return fStatusDA;}
+    /// sorting flag
+    void SetnSorting(Int_t ind) {fSorting = ind;}
     /// set specific  DA prefixname
-    void SetprefixDA(char* folder) {sprintf(fprefixDA,"%s",folder);}
-    /// set the index of calibration runs
+    void SetprefixDA(const char* folder) { fPrefixDA=folder;}
+     /// set specific LDC prefixname
+    void SetprefixLDC(const char* folder) { fPrefixLDC=folder;}
+   /// set the index of calibration runs
     void SetAliIndex(Int_t ind) {fIndex = ind;}
     /// Compute the pedestal data (mean, sigma)
     void Finalize();
     /// Create String to be put into file or AMORE DB
     void MakeASCIIoutput(ostream& out) const;
+    /// Create Histograms
+    void CreateControlHistos();
     /// Fill Histograms
     void MakeControlHistos();
 
-  protected:
-    Int_t fN; ///<
+    Int_t ADCMax() const { return 4095; }
+
+protected:
+    //    Int_t fN; ///<
+    Int_t fNCurrentEvents; ///< Number of current events
+    Int_t fNEvthreshold; ///< Nbevt threshold (pedestal calculation)
+    Int_t fSorting; ///< sorting flag (pedestal values)
     Int_t fNEvents; ///< Number of events
     Int_t fRunNumber; ///< run number
     Int_t fNChannel; ///< Nb of channels (pads)
     Int_t fNManu; ///<  Nb of Manu
-    Int_t fNManu_config; ///<  Nb of Manu in the current detector configuration
+    Int_t fNManuConfig; ///<  Nb of Manu in the current detector configuration
     Int_t fConfig; ///< flag 1(0) for reading(or not) configuration ascii file
+    Int_t fStatusDA; ///< DA return code (0=OK)
+    Int_t fHistos; ///< flag for Histograms (0,1=standard, 2=ntuple with charge)
     AliMUONVStore* fErrorBuspatchTable; ///< Table for buspatches with parity errors 
     AliMUONVStore* fManuBuspatchTable; ///< Occupancy rate for each (buspatch, manu)
     AliMUONVStore* fManuBPoutofconfigTable; ///< (buspatch, manu) out of config
  
     TTimeStamp* fDate; ///< date
     ofstream* fFilcout; ///< .log output file
-    Char_t fHistoFileName[256]; ///< .root histo file
-    AliMUONVStore* fPedestalStore; ///< 
+    TString fHistoFileName; ///< .root histo file
+    AliMUONVStore* fPedestalStore; ///< data container:  (Pedmean,sigma) values for each (BP,manuId)
     Int_t fIndex; ///< calibration run index
-    Char_t fprefixDA[256]; ///< specific DA prefixname
+    TString fPrefixDA; ///< specific DA prefixname
+    TString fPrefixLDC; ///< specific LDC prefixname
+    TFile* fHistoFile; ///< .root histo file
+    TTree* fTree ; ///< charge Tree
 
+  static const Int_t fgkADCMax; ///< max channel count
+  
   private:
     /// Not implemented
     AliMUONPedestal(const AliMUONPedestal& rhs);
     /// Not implemented
     AliMUONPedestal& operator = (const AliMUONPedestal& rhs);
 
-  ClassDef(AliMUONPedestal,3) // 
+  ClassDef(AliMUONPedestal,6) // Pedestal computing for DA
 };
 
 #endif