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 //Author: Pascal Paganini - LLR
5 //Date: 2006/07/10 15:58:06 $
6 
7 #define CMSSW_VERSION 340
8 
9 
10 // system include files
11 #include <memory>
12 
13 // user include files
21 
23 
29 
30 #if (CMSSW_VERSION>=340)
32 #else
33 #include "SimCalorimetry/EcalSimAlgos/interface/EcalShape.h"
34 #endif
35 
36 
37 #include <TH1F.h>
38 
39 #include <vector>
40 #include <string>
41 #include <map>
42 #include <iostream>
43 
46 class EcalTPGDBApp ;
47 
48 class coeffStruc {
49  public:
50  coeffStruc() { }
51  double calibCoeff_ ;
52  double gainRatio_[3] ;
53  int pedestals_[3] ;
54 };
55 
56 class linStruc {
57  public:
58  linStruc() { }
59  int pedestal_[3] ;
60  int mult_[3] ;
61  int shift_[3] ;
62 };
63 
65 
66  public:
67  explicit EcalTPGParamBuilder(edm::ParameterSet const& pSet) ;
69  virtual void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) ;
70  virtual void beginJob() ;
71  bool checkIfOK (EcalPedestals::Item item) ;
72 
73  private:
74  bool computeLinearizerParam(double theta, double gainRatio, double calibCoeff, std::string subdet, int & mult , int & shift) ;
75  void create_header() ;
76  int uncodeWeight(double weight, int complement2 = 7) ;
77  double uncodeWeight(int iweight, int complement2 = 7) ;
78 #if (CMSSW_VERSION>=340)
79  std::vector<unsigned int> computeWeights(EcalShapeBase & shape, TH1F * histo) ;
80 #else
81  std::vector<unsigned int> computeWeights(EcalShape & shape, TH1F * histo) ;
82 #endif
83  void computeLUT(int * lut, std::string det="EB") ;
84  void getCoeff(coeffStruc & coeff, const EcalIntercalibConstantMap & calibMap, uint rawId) ;
85  void getCoeff(coeffStruc & coeff, const EcalGainRatioMap & gainMap, uint rawId) ;
86  void getCoeff(coeffStruc & coeff, const EcalPedestalsMap & pedMap, uint rawId) ;
87  void getCoeff(coeffStruc & coeff, const std::map<EcalLogicID, MonPedestalsDat> & pedMap, const EcalLogicID & logicId) ;
88 
89  void computeFineGrainEBParameters(uint & lowRatio, uint & highRatio,
90  uint & lowThreshold, uint & highThreshold, uint & lut) ;
91  void computeFineGrainEEParameters(uint & threshold, uint & lut_strip, uint & lut_tower) ;
92  int getEtaSlice(int tccId, int towerInTCC) ;
93  bool realignBaseline(linStruc & lin, float forceBase12) ;
94  int getGCTRegionPhi(int ttphi) ;
95  int getGCTRegionEta(int tteta) ;
96  std::string getDet(int tcc) ;
97  std::pair < std::string, int > getCrate(int tcc) ;
98 
103 
107  unsigned int sliding_ ;
108  unsigned int sampleMax_ ;
111  unsigned int nSample_ ;
112  unsigned int complement2_ ;
113  std::string LUT_option_ ;
120  unsigned int FG_lut_EB_ ;
126  int SFGVB_SpikeKillingThreshold_; //modif-alex 01/21/11
128 
129  //modif-alex-02/02/11
130  std::string TimingDelays_EB_;
131  std::string TimingDelays_EE_;
132  std::string TimingPhases_EB_;
133  std::string TimingPhases_EE_;
134  std::map<int, std::vector<int> > delays_EB_ ;
135  std::map<int, std::vector<int> > phases_EB_ ;
136  std::map<int, std::vector<int> > delays_EE_ ;
137  std::map<int, std::vector<int> > phases_EE_ ;
138 
139  std::ofstream * out_file_ ;
140  std::ofstream * geomFile_ ;
142  bool writeToDB_ ;
144  unsigned int DBrunNb_ ;
145  bool DBEE_ ;
146 
153  int spi_conf_id_; //modif-alex 21/01.11
154  int del_conf_id_; //modif-alex 21/01.11
158  std::string tag_;
159  int version_;
166  int m_write_spi; //modif-alex 21/01/11
167  int m_write_del; //modif-alex 21/01/11
171 
172  Int_t * ntupleInts_ ;
173  Char_t ntupleDet_[10] ;
174  Char_t ntupleCrate_[10] ;
175 
176 };
177 #endif
std::map< int, std::vector< int > > phases_EB_
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
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)
shaper for Ecal
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_
unsigned tccId(const DetId &)
static unsigned int const shift
int getGCTRegionEta(int tteta)
int getEtaSlice(int tccId, int towerInTCC)
std::map< int, std::vector< int > > phases_EE_
bool checkIfOK(EcalPedestals::Item item)
void computeFineGrainEBParameters(uint &lowRatio, uint &highRatio, uint &lowThreshold, uint &highThreshold, uint &lut)
int uncodeWeight(double weight, int complement2=7)