test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HGCalRecHitWorkerSimple.cc
Go to the documentation of this file.
9 
12  rechitMaker_.reset( new HGCalRecHitSimpleAlgo() );
13  constexpr float keV2GeV = 1e-6;
14  // HGCee constants
15  HGCEEmipInKeV_ = ps.getParameter<double>("HGCEEmipInKeV");
16  HGCEElsbInMIP_ = ps.getParameter<double>("HGCEElsbInMIP");
17  HGCEEmip2noise_ = ps.getParameter<double>("HGCEEmip2noise");
18  hgceeADCtoGeV_ = HGCEEmipInKeV_ * HGCEElsbInMIP_*keV2GeV;
19  // HGChef constants
20  HGCHEFmipInKeV_ = ps.getParameter<double>("HGCHEFmipInKeV");
21  HGCHEFlsbInMIP_ = ps.getParameter<double>("HGCHEFlsbInMIP");
22  HGCHEFmip2noise_ = ps.getParameter<double>("HGCHEFmip2noise");
23  hgchefADCtoGeV_ = HGCHEFmipInKeV_ * HGCHEFlsbInMIP_*keV2GeV;
24  // HGCheb constants
25  HGCHEBmipInKeV_ = ps.getParameter<double>("HGCHEBmipInKeV");
26  HGCHEBlsbInMIP_ = ps.getParameter<double>("HGCHEBlsbInMIP");
27  HGCHEBmip2noise_ = ps.getParameter<double>("HGCHEBmip2noise");
28  hgchebADCtoGeV_ = HGCHEBmipInKeV_ * HGCHEBlsbInMIP_*keV2GeV;
29 }
30 
32 }
33 
34 
35 bool
37  const HGCUncalibratedRecHit& uncalibRH,
39 {
40  DetId detid=uncalibRH.id();
41  uint32_t recoFlag = 0;
42 
43  switch( detid.subdetId() ) {
44  case HGCEE:
45  rechitMaker_->setADCToGeVConstant(float(hgceeADCtoGeV_) );
46  break;
47  case HGCHEF:
48  rechitMaker_->setADCToGeVConstant(float(hgchefADCtoGeV_) );
49  break;
50  case HGCHEB:
51  rechitMaker_->setADCToGeVConstant(float(hgchebADCtoGeV_) );
52  break;
53  default:
54  throw cms::Exception("NonHGCRecHit")
55  << "Rechit with detid = " << detid.rawId() << " is not HGC!";
56  }
57 
58  // make the rechit and put in the output collection
59  if (recoFlag == 0) {
60  HGCRecHit myrechit( rechitMaker_->makeRecHit(uncalibRH, 0) );
61  result.push_back(myrechit);
62  }
63 
64  return true;
65 }
66 
68 }
69 
70 
T getParameter(std::string const &) const
bool run(const edm::Event &evt, const HGCUncalibratedRecHit &uncalibRH, HGCRecHitCollection &result)
void push_back(T const &t)
#define constexpr
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
tuple result
Definition: query.py:137
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void set(const edm::EventSetup &es)
Definition: DetId.h:18
HGCalRecHitWorkerSimple(const edm::ParameterSet &)
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::unique_ptr< HGCalRecHitSimpleAlgo > rechitMaker_