CMS 3D CMS Logo

HGCalTriggerCellCalibration.cc
Go to the documentation of this file.
2 
3 //class constructor
5 
6  LSB_ = beCodecConfig.getParameter<double>("cellLSB");
7  fCperMIP_ee_ = beCodecConfig.getParameter<std::vector<double>>("fCperMIPee");
8  fCperMIP_fh_ = beCodecConfig.getParameter<std::vector<double>>("fCperMIPfh");
9  dEdX_weights_ = beCodecConfig.getParameter<std::vector<double>>("dEdXweights");
10  thickCorr_ = beCodecConfig.getParameter<std::vector<double>>("thickCorr");
11 }
12 
14  HGCalDetId trgdetid(trgCell.detId());
15  int trgCellLayer = trgdetid.layer();
16  int subdet = trgdetid.subdetId();
17 
18  //get the hardware pT in fC:
19  int hwPt = trgCell.hwPt();
20  //set the lowest signal bit:
21  double amplitude = hwPt * LSB_;
22  if( subdet == HGCEE ){
23  //convert the charge amplitude in MIP:
24  amplitude = amplitude / fCperMIP_ee_.at(cellThickness-1);
25  }else if( subdet == HGCHEF ){
26  //convert the charge amplitude in MIP:
27  amplitude = amplitude / fCperMIP_fh_.at(cellThickness-1);
28  trgCellLayer = trgCellLayer + 28;
29  }else if( subdet == HGCHEB ){
30  edm::LogWarning("DataNotFound") << "WARNING: the BH trgCells are not yet implemented !! ";
31  }
32 
33  //weight the amplitude by the absorber coefficient in MeV + bring it in GeV and correct for the sensor thickness
34  double trgCell_E = amplitude * dEdX_weights_.at(trgCellLayer) * 0.001 * thickCorr_.at(cellThickness-1);
35 
36  //assign the new energy to the four-vector of the trigger cell
37  math::PtEtaPhiMLorentzVector calibP4(trgCell_E/cosh(trgCell.eta()), trgCell.eta(), trgCell.phi(), trgCell.p4().M() );
38  trgCell.setP4(calibP4);
39 
40 }
T getParameter(std::string const &) const
void calibrate(l1t::HGCalTriggerCell &, int cellThickness)
virtual double eta() const final
momentum pseudorapidity
virtual double phi() const final
momentum azimuthal angle
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
uint32_t detId() const
int hwPt() const
Definition: L1Candidate.h:48
virtual void setP4(const LorentzVector &p4) final
set 4-momentum
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
int layer() const
get the layer #
Definition: HGCalDetId.h:48
HGCalTriggerCellCalibration(const edm::ParameterSet &conf)