test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DQMHcalDiJetsAlCaReco.cc
Go to the documentation of this file.
1 /*
2  * \file DQMHcalPhiSymAlCaReco.cc
3  *
4  * \author Olga Kodolova
5  *
6  *
7  *
8  * Description: Monitoring of Phi Symmetry Calibration Stream
9 */
10 
15 
16 // DQM include files
17 
19 
20 // work on collections
21 
26 
27 
28 // #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
29 // #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
30 // #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
31 
33 
34 using namespace std;
35 using namespace edm;
36 using namespace reco;
37 
38 // ******************************************
39 // constructors
40 // *****************************************
41 
43 eventCounter_(0)
44 {
45 //
46 // Input from configurator file
47 //
48  folderName_ = iConfig.getUntrackedParameter<string>("FolderName","ALCAStreamHcalDiJets");
49 
50 
51  jets_= consumes<CaloJetCollection>(iConfig.getParameter<edm::InputTag>("jetsInput"));
52  ec_= consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("ecInput"));
53  hbhe_= consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInput"));
54  ho_= consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInput"));
55  hf_= consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInput"));
56 
57  saveToFile_= iConfig.getUntrackedParameter<bool>("SaveToFile",false);
58  fileName_= iConfig.getUntrackedParameter<string>("FileName","MonitorAlCaHcalDiJets.root");
59 
60 }
61 
63 {}
64 
65 //--------------------------------------------------------
66 void DQMHcalDiJetsAlCaReco::bookHistograms(DQMStore::IBooker & ibooker, edm::Run const & /* iRun*/, edm::EventSetup const & /* iSetup */)
67 {
68 
69  // create and cd into new folder
71 
72  // book some histograms 1D
73  hiDistrRecHitEnergyEBEE_ = ibooker.book1D("RecHitEnergyEBEE", "the number of hits inside jets", 100, 0, 800);
75  hiDistrRecHitEnergyEBEE_->setAxisTitle("# rechits", 2);
76 
77  hiDistrRecHitEnergyHBHE_ = ibooker.book1D("RecHitEnergyHBHE", "the number of hits inside jets", 100,0, 800);
79  hiDistrRecHitEnergyHBHE_->setAxisTitle("# rechits", 2);
80 
81  hiDistrRecHitEnergyHF_ = ibooker.book1D("RecHitEnergyHF", "the number of hits inside jets", 150,0, 1500);
83  hiDistrRecHitEnergyHF_->setAxisTitle("# rechits", 2);
84 
85  hiDistrRecHitEnergyHO_ = ibooker.book1D("RecHitEnergyHO", "the number of hits inside jets", 100,0, 100);
87  hiDistrRecHitEnergyHO_->setAxisTitle("# rechits", 2);
88 
89  hiDistrProbeJetEnergy_ = ibooker.book1D("ProbeJetEnergy", "the energy of probe jets", 250,0, 2500);
92 
93  hiDistrProbeJetEta_ = ibooker.book1D("ProbeJetEta", "the number of probe jets", 100, -5., 5.);
95  hiDistrProbeJetEta_->setAxisTitle("# jets", 2);
96 
97  hiDistrProbeJetPhi_ = ibooker.book1D("ProbeJetPhi", "the number of probe jets", 50, -3.14, 3.14);
99  hiDistrProbeJetPhi_->setAxisTitle("# jets", 2);
100 
101  hiDistrTagJetEnergy_ = ibooker.book1D("TagJetEnergy", "the energy of tsg jets", 250,0, 2500);
102  hiDistrTagJetEnergy_->setAxisTitle("E, GeV", 1);
103  hiDistrTagJetEnergy_->setAxisTitle("# jets", 2);
104 
105  hiDistrTagJetEta_ = ibooker.book1D("TagJetEta", "the number of tag jets", 100, -5., 5.);
106  hiDistrTagJetEta_->setAxisTitle("#eta", 1);
107  hiDistrTagJetEta_->setAxisTitle("# jets", 2);
108 
109  hiDistrTagJetPhi_ = ibooker.book1D("TagJetPhi", "the number of tag jets", 50, -3.14, 3.14);
110  hiDistrTagJetPhi_->setAxisTitle("#phi", 1);
111  hiDistrTagJetPhi_->setAxisTitle("# jets", 2);
112 
113  hiDistrEtThirdJet_ = ibooker.book1D("EtThirdJet", "Et of the third jet", 90, 0, 90);
114 
115 
116 //==================================================================================
117 
118 
119 }
120 
121 
122 //--------------------------------------------------------
124  const EventSetup& context) {
125 
126 }
127 
128 //-------------------------------------------------------------
129 
131  const EventSetup& iSetup ){
132 
133 
134  eventCounter_++;
135 
136  CaloJet jet1, jet2, jet3;
137  Float_t etVetoJet;
138 
140  iEvent.getByToken(jets_,jets);
141 
142  if(!jets.isValid()){
143  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't getjet product!" << std::endl;
144  return ;
145  }
146 
147 
148 
149  if(jets->size()>1){
150  jet1 = (*jets)[0];
151  jet2 = (*jets)[1];
152  if(fabs(jet1.eta())>fabs(jet2.eta())){
153  CaloJet jet = jet1;
154  jet1 = jet2;
155  jet2 = jet;
156  }
157  // if(fabs(jet1.eta())>eta_1 || (fabs(jet2.eta())-jet_R) < eta_2){ return;}
158  } else {return;}
159 
161  hiDistrTagJetEta_->Fill(jet1.eta());
162  hiDistrTagJetPhi_->Fill(jet1.phi());
163 
165  hiDistrProbeJetEta_->Fill(jet2.eta());
166  hiDistrProbeJetPhi_->Fill(jet2.phi());
167 
168  if(jets->size()>2){
169  jet3 = (*jets)[2];
170  etVetoJet = jet3.et();
171  hiDistrEtThirdJet_->Fill(etVetoJet);
172  } else { etVetoJet = 0.; hiDistrEtThirdJet_->Fill(etVetoJet); }
173 
174 
175 
177  iEvent.getByToken(ec_,ec);
178 
179  if(!ec.isValid()){
180  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get ec product!" << std::endl;
181  return ;
182  }
183 
184 
185  for(EcalRecHitCollection::const_iterator ecItr = (*ec).begin();
186  ecItr != (*ec).end(); ++ecItr)
187  {
188  hiDistrRecHitEnergyEBEE_->Fill(ecItr->energy());
189  }
190 
191 
192 
193 
195  iEvent.getByToken(hbhe_, hbhe);
196 
197  if(!hbhe.isValid()){
198  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get hbhe product!" << std::endl;
199  return ;
200  }
201 
202 
203  for(HBHERecHitCollection::const_iterator hbheItr=hbhe->begin();
204  hbheItr!=hbhe->end(); hbheItr++)
205  {
206  hiDistrRecHitEnergyHBHE_->Fill(hbheItr->energy());
207  }
208 
209 
211  iEvent.getByToken(ho_, ho);
212 
213  if(!ho.isValid()){
214  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get ho product!" << std::endl;
215  return ;
216  }
217 
218 
219  for(HORecHitCollection::const_iterator hoItr=ho->begin();
220  hoItr!=ho->end(); hoItr++)
221  {
222  hiDistrRecHitEnergyHO_->Fill(hoItr->energy());
223 
224  }
225 
226 
227 
228 
230  iEvent.getByToken(hf_, hf);
231 
232  if(!hf.isValid()){
233  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get hf product!" << std::endl;
234  return ;
235  }
236 
237 
238  for(HFRecHitCollection::const_iterator hfItr=hf->begin();
239  hfItr!=hf->end(); hfItr++)
240  {
241  hiDistrRecHitEnergyHF_->Fill(hfItr->energy());
242  }
243 
244 } //analyze
245 
246 
247 
#define LogDebug(id)
edm::EDGetTokenT< reco::CaloJetCollection > jets_
object to monitor
MonitorElement * hiDistrTagJetEnergy_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * hiDistrRecHitEnergyHF_
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual double energy() const final
energy
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::string fileName_
Output file name if required.
MonitorElement * hiDistrTagJetPhi_
MonitorElement * hiDistrTagJetEta_
std::vector< EcalRecHit >::const_iterator const_iterator
virtual double phi() const final
momentum azimuthal angle
MonitorElement * hiDistrRecHitEnergyEBEE_
void Fill(long long x)
int iEvent
Definition: GenABIO.cc:230
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
edm::EDGetTokenT< HORecHitCollection > ho_
vector< PseudoJet > jets
edm::EDGetTokenT< HFRecHitCollection > hf_
MonitorElement * hiDistrProbeJetEta_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
bool isValid() const
Definition: HandleBase.h:75
DQMHcalDiJetsAlCaReco(const edm::ParameterSet &)
MonitorElement * hiDistrProbeJetPhi_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
bool saveToFile_
Write to file.
return(e1-e2)*(e1-e2)+dp *dp
edm::EDGetTokenT< EcalRecHitCollection > ec_
MonitorElement * hiDistrRecHitEnergyHBHE_
virtual double et() const final
transverse energy
MonitorElement * hiDistrProbeJetEnergy_
MonitorElement * hiDistrRecHitEnergyHO_
std::string folderName_
DQM folder name.
virtual double eta() const final
momentum pseudorapidity
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * hiDistrEtThirdJet_
void analyze(const edm::Event &e, const edm::EventSetup &c)
Definition: Run.h:43
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override