CMS 3D CMS Logo

HcalHBHEMuonSimAnalyzer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <iostream>
3 #include <vector>
4 
5 #include <TTree.h>
6 
7 // user include files
16 
25 
29 
40 
41 //#define EDM_ML_DEBUG
42 
43 class HcalHBHEMuonSimAnalyzer : public edm::one::EDAnalyzer<edm::one::WatchRuns,edm::one::SharedResources> {
44 
45 public:
48 
49  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
50 
51 private:
52  virtual void beginJob() override;
53  virtual void analyze(edm::Event const&, edm::EventSetup const&) override;
54  virtual void beginRun(edm::Run const&, edm::EventSetup const&) override;
55  virtual void endRun(edm::Run const&, edm::EventSetup const&) override {}
58  void clearVectors();
59  unsigned int matchId(const HcalDetId&, const HcalDetId&);
60  double activeLength(const DetId&);
61 
65  double etaMax_;
66  std::vector<HcalDDDRecConstants::HcalActiveLength> actHB_, actHE_;
67  const int MaxDepth=7;
68  const int idMuon_=13;
75 
76  TTree *tree_;
78  std::vector<double> ptGlob_, etaGlob_, phiGlob_, pMuon_;
79  std::vector<double> ecal3x3Energy_, hcal1x1Energy_;
80  std::vector<unsigned int> ecalDetId_, hcalDetId_, hcalHot_;
96 };
97 
99 
100  usesResource(TFileService::kSharedResource);
101 
102  //now do what ever initialization is needed
103  g4Label_ = iConfig.getParameter<std::string>("ModuleLabel");
104  ebLabel_ = iConfig.getParameter<std::string>("EBCollection");
105  eeLabel_ = iConfig.getParameter<std::string>("EECollection");
106  hcLabel_ = iConfig.getParameter<std::string>("HCCollection");
107  verbosity_ = iConfig.getUntrackedParameter<int>("Verbosity",0);
108  maxDepth_ = iConfig.getUntrackedParameter<int>("MaxDepth",4);
109  etaMax_ = iConfig.getUntrackedParameter<double>("EtaMax", 3.0);
110  tMinE_ = iConfig.getUntrackedParameter<double>("TimeMinCutECAL", -500.);
111  tMaxE_ = iConfig.getUntrackedParameter<double>("TimeMaxCutECAL", 500.);
112  tMinH_ = iConfig.getUntrackedParameter<double>("TimeMinCutHCAL", -500.);
113  tMaxH_ = iConfig.getUntrackedParameter<double>("TimeMaxCutHCAL", 500.);
114 
115  tok_SimTk_ = consumes<edm::SimTrackContainer>(edm::InputTag(g4Label_));
116  tok_SimVtx_ = consumes<edm::SimVertexContainer>(edm::InputTag(g4Label_));
117  tok_caloEB_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,ebLabel_));
118  tok_caloEE_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,eeLabel_));
119  tok_caloHH_ = consumes<edm::PCaloHitContainer>(edm::InputTag(g4Label_,hcLabel_));
120  if (maxDepth_ > MaxDepth) maxDepth_ = MaxDepth;
121  else if (maxDepth_ < 1) maxDepth_ = 4;
122 
123  std::cout << "Labels: " << g4Label_ << ":" << ebLabel_ << ":" << eeLabel_
124  << ":" << hcLabel_ << "\nVerbosity " << verbosity_ << " MaxDepth "
125  << maxDepth_ << " Maximum Eta " << etaMax_ << " tMin|tMax "
126  << tMinE_ << ":" << tMaxE_ << ":" << tMinH_ << ":" << tMaxH_
127  << std::endl;
128 }
129 
131 
133  const edm::EventSetup& iSetup) {
134 
135  clearVectors();
136  bool debug(false);
137 #ifdef EDM_ML_DEBUG
138  debug = ((verbosity_/10)>0);
139 #endif
140  // depthHE is the first depth index for HE for |ieta| = 16
141  // It used to be 3 for all runs preceding 2017 and 4 beyond that
142  int depthHE = (maxDepth_ <= 6) ? 3 : 4;
143 
145  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
146  const HcalDDDRecConstants* hcons = &(*pHRNDC);
147 
148  runNumber_ = iEvent.id().run();
149  eventNumber_ = iEvent.id().event();
150  lumiNumber_ = iEvent.id().luminosityBlock();
151  bxNumber_ = iEvent.bunchCrossing();
152 
153  //get Handles to SimTracks and SimHits
155  iEvent.getByToken(tok_SimTk_,SimTk);
156  edm::SimTrackContainer::const_iterator simTrkItr;
158  iEvent.getByToken(tok_SimVtx_,SimVtx);
159 
160  //get Handles to PCaloHitContainers of eb/ee/hbhe
162  iEvent.getByToken(tok_caloEB_, pcaloeb);
164  iEvent.getByToken(tok_caloEE_, pcaloee);
166  iEvent.getByToken(tok_caloHH_, pcalohh);
167  std::vector<PCaloHit> calohh;
168  bool testN(false);
169  for (unsigned int k=1; k<pcalohh->size(); ++k) {
170  // if it is a standard DetId bits 28..31 will carry the det #
171  // for HCAL det # is 4 and if there is at least one hit in the collection
172  // have det # which is not 4 this collection is created using TestNumbering
173  int det = ((((*pcalohh)[k].id())>>28)&0xF);
174  if (det != 4) {testN = true; break;}
175  }
176  if (testN) {
177  for (edm::PCaloHitContainer::const_iterator itr=pcalohh->begin(); itr != pcalohh->end(); ++itr) {
178  PCaloHit hit(*itr);
179  DetId newid = HcalHitRelabeller::relabel(hit.id(),hcons);
180  std::cout << "Old ID " << std::hex << hit.id() << std::dec << " New " << HcalDetId(newid) << std::endl;
181  hit.setID(newid.rawId());
182  calohh.push_back(hit);
183  }
184  } else {
185  calohh.insert(calohh.end(),pcalohh->begin(),pcalohh->end());
186  }
187 
188  // get handles to calogeometry and calotopology
190  iSetup.get<CaloGeometryRecord>().get(pG);
191  const CaloGeometry* geo = pG.product();
192 
194  iSetup.get<IdealMagneticFieldRecord>().get(bFieldH);
195  const MagneticField* bField = bFieldH.product();
196 
197  edm::ESHandle<CaloTopology> theCaloTopology;
198  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
199  const CaloTopology *caloTopology = theCaloTopology.product();
200 
202  iSetup.get<HcalRecNumberingRecord>().get(htopo);
203  const HcalTopology* theHBHETopology = htopo.product();
204 
205  // Loop over all SimTracks
206  for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
207  simTrkItr!= SimTk->end(); simTrkItr++) {
208  if ((std::abs(simTrkItr->type()) == idMuon_) && (simTrkItr->vertIndex() == 0) &&
209  (std::abs(simTrkItr->momentum().eta()) < etaMax_)) {
210  unsigned int thisTrk = simTrkItr->trackId();
211  spr::propagatedTrackDirection trkD = spr::propagateCALO(thisTrk, SimTk, SimVtx, geo, bField, debug);
212 
213  double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
214  double eHcalDepth[MaxDepth], eHcalDepthHot[MaxDepth];
215  double activeL[MaxDepth], activeHotL[MaxDepth];
216  unsigned int isHot(0);
217  for (int i=0; i<MaxDepth; ++i)
218  eHcalDepth[i] = eHcalDepthHot[i] = activeL[i] = activeHotL[i] = -10000;
219 
220 #ifdef EDM_ML_DEBUG
221  if ((verbosity_%10) > 0)
222  std::cout << "Track Type " << simTrkItr->type() << " Vertex "
223  << simTrkItr->vertIndex() << " Charge " << simTrkItr->charge()
224  << " Momentum " << simTrkItr->momentum().P() << ":"
225  << simTrkItr->momentum().eta() << ":"
226  << simTrkItr->momentum().phi() << " ECAL|HCAL " << trkD.okECAL
227  << ":" << trkD.okHCAL << " Point " << trkD.pointECAL << ":"
228  << trkD.pointHCAL << " Direction " << trkD.directionECAL.eta()
229  << ":" << trkD.directionECAL.phi() << " | "
230  << trkD.directionHCAL.eta() << ":" << trkD.directionHCAL.phi()
231  << std::endl;
232 #endif
233 
234  if (trkD.okHCAL) {
235  // Muon properties
236  spr::trackAtOrigin tkvx = spr::simTrackAtOrigin(thisTrk, SimTk, SimVtx, debug);
237  ptGlob_.push_back(tkvx.momentum.perp());
238  etaGlob_.push_back(tkvx.momentum.eta());
239  phiGlob_.push_back(tkvx.momentum.phi());
240  pMuon_.push_back(tkvx.momentum.mag());
241 #ifdef EDM_ML_DEBUG
242  if ((verbosity_%10) > 0)
243  std::cout << "Track at vertex " << tkvx.ok << " position "
244  << tkvx.position << " Momentum " << tkvx.momentum.mag()
245  << ":" << tkvx.momentum.eta() << ":"
246  << tkvx.momentum.phi() << " Charge " << tkvx.charge
247  << std::endl;
248 #endif
249 
250  // Energy in ECAL
251  DetId isoCell;
252  if (trkD.okECAL) {
253  isoCell = trkD.detIdECAL;
254  eEcal = spr::eECALmatrix(isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0, tMinE_, tMaxE_, debug);
255  }
256 
257  // Energy in Hcal
258  const DetId closestCell(trkD.detIdHCAL);
259  eHcal = spr::eHCALmatrix(theHBHETopology, closestCell, calohh,0,0, false, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_, debug);
260 #ifdef EDM_ML_DEBUG
261  if ((verbosity_%10) > 0)
262  std::cout << "eEcal " << trkD.okECAL << ":" << eEcal << " eHcal "
263  << eHcal << std::endl;
264 #endif
265 
266  HcalSubdetector subdet = HcalDetId(closestCell).subdet();
267  int ieta = HcalDetId(closestCell).ieta();
268  int iphi = HcalDetId(closestCell).iphi();
269  bool hbhe = (std::abs(ieta) == 16);
270  std::vector<std::pair<double,int> > ehdepth;
271  spr::energyHCALCell((HcalDetId)closestCell, calohh, ehdepth, maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0, debug);
272  for (unsigned int i=0; i<ehdepth.size(); ++i) {
273  eHcalDepth[ehdepth[i].second-1] = ehdepth[i].first;
274  HcalSubdetector subdet0 = (hbhe) ? ((ehdepth[i].second >= depthHE) ? HcalEndcap : HcalBarrel) : subdet;
275  HcalDetId hcid0(subdet0,ieta,iphi,ehdepth[i].second);
276  double actL = activeLength(DetId(hcid0));
277  activeL[ehdepth[i].second-1] = actL;
278  activeLengthTot += actL;
279 #ifdef EDM_ML_DEBUG
280  if ((verbosity_%10) > 0)
281  std::cout << hcid0 << " E " << ehdepth[i].first << " L " << actL
282  << std::endl;
283 #endif
284  }
285 
286  HcalDetId hotCell;
287 #ifdef EDM_ML_DEBUG
288  double h3x3 =
289 #endif
290  spr::eHCALmatrix(geo,theHBHETopology, closestCell, calohh, 1,1, hotCell, debug);
291  isHot = matchId(closestCell,hotCell);
292 #ifdef EDM_ML_DEBUG
293  if ((verbosity_%10) > 0)
294  std::cout << "hcal 3X3 < " << h3x3 << ">" << " ClosestCell <"
295  << (HcalDetId)(closestCell) << "> hotCell id < " << hotCell
296  << "> isHot" << isHot << std::endl;
297 #endif
298 
299  if (hotCell != HcalDetId()) {
300  subdet = HcalDetId(hotCell).subdet();
301  ieta = HcalDetId(hotCell).ieta();
302  iphi = HcalDetId(hotCell).iphi();
303  hbhe = (std::abs(ieta) == 16);
304  std::vector<std::pair<double,int> > ehdepth;
305  spr::energyHCALCell(hotCell, calohh, ehdepth, maxDepth_, -100.0, -100.0, -100.0, -100.0, tMinH_, tMaxH_, debug);
306  for (unsigned int i=0; i<ehdepth.size(); ++i) {
307  eHcalDepthHot[ehdepth[i].second-1] = ehdepth[i].first;
308  HcalSubdetector subdet0 = (hbhe) ? ((ehdepth[i].second >= depthHE) ? HcalEndcap : HcalBarrel) : subdet;
309  HcalDetId hcid0(subdet0,ieta,iphi,ehdepth[i].second);
310  double actL = activeLength(DetId(hcid0));
311  activeHotL[ehdepth[i].second-1] = actL;
312  activeLengthHotTot += actL;
313 #ifdef EDM_ML_DEBUG
314  if ((verbosity_%10) > 0)
315  std::cout << hcid0 << " E " << ehdepth[i].first << " L "
316  << actL << std::endl;
317 #endif
318  }
319  }
320 #ifdef EDM_ML_DEBUG
321  if ((verbosity_%10) > 0) {
322  for (int k=0; k<MaxDepth; ++k)
323  std::cout << "Depth " << k << " E " << eHcalDepth[k] << ":"
324  << eHcalDepthHot[k] << std::endl;
325  }
326 #endif
327  ecal3x3Energy_.push_back(eEcal);
328  ecalDetId_.push_back(isoCell.rawId());
329  hcal1x1Energy_.push_back(eHcal);
330  hcalDetId_.push_back(closestCell.rawId());
331  hcalDepth1Energy_.push_back(eHcalDepth[0]);
332  hcalDepth2Energy_.push_back(eHcalDepth[1]);
333  hcalDepth3Energy_.push_back(eHcalDepth[2]);
334  hcalDepth4Energy_.push_back(eHcalDepth[3]);
335  hcalDepth5Energy_.push_back(eHcalDepth[4]);
336  hcalDepth6Energy_.push_back(eHcalDepth[5]);
337  hcalDepth7Energy_.push_back(eHcalDepth[6]);
338  hcalDepth1ActiveLength_.push_back(activeL[0]);
339  hcalDepth2ActiveLength_.push_back(activeL[1]);
340  hcalDepth3ActiveLength_.push_back(activeL[2]);
341  hcalDepth4ActiveLength_.push_back(activeL[3]);
342  hcalDepth5ActiveLength_.push_back(activeL[4]);
343  hcalDepth6ActiveLength_.push_back(activeL[5]);
344  hcalDepth7ActiveLength_.push_back(activeL[6]);
345  hcalActiveLength_.push_back(activeLengthTot);
346  hcalHot_.push_back(isHot);
347  hcalDepth1EnergyHot_.push_back(eHcalDepthHot[0]);
348  hcalDepth2EnergyHot_.push_back(eHcalDepthHot[1]);
349  hcalDepth3EnergyHot_.push_back(eHcalDepthHot[2]);
350  hcalDepth4EnergyHot_.push_back(eHcalDepthHot[3]);
351  hcalDepth5EnergyHot_.push_back(eHcalDepthHot[4]);
352  hcalDepth6EnergyHot_.push_back(eHcalDepthHot[5]);
353  hcalDepth7EnergyHot_.push_back(eHcalDepthHot[6]);
354  hcalDepth1ActiveLengthHot_.push_back(activeHotL[0]);
355  hcalDepth2ActiveLengthHot_.push_back(activeHotL[1]);
356  hcalDepth3ActiveLengthHot_.push_back(activeHotL[2]);
357  hcalDepth4ActiveLengthHot_.push_back(activeHotL[3]);
358  hcalDepth5ActiveLengthHot_.push_back(activeHotL[4]);
359  hcalDepth6ActiveLengthHot_.push_back(activeHotL[5]);
360  hcalDepth7ActiveLengthHot_.push_back(activeHotL[6]);
361  hcalActiveLengthHot_.push_back(activeLengthHotTot);
362  }
363  }
364  }
365  if (hcalHot_.size() > 0) tree_->Fill();
366 }
367 
369 
370  tree_ = fs_->make<TTree>("TREE", "TREE");
371  tree_->Branch("Run_No", &runNumber_);
372  tree_->Branch("Event_No", &eventNumber_);
373  tree_->Branch("LumiNumber", &lumiNumber_);
374  tree_->Branch("BXNumber", &bxNumber_);
375  tree_->Branch("pt_of_muon", &ptGlob_);
376  tree_->Branch("eta_of_muon", &etaGlob_);
377  tree_->Branch("phi_of_muon", &phiGlob_);
378  tree_->Branch("p_of_muon", &pMuon_);
379 
380  tree_->Branch("ecal_3x3", &ecal3x3Energy_);
381  tree_->Branch("ecal_detID", &ecalDetId_);
382  tree_->Branch("hcal_1x1", &hcal1x1Energy_);
383  tree_->Branch("hcal_detID", &hcalDetId_);
384  tree_->Branch("hcal_cellHot", &hcalHot_);
385  tree_->Branch("activeLength", &hcalActiveLength_);
386  tree_->Branch("hcal_edepth1", &hcalDepth1Energy_);
387  tree_->Branch("hcal_edepth2", &hcalDepth2Energy_);
388  tree_->Branch("hcal_edepth3", &hcalDepth3Energy_);
389  tree_->Branch("hcal_edepth4", &hcalDepth4Energy_);
390  tree_->Branch("hcal_activeL1", &hcalDepth1ActiveLength_);
391  tree_->Branch("hcal_activeL2", &hcalDepth2ActiveLength_);
392  tree_->Branch("hcal_activeL3", &hcalDepth3ActiveLength_);
393  tree_->Branch("hcal_activeL4", &hcalDepth4ActiveLength_);
394  tree_->Branch("activeLengthHot", &hcalActiveLengthHot_);
395  tree_->Branch("hcal_edepthHot1", &hcalDepth1EnergyHot_);
396  tree_->Branch("hcal_edepthHot2", &hcalDepth2EnergyHot_);
397  tree_->Branch("hcal_edepthHot3", &hcalDepth3EnergyHot_);
398  tree_->Branch("hcal_edepthHot4", &hcalDepth4EnergyHot_);
399  tree_->Branch("hcal_activeHotL1", &hcalDepth1ActiveLength_);
400  tree_->Branch("hcal_activeHotL2", &hcalDepth2ActiveLength_);
401  tree_->Branch("hcal_activeHotL3", &hcalDepth3ActiveLength_);
402  tree_->Branch("hcal_activeHotL4", &hcalDepth4ActiveLength_);
403  if (maxDepth_ > 4) {
404  tree_->Branch("hcal_edepth5", &hcalDepth5Energy_);
405  tree_->Branch("hcal_activeL5", &hcalDepth5ActiveLength_);
406  tree_->Branch("hcal_edepthHot5", &hcalDepth5EnergyHot_);
407  tree_->Branch("hcal_activeHotL5", &hcalDepth5ActiveLength_);
408  if (maxDepth_ > 5) {
409  tree_->Branch("hcal_edepth6", &hcalDepth6Energy_);
410  tree_->Branch("hcal_activeL6", &hcalDepth6ActiveLength_);
411  tree_->Branch("hcal_edepthHot6", &hcalDepth6EnergyHot_);
412  tree_->Branch("hcal_activeHotL6", &hcalDepth6ActiveLength_);
413  if (maxDepth_ > 6) {
414  tree_->Branch("hcal_edepth7", &hcalDepth7Energy_);
415  tree_->Branch("hcal_activeL7", &hcalDepth7ActiveLength_);
416  tree_->Branch("hcal_edepthHot7", &hcalDepth7EnergyHot_);
417  tree_->Branch("hcal_activeHotL7", &hcalDepth7ActiveLength_);
418  }
419  }
420  }
421 
422 }
423 
425  edm::EventSetup const& iSetup) {
426 
428  iSetup.get<HcalRecNumberingRecord>().get(pHRNDC);
429  const HcalDDDRecConstants & hdc = (*pHRNDC);
430  actHB_.clear();
431  actHE_.clear();
432  actHB_ = hdc.getThickActive(0);
433  actHE_ = hdc.getThickActive(1);
434 }
435 
436 
438  //The following says we do not know what parameters are allowed so do no validation
439  // Please change this to state exactly what you do use, even if it is no parameters
441  desc.add<std::string>("ModuleLabel","g4SimHits");
442  desc.add<std::string>("EBCollection","EcalHitsEB");
443  desc.add<std::string>("EECollection","EcalHitsEE");
444  desc.add<std::string>("HCCollection","HcalHits");
445  desc.addUntracked<int>("Verbosity",0);
446  desc.addUntracked<int>("MaxDepth",4);
447  desc.addUntracked<double>("EtaMax",3.0);
448  desc.addUntracked<double>("TimeMinCutECAL",-500.0);
449  desc.addUntracked<double>("TimeMaxCutECAL",500.0);
450  desc.addUntracked<double>("TimeMinCutHCAL",-500.0);
451  desc.addUntracked<double>("TimeMaxCutHCAL",500.0);
452  descriptions.add("hcalHBHEMuonSim",desc);
453 }
454 
456 
458  runNumber_ = -99999;
459  eventNumber_ = -99999;
460  lumiNumber_ = -99999;
461  bxNumber_ = -99999;
462 
463  ptGlob_.clear();
464  etaGlob_.clear();
465  phiGlob_.clear();
466  pMuon_.clear();
467 
468  ecal3x3Energy_.clear();
469  ecalDetId_.clear();
470  hcal1x1Energy_.clear();
471  hcalDetId_.clear();
472  hcalHot_.clear();
473  hcalActiveLength_.clear();
474  hcalDepth1Energy_.clear();
475  hcalDepth2Energy_.clear();
476  hcalDepth3Energy_.clear();
477  hcalDepth4Energy_.clear();
478  hcalDepth5Energy_.clear();
479  hcalDepth6Energy_.clear();
480  hcalDepth7Energy_.clear();
481  hcalDepth1ActiveLength_.clear();
482  hcalDepth2ActiveLength_.clear();
483  hcalDepth3ActiveLength_.clear();
484  hcalDepth4ActiveLength_.clear();
485  hcalDepth5ActiveLength_.clear();
486  hcalDepth6ActiveLength_.clear();
487  hcalDepth7ActiveLength_.clear();
488  hcalActiveLengthHot_.clear();
489  hcalDepth1EnergyHot_.clear();
490  hcalDepth2EnergyHot_.clear();
491  hcalDepth3EnergyHot_.clear();
492  hcalDepth4EnergyHot_.clear();
493  hcalDepth5EnergyHot_.clear();
494  hcalDepth6EnergyHot_.clear();
495  hcalDepth7EnergyHot_.clear();
503 }
504 
506  const HcalDetId& id2) {
507 
508  HcalDetId kd1(id1.subdet(),id1.ieta(),id1.iphi(),1);
509  HcalDetId kd2(id2.subdet(),id2.ieta(),id2.iphi(),1);
510  unsigned int match = ((kd1 == kd2) ? 1 : 0);
511  return match;
512 }
513 
515  HcalDetId id(id_);
516  int ieta = id.ietaAbs();
517  int depth= id.depth();
518  double lx(0);
519  if (id.subdet() == HcalBarrel) {
520  for (unsigned int i=0; i<actHB_.size(); ++i) {
521  if (ieta == actHB_[i].ieta && depth == actHB_[i].depth) {
522  lx = actHB_[i].thick;
523  break;
524  }
525  }
526  } else {
527  for (unsigned int i=0; i<actHE_.size(); ++i) {
528  if (ieta == actHE_[i].ieta && depth == actHE_[i].depth) {
529  lx = actHE_[i].thick;
530  break;
531  }
532  }
533  }
534  return lx;
535 }
536 
537 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:39
static const std::string kSharedResource
Definition: TFileService.h:76
std::vector< double > hcalDepth2ActiveLengthHot_
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
std::vector< double > hcalDepth6EnergyHot_
std::vector< double > ecal3x3Energy_
std::vector< double > hcalDepth6ActiveLengthHot_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
T perp() const
Definition: PV3DBase.h:72
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< double > hcalDepth2EnergyHot_
std::vector< unsigned int > hcalDetId_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< double > hcal1x1Energy_
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
int bunchCrossing() const
Definition: EventBase.h:64
std::vector< double > hcalDepth5Energy_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::SimVertexContainer > tok_SimVtx_
std::vector< double > hcalDepth4Energy_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
std::vector< double > ptGlob_
std::vector< double > hcalDepth5EnergyHot_
std::vector< double > hcalDepth5ActiveLengthHot_
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
edm::Service< TFileService > fs_
virtual void endRun(edm::Run const &, edm::EventSetup const &) override
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > hcalDepth2ActiveLength_
std::vector< double > hcalActiveLengthHot_
double activeLength(const DetId &)
std::vector< double > hcalDepth2Energy_
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
U second(std::pair< T, U > const &p)
int iEvent
Definition: GenABIO.cc:230
T mag() const
Definition: PV3DBase.h:67
edm::EDGetTokenT< edm::SimTrackContainer > tok_SimTk_
std::vector< double > hcalDepth1Energy_
std::vector< double > hcalActiveLength_
std::vector< double > hcalDepth7Energy_
std::vector< double > hcalDepth3Energy_
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > hcalDepth1ActiveLengthHot_
unsigned int id() const
Definition: PCaloHit.h:43
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
std::vector< double > hcalDepth3ActiveLengthHot_
std::vector< double > hcalDepth6Energy_
std::vector< HcalActiveLength > getThickActive(const int type) const
std::vector< double > phiGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE_
int k[5][pyjets_maxn]
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
Definition: DetId.h:18
std::vector< double > hcalDepth3ActiveLength_
#define debug
Definition: HDRShower.cc:19
std::vector< double > hcalDepth5ActiveLength_
std::vector< double > hcalDepth4EnergyHot_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
const T & get() const
Definition: EventSetup.h:56
std::vector< double > etaGlob_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > hcalDepth7ActiveLengthHot_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB_
std::vector< double > pMuon_
T eta() const
Definition: PV3DBase.h:76
edm::EventID id() const
Definition: EventBase.h:58
std::vector< double > hcalDepth7EnergyHot_
std::vector< double > hcalDepth4ActiveLengthHot_
std::vector< double > hcalDepth6ActiveLength_
void setID(unsigned int id)
Definition: PCaloHit.h:42
unsigned int matchId(const HcalDetId &, const HcalDetId &)
HcalHBHEMuonSimAnalyzer(const edm::ParameterSet &)
std::vector< double > hcalDepth1EnergyHot_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
DetId relabel(const uint32_t testId) const
std::vector< double > hcalDepth7ActiveLength_
std::vector< double > hcalDepth3EnergyHot_
virtual void beginJob() override
T const * product() const
Definition: ESHandle.h:86
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< unsigned int > hcalHot_
std::vector< double > hcalDepth4ActiveLength_
Definition: Run.h:42
std::vector< unsigned int > ecalDetId_
std::vector< double > hcalDepth1ActiveLength_
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)