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, unsigned int rawId) ;
85  void getCoeff(coeffStruc & coeff, const EcalGainRatioMap & gainMap, unsigned int rawId) ;
86  void getCoeff(coeffStruc & coeff, const EcalPedestalsMap & pedMap, unsigned int rawId) ;
87  void getCoeff(coeffStruc & coeff, const std::map<EcalLogicID, MonPedestalsDat> & pedMap, const EcalLogicID & logicId) ;
88 
89  void computeFineGrainEBParameters(unsigned int & lowRatio, unsigned int & highRatio,
90  unsigned int & lowThreshold, unsigned int & highThreshold, unsigned int & lut) ;
91  void computeFineGrainEEParameters(unsigned int & threshold, unsigned int & lut_strip, unsigned int & 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_ ;
127 
128 
129  std::ofstream * out_file_ ;
130  std::ofstream * geomFile_ ;
132  bool writeToDB_ ;
134  unsigned int DBrunNb_ ;
135  bool DBEE_ ;
136 
145  std::string tag_;
146  int version_;
155 
156  Float_t * ntupleFloats_ ;
157  Char_t ntupleDet_[10] ;
158  Char_t ntupleCrate_[10] ;
159 
160 };
161 #endif
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
tuple histo
Definition: trackerHits.py:12
const CaloSubdetectorGeometry * theEndcapGeometry_
std::ofstream * out_file_
void computeFineGrainEBParameters(unsigned int &lowRatio, unsigned int &highRatio, unsigned int &lowThreshold, unsigned int &highThreshold, unsigned int &lut)
void getCoeff(coeffStruc &coeff, const EcalIntercalibConstantMap &calibMap, unsigned int rawId)
std::vector< unsigned int > computeWeights(EcalShapeBase &shape, TH1F *histo)
const EcalElectronicsMapping * theMapping_
float threshold
Definition: crabWrap.py:319
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_
void computeFineGrainEEParameters(unsigned int &threshold, unsigned int &lut_strip, unsigned int &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 getEtaSlice(int tccId, int towerInTCC)
bool checkIfOK(EcalPedestals::Item item)
int uncodeWeight(double weight, int complement2=7)