CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
HGCalHitCalibration Class Reference
Inheritance diagram for HGCalHitCalibration:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 HGCalHitCalibration (const edm::ParameterSet &)
 
 ~HGCalHitCalibration () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void fillWithRecHits (std::map< DetId, const HGCRecHit * > &, DetId, unsigned int, float, int &, float &)
 

Private Attributes

int algo_
 
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
 
int debug_
 
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electrons_
 
std::array< float, layers_Energy_layer_calib_
 
std::array< float, layers_Energy_layer_calib_fraction_
 
std::map< int, MonitorElement * > h_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_ele_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_EoP_CPene_calib_fraction_
 
std::map< int, MonitorElement * > hgcal_photon_EoP_CPene_calib_fraction_
 
edm::EDGetTokenT< std::vector< reco::PFCluster > > hgcalMultiClusters_
 
MonitorElementLayerOccupancy_
 
edm::EDGetTokenT< std::vector< reco::Photon > > photons_
 
bool rawRecHits_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsBH_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsEE_
 
edm::EDGetTokenT< HGCRecHitCollectionrecHitsFH_
 
hgcal::RecHitTools recHitTools_
 

Static Private Attributes

static int layers_ = 60
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 45 of file HGCalHitCalibration.cc.

Constructor & Destructor Documentation

HGCalHitCalibration::HGCalHitCalibration ( const edm::ParameterSet iConfig)
explicit

Definition at line 84 of file HGCalHitCalibration.cc.

References algo_, caloTruthProducer_cfi::caloParticles, caloParticles_, gamEcalExtractorBlocks_cff::detector, electrons_cff::electrons, electrons_, Energy_layer_calib_, Energy_layer_calib_fraction_, edm::ParameterSet::getParameter(), hgcalMultiClusters_, nano_cff::photons, photons_, recHitsBH_, EcalDeadCellBoundaryEnergyFilter_cfi::recHitsEE, recHitsEE_, recHitsFH_, and AlCaHLTBitMon_QueryRunRegistry::string.

85  : rawRecHits_(iConfig.getParameter<bool>("rawRecHits")),
86  debug_(iConfig.getParameter<int>("debug")) {
87  auto detector = iConfig.getParameter<std::string>("detector");
88  auto recHitsEE = iConfig.getParameter<edm::InputTag>("recHitsEE");
89  auto recHitsFH = iConfig.getParameter<edm::InputTag>("recHitsFH");
90  auto recHitsBH = iConfig.getParameter<edm::InputTag>("recHitsBH");
91  auto caloParticles = iConfig.getParameter<edm::InputTag>("caloParticles");
92  auto hgcalMultiClusters = iConfig.getParameter<edm::InputTag>("hgcalMultiClusters");
93  auto electrons = iConfig.getParameter<edm::InputTag>("electrons");
94  auto photons = iConfig.getParameter<edm::InputTag>("photons");
95  if (detector == "all") {
96  recHitsEE_ = consumes<HGCRecHitCollection>(recHitsEE);
97  recHitsFH_ = consumes<HGCRecHitCollection>(recHitsFH);
98  recHitsBH_ = consumes<HGCRecHitCollection>(recHitsBH);
99  algo_ = 1;
100  } else if (detector == "EM") {
101  recHitsEE_ = consumes<HGCRecHitCollection>(recHitsEE);
102  algo_ = 2;
103  } else if (detector == "HAD") {
104  recHitsFH_ = consumes<HGCRecHitCollection>(recHitsFH);
105  recHitsBH_ = consumes<HGCRecHitCollection>(recHitsBH);
106  algo_ = 3;
107  }
108  caloParticles_ = consumes<std::vector<CaloParticle> >(caloParticles);
109  hgcalMultiClusters_ = consumes<std::vector<reco::PFCluster> >(hgcalMultiClusters);
110  electrons_ = consumes<std::vector<reco::GsfElectron> >(electrons);
111  photons_ = consumes<std::vector<reco::Photon> >(photons);
112 
113  // size should be HGC layers 52 is enough
114  Energy_layer_calib_.fill(0.);
116 }
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
edm::EDGetTokenT< std::vector< reco::Photon > > photons_
std::array< float, layers_ > Energy_layer_calib_fraction_
edm::EDGetTokenT< std::vector< reco::PFCluster > > hgcalMultiClusters_
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electrons_
std::array< float, layers_ > Energy_layer_calib_
HGCalHitCalibration::~HGCalHitCalibration ( )
override

Definition at line 118 of file HGCalHitCalibration.cc.

118  {
119  // do anything here that needs to be done at desctruction time
120  // (e.g. close files, deallocate resources etc.)
121 }

Member Function Documentation

void HGCalHitCalibration::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 184 of file HGCalHitCalibration.cc.

References a, algo_, b, caloTruthProducer_cfi::caloParticles, caloParticles_, fastPrimaryVertexProducer_cfi::clusters, reco::CaloCluster::correctedEnergy(), debug_, reco::deltaR2(), DetId::det(), electrons_, reco::PFCluster::energy(), SimCluster::energy(), Energy_layer_calib_, Energy_layer_calib_fraction_, HcalObjRepresent::Fill(), fillWithRecHits(), DetId::Forward, edm::Event::getByToken(), hgcal::RecHitTools::getEventSetup(), hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getSiThickness(), h_EoP_CPene_calib_fraction_, DetId::Hcal, HcalEndcap, hgcal_ele_EoP_CPene_calib_fraction_, hgcal_EoP_CPene_calib_fraction_, hgcal_photon_EoP_CPene_calib_fraction_, hgcalMultiClusters_, HGCEE, HGCHEB, HGCHEF, SimCluster::hits_and_fractions(), mps_fire::i, IfLogTrace, edm::HandleBase::isValid(), or, muons2muons_cfi::photon, photons_, rawRecHits_, recHitsBH_, recHitsEE_, recHitsFH_, recHitTools_, SimCluster::simEnergy(), edm::SortedCollection< T, SORT >::size(), and DetId::subdetId().

185  {
186  using namespace edm;
187 
188  recHitTools_.getEventSetup(iSetup);
189 
190  Handle<HGCRecHitCollection> recHitHandleEE;
191  Handle<HGCRecHitCollection> recHitHandleFH;
192  Handle<HGCRecHitCollection> recHitHandleBH;
193 
194  Handle<std::vector<CaloParticle> > caloParticleHandle;
195  iEvent.getByToken(caloParticles_, caloParticleHandle);
196  const std::vector<CaloParticle>& caloParticles = *caloParticleHandle;
197 
198  Handle<std::vector<reco::PFCluster> > hgcalMultiClustersHandle;
199  iEvent.getByToken(hgcalMultiClusters_, hgcalMultiClustersHandle);
200 
201  Handle<std::vector<reco::GsfElectron> > PFElectronHandle;
202  iEvent.getByToken(electrons_, PFElectronHandle);
203 
204  Handle<std::vector<reco::Photon> > PFPhotonHandle;
205  iEvent.getByToken(photons_, PFPhotonHandle);
206 
207  // make a map detid-rechit
208  std::map<DetId, const HGCRecHit*> hitmap;
209  switch (algo_) {
210  case 1: {
211  iEvent.getByToken(recHitsEE_, recHitHandleEE);
212  iEvent.getByToken(recHitsFH_, recHitHandleFH);
213  iEvent.getByToken(recHitsBH_, recHitHandleBH);
214  const auto& rechitsEE = *recHitHandleEE;
215  const auto& rechitsFH = *recHitHandleFH;
216  const auto& rechitsBH = *recHitHandleBH;
217  for (unsigned int i = 0; i < rechitsEE.size(); ++i) {
218  hitmap[rechitsEE[i].detid()] = &rechitsEE[i];
219  }
220  for (unsigned int i = 0; i < rechitsFH.size(); ++i) {
221  hitmap[rechitsFH[i].detid()] = &rechitsFH[i];
222  }
223  for (unsigned int i = 0; i < rechitsBH.size(); ++i) {
224  hitmap[rechitsBH[i].detid()] = &rechitsBH[i];
225  }
226  break;
227  }
228  case 2: {
229  iEvent.getByToken(recHitsEE_, recHitHandleEE);
230  const HGCRecHitCollection& rechitsEE = *recHitHandleEE;
231  for (unsigned int i = 0; i < rechitsEE.size(); i++) {
232  hitmap[rechitsEE[i].detid()] = &rechitsEE[i];
233  }
234  break;
235  }
236  case 3: {
237  iEvent.getByToken(recHitsFH_, recHitHandleFH);
238  iEvent.getByToken(recHitsBH_, recHitHandleBH);
239  const auto& rechitsFH = *recHitHandleFH;
240  const auto& rechitsBH = *recHitHandleBH;
241  for (unsigned int i = 0; i < rechitsFH.size(); i++) {
242  hitmap[rechitsFH[i].detid()] = &rechitsFH[i];
243  }
244  for (unsigned int i = 0; i < rechitsBH.size(); i++) {
245  hitmap[rechitsBH[i].detid()] = &rechitsBH[i];
246  }
247  break;
248  }
249  default:
250  assert(false);
251  break;
252  }
253 
254  // loop over caloParticles
255  int seedDet = 0;
256  float seedEnergy = 0.;
257  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
258  << "Number of caloParticles: " << caloParticles.size() << std::endl;
259  for (const auto& it_caloPart : caloParticles) {
260  const SimClusterRefVector& simClusterRefVector = it_caloPart.simClusters();
261  Energy_layer_calib_.fill(0.);
263 
264  seedDet = 0;
265  seedEnergy = 0.;
266  for (const auto& it_sc : simClusterRefVector) {
267  const SimCluster& simCluster = (*(it_sc));
268  IfLogTrace(debug_ > 1, "HGCalHitCalibration")
269  << ">>> SC.energy(): " << simCluster.energy()
270  << " SC.simEnergy(): " << simCluster.simEnergy()
271  << std::endl;
272  const std::vector<std::pair<uint32_t, float> >& hits_and_fractions =
273  simCluster.hits_and_fractions();
274 
275  // loop over hits
276  for (const auto& it_haf : hits_and_fractions) {
277  unsigned int hitlayer = recHitTools_.getLayerWithOffset(it_haf.first);
278  DetId hitid = (it_haf.first);
279  // dump raw RecHits and match
280  if (rawRecHits_) {
281  if ((hitid.det() == DetId::Forward &&
282  (hitid.subdetId() == HGCEE or hitid.subdetId() == HGCHEF or
283  hitid.subdetId() == HGCHEB)) ||
284  (hitid.det() == DetId::Hcal && hitid.subdetId() == HcalEndcap))
285  fillWithRecHits(hitmap, hitid, hitlayer, it_haf.second, seedDet,
286  seedEnergy);
287  }
288  } // end simHit
289  } // end simCluster
290 
291  auto sumCalibRecHitCalib_fraction = std::accumulate(Energy_layer_calib_fraction_.begin(),
292  Energy_layer_calib_fraction_.end(), 0.);
293  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
294  << ">>> MC Energy: " << it_caloPart.energy()
295  << " reco energy: " << sumCalibRecHitCalib_fraction
296  << std::endl;
297  if (h_EoP_CPene_calib_fraction_.count(seedDet))
298  h_EoP_CPene_calib_fraction_[seedDet]->Fill(sumCalibRecHitCalib_fraction /
299  it_caloPart.energy());
300 
301  // Loop on reconstructed SC.
302  const auto& clusters = *hgcalMultiClustersHandle;
303  float total_energy = 0.;
304  float max_dR2 = 0.0025;
305  auto closest = std::min_element(clusters.begin(),
306  clusters.end(),
307  [&](const reco::PFCluster &a,
308  const reco::PFCluster &b) {
309  auto dR2_a = reco::deltaR2(it_caloPart, a);
310  auto dR2_b = reco::deltaR2(it_caloPart, b);
311  auto ERatio_a = a.correctedEnergy()/it_caloPart.energy();
312  auto ERatio_b = b.correctedEnergy()/it_caloPart.energy();
313  // If both clusters are within 0.0025, mark as first (min) the
314  // element with the highest ratio against the SimCluster
315  if (dR2_a < max_dR2 && dR2_b < max_dR2)
316  return ERatio_a > ERatio_b;
317  return dR2_a < dR2_b;
318  });
319  if (closest != clusters.end()
320  && reco::deltaR2(*closest, it_caloPart) < 0.01) {
321  total_energy = closest->correctedEnergy();
322  seedDet = recHitTools_.getSiThickness(closest->seed());
323  if (hgcal_EoP_CPene_calib_fraction_.count(seedDet)) {
324  hgcal_EoP_CPene_calib_fraction_[seedDet]->Fill(total_energy /
325  it_caloPart.energy());
326  }
327  }
328 
329  auto closest_fcn = [&](auto const &a, auto const&b){
330  auto dR2_a = reco::deltaR2(it_caloPart, a);
331  auto dR2_b = reco::deltaR2(it_caloPart, b);
332  auto ERatio_a = a.energy()/it_caloPart.energy();
333  auto ERatio_b = b.energy()/it_caloPart.energy();
334  // If both clusters are within 0.0025, mark as first (min) the
335  // element with the highest ratio against the SimCluster
336  if (dR2_a < max_dR2 && dR2_b < max_dR2)
337  return ERatio_a > ERatio_b;
338  return dR2_a < dR2_b;
339  };
340  // ELECTRONS in HGCAL
341  if (PFElectronHandle.isValid()) {
342  auto const & ele = (*PFElectronHandle);
343  auto closest = std::min_element(ele.begin(),
344  ele.end(),
345  closest_fcn);
346  if (closest != ele.end()
347  && closest->superCluster()->seed()->seed().det() == DetId::Forward
348  && reco::deltaR2(*closest, it_caloPart) < 0.01) {
349  seedDet = recHitTools_.getSiThickness(closest->superCluster()->seed()->seed());
350  if (hgcal_ele_EoP_CPene_calib_fraction_.count(seedDet)) {
351  hgcal_ele_EoP_CPene_calib_fraction_[seedDet]->Fill(closest->energy() /
352  it_caloPart.energy());
353  }
354  }
355  }
356 
357  // PHOTONS in HGCAL
358  if (PFPhotonHandle.isValid()) {
359  auto const & photon = (*PFPhotonHandle);
360  auto closest = std::min_element(photon.begin(),
361  photon.end(),
362  closest_fcn);
363  if (closest != photon.end()
364  && closest->superCluster()->seed()->seed().det() == DetId::Forward
365  && reco::deltaR2(*closest, it_caloPart) < 0.01) {
366  seedDet = recHitTools_.getSiThickness(closest->superCluster()->seed()->seed());
367  if (hgcal_photon_EoP_CPene_calib_fraction_.count(seedDet)) {
368  hgcal_photon_EoP_CPene_calib_fraction_[seedDet]->Fill(closest->energy() /
369  it_caloPart.energy());
370  }
371  }
372  }
373  } // end caloparticle
374 }
edm::EDGetTokenT< std::vector< CaloParticle > > caloParticles_
edm::EDGetTokenT< std::vector< reco::Photon > > photons_
std::array< float, layers_ > Energy_layer_calib_fraction_
edm::EDGetTokenT< std::vector< reco::PFCluster > > hgcalMultiClusters_
std::map< int, MonitorElement * > hgcal_EoP_CPene_calib_fraction_
double correctedEnergy() const
Definition: CaloCluster.h:125
edm::EDGetTokenT< HGCRecHitCollection > recHitsFH_
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:47
edm::EDGetTokenT< HGCRecHitCollection > recHitsEE_
std::vector< std::pair< uint32_t, float > > hits_and_fractions() const
Returns list of rechit IDs and fractions for this SimCluster.
Definition: SimCluster.h:210
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::map< int, MonitorElement * > hgcal_ele_EoP_CPene_calib_fraction_
#define IfLogTrace(cond, cat)
std::map< int, MonitorElement * > hgcal_photon_EoP_CPene_calib_fraction_
void getEventSetup(const edm::EventSetup &)
Definition: RecHitTools.cc:61
edm::EDGetTokenT< HGCRecHitCollection > recHitsBH_
Monte Carlo truth information used for tracking validation.
Definition: SimCluster.h:28
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
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
float energy() const
Energy. Note this is taken from the first SimTrack only.
Definition: SimCluster.h:111
bool isValid() const
Definition: HandleBase.h:74
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
double energy() const
cluster energy
Definition: PFCluster.h:82
hgcal::RecHitTools recHitTools_
float simEnergy() const
returns the accumulated sim energy in the cluster
Definition: SimCluster.h:225
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:103
Definition: DetId.h:18
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:179
edm::EDGetTokenT< std::vector< reco::GsfElectron > > electrons_
std::map< int, MonitorElement * > h_EoP_CPene_calib_fraction_
double b
Definition: hdecay.h:120
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
HLT enums.
void fillWithRecHits(std::map< DetId, const HGCRecHit * > &, DetId, unsigned int, float, int &, float &)
size_type size() const
double a
Definition: hdecay.h:121
std::array< float, layers_ > Energy_layer_calib_
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
void HGCalHitCalibration::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 123 of file HGCalHitCalibration.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::cd(), h_EoP_CPene_calib_fraction_, hgcal_ele_EoP_CPene_calib_fraction_, hgcal_EoP_CPene_calib_fraction_, hgcal_photon_EoP_CPene_calib_fraction_, LayerOccupancy_, layers_, and DQMStore::IBooker::setCurrentFolder().

125  {
126  ibooker.cd();
127  ibooker.setCurrentFolder("HGCalHitCalibration");
129  ibooker.book1D("h_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
131  ibooker.book1D("h_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
133  ibooker.book1D("h_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
135  ibooker.book1D("hgcal_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
137  ibooker.book1D("hgcal_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
139  ibooker.book1D("hgcal_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
141  ibooker.book1D("hgcal_ele_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
143  ibooker.book1D("hgcal_ele_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
145  ibooker.book1D("hgcal_ele_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
147  ibooker.book1D("hgcal_photon_EoP_CPene_100_calib_fraction", "", 1000, -0.5, 2.5);
149  ibooker.book1D("hgcal_photon_EoP_CPene_200_calib_fraction", "", 1000, -0.5, 2.5);
151  ibooker.book1D("hgcal_photon_EoP_CPene_300_calib_fraction", "", 1000, -0.5, 2.5);
152  LayerOccupancy_ = ibooker.book1D("LayerOccupancy", "", layers_, 0., (float)layers_);
153 }
std::map< int, MonitorElement * > hgcal_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > hgcal_ele_EoP_CPene_calib_fraction_
std::map< int, MonitorElement * > hgcal_photon_EoP_CPene_calib_fraction_
MonitorElement * LayerOccupancy_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
std::map< int, MonitorElement * > h_EoP_CPene_calib_fraction_
void HGCalHitCalibration::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 378 of file HGCalHitCalibration.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and AlCaHLTBitMon_QueryRunRegistry::string.

379  {
381  desc.add<int>("debug", 0);
382  desc.add<bool>("rawRecHits", true);
383  desc.add<std::string>("detector", "all");
384  desc.add<edm::InputTag>("caloParticles", edm::InputTag("mix", "MergedCaloTruth"));
385  desc.add<edm::InputTag>("recHitsEE", edm::InputTag("HGCalRecHit", "HGCEERecHits"));
386  desc.add<edm::InputTag>("recHitsFH", edm::InputTag("HGCalRecHit", "HGCHEFRecHits"));
387  desc.add<edm::InputTag>("recHitsBH", edm::InputTag("HGCalRecHit", "HGCHEBRecHits"));
388  desc.add<edm::InputTag>("hgcalMultiClusters", edm::InputTag("particleFlowClusterHGCalFromMultiCl"));
389  desc.add<edm::InputTag>("electrons", edm::InputTag("ecalDrivenGsfElectronsFromMultiCl"));
390  desc.add<edm::InputTag>("photons", edm::InputTag("photonsFromMultiCl"));
391  descriptions.add("hgcalHitCalibration", desc);
392 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HGCalHitCalibration::fillWithRecHits ( std::map< DetId, const HGCRecHit * > &  hitmap,
DetId  hitid,
unsigned int  hitlayer,
float  fraction,
int &  seedDet,
float &  seedEnergy 
)
private

Definition at line 155 of file HGCalHitCalibration.cc.

References debug_, TauDecayModes::dec, DetId::det(), Energy_layer_calib_fraction_, MonitorElement::Fill(), DetId::Forward, dedxEstimators_cff::fraction, hgcal::RecHitTools::getLayerWithOffset(), hgcal::RecHitTools::getSiThickness(), IfLogTrace, LayerOccupancy_, DetId::rawId(), recHitTools_, and DetId::subdetId().

Referenced by analyze().

158  {
159  if (hitmap.find(hitid) == hitmap.end()) {
160  // Hit was not reconstructed
161  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
162  << ">>> Failed to find detid " << std::hex << hitid.rawId() << std::dec
163  << " Det " << hitid.det()
164  << " Subdet " << hitid.subdetId() << std::endl;
165  return;
166  }
167  if (hitid.det() != DetId::Forward) {
168  IfLogTrace(debug_ > 0, "HGCalHitCalibration")
169  << ">>> Wrong type of detid " << std::hex << hitid.rawId() << std::dec
170  << " Det " << hitid.det()
171  << " Subdet " << hitid.subdetId() << std::endl;
172  return;
173  }
174  unsigned int layer = recHitTools_.getLayerWithOffset(hitid);
175  assert(hitlayer == layer);
176  Energy_layer_calib_fraction_[layer] += hitmap[hitid]->energy() * fraction;
177  LayerOccupancy_->Fill(layer);
178  if (seedEnergy < hitmap[hitid]->energy()) {
179  seedEnergy = hitmap[hitid]->energy();
180  seedDet = recHitTools_.getSiThickness(hitid);
181  }
182 }
std::array< float, layers_ > Energy_layer_calib_fraction_
#define IfLogTrace(cond, cat)
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
MonitorElement * LayerOccupancy_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
hgcal::RecHitTools recHitTools_
std::float_t getSiThickness(const DetId &) const
Definition: RecHitTools.cc:103
unsigned int getLayerWithOffset(const DetId &) const
Definition: RecHitTools.cc:179
Detector det() const
get the detector field from this detid
Definition: DetId.h:35

Member Data Documentation

int HGCalHitCalibration::algo_
private

Definition at line 68 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

edm::EDGetTokenT<std::vector<CaloParticle> > HGCalHitCalibration::caloParticles_
private

Definition at line 63 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

int HGCalHitCalibration::debug_
private

Definition at line 70 of file HGCalHitCalibration.cc.

Referenced by analyze(), and fillWithRecHits().

edm::EDGetTokenT<std::vector<reco::GsfElectron> > HGCalHitCalibration::electrons_
private

Definition at line 65 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

std::array<float, layers_> HGCalHitCalibration::Energy_layer_calib_
private

Definition at line 80 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

std::array<float, layers_> HGCalHitCalibration::Energy_layer_calib_fraction_
private

Definition at line 81 of file HGCalHitCalibration.cc.

Referenced by analyze(), fillWithRecHits(), and HGCalHitCalibration().

std::map<int, MonitorElement*> HGCalHitCalibration::h_EoP_CPene_calib_fraction_
private

Definition at line 73 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_ele_EoP_CPene_calib_fraction_
private

Definition at line 75 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_EoP_CPene_calib_fraction_
private

Definition at line 74 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

std::map<int, MonitorElement*> HGCalHitCalibration::hgcal_photon_EoP_CPene_calib_fraction_
private

Definition at line 76 of file HGCalHitCalibration.cc.

Referenced by analyze(), and bookHistograms().

edm::EDGetTokenT<std::vector<reco::PFCluster> > HGCalHitCalibration::hgcalMultiClusters_
private

Definition at line 64 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

MonitorElement* HGCalHitCalibration::LayerOccupancy_
private

Definition at line 77 of file HGCalHitCalibration.cc.

Referenced by bookHistograms(), and fillWithRecHits().

int HGCalHitCalibration::layers_ = 60
staticprivate

Definition at line 79 of file HGCalHitCalibration.cc.

Referenced by bookHistograms().

edm::EDGetTokenT<std::vector<reco::Photon> > HGCalHitCalibration::photons_
private

Definition at line 66 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

bool HGCalHitCalibration::rawRecHits_
private

Definition at line 69 of file HGCalHitCalibration.cc.

Referenced by analyze().

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsBH_
private

Definition at line 62 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsEE_
private

Definition at line 60 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

edm::EDGetTokenT<HGCRecHitCollection> HGCalHitCalibration::recHitsFH_
private

Definition at line 61 of file HGCalHitCalibration.cc.

Referenced by analyze(), and HGCalHitCalibration().

hgcal::RecHitTools HGCalHitCalibration::recHitTools_
private

Definition at line 71 of file HGCalHitCalibration.cc.

Referenced by analyze(), and fillWithRecHits().