CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalTriggerCellCalibration Class Reference

#include <HGCalTriggerCellCalibration.h>

Public Member Functions

void calibrateInGeV (l1t::HGCalTriggerCell &) const
 
void calibrateInMipT (l1t::HGCalTriggerCell &) const
 
void calibrateMipTinGeV (l1t::HGCalTriggerCell &) const
 
void eventSetup (const edm::EventSetup &es)
 
 HGCalTriggerCellCalibration (const edm::ParameterSet &conf)
 
void print ()
 

Private Attributes

std::vector< double > dEdX_weights_
 
double fCperMIP_
 
double LSB_scintillator_MIP_
 
double LSB_silicon_fC_
 
double thickCorr_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 15 of file HGCalTriggerCellCalibration.h.

Constructor & Destructor Documentation

HGCalTriggerCellCalibration::HGCalTriggerCellCalibration ( const edm::ParameterSet conf)

Definition at line 4 of file HGCalTriggerCellCalibration.cc.

References fCperMIP_, and thickCorr_.

5  : LSB_silicon_fC_(conf.getParameter<double>("siliconCellLSB_fC")),
6  LSB_scintillator_MIP_(conf.getParameter<double>("scintillatorCellLSB_MIP")),
7  fCperMIP_(conf.getParameter<double>("fCperMIP")),
8  thickCorr_(conf.getParameter<double>("thickCorr")),
9  dEdX_weights_(conf.getParameter<std::vector<double>>("dEdXweights")) {
10  if (fCperMIP_ <= 0) {
11  edm::LogWarning("DivisionByZero") << "WARNING: the MIP->fC correction factor is zero or negative. It won't be "
12  "applied to correct trigger cell energies.";
13  }
14  if (thickCorr_ <= 0) {
15  edm::LogWarning("DivisionByZero") << "WARNING: the cell-thickness correction factor is zero or negative. It won't "
16  "be applied to correct trigger cell energies.";
17  }
18 }
T getParameter(std::string const &) const

Member Function Documentation

void HGCalTriggerCellCalibration::calibrateInGeV ( l1t::HGCalTriggerCell trgCell) const

Definition at line 73 of file HGCalTriggerCellCalibration.cc.

References calibrateInMipT(), and calibrateMipTinGeV().

Referenced by HGCalConcentratorCoarsenerImpl::assignCoarseTriggerCellEnergy(), HGCalConcentratorSuperTriggerCellImpl::assignSuperTriggerCellEnergyAndPosition(), and eventSetup().

73  {
74  /* calibrate from ADC count to transverse mip */
75  calibrateInMipT(trgCell);
76 
77  /* calibrate from mip count to GeV */
78  calibrateMipTinGeV(trgCell);
79 }
void calibrateMipTinGeV(l1t::HGCalTriggerCell &) const
void calibrateInMipT(l1t::HGCalTriggerCell &) const
void HGCalTriggerCellCalibration::calibrateInMipT ( l1t::HGCalTriggerCell trgCell) const

Definition at line 20 of file HGCalTriggerCellCalibration.cc.

References CustomPhysics_cfi::amplitude, l1t::HGCalTriggerCell::detId(), reco::LeafCandidate::eta(), fCperMIP_, l1t::L1Candidate::hwPt(), HGCalTriggerTools::isSilicon(), LSB_scintillator_MIP_, LSB_silicon_fC_, l1t::HGCalTriggerCell::setMipPt(), and triggerTools_.

Referenced by calibrateInGeV(), and eventSetup().

20  {
21  bool isSilicon = triggerTools_.isSilicon(trgCell.detId());
22 
23  /* get the hardware pT in ADC counts: */
24  int hwPt = trgCell.hwPt();
25 
26  // Convert ADC to charge in fC (in EE+FH) or in MIPs (in BH)
27  double amplitude = hwPt * (!isSilicon ? LSB_scintillator_MIP_ : LSB_silicon_fC_);
28 
29  // The responses of the different cell thicknesses have been equalized
30  // to the 200um response in the front-end. So there is only one global
31  // fCperMIP and thickCorr here
32  /* convert the charge amplitude in MIP: */
33  double trgCellMipP = amplitude;
34  if (isSilicon && fCperMIP_ > 0) {
35  trgCellMipP /= fCperMIP_;
36  }
37 
38  /* compute the transverse-mip */
39  double trgCellMipPt = trgCellMipP / cosh(trgCell.eta());
40 
41  /* setting pT [mip] */
42  trgCell.setMipPt(trgCellMipPt);
43 }
double eta() const final
momentum pseudorapidity
uint32_t detId() const
void setMipPt(double value)
bool isSilicon(const DetId &) const
int hwPt() const
Definition: L1Candidate.h:35
void HGCalTriggerCellCalibration::calibrateMipTinGeV ( l1t::HGCalTriggerCell trgCell) const

Definition at line 45 of file HGCalTriggerCellCalibration.cc.

References dEdX_weights_, l1t::HGCalTriggerCell::detId(), reco::LeafCandidate::eta(), Exception, HGCalTriggerTools::isSilicon(), HGCalTriggerTools::layerWithOffset(), l1t::HGCalTriggerCell::mipPt(), reco::LeafCandidate::phi(), reco::LeafCandidate::setP4(), thickCorr_, and triggerTools_.

Referenced by calibrateInGeV(), and eventSetup().

45  {
46  const double MevToGeV(0.001);
47 
48  DetId trgdetid(trgCell.detId());
49  unsigned trgCellLayer = triggerTools_.layerWithOffset(trgdetid);
50 
51  if (dEdX_weights_.at(trgCellLayer) == 0.) {
52  throw cms::Exception("BadConfiguration")
53  << "Trigger cell energy forced to 0 by calibration coefficients.\n"
54  << "The configuration should be changed. "
55  << "Discarded layers should be defined in hgcalTriggerGeometryESProducer.TriggerGeometry.DisconnectedLayers "
56  "and not with calibration coefficients = 0\n";
57  }
58 
59  /* weight the amplitude by the absorber coefficient in MeV/mip + bring it in GeV */
60  double trgCellEt = trgCell.mipPt() * dEdX_weights_.at(trgCellLayer) * MevToGeV;
61 
62  /* correct for the cell-thickness */
63  if (triggerTools_.isSilicon(trgdetid) && thickCorr_ > 0) {
64  trgCellEt /= thickCorr_;
65  }
66  /* assign the new energy to the four-vector of the trigger cell */
67  math::PtEtaPhiMLorentzVector calibP4(trgCellEt, trgCell.eta(), trgCell.phi(), 0.);
68 
69  /* overwriting the 4p with the calibrated 4p */
70  trgCell.setP4(calibP4);
71 }
double eta() const final
momentum pseudorapidity
unsigned layerWithOffset(const DetId &) const
double mipPt() const
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
uint32_t detId() const
Definition: DetId.h:17
bool isSilicon(const DetId &) const
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum
void HGCalTriggerCellCalibration::eventSetup ( const edm::EventSetup es)
inline
void HGCalTriggerCellCalibration::print ( )

Referenced by eventSetup().

Member Data Documentation

std::vector<double> HGCalTriggerCellCalibration::dEdX_weights_
private

Definition at line 29 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateMipTinGeV().

double HGCalTriggerCellCalibration::fCperMIP_
private

Definition at line 27 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT(), and HGCalTriggerCellCalibration().

double HGCalTriggerCellCalibration::LSB_scintillator_MIP_
private

Definition at line 26 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT().

double HGCalTriggerCellCalibration::LSB_silicon_fC_
private

Definition at line 25 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT().

double HGCalTriggerCellCalibration::thickCorr_
private
HGCalTriggerTools HGCalTriggerCellCalibration::triggerTools_
private

Definition at line 31 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT(), calibrateMipTinGeV(), and eventSetup().