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 
20 
21 // DQM include files
22 
26 
27 // work on collections
28 
37 
40 
43 
45 public:
48 
49 protected:
50  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
51  void analyze(const edm::Event &e, const edm::EventSetup &c) override;
52 
53 private:
54  //
55  // Monitor elements
56  //
58 
61  bool plotAll_;
62 
68 };
69 
70 // ******************************************
71 // constructors
72 // *****************************************
73 
75  //
76  // Input from configurator file
77  //
78  folderName_ = ps.getUntrackedParameter<std::string>("FolderName", "ALCAStreamHcalIsolatedBunch");
79  trigName_ = ps.getParameter<std::string>("TriggerName");
80  plotAll_ = ps.getUntrackedParameter<bool>("PlotAll", true);
81 
82  hbhereco_ = consumes<HBHERecHitCollection>(ps.getParameter<edm::InputTag>("hbheInput"));
83  horeco_ = consumes<HORecHitCollection>(ps.getParameter<edm::InputTag>("hoInput"));
84  hfreco_ = consumes<HFRecHitCollection>(ps.getParameter<edm::InputTag>("hfInput"));
85  trigResult_ = consumes<edm::TriggerResults>(ps.getParameter<edm::InputTag>("TriggerResult"));
86 }
87 
89 
90 //--------------------------------------------------------
92  edm::Run const &irun,
93  edm::EventSetup const &isetup) {
94  // create and cd into new folder
96  h_Event_ = ibooker.book1D("hEvent", "Selection summary", 10, 0, 10);
97  h_hbhehit_ = ibooker.book1D("hHBHEHit", "Size of HBHE Collection", 200, 0, 2000);
98  h_hohit_ = ibooker.book1D("hHOHit", "Size of HO Collection", 200, 0, 2000);
99  h_hfhit_ = ibooker.book1D("hHFHit", "Size of HF Collection", 200, 0, 2000);
100 }
101 
102 //-------------------------------------------------------------
103 
105  bool accept(false);
108  iEvent.getByToken(trigResult_, triggerResults);
109  if (triggerResults.isValid()) {
110  const edm::TriggerNames &triggerNames = iEvent.triggerNames(*triggerResults);
111  const std::vector<std::string> &triggerNames_ = triggerNames.triggerNames();
112  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
113  int hlt = triggerResults->accept(iHLT);
114  if (hlt > 0) {
115  if (triggerNames_[iHLT].find(trigName_) != std::string::npos) {
116  accept = true;
117  break;
118  }
119  }
120  }
121  }
122  h_Event_->Fill(0.);
123  if (accept)
124  h_Event_->Fill(1.);
125 
126  if (accept || plotAll_) {
128  iEvent.getByToken(hbhereco_, hbhe);
129  if (!hbhe.isValid()) {
130  edm::LogInfo("HcalCalib") << "Cannot get hbhe product!" << std::endl;
131  } else {
132  h_hbhehit_->Fill(hbhe->size());
133  }
134 
136  iEvent.getByToken(hfreco_, hf);
137  if (!hf.isValid()) {
138  edm::LogInfo("HcalCalib") << "Cannot get hf product!" << std::endl;
139  } else {
140  h_hfhit_->Fill(hf->size());
141  }
142 
144  iEvent.getByToken(horeco_, ho);
145  if (!ho.isValid()) {
146  edm::LogInfo("HcalCalib") << "Cannot get ho product!" << std::endl;
147  } else {
148  h_hohit_->Fill(ho->size());
149  }
150  }
151 
152 } // analyze
153 
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< HBHERecHitCollection > hbhereco_
object to monitor
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:31
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
DQMHcalIsolatedBunchAlCaReco(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:224
std::string folderName_
DQM folder name.
edm::EDGetTokenT< HORecHitCollection > horeco_
edm::EDGetTokenT< HFRecHitCollection > hfreco_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static std::string const triggerResults
Definition: EdmProvDump.cc:47
Log< level::Info, false > LogInfo
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::TriggerResults > trigResult_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
Definition: Run.h:45