]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONPedestal.h
next50 trigger mask in AliHLTGlobalEsdConverterComponent
[u/mrichter/AliRoot.git] / MUON / AliMUONPedestal.h
1 #ifndef ALIMUONPEDESTAL_H
2 #define ALIMUONPEDESTAL_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
9 /// \ingroup calib
10 /// \class AliMUONPedestal
11 /// \brief Implementation of the pedestal computing
12 /// 
13 //  Author Alberto Baldisseri, JL Charvet 
14
15 #ifndef ROOT_TObject
16 #  include <TObject.h>
17 #endif
18 #ifndef ROOT_TString
19 #  include <TString.h>
20 #endif
21
22 class AliMUONVStore;
23
24 class TTimeStamp;
25 class TTree;
26 class TFile;
27
28 using std::ofstream;
29 using std::ostream;
30
31 class AliMUONPedestal : public TObject
32 {
33   public:
34     AliMUONPedestal();
35     AliMUONPedestal(TRootIOCtor* dummy);
36     virtual ~AliMUONPedestal();
37     
38     /// return the number of current events
39     void SetAliNCurrentEvents(Int_t events) {fNCurrentEvents = events;}
40     /// return the number of events
41     void SetAliNEvents(Int_t events) {fNEvents = events;}
42     /// return the Run number
43     void SetAliRunNumber(Int_t run) {fRunNumber = run;}
44     /// return the total number of channels (or pads)
45     void SetAliNChannel(Int_t nch) {fNChannel = nch;}
46     /// output .log file of DAs
47     void SetAlifilcout(ofstream* stream) {fFilcout = stream;}
48     /// return date and time
49     TTimeStamp* GetDate() const {return fDate;}
50     /// Count parity errors per Buspatch
51     AliMUONVStore* GetErrorBuspatchTable() const {return fErrorBuspatchTable;}
52     /// return the name of DAPedestal .root file
53     const char* GetHistoFileName() const;
54     /// load MuonTrk configuration from ascii dbfile
55     void LoadConfig(const char* dbfile);
56     /// sum pedestal values for mean and sigma determination
57     void MakePed(Int_t bp,Int_t manu,Int_t ch,Int_t charge);
58
59     /// set config flag
60     void SetconfigDA(Int_t ind) {fConfig = ind;}
61      /// set Histos flag
62     void SetHistos(Int_t ind) {fHistos = ind;}
63    /// set Nb of evt threshold to calculate pedestal
64     void SetnEvthreshold(Int_t ind) {fNEvthreshold = ind;}
65     /// set DA status (return code)
66     void SetStatusDA(Int_t ind) {fStatusDA = ind;}
67     /// get DA status (return code)
68     Int_t GetStatusDA() const {return fStatusDA;}
69     /// sorting flag
70     void SetnSorting(Int_t ind) {fSorting = ind;}
71     /// set specific  DA prefixname
72     void SetprefixDA(const char* folder) { fPrefixDA=folder;}
73      /// set specific LDC prefixname
74     void SetprefixLDC(const char* folder) { fPrefixLDC=folder;}
75    /// set the index of calibration runs
76     void SetAliIndex(Int_t ind) {fIndex = ind;}
77     /// Compute the pedestal data (mean, sigma)
78     void Finalize();
79     /// Create String to be put into file or AMORE DB
80     void MakeASCIIoutput(ostream& out) const;
81     /// Create Histograms
82     void CreateControlHistos();
83     /// Fill Histograms
84     void MakeControlHistos();
85
86     Int_t ADCMax() const { return 4095; }
87
88 protected:
89     //    Int_t fN; ///<
90     Int_t fNCurrentEvents; ///< Number of current events
91     Int_t fNEvthreshold; ///< Nbevt threshold (pedestal calculation)
92     Int_t fSorting; ///< sorting flag (pedestal values)
93     Int_t fNEvents; ///< Number of events
94     Int_t fRunNumber; ///< run number
95     Int_t fNChannel; ///< Nb of channels (pads)
96     Int_t fNManu; ///<  Nb of Manu
97     Int_t fNManuConfig; ///<  Nb of Manu in the current detector configuration
98     Int_t fConfig; ///< flag 1(0) for reading(or not) configuration ascii file
99     Int_t fStatusDA; ///< DA return code (0=OK)
100     Int_t fHistos; ///< flag for Histograms (0,1=standard, 2=ntuple with charge)
101     AliMUONVStore* fErrorBuspatchTable; ///< Table for buspatches with parity errors 
102     AliMUONVStore* fManuBuspatchTable; ///< Occupancy rate for each (buspatch, manu)
103     AliMUONVStore* fManuBPoutofconfigTable; ///< (buspatch, manu) out of config
104  
105     TTimeStamp* fDate; ///< date
106     ofstream* fFilcout; ///< .log output file
107     TString fHistoFileName; ///< .root histo file
108     AliMUONVStore* fPedestalStore; ///< data container:  (Pedmean,sigma) values for each (BP,manuId)
109     Int_t fIndex; ///< calibration run index
110     TString fPrefixDA; ///< specific DA prefixname
111     TString fPrefixLDC; ///< specific LDC prefixname
112     TFile* fHistoFile; ///< .root histo file
113     TTree* fTree ; ///< charge Tree
114
115   static const Int_t fgkADCMax; ///< max channel count
116   
117   private:
118     /// Not implemented
119     AliMUONPedestal(const AliMUONPedestal& rhs);
120     /// Not implemented
121     AliMUONPedestal& operator = (const AliMUONPedestal& rhs);
122
123   ClassDef(AliMUONPedestal,6) // Pedestal computing for DA
124 };
125
126 #endif