CMS 3D CMS Logo

DQMHcalIsolatedBunchAlCaReco.cc
Go to the documentation of this file.
1 /*
2  * \file DQMHcalIsolatedBunchAlCaReco.cc
3  *
4  * \author Olga Kodolova
5  *
6  *
7  *
8  * Description: Monitoring of Phi Symmetry Calibration Stream
9  */
10 
16 
19 
20 // DQM include files
21 
23 
24 // work on collections
25 
30 
36 
39 
40 // ******************************************
41 // constructors
42 // *****************************************
43 
45  //
46  // Input from configurator file
47  //
48  folderName_ = ps.getUntrackedParameter<std::string>("FolderName", "ALCAStreamHcalIsolatedBunch");
49  trigName_ = ps.getParameter<std::string>("TriggerName");
50  plotAll_ = ps.getUntrackedParameter<bool>("PlotAll", true);
51 
52  hbhereco_ = consumes<HBHERecHitCollection>(ps.getParameter<edm::InputTag>("hbheInput"));
53  horeco_ = consumes<HORecHitCollection>(ps.getParameter<edm::InputTag>("hoInput"));
54  hfreco_ = consumes<HFRecHitCollection>(ps.getParameter<edm::InputTag>("hfInput"));
55  trigResult_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResult"));
56 }
57 
59 
60 //--------------------------------------------------------
62  edm::Run const &irun,
63  edm::EventSetup const &isetup) {
64  // create and cd into new folder
66  h_Event_ = ibooker.book1D("hEvent", "Selection summary", 10, 0, 10);
67  h_hbhehit_ = ibooker.book1D("hHBHEHit", "Size of HBHE Collection", 200, 0, 2000);
68  h_hohit_ = ibooker.book1D("hHOHit", "Size of HO Collection", 200, 0, 2000);
69  h_hfhit_ = ibooker.book1D("hHFHit", "Size of HF Collection", 200, 0, 2000);
70 }
71 
72 //-------------------------------------------------------------
73 
75  bool accept(false);
78  iEvent.getByToken(trigResult_, triggerResults);
79  if (triggerResults.isValid()) {
80  const edm::TriggerNames &triggerNames = iEvent.triggerNames(*triggerResults);
81  const std::vector<std::string> &triggerNames_ = triggerNames.triggerNames();
82  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
83  int hlt = triggerResults->accept(iHLT);
84  if (hlt > 0) {
85  if (triggerNames_[iHLT].find(trigName_) != std::string::npos) {
86  accept = true;
87  break;
88  }
89  }
90  }
91  }
92  h_Event_->Fill(0.);
93  if (accept)
94  h_Event_->Fill(1.);
95 
96  if (accept || plotAll_) {
98  iEvent.getByToken(hbhereco_, hbhe);
99  if (!hbhe.isValid()) {
100  edm::LogInfo("HcalCalib") << "Cannot get hbhe product!" << std::endl;
101  } else {
102  h_hbhehit_->Fill(hbhe->size());
103  }
104 
106  iEvent.getByToken(hfreco_, hf);
107  if (!hf.isValid()) {
108  edm::LogInfo("HcalCalib") << "Cannot get hf product!" << std::endl;
109  } else {
110  h_hfhit_->Fill(hf->size());
111  }
112 
114  iEvent.getByToken(horeco_, ho);
115  if (!ho.isValid()) {
116  edm::LogInfo("HcalCalib") << "Cannot get ho product!" << std::endl;
117  } else {
118  h_hohit_->Fill(ho->size());
119  }
120  }
121 
122 } // analyze
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HBHERecHitCollection > hbhereco_
object to monitor
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
bool accept() const
Has at least one path accepted the event?
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
void Fill(long long x)
DQMHcalIsolatedBunchAlCaReco(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
unsigned int size() const
Get number of paths stored.
std::string folderName_
DQM folder name.
edm::EDGetTokenT< HORecHitCollection > horeco_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
edm::EDGetTokenT< HFRecHitCollection > hfreco_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::TriggerResults > trigResult_
size_type size() const
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:256
Definition: Run.h:45