CMS 3D CMS Logo

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 // #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
28 // #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
29 // #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
30 
32 
33 using namespace std;
34 using namespace edm;
35 using namespace reco;
36 
37 // ******************************************
38 // constructors
39 // *****************************************
40 
42  //
43  // Input from configurator file
44  //
45  folderName_ = iConfig.getUntrackedParameter<string>("FolderName", "ALCAStreamHcalDiJets");
46 
47  jets_ = consumes<CaloJetCollection>(iConfig.getParameter<edm::InputTag>("jetsInput"));
48  ec_ = consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("ecInput"));
49  hbhe_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInput"));
50  ho_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInput"));
51  hf_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInput"));
52 
53  saveToFile_ = iConfig.getUntrackedParameter<bool>("SaveToFile", false);
54  fileName_ = iConfig.getUntrackedParameter<string>("FileName", "MonitorAlCaHcalDiJets.root");
55 }
56 
58 
59 //--------------------------------------------------------
61  edm::Run const & /* iRun*/,
62  edm::EventSetup const & /* iSetup */) {
63  // create and cd into new folder
65 
66  // book some histograms 1D
67  hiDistrRecHitEnergyEBEE_ = ibooker.book1D("RecHitEnergyEBEE", "the number of hits inside jets", 100, 0, 800);
69  hiDistrRecHitEnergyEBEE_->setAxisTitle("# rechits", 2);
70 
71  hiDistrRecHitEnergyHBHE_ = ibooker.book1D("RecHitEnergyHBHE", "the number of hits inside jets", 100, 0, 800);
73  hiDistrRecHitEnergyHBHE_->setAxisTitle("# rechits", 2);
74 
75  hiDistrRecHitEnergyHF_ = ibooker.book1D("RecHitEnergyHF", "the number of hits inside jets", 150, 0, 1500);
77  hiDistrRecHitEnergyHF_->setAxisTitle("# rechits", 2);
78 
79  hiDistrRecHitEnergyHO_ = ibooker.book1D("RecHitEnergyHO", "the number of hits inside jets", 100, 0, 100);
81  hiDistrRecHitEnergyHO_->setAxisTitle("# rechits", 2);
82 
83  hiDistrProbeJetEnergy_ = ibooker.book1D("ProbeJetEnergy", "the energy of probe jets", 250, 0, 2500);
86 
87  hiDistrProbeJetEta_ = ibooker.book1D("ProbeJetEta", "the number of probe jets", 100, -5., 5.);
89  hiDistrProbeJetEta_->setAxisTitle("# jets", 2);
90 
91  hiDistrProbeJetPhi_ = ibooker.book1D("ProbeJetPhi", "the number of probe jets", 50, -3.14, 3.14);
93  hiDistrProbeJetPhi_->setAxisTitle("# jets", 2);
94 
95  hiDistrTagJetEnergy_ = ibooker.book1D("TagJetEnergy", "the energy of tsg jets", 250, 0, 2500);
96  hiDistrTagJetEnergy_->setAxisTitle("E, GeV", 1);
97  hiDistrTagJetEnergy_->setAxisTitle("# jets", 2);
98 
99  hiDistrTagJetEta_ = ibooker.book1D("TagJetEta", "the number of tag jets", 100, -5., 5.);
100  hiDistrTagJetEta_->setAxisTitle("#eta", 1);
101  hiDistrTagJetEta_->setAxisTitle("# jets", 2);
102 
103  hiDistrTagJetPhi_ = ibooker.book1D("TagJetPhi", "the number of tag jets", 50, -3.14, 3.14);
104  hiDistrTagJetPhi_->setAxisTitle("#phi", 1);
105  hiDistrTagJetPhi_->setAxisTitle("# jets", 2);
106 
107  hiDistrEtThirdJet_ = ibooker.book1D("EtThirdJet", "Et of the third jet", 90, 0, 90);
108 
109  //==================================================================================
110 }
111 
112 //-------------------------------------------------------------
113 
115  eventCounter_++;
116 
117  CaloJet jet1, jet2, jet3;
118  Float_t etVetoJet;
119 
121  iEvent.getByToken(jets_, jets);
122 
123  if (!jets.isValid()) {
124  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't getjet product!" << std::endl;
125  return;
126  }
127 
128  if (jets->size() > 1) {
129  jet1 = (*jets)[0];
130  jet2 = (*jets)[1];
131  if (fabs(jet1.eta()) > fabs(jet2.eta())) {
132  CaloJet jet = jet1;
133  jet1 = jet2;
134  jet2 = jet;
135  }
136  // if(fabs(jet1.eta())>eta_1 || (fabs(jet2.eta())-jet_R) < eta_2){
137  // return;}
138  } else {
139  return;
140  }
141 
143  hiDistrTagJetEta_->Fill(jet1.eta());
144  hiDistrTagJetPhi_->Fill(jet1.phi());
145 
147  hiDistrProbeJetEta_->Fill(jet2.eta());
148  hiDistrProbeJetPhi_->Fill(jet2.phi());
149 
150  if (jets->size() > 2) {
151  jet3 = (*jets)[2];
152  etVetoJet = jet3.et();
153  hiDistrEtThirdJet_->Fill(etVetoJet);
154  } else {
155  etVetoJet = 0.;
156  hiDistrEtThirdJet_->Fill(etVetoJet);
157  }
158 
160  iEvent.getByToken(ec_, ec);
161 
162  if (!ec.isValid()) {
163  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get ec product!" << std::endl;
164  return;
165  }
166 
167  for (EcalRecHitCollection::const_iterator ecItr = (*ec).begin(); ecItr != (*ec).end(); ++ecItr) {
168  hiDistrRecHitEnergyEBEE_->Fill(ecItr->energy());
169  }
170 
172  iEvent.getByToken(hbhe_, hbhe);
173 
174  if (!hbhe.isValid()) {
175  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get hbhe product!" << std::endl;
176  return;
177  }
178 
179  for (HBHERecHitCollection::const_iterator hbheItr = hbhe->begin(); hbheItr != hbhe->end(); hbheItr++) {
180  hiDistrRecHitEnergyHBHE_->Fill(hbheItr->energy());
181  }
182 
184  iEvent.getByToken(ho_, ho);
185 
186  if (!ho.isValid()) {
187  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get ho product!" << std::endl;
188  return;
189  }
190 
191  for (HORecHitCollection::const_iterator hoItr = ho->begin(); hoItr != ho->end(); hoItr++) {
192  hiDistrRecHitEnergyHO_->Fill(hoItr->energy());
193  }
194 
196  iEvent.getByToken(hf_, hf);
197 
198  if (!hf.isValid()) {
199  LogDebug("") << "DQMHcalDiJetsAlCaReco: Error! can't get hf product!" << std::endl;
200  return;
201  }
202 
203  for (HFRecHitCollection::const_iterator hfItr = hf->begin(); hfItr != hf->end(); hfItr++) {
204  hiDistrRecHitEnergyHF_->Fill(hfItr->energy());
205  }
206 
207 } // analyze
reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
DQMHcalDiJetsAlCaReco::hiDistrRecHitEnergyHF_
MonitorElement * hiDistrRecHitEnergyHF_
Definition: DQMHcalDiJetsAlCaReco.h:41
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
MessageLogger.h
edm::Run
Definition: Run.h:45
edm
HLT enums.
Definition: AlignableModifier.h:19
DQMHcalDiJetsAlCaReco::hiDistrTagJetPhi_
MonitorElement * hiDistrTagJetPhi_
Definition: DQMHcalDiJetsAlCaReco.h:50
es_hardcode_cfi.hf
hf
Definition: es_hardcode_cfi.py:161
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
DQMHcalDiJetsAlCaReco::hiDistrProbeJetPhi_
MonitorElement * hiDistrProbeJetPhi_
Definition: DQMHcalDiJetsAlCaReco.h:46
edm::Handle
Definition: AssociativeIterator.h:50
DQMHcalDiJetsAlCaReco::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: DQMHcalDiJetsAlCaReco.cc:60
Service.h
DQMHcalDiJetsAlCaReco::hiDistrTagJetEnergy_
MonitorElement * hiDistrTagJetEnergy_
Definition: DQMHcalDiJetsAlCaReco.h:48
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DQMHcalDiJetsAlCaReco::eventCounter_
int eventCounter_
Definition: DQMHcalDiJetsAlCaReco.h:34
DQMHcalDiJetsAlCaReco::folderName_
std::string folderName_
DQM folder name.
Definition: DQMHcalDiJetsAlCaReco.h:62
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
DQMHcalDiJetsAlCaReco::hiDistrProbeJetEta_
MonitorElement * hiDistrProbeJetEta_
Definition: DQMHcalDiJetsAlCaReco.h:45
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
DQMHcalDiJetsAlCaReco::hiDistrTagJetEta_
MonitorElement * hiDistrTagJetEta_
Definition: DQMHcalDiJetsAlCaReco.h:49
HcalDetId.h
DQMHcalDiJetsAlCaReco::fileName_
std::string fileName_
Output file name if required.
Definition: DQMHcalDiJetsAlCaReco.h:68
DQMHcalDiJetsAlCaReco::DQMHcalDiJetsAlCaReco
DQMHcalDiJetsAlCaReco(const edm::ParameterSet &)
Definition: DQMHcalDiJetsAlCaReco.cc:41
iEvent
int iEvent
Definition: GenABIO.cc:224
DQMHcalDiJetsAlCaReco::analyze
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: DQMHcalDiJetsAlCaReco.cc:114
DQMHcalDiJetsAlCaReco::hiDistrRecHitEnergyEBEE_
MonitorElement * hiDistrRecHitEnergyEBEE_
Definition: DQMHcalDiJetsAlCaReco.h:39
CaloTowerDetId.h
edm::EventSetup
Definition: EventSetup.h:57
DQMHcalDiJetsAlCaReco::hbhe_
edm::EDGetTokenT< HBHERecHitCollection > hbhe_
Definition: DQMHcalDiJetsAlCaReco.h:57
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
DQMHcalDiJetsAlCaReco.h
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
std
Definition: JetResolutionObject.h:76
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
DetId.h
metsig::jet
Definition: SignAlgoResolutions.h:47
DQMHcalDiJetsAlCaReco::saveToFile_
bool saveToFile_
Write to file.
Definition: DQMHcalDiJetsAlCaReco.h:65
DQMHcalDiJetsAlCaReco::~DQMHcalDiJetsAlCaReco
~DQMHcalDiJetsAlCaReco() override
Definition: DQMHcalDiJetsAlCaReco.cc:57
DQMHcalDiJetsAlCaReco::hiDistrRecHitEnergyHBHE_
MonitorElement * hiDistrRecHitEnergyHBHE_
Definition: DQMHcalDiJetsAlCaReco.h:40
DQMHcalDiJetsAlCaReco::ec_
edm::EDGetTokenT< EcalRecHitCollection > ec_
Definition: DQMHcalDiJetsAlCaReco.h:56
EventSetup.h
DQMHcalDiJetsAlCaReco::hiDistrProbeJetEnergy_
MonitorElement * hiDistrProbeJetEnergy_
Definition: DQMHcalDiJetsAlCaReco.h:44
dqm::implementation::IBooker
Definition: DQMStore.h:43
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
DQMHcalDiJetsAlCaReco::ho_
edm::EDGetTokenT< HORecHitCollection > ho_
Definition: DQMHcalDiJetsAlCaReco.h:58
es_hardcode_cfi.ho
ho
Definition: es_hardcode_cfi.py:191
ParameterSet.h
DQMHcalDiJetsAlCaReco::hiDistrRecHitEnergyHO_
MonitorElement * hiDistrRecHitEnergyHO_
Definition: DQMHcalDiJetsAlCaReco.h:42
DQMHcalDiJetsAlCaReco::hf_
edm::EDGetTokenT< HFRecHitCollection > hf_
Definition: DQMHcalDiJetsAlCaReco.h:59
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
edm::InputTag
Definition: InputTag.h:15
DQMHcalDiJetsAlCaReco::hiDistrEtThirdJet_
MonitorElement * hiDistrEtThirdJet_
Definition: DQMHcalDiJetsAlCaReco.h:52
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
DQMHcalDiJetsAlCaReco::jets_
edm::EDGetTokenT< reco::CaloJetCollection > jets_
object to monitor
Definition: DQMHcalDiJetsAlCaReco.h:55