CMS 3D CMS Logo

HGCalTriggerCellCalibration.cc
Go to the documentation of this file.
4 
5 // class constructor
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 }
24 
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 }
55 
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 }
103 
105  /* calibrate from ADC count to transverse mip */
106  calibrateInMipT(trgCell);
107 
108  /* calibrate from mip count to GeV */
109  calibrateMipTinGeV(trgCell);
110 }
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.h
HGCalTriggerCellCalibration::fCperMIPnose_
std::vector< double > fCperMIPnose_
Definition: HGCalTriggerCellCalibration.h:28
Calorimetry_cff.thickness
thickness
Definition: Calorimetry_cff.py:114
HFNoseTriggerDetId.h
l1t::HGCalTriggerCell
Definition: HGCalTriggerCell.h:14
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
edm::ParameterSet
Definition: ParameterSet.h:36
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
HGCalTriggerCellCalibration::HGCalTriggerCellCalibration
HGCalTriggerCellCalibration(const edm::ParameterSet &conf)
Definition: HGCalTriggerCellCalibration.cc:6
HGCalTriggerCellCalibration::dEdX_weights_Nose_
std::vector< double > dEdX_weights_Nose_
Definition: HGCalTriggerCellCalibration.h:32
HGCalTriggerCellCalibration::fCperMIP_
double fCperMIP_
Definition: HGCalTriggerCellCalibration.h:27
reco::LeafCandidate::setP4
void setP4(const LorentzVector &p4) final
set 4-momentum
Definition: LeafCandidate.h:158
std
Definition: JetResolutionObject.h:76
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::calibrateInGeV
void calibrateInGeV(l1t::HGCalTriggerCell &) const
Definition: HGCalTriggerCellCalibration.cc:104
HGCalTriggerCellCalibration::triggerTools_
HGCalTriggerTools triggerTools_
Definition: HGCalTriggerCellCalibration.h:34
HGCalTriggerDetId.h
HGCalTriggerCellCalibration::thickCorr_
double thickCorr_
Definition: HGCalTriggerCellCalibration.h:29