Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:58

0001 #ifndef TPedValues_h
0002 #define TPedValues_h
0003 
0004 /**
0005  * \file TPedValues.h
0006  * \brief Transient container
0007  * Store all the pedestal values depending on the gain and pedestal offset
0008  * $Date:
0009  * $Revision:
0010  * \author P. Govoni (pietro.govoni@cernNOSPAM.ch)
0011  */
0012 
0013 #include <vector>
0014 
0015 #include "TFile.h"
0016 #include "TPedResult.h"
0017 #include "TSinglePedEntry.h"
0018 
0019 class TPedValues {
0020 public:
0021   //! ctor
0022   TPedValues(double RMSmax = 2, int bestPedestal = 200);
0023 
0024   //! copy ctor
0025   TPedValues(const TPedValues &orig);
0026 
0027   //! dtor
0028   ~TPedValues();
0029 
0030   //! add a single value
0031   void insert(const int gainId, const int crystal, const int DAC, const int pedestal, const int endcapIndex);
0032 
0033   //! calculate the offset values for all the containers
0034   TPedResult terminate(const int &DACstart = 0, const int &DACend = 256) const;
0035 
0036   //! check whether the scan was complete in the range
0037   int checkEntries(const int &DACstart = 0, const int &DACend = 256) const;
0038 
0039   //! create a plot of the DAC pedestal trend
0040   int makePlots(TFile *rootFile,
0041                 const std::string &dirName,
0042                 const double maxSlopeAllowed,
0043                 const double minSlopeAllowed,
0044                 const double maxChi2OverNDF) const;
0045 
0046   //! return the index from the table
0047   int getCrystalNumber(int xtal) const;
0048 
0049 private:
0050   TSinglePedEntry m_entries[3][1700][256];
0051   // 1,305,600 elements
0052   int m_bestPedestal;
0053   double m_RMSmax;
0054   // store the EE index as
0055   // 100*elecId.towerId()+5*(elecId.stripId()-1)+elecId.xtalId()
0056   int endcapCrystalNumbers[1700];
0057 };
0058 
0059 #endif