Line data Source code
1 : #ifndef AliHMPIDCalib_h
2 : #define AliHMPIDCalib_h
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : // Class of HMPID to manage digits ---> pads
7 : //.
8 : //.
9 : //.
10 :
11 : //#include "TTreePlayer.h"
12 : //#include <TTree.h>
13 : #include <TH1.h>
14 : #include <TH2.h>
15 : //#include <TH1S.h>
16 : #include <TMath.h>
17 : #include <TFile.h>
18 : #include <TString.h>
19 : #include <THnSparse.h>
20 : #include "AliHMPIDParam.h"
21 : #include "AliHMPIDRawStream.h"
22 :
23 : class TFile;
24 : class AliHMPIDCalib: public TObject {
25 :
26 :
27 : public:
28 : AliHMPIDCalib();
29 : virtual ~AliHMPIDCalib();
30 : void Init();
31 : void FillPedestal(Int_t pad,Int_t q); //absolute pad number and the charge of the pad
32 : void FillErrors(Int_t nDDL,Int_t nErrType, Int_t nErr); //Fill the errors from RawStream
33 : void FillDDLCnt(Int_t iddl,Int_t inDDL, Int_t outDDL); //Fill the errors from RawStream
34 : Bool_t CalcPedestal(Int_t nDDL, Char_t* name, Char_t *name2,Int_t nEv); //number of the DDL, name of the output file and the number of events processed
35 :
36 : Bool_t WriteErrors(Int_t nDDL, Char_t* name, Int_t nEv); //number of the DDL, name of the output file and the number of events processed
37 : void SetRunParams(ULong_t runNum,Int_t timeStamp, Int_t ldcId); //Set Run Parameters such as Run Number, TimeStamp, LDCid
38 0 : void SetSigCut(Int_t nSigCut) { fSigCut=nSigCut;} //Set Sigma Cuts from Setter
39 : void SetSigCutFromFile(TString name); //Set Sigma Cuts from File
40 : void SetDeadChannelMapFromFile(TString name);
41 0 : Bool_t GetSelectedDDL() const {return fSelectDDL;} //Set wether ADC histos of pads are written or not
42 0 : TH2F *GetPedMeanMap(Int_t iDDL) {return fPedMeanMap[iDDL];} //Get the pedestal mean map for a DDL to send to AMORE
43 0 : TH2F *GetPedSigMap(Int_t iDDL) {return fPedSigMap[iDDL];} //Get the pedestal sigma map for a DDL to send to AMORE
44 0 : TH1F *GetPedMean(Int_t iChFee) {return f1DPedMean[iChFee];} //Get the pedestal mean map for a FEE channel to send to AMORE
45 0 : TH1F *GetPedSigma(Int_t iChFee) {return f1DPedSigma[iChFee];} //Get the pedestal Sigma map for a FEE channel to send to AMORE
46 0 : THnSparse *GetDeadMap() {return fDeadMap;} //Get the masked channel map from the DAQ database
47 0 : Int_t GetNumMaskedPads() {return fNumMaskedPads;} //Get the number of masked channels
48 0 : Int_t GetNumDeadPads() {return fNumDeadPads;} //Get the number of masked channels
49 : protected:
50 :
51 : Bool_t *faddl; //check is ddl is filled
52 : Float_t ****fsq; //Sum of pad Q
53 : Float_t ****fsq2; //Sum of pad Q^2
54 : Int_t ****fnpc; //# of the pad was called with non zero charge
55 : Int_t ****fpedQ0; //Check how many times a pad gives 0 charge in pedestal runs
56 : Int_t **fErr; // Store the numner of errors for a given error type and a given DDL
57 : TH1I **fPadAdc; //Charge distribution for pads
58 : Bool_t *fIsPad; //Check if the ADC histo for the pad is booked or not
59 : TFile *fFile; //ADC histo output file (one per LDC)
60 : UInt_t fLdcId; //Ldc ID
61 : UInt_t fTimeStamp; //Time Stamp
62 : Int_t fRunNum; //Run Number
63 : Int_t fSigCut; //n. of pedestal distribution sigmas used to create zero suppresion table
64 : Int_t *fnDDLInStream; // if the DDL is in the raw data
65 : Int_t *fnDDLOutStream; // if the DDL is in the raw data
66 : Bool_t fLargeHisto; //Default is kFALSE.if kTRUE then write large pad histograms with 4093 bins!!!! Only if you have 2GB of RAM!!!
67 : Int_t fSelectDDL; //Select the DDL to write for the in the large histograms. Only ONE at one time!
68 : THnSparse *fDeadMap; //Dead Channel Map
69 : TH2F **fPedMeanMap; //2D mean pedestal map to export to AMORE
70 : TH2F **fPedSigMap; //2D pedestal sigma map to export to AMORE
71 : TH1F **f1DPedMean; //1D mean pedestal map to export to AMORE
72 : TH1F **f1DPedSigma; //1D pedestal sigma map to export to AMORE
73 : Int_t fNumMaskedPads; //Number of masked pads
74 : Int_t fNumDeadPads; //Number of currently dead channels
75 :
76 : private:
77 :
78 : AliHMPIDCalib(const AliHMPIDCalib& c); //dummy copy constructor
79 : AliHMPIDCalib &operator=(const AliHMPIDCalib& c); //dummy assignment operator
80 :
81 16 : ClassDef(AliHMPIDCalib,5) //HMPID calibration and pedestal class
82 : };
83 : #endif
84 :
|