CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
HGCalRecHitWorkerSimple Class Reference

#include <HGCalRecHitWorkerSimple.h>

Inheritance diagram for HGCalRecHitWorkerSimple:
HGCalRecHitWorkerBaseClass

Public Member Functions

 HGCalRecHitWorkerSimple (const edm::ParameterSet &)
 
bool run (const edm::Event &evt, const HGCUncalibratedRecHit &uncalibRH, HGCRecHitCollection &result)
 
void set (const edm::EventSetup &es)
 
virtual ~HGCalRecHitWorkerSimple ()
 
- Public Member Functions inherited from HGCalRecHitWorkerBaseClass
 HGCalRecHitWorkerBaseClass (const edm::ParameterSet &)
 
virtual ~HGCalRecHitWorkerBaseClass ()
 

Protected Attributes

std::array< const HGCalDDDConstants *, 3 > ddds_
 
std::vector< double > HGCEE_fCPerMIP_
 
bool HGCEE_isSiFE_
 
double HGCEE_keV2DIGI_
 
double hgceeUncalib2GeV_
 
bool HGCHEB_isSiFE_
 
double HGCHEB_keV2DIGI_
 
double hgchebUncalib2GeV_
 
std::vector< double > HGCHEF_fCPerMIP_
 
bool HGCHEF_isSiFE_
 
double HGCHEF_keV2DIGI_
 
double hgchefUncalib2GeV_
 
bool killDeadChannels_
 
std::vector< float > rcorr_
 
std::unique_ptr< HGCalRecHitSimpleAlgorechitMaker_
 
std::vector< int > v_chstatus_
 
std::vector< int > v_DB_reco_flags_
 

Detailed Description

Definition at line 18 of file HGCalRecHitWorkerSimple.h.

Constructor & Destructor Documentation

HGCalRecHitWorkerSimple::HGCalRecHitWorkerSimple ( const edm::ParameterSet ps)

Definition at line 11 of file HGCalRecHitWorkerSimple.cc.

References constexpr, corr, MillePedeFileConverter_cfg::e, f, edm::ParameterSet::getParameter(), HGCEE_fCPerMIP_, HGCEE_isSiFE_, HGCEE_keV2DIGI_, hgceeUncalib2GeV_, HGCHEB_isSiFE_, HGCHEB_keV2DIGI_, hgchebUncalib2GeV_, HGCHEF_fCPerMIP_, HGCHEF_isSiFE_, HGCHEF_keV2DIGI_, hgchefUncalib2GeV_, rcorr_, rechitMaker_, and create_public_lumi_plots::weights.

11  :
13  rechitMaker_.reset( new HGCalRecHitSimpleAlgo() );
14  constexpr float keV2GeV = 1e-6;
15  // HGCee constants
16  HGCEE_keV2DIGI_ = ps.getParameter<double>("HGCEE_keV2DIGI");
17  HGCEE_fCPerMIP_ = ps.getParameter<std::vector<double> >("HGCEE_fCPerMIP");
18  HGCEE_isSiFE_ = ps.getParameter<bool>("HGCEE_isSiFE");
20 
21  // HGChef constants
22  HGCHEF_keV2DIGI_ = ps.getParameter<double>("HGCHEF_keV2DIGI");
23  HGCHEF_fCPerMIP_ = ps.getParameter<std::vector<double> >("HGCHEF_fCPerMIP");
24  HGCHEF_isSiFE_ = ps.getParameter<bool>("HGCHEF_isSiFE");
26 
27  // HGCheb constants
28  HGCHEB_keV2DIGI_ = ps.getParameter<double>("HGCHEB_keV2DIGI");
29  HGCHEB_isSiFE_ = ps.getParameter<bool>("HGCHEB_isSiFE");
31 
32  // layer weights (from Valeri/Arabella)
33  std::vector<float> weights;
34  const auto& dweights = ps.getParameter<std::vector<double> >("layerWeights");
35  for( auto weight : dweights ) {
36  weights.push_back(weight);
37  }
38  rechitMaker_->setLayerWeights(weights);
39 
40  // residual correction for cell thickness
41  const auto& rcorr = ps.getParameter<std::vector<double> >("thicknessCorrection");
42  rcorr_.clear();
43  rcorr_.push_back(1.f);
44  for( auto corr : rcorr ) {
45  rcorr_.push_back(1.0/corr);
46  }
47 
48 }
T getParameter(std::string const &) const
Definition: weight.py:1
#define constexpr
double f[11][100]
HGCalRecHitWorkerBaseClass(const edm::ParameterSet &)
JetCorrectorParameters corr
Definition: classes.h:5
std::vector< double > HGCHEF_fCPerMIP_
std::vector< double > HGCEE_fCPerMIP_
std::unique_ptr< HGCalRecHitSimpleAlgo > rechitMaker_
HGCalRecHitWorkerSimple::~HGCalRecHitWorkerSimple ( )
virtual

Definition at line 113 of file HGCalRecHitWorkerSimple.cc.

References DEFINE_EDM_PLUGIN.

113  {
114 }

Member Function Documentation

bool HGCalRecHitWorkerSimple::run ( const edm::Event evt,
const HGCUncalibratedRecHit uncalibRH,
HGCRecHitCollection result 
)
virtual

Implements HGCalRecHitWorkerBaseClass.

Definition at line 70 of file HGCalRecHitWorkerSimple.cc.

References ddds_, Exception, HcalEndcap, HGCEE, hgceeUncalib2GeV_, HGCHEB, hgchebUncalib2GeV_, HGCHEF, hgchefUncalib2GeV_, HGCUncalibratedRecHit::id(), edm::SortedCollection< T, SORT >::push_back(), DetId::rawId(), rcorr_, rechitMaker_, DetId::subdetId(), and HGCalDetId::wafer().

72  {
73  DetId detid=uncalibRH.id();
74  uint32_t recoFlag = 0;
75  //const std::vector<double>* fCPerMIP = nullptr;
76 
77  switch( detid.subdetId() ) {
78  case HGCEE:
79  rechitMaker_->setADCToGeVConstant(float(hgceeUncalib2GeV_) );
80  //fCPerMIP = &HGCEE_fCPerMIP_;
81  break;
82  case HGCHEF:
83  rechitMaker_->setADCToGeVConstant(float(hgchefUncalib2GeV_) );
84  //fCPerMIP = &HGCHEF_fCPerMIP_;
85  break;
86  case HcalEndcap:
87  case HGCHEB:
88  rechitMaker_->setADCToGeVConstant(float(hgchebUncalib2GeV_) );
89  break;
90  default:
91  throw cms::Exception("NonHGCRecHit")
92  << "Rechit with detid = " << detid.rawId() << " is not HGC!";
93  }
94 
95  // make the rechit and put in the output collection
96  if (recoFlag == 0) {
97  HGCRecHit myrechit( rechitMaker_->makeRecHit(uncalibRH, 0) );
98  int thk = -1;
99  if( detid.subdetId() != HcalEndcap ) {
100  HGCalDetId hid(detid);
101  thk = ddds_[hid.subdetId()-3]->waferTypeL(hid.wafer());
102  // units out of rechit maker are MIP * (GeV/fC)
103  // so multiple
104  }
105  const double new_E = myrechit.energy()*(thk == -1 ? 1.0 : rcorr_[thk]);
106  myrechit.setEnergy(new_E);
107  result.push_back(myrechit);
108  }
109 
110  return true;
111 }
std::array< const HGCalDDDConstants *, 3 > ddds_
void push_back(T const &t)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
std::unique_ptr< HGCalRecHitSimpleAlgo > rechitMaker_
void HGCalRecHitWorkerSimple::set ( const edm::EventSetup es)
virtual

Implements HGCalRecHitWorkerBaseClass.

Definition at line 50 of file HGCalRecHitWorkerSimple.cc.

References HGCalTopology::dddConstants(), ddds_, edm::EventSetup::get(), HGCEE_isSiFE_, HGCHEF_isSiFE_, and HGCalGeometry::topology().

50  {
51  if (HGCEE_isSiFE_) {
52  edm::ESHandle<HGCalGeometry> hgceeGeoHandle;
53  es.get<IdealGeometryRecord>().get("HGCalEESensitive",hgceeGeoHandle);
54  ddds_[0] = &(hgceeGeoHandle->topology().dddConstants());
55  } else {
56  ddds_[0] = nullptr;
57  }
58  if (HGCHEF_isSiFE_) {
59  edm::ESHandle<HGCalGeometry> hgchefGeoHandle;
60  es.get<IdealGeometryRecord>().get("HGCalHESiliconSensitive",hgchefGeoHandle);
61  ddds_[1] = &(hgchefGeoHandle->topology().dddConstants());
62  } else {
63  ddds_[1] = nullptr;
64  }
65  ddds_[2] = nullptr;
66 }
std::array< const HGCalDDDConstants *, 3 > ddds_
const HGCalTopology & topology() const
Definition: HGCalGeometry.h:96
const HGCalDDDConstants & dddConstants() const
const T & get() const
Definition: EventSetup.h:56

Member Data Documentation

std::array<const HGCalDDDConstants*, 3> HGCalRecHitWorkerSimple::ddds_
protected

Definition at line 35 of file HGCalRecHitWorkerSimple.h.

Referenced by run(), and set().

std::vector<double> HGCalRecHitWorkerSimple::HGCEE_fCPerMIP_
protected

Definition at line 29 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

bool HGCalRecHitWorkerSimple::HGCEE_isSiFE_
protected

Definition at line 33 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and set().

double HGCalRecHitWorkerSimple::HGCEE_keV2DIGI_
protected

Definition at line 28 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

double HGCalRecHitWorkerSimple::hgceeUncalib2GeV_
protected

Definition at line 28 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and run().

bool HGCalRecHitWorkerSimple::HGCHEB_isSiFE_
protected

Definition at line 33 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

double HGCalRecHitWorkerSimple::HGCHEB_keV2DIGI_
protected

Definition at line 32 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

double HGCalRecHitWorkerSimple::hgchebUncalib2GeV_
protected

Definition at line 32 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and run().

std::vector<double> HGCalRecHitWorkerSimple::HGCHEF_fCPerMIP_
protected

Definition at line 31 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

bool HGCalRecHitWorkerSimple::HGCHEF_isSiFE_
protected

Definition at line 33 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and set().

double HGCalRecHitWorkerSimple::HGCHEF_keV2DIGI_
protected

Definition at line 30 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple().

double HGCalRecHitWorkerSimple::hgchefUncalib2GeV_
protected

Definition at line 30 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and run().

bool HGCalRecHitWorkerSimple::killDeadChannels_
protected

Definition at line 40 of file HGCalRecHitWorkerSimple.h.

std::vector<float> HGCalRecHitWorkerSimple::rcorr_
protected

Definition at line 42 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and run().

std::unique_ptr<HGCalRecHitSimpleAlgo> HGCalRecHitWorkerSimple::rechitMaker_
protected

Definition at line 44 of file HGCalRecHitWorkerSimple.h.

Referenced by HGCalRecHitWorkerSimple(), and run().

std::vector<int> HGCalRecHitWorkerSimple::v_chstatus_
protected

Definition at line 37 of file HGCalRecHitWorkerSimple.h.

std::vector<int> HGCalRecHitWorkerSimple::v_DB_reco_flags_
protected

Definition at line 39 of file HGCalRecHitWorkerSimple.h.