LCOV - code coverage report
Current view: top level - PHOS/PHOSbase - AliPHOSCpvPedProducer.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 10 10.0 %
Date: 2016-06-14 17:26:59 Functions: 1 16 6.2 %

          Line data    Source code
       1             : #ifndef AliPHOSCpvPedProducer_h
       2             : #define AliPHOSCpvPedProducer_h
       3             : 
       4             : // Authors: Mikhail.Stolpovskiy@cern.ch, Sergey.Evdokimov@cern.ch
       5             : // The AliPHOSCpvPedProducer class calculates pedestals using AliPHOSCpvRawStream
       6             : // Also writes pedestals to files
       7             : // And creates a ROOT file with some histograms.
       8             : // this class supposed to be used in Cpv DA programm
       9             : 
      10             : #include <TH1.h>
      11             : #include <TH2.h>
      12             : #include <TMath.h>
      13             : #include <TFile.h>
      14             : #include <TString.h>
      15             : #include <THnSparse.h>
      16             : #include "AliPHOSCpvParam.h"
      17             : #include "AliPHOSCpvRawStream.h"
      18             : #include <TClonesArray.h>
      19             : 
      20             : class TFile;
      21           0 : class AliPHOSCpvPedProducer: public TObject {
      22             : 
      23             : 
      24             : public:
      25             :   AliPHOSCpvPedProducer(Int_t sigcut = 3);
      26             :   virtual ~AliPHOSCpvPedProducer();
      27             :   void SetPermanentBadMap(TH2* badMap, int iDDL);
      28           0 :   void   SetSigCut(Int_t sigcut = 3) {fSigCut = sigcut;} //set n. of pedestal distribution sigmas used to create zero suppresion table
      29             :   Bool_t LoadNewEvent(AliRawReader *& rawReader); // returns true, if ok
      30             :   void   SetTurbo(Bool_t turbo);                  // if turbo==true then do read without error checking
      31           0 :   Bool_t GetTurbo() const {return fTurbo;}
      32             : 
      33             :   Bool_t FillPedestal(Int_t pad,Float_t q);   // pad - absolute pad number; q - charge of the pad
      34             :   Bool_t FillPedestal();  // analyse event and fill pedestals
      35             :   Bool_t CalcPedestal(Int_t iDDL);        //  analyse pedestals when all events processed for indicated DDL
      36             : 
      37           0 :   TH2F* GetPedMeanMap(Int_t iDDL) const {return fPedMeanMap[iDDL];}  //Get the pedestal mean map for a DDL to send to AMORE
      38           0 :   TH2F* GetPedSigMap(Int_t iDDL)  const {return fPedSigMap[iDDL];}   //Get the pedestal sigma map for a DDL to send to AMORE
      39           0 :   TH1F* GetPedMean(Int_t iChFee)  const {return f1DPedMean[iChFee];} //Get the pedestal mean map for a FEE channel to send to AMORE
      40           0 :   TH1F* GetPedSigma(Int_t iChFee) const {return f1DPedSigma[iChFee];}//Get the pedestal Sigma map for a FEE channel to send to AMORE
      41             :   void  WritePedFiles(Int_t iDDL) const;                             // write pedestals to load(?) to RCB for indicated DDL
      42             :   void WriteAllHistsToFile(const char* name) const;                  // create and write a new root file with hists
      43             : 
      44           0 :   void SetErrorsHist(TH1I * pHist) {fhErrors = new TH1I(*pHist);}    //Set the histogram of errors, taken from AliPHOSCpvRawDigiProdicer
      45           0 :   static Int_t GetMaxThr() {return fMaxThr;}                         // Get maximal threshold
      46             : 
      47             : protected:
      48             :   void CreateErrHist();    // initialize histogram of errors
      49             :   void CreateDDLHistos(Int_t iDDL);  // initialize histograms for pedestal calculation and representation
      50             : 
      51             :   //our ddls are 0,2,4,6,8
      52             :   TH1F       *fPadAdc[2*AliPHOSCpvParam::kNDDL][AliPHOSCpvParam::kPadPcX][AliPHOSCpvParam::kPadPcY];        //Charge distribution for pads
      53             :   Int_t       fSigCut;                         //n. of pedestal distribution sigmas used to create zero suppresion table
      54             :   static const Int_t fMaxThr = 511;            //maximal threshold (9 bits all with 1)
      55             :   Bool_t fTurbo;           // if true, then read without error checking
      56             :   //our ddls are 0,2,4,6,8
      57             :   TH2F       *fPedMeanMap[2*AliPHOSCpvParam::kNDDL]; //2D mean pedestal map to export to AMORE
      58             :   TH2F       *fPedSigMap [2*AliPHOSCpvParam::kNDDL]; //2D pedestal sigma map to export to AMORE
      59             :   TH1F       *f1DPedMean [2*AliPHOSCpvParam::kNDDL]; //1D mean pedestal map to export to AMORE
      60             :   TH1F       *f1DPedSigma[2*AliPHOSCpvParam::kNDDL]; //1D pedestal sigma map to export to AMORE
      61             :   TH1I       *fhErrors;                        //histogram of errors from AliPHOSCpvRawDigiProducer
      62             :   TH2I       *fPermanentBadMap[2*AliPHOSCpvParam::kNDDL];
      63             :   AliPHOSCpvRawStream         * fRawStream;       //! Raw data stream
      64             : private:
      65          22 :   ClassDef(AliPHOSCpvPedProducer,1);                                                  //Cpv calibration and pedestal class
      66             : };
      67             : #endif

Generated by: LCOV version 1.11