CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalTPGParamBuilder.h
Go to the documentation of this file.
1 #ifndef ECALTPGPARAMBUILDER_H
2 #define ECALTPGPARAMBUILDER_H
3 
4 // system include files
5 #include <memory>
6 
7 // user include files
15 
17 
23 
25 
26 
27 #include <TH1F.h>
28 
29 #include <vector>
30 #include <string>
31 #include <map>
32 #include <iostream>
33 
36 class EcalTPGDBApp ;
37 
38 class coeffStruc {
39  public:
40  coeffStruc() { }
41  double calibCoeff_ ;
42  double gainRatio_[3] ;
43  int pedestals_[3] ;
44 };
45 
46 class linStruc {
47  public:
48  linStruc() { }
49  int pedestal_[3] ;
50  int mult_[3] ;
51  int shift_[3] ;
52 };
53 
55 
56  public:
57  explicit EcalTPGParamBuilder(edm::ParameterSet const& pSet) ;
59  virtual void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) ;
60  virtual void beginJob() ;
61  bool checkIfOK (const EcalPedestals::Item& item) ;
62 
63  private:
64  bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int & mult , int & shift) ;
65  void create_header() ;
66  int uncodeWeight(double weight, int complement2 = 7) ;
67  double uncodeWeight(int iweight, int complement2 = 7) ;
68  std::vector<unsigned int> computeWeights(EcalShapeBase & shape, TH1F * histo) ;
69  void computeLUT(int * lut, std::string det="EB") ;
70  void getCoeff(coeffStruc & coeff, const EcalIntercalibConstantMap & calibMap, uint rawId) ;
71  void getCoeff(coeffStruc & coeff, const EcalGainRatioMap & gainMap, uint rawId) ;
72  void getCoeff(coeffStruc & coeff, const EcalPedestalsMap & pedMap, uint rawId) ;
73  void getCoeff(coeffStruc & coeff, const std::map<EcalLogicID, MonPedestalsDat> & pedMap, const EcalLogicID & logicId) ;
74 
75  void computeFineGrainEBParameters(uint & lowRatio, uint & highRatio,
76  uint & lowThreshold, uint & highThreshold, uint & lut) ;
77  void computeFineGrainEEParameters(uint & threshold, uint & lut_strip, uint & lut_tower) ;
78  int getEtaSlice(int tccId, int towerInTCC) ;
79  bool realignBaseline(linStruc & lin, float forceBase12) ;
80  int getGCTRegionPhi(int ttphi) ;
81  int getGCTRegionEta(int tteta) ;
82  std::string getDet(int tcc) ;
83  std::pair < std::string, int > getCrate(int tcc) ;
84 
89 
93  unsigned int sliding_ ;
94  unsigned int sampleMax_ ;
97  unsigned int nSample_ ;
98  unsigned int complement2_ ;
106  unsigned int FG_lut_EB_ ;
112  int SFGVB_SpikeKillingThreshold_; //modif-alex 01/21/11
114 
115  //modif-alex-02/02/11
120  std::map<int, std::vector<int> > delays_EB_ ;
121  std::map<int, std::vector<int> > phases_EB_ ;
122  std::map<int, std::vector<int> > delays_EE_ ;
123  std::map<int, std::vector<int> > phases_EE_ ;
124 
125  std::ofstream * out_file_ ;
126  std::ofstream * geomFile_ ;
128  bool writeToDB_ ;
130  bool DBEE_ ;
131 
138  int spi_conf_id_; //modif-alex 21/01.11
139  int del_conf_id_; //modif-alex 21/01.11
144  int version_;
151  int m_write_spi; //modif-alex 21/01/11
152  int m_write_del; //modif-alex 21/01/11
156 
157  Int_t * ntupleInts_ ;
158  Char_t ntupleDet_[10] ;
159  Char_t ntupleCrate_[10] ;
160 
161 };
162 #endif
std::map< int, std::vector< int > > phases_EB_
bool checkIfOK(const EcalPedestals::Item &item)
edm::ESHandle< EcalTrigTowerConstituentsMap > eTTmap_
std::pair< std::string, int > getCrate(int tcc)
int getGCTRegionPhi(int ttphi)
double gainRatio_[3]
std::string getDet(int tcc)
Geom::Theta< T > theta() const
unsigned tccId(DetId const &)
const CaloSubdetectorGeometry * theEndcapGeometry_
std::ofstream * out_file_
std::map< int, std::vector< int > > delays_EB_
void getCoeff(coeffStruc &coeff, const EcalIntercalibConstantMap &calibMap, uint rawId)
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
std::map< int, std::vector< int > > delays_EE_
const EcalElectronicsMapping * theMapping_
void computeLUT(int *lut, std::string det="EB")
EcalTPGParamBuilder(edm::ParameterSet const &pSet)
virtual void analyze(const edm::Event &evt, const edm::EventSetup &evtSetup)
std::ofstream * geomFile_
tuple lut
Definition: lumiPlot.py:244
void computeFineGrainEEParameters(uint &threshold, uint &lut_strip, uint &lut_tower)
bool realignBaseline(linStruc &lin, float forceBase12)
bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int &mult, int &shift)
const CaloSubdetectorGeometry * theBarrelGeometry_
static unsigned int const shift
int getGCTRegionEta(int tteta)
int weight
Definition: histoStyle.py:50
int getEtaSlice(int tccId, int towerInTCC)
std::map< int, std::vector< int > > phases_EE_
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
int uncodeWeight(double weight, int complement2=7)