CMS 3D CMS Logo

HGCalTriggerCellCalibration.cc
Go to the documentation of this file.
2 
3 //class constructor
5 
6  LSB_silicon_fC_ = beCodecConfig.getParameter<double>("siliconCellLSB_fC");
7  LSB_scintillator_MIP_ = beCodecConfig.getParameter<double>("scintillatorCellLSB_MIP");
8  fCperMIP_ = beCodecConfig.getParameter<double>("fCperMIP");
9  dEdX_weights_ = beCodecConfig.getParameter<std::vector<double>>("dEdXweights");
10  thickCorr_ = beCodecConfig.getParameter<double>("thickCorr");
11 
12 
13 
14  if(fCperMIP_ <= 0){
15  edm::LogWarning("DivisionByZero") << "WARNING: the MIP->fC correction factor is zero or negative. It won't be applied to correct trigger cell energies.";
16  }
17  if(thickCorr_ <= 0){
18  edm::LogWarning("DivisionByZero") << "WARNING: the cell-thickness correction factor is zero or negative. It won't be applied to correct trigger cell energies.";
19  }
20 
21 }
22 
23 
25 {
26 
27  HGCalDetId trgdetid( trgCell.detId() );
28 
29  /* get the hardware pT in ADC counts: */
30  int hwPt = trgCell.hwPt();
31 
32  // Convert ADC to charge in fC (in EE+FH) or in MIPs (in BH)
33  double amplitude = hwPt * (trgdetid.subdetId()==HGCHEB ? LSB_scintillator_MIP_ : LSB_silicon_fC_);
34 
35  // The responses of the different cell thicknesses have been equalized
36  // to the 200um response in the front-end. So there is only one global
37  // fCperMIP and thickCorr here
38  /* convert the charge amplitude in MIP: */
39  double trgCellMipP = amplitude;
40  if( trgdetid.subdetId()!=HGCHEB && fCperMIP_ > 0 ){
41  trgCellMipP /= fCperMIP_;
42  }
43 
44  /* compute the transverse-mip */
45  double trgCellMipPt = trgCellMipP/cosh( trgCell.eta() );
46 
47  /* setting pT [mip] */
48  trgCell.setMipPt( trgCellMipPt ) ;
49 }
50 
51 
53 {
54  const double MevToGeV(0.001);
55 
56  HGCalDetId trgdetid( trgCell.detId() );
57  int trgCellLayer = trgdetid.layer();
58  int subdet = trgdetid.subdetId();
59 
60 
61  if( subdet == HGCHEF ){
62  trgCellLayer = trgCellLayer + kLayersEE_;
63  }
64  else if( subdet == HGCHEB ){
65  trgCellLayer = trgCellLayer + kLayersEE_ + kLayersFH_;
66  }
67 
68  /* weight the amplitude by the absorber coefficient in MeV/mip + bring it in GeV */
69  double trgCellEt = trgCell.mipPt() * dEdX_weights_.at(trgCellLayer) * MevToGeV;
70 
71  /* correct for the cell-thickness */
72  if( subdet!=HGCHEB && thickCorr_ > 0 ){
73  trgCellEt /= thickCorr_;
74  }
75 
76  /* assign the new energy to the four-vector of the trigger cell */
77  math::PtEtaPhiMLorentzVector calibP4(trgCellEt,
78  trgCell.eta(),
79  trgCell.phi(),
80  0.);
81 
82  /* overwriting the 4p with the calibrated 4p */
83  trgCell.setP4( calibP4 );
84 
85 }
86 
88 {
89 
90  /* calibrate from ADC count to transverse mip */
91  calibrateInMipT(trgCell);
92 
93  /* calibrate from mip count to GeV */
94  calibrateMipTinGeV(trgCell);
95 
96 }
97 
T getParameter(std::string const &) const
double eta() const final
momentum pseudorapidity
double mipPt() const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
uint32_t detId() const
void setMipPt(double value)
void calibrateInMipT(l1t::HGCalTriggerCell &)
void calibrateMipTinGeV(l1t::HGCalTriggerCell &)
int hwPt() const
Definition: L1Candidate.h:48
void calibrateInGeV(l1t::HGCalTriggerCell &)
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum
int layer() const
get the layer #
Definition: HGCalDetId.h:48
HGCalTriggerCellCalibration(const edm::ParameterSet &conf)