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