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_
 
std::vector< double > dEdX_weights_Nose_
 
double fCperMIP_
 
std::vector< double > fCperMIPnose_
 
double LSB_scintillator_MIP_
 
double LSB_silicon_fC_
 
double thickCorr_
 
std::vector< double > thickCorrNose_
 
HGCalTriggerTools triggerTools_
 

Detailed Description

Definition at line 15 of file HGCalTriggerCellCalibration.h.

Constructor & Destructor Documentation

◆ HGCalTriggerCellCalibration()

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

Definition at line 6 of file HGCalTriggerCellCalibration.cc.

7  : LSB_silicon_fC_(conf.getParameter<double>("siliconCellLSB_fC")),
8  LSB_scintillator_MIP_(conf.getParameter<double>("scintillatorCellLSB_MIP")),
9  fCperMIP_(conf.getParameter<double>("fCperMIP")),
10  fCperMIPnose_(conf.getParameter<std::vector<double>>("fCperMIPnose")),
11  thickCorr_(conf.getParameter<double>("thickCorr")),
12  thickCorrNose_(conf.getParameter<std::vector<double>>("thickCorrNose")),
13  dEdX_weights_(conf.getParameter<std::vector<double>>("dEdXweights")),
14  dEdX_weights_Nose_(conf.getParameter<std::vector<double>>("dEdXweightsNose")) {
15  if (fCperMIP_ <= 0 or fCperMIPnose_.at(0) <= 0) {
16  edm::LogWarning("DivisionByZero") << "WARNING: the MIP->fC correction factor is zero or negative. It won't be "
17  "applied to correct trigger cell energies.";
18  }
19  if (thickCorr_ <= 0 or thickCorrNose_.at(0) <= 0) {
20  edm::LogWarning("DivisionByZero") << "WARNING: the cell-thickness correction factor is zero or negative. It won't "
21  "be applied to correct trigger cell energies.";
22  }
23 }

References fCperMIP_, fCperMIPnose_, or, thickCorr_, and thickCorrNose_.

Member Function Documentation

◆ calibrateInGeV()

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

Definition at line 104 of file HGCalTriggerCellCalibration.cc.

104  {
105  /* calibrate from ADC count to transverse mip */
106  calibrateInMipT(trgCell);
107 
108  /* calibrate from mip count to GeV */
109  calibrateMipTinGeV(trgCell);
110 }

References calibrateInMipT(), and calibrateMipTinGeV().

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

◆ calibrateInMipT()

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

Definition at line 25 of file HGCalTriggerCellCalibration.cc.

25  {
26  DetId trgdetid(trgCell.detId());
27  bool isSilicon = triggerTools_.isSilicon(trgdetid);
28  bool isNose = triggerTools_.isNose(trgdetid);
29  int thickness = isSilicon ? triggerTools_.thicknessIndex(trgdetid, false) : 0;
30 
31  /* get the hardware pT in ADC counts: */
32  int hwPt = trgCell.hwPt();
33 
34  // Convert ADC to charge in fC (in EE+FH) or in MIPs (in BH)
35  double amplitude = hwPt * (!isSilicon ? LSB_scintillator_MIP_ : LSB_silicon_fC_);
36 
37  // The responses of the different cell thicknesses have been equalized
38  // to the 200um response in the front-end. So there is only one global
39  // fCperMIP and thickCorr here
40  /* convert the charge amplitude in MIP: */
41  double trgCellMipP = amplitude;
42 
43  if (isNose and fCperMIPnose_[thickness] > 0) {
44  trgCellMipP /= fCperMIPnose_[thickness];
45  } else if (isSilicon && fCperMIP_ > 0) {
46  trgCellMipP /= fCperMIP_;
47  }
48 
49  /* compute the transverse-mip */
50  double trgCellMipPt = trgCellMipP / cosh(trgCell.eta());
51 
52  /* setting pT [mip] */
53  trgCell.setMipPt(trgCellMipPt);
54 }

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

Referenced by calibrateInGeV().

◆ calibrateMipTinGeV()

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

Definition at line 56 of file HGCalTriggerCellCalibration.cc.

56  {
57  const double MevToGeV(0.001);
58  double trgCellEt(0.);
59 
60  DetId trgdetid(trgCell.detId());
61  bool isNose = triggerTools_.isNose(trgdetid);
62  unsigned trgCellLayer = triggerTools_.layerWithOffset(trgdetid);
63  bool isSilicon = triggerTools_.isSilicon(trgdetid);
64  int thickness = isSilicon ? triggerTools_.thicknessIndex(trgdetid, false) : 0;
65 
66  if (isNose) {
67  if (dEdX_weights_Nose_.at(trgCellLayer) == 0.) {
68  throw cms::Exception("BadConfiguration - HFNose")
69  << "Trigger cell energy forced to 0 by calibration coefficients.\n"
70  << "The configuration should be changed. \n";
71  }
72  } else {
73  if (dEdX_weights_.at(trgCellLayer) == 0.) {
74  throw cms::Exception("BadConfiguration - HGCAL ")
75  << "Trigger cell energy forced to 0 by calibration coefficients.\n"
76  << "The configuration should be changed. "
77  << "Discarded layers should be defined in "
78  "hgcalTriggerGeometryESProducer.TriggerGeometry."
79  "DisconnectedLayers "
80  "and not with calibration coefficients = 0\n";
81  }
82  }
83 
84  /* weight the amplitude by the absorber coefficient in MeV/mip + bring it in
85  * GeV */
86  trgCellEt = trgCell.mipPt() * MevToGeV;
87  trgCellEt *= (isNose) ? dEdX_weights_Nose_.at(trgCellLayer) : dEdX_weights_.at(trgCellLayer);
88 
89  /* correct for the cell-thickness */
90  if (triggerTools_.isSilicon(trgdetid)) {
91  if (isNose && thickCorrNose_[thickness] > 0)
92  trgCellEt /= thickCorrNose_[thickness];
93  else if (thickCorr_ > 0)
94  trgCellEt /= thickCorr_;
95  }
96 
97  /* assign the new energy to the four-vector of the trigger cell */
98  math::PtEtaPhiMLorentzVector calibP4(trgCellEt, trgCell.eta(), trgCell.phi(), 0.);
99 
100  /* overwriting the 4p with the calibrated 4p */
101  trgCell.setP4(calibP4);
102 }

References dEdX_weights_, dEdX_weights_Nose_, l1t::HGCalTriggerCell::detId(), reco::LeafCandidate::eta(), Exception, HGCalTriggerTools::isNose(), HGCalTriggerTools::isSilicon(), HGCalTriggerTools::layerWithOffset(), l1t::HGCalTriggerCell::mipPt(), reco::LeafCandidate::phi(), reco::LeafCandidate::setP4(), thickCorr_, thickCorrNose_, Calorimetry_cff::thickness, HGCalTriggerTools::thicknessIndex(), and triggerTools_.

Referenced by calibrateInGeV().

◆ eventSetup()

void HGCalTriggerCellCalibration::eventSetup ( const edm::EventSetup es)
inline

◆ print()

void HGCalTriggerCellCalibration::print ( )

Member Data Documentation

◆ dEdX_weights_

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

Definition at line 31 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateMipTinGeV().

◆ dEdX_weights_Nose_

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

Definition at line 32 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateMipTinGeV().

◆ fCperMIP_

double HGCalTriggerCellCalibration::fCperMIP_
private

Definition at line 27 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT(), and HGCalTriggerCellCalibration().

◆ fCperMIPnose_

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

Definition at line 28 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT(), and HGCalTriggerCellCalibration().

◆ LSB_scintillator_MIP_

double HGCalTriggerCellCalibration::LSB_scintillator_MIP_
private

Definition at line 26 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT().

◆ LSB_silicon_fC_

double HGCalTriggerCellCalibration::LSB_silicon_fC_
private

Definition at line 25 of file HGCalTriggerCellCalibration.h.

Referenced by calibrateInMipT().

◆ thickCorr_

double HGCalTriggerCellCalibration::thickCorr_
private

◆ thickCorrNose_

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

◆ triggerTools_

HGCalTriggerTools HGCalTriggerCellCalibration::triggerTools_
private

Definition at line 34 of file HGCalTriggerCellCalibration.h.

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

HGCalTriggerTools::eventSetup
void eventSetup(const edm::EventSetup &)
Definition: HGCalTriggerTools.cc:35
CustomPhysics_cfi.amplitude
amplitude
Definition: CustomPhysics_cfi.py:12
HGCalTriggerCellCalibration::LSB_scintillator_MIP_
double LSB_scintillator_MIP_
Definition: HGCalTriggerCellCalibration.h:26
HGCalTriggerCellCalibration::dEdX_weights_
std::vector< double > dEdX_weights_
Definition: HGCalTriggerCellCalibration.h:31
HGCalTriggerTools::thicknessIndex
int thicknessIndex(const DetId &, bool tc=false) const
Definition: HGCalTriggerTools.cc:233
HGCalTriggerCellCalibration::LSB_silicon_fC_
double LSB_silicon_fC_
Definition: HGCalTriggerCellCalibration.h:25
HGCalTriggerTools::isSilicon
bool isSilicon(const DetId &) const
Definition: HGCalTriggerTools.cc:181
HGCalTriggerCellCalibration::thickCorrNose_
std::vector< double > thickCorrNose_
Definition: HGCalTriggerCellCalibration.h:30
l1t::HGCalTriggerCell::setMipPt
void setMipPt(double value)
Definition: HGCalTriggerCell.h:30
DetId
Definition: DetId.h:17
HGCalTriggerCellCalibration::fCperMIPnose_
std::vector< double > fCperMIPnose_
Definition: HGCalTriggerCellCalibration.h:28
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
HGCalTriggerTools::layerWithOffset
unsigned layerWithOffset(const DetId &) const
Definition: HGCalTriggerTools.cc:134
HGCalTriggerTools::isNose
bool isNose(const DetId &) const
Definition: HGCalTriggerTools.cc:170
edm::LogWarning
Definition: MessageLogger.h:141
l1t::HGCalTriggerCell::mipPt
double mipPt() const
Definition: HGCalTriggerCell.h:31
l1t::HGCalTriggerCell::detId
uint32_t detId() const
Definition: HGCalTriggerCell.h:25
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
HGCalTriggerCellCalibration::dEdX_weights_Nose_
std::vector< double > dEdX_weights_Nose_
Definition: HGCalTriggerCellCalibration.h:32
HGCalTriggerCellCalibration::fCperMIP_
double fCperMIP_
Definition: HGCalTriggerCellCalibration.h:27
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
HGCalTriggerCellCalibration::calibrateInMipT
void calibrateInMipT(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:25
Exception
Definition: hltDiff.cc:246
HGCalTriggerCellCalibration::calibrateMipTinGeV
void calibrateMipTinGeV(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:56
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
l1t::L1Candidate::hwPt
int hwPt() const
Definition: L1Candidate.h:35
math::PtEtaPhiMLorentzVector
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
HGCalTriggerCellCalibration::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTriggerCellCalibration.h:34
HGCalTriggerCellCalibration::thickCorr_
double thickCorr_
Definition: HGCalTriggerCellCalibration.h:29