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 }
58 
60 
61 //--------------------------------------------------------
63 
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 //-------------------------------------------------------------
74 
76  const edm::EventSetup& iSetup ){
77 
78  bool accept(false);
81  iEvent.getByToken(trigResult_, triggerResults);
82  if (triggerResults.isValid()) {
83  const edm::TriggerNames & triggerNames = iEvent.triggerNames(*triggerResults);
84  const std::vector<std::string> & triggerNames_ = triggerNames.triggerNames();
85  for (unsigned int iHLT=0; iHLT<triggerResults->size(); iHLT++) {
86  int hlt = triggerResults->accept(iHLT);
87  if (hlt > 0) {
88  if (triggerNames_[iHLT].find(trigName_)!=std::string::npos) {
89  accept = true;
90  break;
91  }
92  }
93  }
94  }
95  h_Event_->Fill(0.);
96  if (accept) h_Event_->Fill(1.);
97 
98  if (accept || plotAll_) {
100  iEvent.getByToken(hbhereco_, hbhe);
101  if (!hbhe.isValid()) {
102  edm::LogInfo("HcalCalib") << "Cannot get hbhe product!" << std::endl;
103  } else {
104  h_hbhehit_->Fill(hbhe->size());
105  }
106 
108  iEvent.getByToken(hfreco_, hf);
109  if (!hf.isValid()) {
110  edm::LogInfo("HcalCalib") << "Cannot get hf product!" << std::endl;
111  } else {
112  h_hfhit_->Fill(hf->size());
113  }
114 
116  iEvent.getByToken(horeco_, ho);
117  if (!ho.isValid()) {
118  edm::LogInfo("HcalCalib") << "Cannot get ho product!" << std::endl;
119  } else {
120  h_hohit_->Fill(ho->size());
121  }
122  }
123 
124 } //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:508
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:24
void Fill(long long x)
DQMHcalIsolatedBunchAlCaReco(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:230
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:115
edm::EDGetTokenT< HFRecHitCollection > hfreco_
void analyze(const edm::Event &e, const edm::EventSetup &c) override
static std::string const triggerResults
Definition: EdmProvDump.cc:41
bool isValid() const
Definition: HandleBase.h:74
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
edm::EDGetTokenT< edm::TriggerResults > trigResult_
size_type size() const
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:272
Definition: Run.h:43