CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SingleTopTChannelLeptonDQM.cc
Go to the documentation of this file.
1 
11 #include <iostream>
15 using namespace std;
16 namespace SingleTopTChannelLepton {
17 
18  // maximal number of leading jets
19  // to be used for top mass estimate
20  static const unsigned int MAXJETS = 4;
21  // nominal mass of the W boson to
22  // be used for the top mass estimate
23  static const double WMASS = 80.4;
24 
25  MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg, const edm::VParameterSet& vcfg, edm::ConsumesCollector && iC) :
26  label_(label), pvSelect_(0), jetIDSelect_(0), includeBTag_(false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0)
27 
28  {
29  // sources have to be given; this PSet is not optional
30  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
31  muons_ = iC.consumes<edm::View<reco::PFCandidate> >(sources.getParameter<edm::InputTag>("muons"));
32  elecs_gsf_ = iC.consumes<edm::View<reco::GsfElectron> >(sources.getParameter<edm::InputTag>("elecs_gsf"));
33  elecs_ = iC.consumes<edm::View<reco::PFCandidate> >(sources.getParameter<edm::InputTag>("elecs"));
34  jets_ = iC.consumes<edm::View<reco::Jet> >(sources.getParameter<edm::InputTag>("jets" ));
35  for (edm::InputTag const & tag : sources.getParameter<std::vector<edm::InputTag> >("mets"))
36  mets_.push_back( iC.consumes<edm::View<reco::MET> >(tag) );
37  pvs_ = iC.consumes<edm::View<reco::Vertex> >(sources.getParameter<edm::InputTag>("pvs"));
38  // electronExtras are optional; they may be omitted or
39  // empty
40  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
41  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
42  // select is optional; in case it's not found no
43  // selection will be applied
44  if( elecExtras.existsAs<std::string>("select") ){
45  // elecSelect_= new StringCutObjectSelector<reco::GsfElectron>(elecExtras.getParameter<std::string>("select"));
46  elecSelect_ = vcfg[1].getParameter<std::string>("select");
47  }
48  // isolation is optional; in case it's not found no
49  // isolation will be applied
50  if( elecExtras.existsAs<std::string>("isolation") ){
51  //elecIso_= new StringCutObjectSelector<reco::GsfElectron>(elecExtras.getParameter<std::string>("isolation"));
52  elecIso_= elecExtras.getParameter<std::string>("isolation");
53  }
54  // electronId is optional; in case it's not found the
55  // InputTag will remain empty
56  edm::ParameterSet elecId=vcfg[1].getParameter<edm::ParameterSet>("electronId");
57  electronId_= iC.consumes<edm::ValueMap<float> >(elecId.getParameter<edm::InputTag>("src"));
58  eidPattern_= elecId.getParameter<int>("pattern");
59  }
60  // pvExtras are opetional; they may be omitted or empty
61  if(cfg.existsAs<edm::ParameterSet>("pvExtras")){
62  edm::ParameterSet pvExtras=cfg.getParameter<edm::ParameterSet>("pvExtras");
63  // select is optional; in case it's not found no
64  // selection will be applied
65  if( pvExtras.existsAs<std::string>("select") ){
67  }
68  }
69  // muonExtras are optional; they may be omitted or empty
70  if( cfg.existsAs<edm::ParameterSet>("muonExtras")){ // && vcfg.existsAs<std::vector<edm::ParameterSet> >("selection")){
71  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
72 
73  // select is optional; in case it's not found no
74  // selection will be applied
75  if( muonExtras.existsAs<std::string>("select") ){
76  // muonSelect_= new StringCutObjectSelector<reco::Muon>(muonExtras.getParameter<std::string>("select"));
77  // muonSelect_= muonExtras.getParameter<std::string>("select");
78  muonSelect_ = vcfg[1].getParameter<std::string>("select");
79  }
80  // isolation is optional; in case it's not found no
81  // isolation will be applied
82  if( muonExtras.existsAs<std::string>("isolation") ){
83  // muonIso_= new StringCutObjectSelector<reco::Muon>(muonExtras.getParameter<std::string>("isolation"));
84  muonIso_= muonExtras.getParameter<std::string>("isolation");
85  }
86  }
87 
88  // jetExtras are optional; they may be omitted or
89  // empty
90  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
91  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
92  // jetCorrector is optional; in case it's not found
93  // the InputTag will remain empty
94  if( jetExtras.existsAs<std::string>("jetCorrector") ){
95  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
96  }
97  // read jetID information if it exists
98  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
100  jetIDLabel_ = iC.consumes<reco::JetIDValueMap>(jetID.getParameter<edm::InputTag>("label"));
102  }
103  // select is optional; in case it's not found no
104  // selection will be applied (only implemented for
105  // CaloJets at the moment)
106  if( jetExtras.existsAs<std::string>("select") ){
107 
108  jetSelect_= jetExtras.getParameter<std::string>("select");
109  jetSelect_ = vcfg[2].getParameter<std::string>("select");
110  }
111  // jetBDiscriminators are optional; in case they are
112  // not found the InputTag will remain empty; they
113  // consist of pairs of edm::JetFlavorAssociation's &
114  // corresponding working points
115  includeBTag_=jetExtras.existsAs<edm::ParameterSet>("jetBTaggers");
116  if( includeBTag_ ){
117  edm::ParameterSet btagEff=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingEff");
118  btagEff_= iC.consumes<reco::JetTagCollection>(btagEff.getParameter<edm::InputTag>("label")); btagEffWP_= btagEff.getParameter<double>("workingPoint");
119  edm::ParameterSet btagPur=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingPur");
120  btagPur_= iC.consumes<reco::JetTagCollection>(btagPur.getParameter<edm::InputTag>("label")); btagPurWP_= btagPur.getParameter<double>("workingPoint");
121  edm::ParameterSet btagVtx=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("secondaryVertex" );
122  btagVtx_= iC.consumes<reco::JetTagCollection>(btagVtx.getParameter<edm::InputTag>("label")); btagVtxWP_= btagVtx.getParameter<double>("workingPoint");
123  edm::ParameterSet btagCombVtx=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("combinedSecondaryVertex" );
124  btagCombVtx_= iC.consumes<reco::JetTagCollection>(btagCombVtx.getParameter<edm::InputTag>("label")); btagCombVtxWP_= btagCombVtx.getParameter<double>("workingPoint");
125  }
126  }
127 
128  // triggerExtras are optional; they may be omitted or empty
129  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
130  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
131  triggerTable_=iC.consumes<edm::TriggerResults>(triggerExtras.getParameter<edm::InputTag>("src"));
132  triggerPaths_=triggerExtras.getParameter<std::vector<std::string> >("paths");
133  }
134 
135  // massExtras is optional; in case it's not found no mass
136  // window cuts are applied for the same flavor monitor
137  // histograms
138  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
139  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
140  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
141  upperEdge_= massExtras.getParameter<double>("upperEdge");
142  }
143 
144  // setup the verbosity level for booking histograms;
145  // per default the verbosity level will be set to
146  // STANDARD. This will also be the chosen level in
147  // the case when the monitoring PSet is not found
149  if( cfg.existsAs<edm::ParameterSet>("monitoring") ){
150  edm::ParameterSet monitoring=cfg.getParameter<edm::ParameterSet>("monitoring");
151  if(monitoring.getParameter<std::string>("verbosity") == "DEBUG" )
152  verbosity_= DEBUG;
153  if(monitoring.getParameter<std::string>("verbosity") == "VERBOSE" )
155  if(monitoring.getParameter<std::string>("verbosity") == "STANDARD")
157  }
158  // and don't forget to do the histogram booking
159  book(cfg.getParameter<std::string>("directory"));
160  }
161 
162  void
164  {
165  //set up the current directory path
166  std::string current(directory); current+=label_;
168  store_->setCurrentFolder(current);
169 
170  // determine number of bins for trigger monitoring
171  unsigned int nPaths=triggerPaths_.size();
172 
173  // --- [STANDARD] --- //
174  // number of selected primary vertices
175  hists_["pvMult_" ] = store_->book1D("PvMult" , "N_{pvs}" , 100, 0., 100.);
176  // pt of the leading muon
177  hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 250.);
178  // muon multiplicity before std isolation
179  hists_["muonMult_" ] = store_->book1D("MuonMult" , "N_{20}(#mu)" , 10, 0., 10.);
180  // muon multiplicity after std isolation
181  hists_["muonMultIso_"] = store_->book1D("MuonMultIso", "N_{Iso}(#mu)" , 10, 0., 10.);
182  // pt of the leading electron
183  hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 250.);
184  // electron multiplicity before std isolation
185  hists_["elecMult_" ] = store_->book1D("ElecMult" , "N_{30}(e)" , 10, 0., 10.);
186  // electron multiplicity after std isolation
187  hists_["elecMultIso_"] = store_->book1D("ElecMultIso", "N_{Iso}(e)" , 10, 0., 10.);
188  // multiplicity of jets with pt>20 (corrected to L2+L3)
189  hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 10, 0., 10.);
190  // trigger efficiency estimates for single lepton triggers
191  hists_["triggerEff_" ] = store_->book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths);
192  // monitored trigger occupancy for single lepton triggers
193  hists_["triggerMon_" ] = store_->book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths);
194  // MET (calo)
195  hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.);
196  // W mass estimate
197  hists_["massW_" ] = store_->book1D("MassW" , "M(W)" , 60, 0., 300.);
198  // Top mass estimate
199  hists_["massTop_" ] = store_->book1D("MassTop" , "M(Top)" , 50, 0., 500.);
200  // W mass transverse estimate mu
201  hists_["MTWm_" ] = store_->book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.);
202  // Top mass transverse estimate mu
203  hists_["mMTT_" ] = store_->book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.);
204 
205  // W mass transverse estimate e
206  hists_["MTWe_" ] = store_->book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.);
207  // Top mass transverse estimate e
208  hists_["eMTT_" ] = store_->book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.);
209 
210  // set bin labels for trigger monitoring
212 
213  if( verbosity_==STANDARD) return;
214 
215  // --- [VERBOSE] --- //
216 
217  // eta of the leading muon
218  hists_["muonEta_" ] = store_->book1D("MuonEta" , "#eta(#mu)" , 30, -3., 3.);
219  // std isolation variable of the leading muon
220  hists_["muonPFRelIso_" ] = store_->book1D("MuonPFRelIso","PFIso_{Rel}(#mu)", 50, 0., 1.);
221  hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.);
222 
223  // eta of the leading electron
224  hists_["elecEta_" ] = store_->book1D("ElecEta" , "#eta(e)" , 30, -3., 3.);
225  // std isolation variable of the leading electron
226  hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.);
227  hists_["elecPFRelIso_" ] = store_->book1D("ElecPFRelIso" , "PFIso_{Rel}(e)", 50, 0., 1.);
228 
229  // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>30
230  hists_["jetMultBEff_"] = store_->book1D("JetMultBEff", "N_{30}(b/eff)" , 10, 0., 10.);
231  // btag discriminator for track counting high efficiency for jets with pt(L2L3)>30
232  hists_["jetBDiscEff_"] = store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.);
233 
234 
235  // eta of the 1. leading jet
236  hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta (jet1)" , 50, -5., 5.);
237  // eta of the 2. leading jet
238  hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta (jet2)" , 50, -5., 5.);
239 
240  // pt of the 1. leading jet (corrected to L2+L3)
241  hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.);
242  // pt of the 2. leading jet (corrected to L2+L3)
243  hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.);
244 
245 
246  // eta and pt of the b-tagged jet (filled only when nJets==2)
247  hists_["TaggedJetEta_" ] = store_->book1D("TaggedJetEta" , "#eta (Tagged jet)" , 50, -5., 5.);
248  hists_["TaggedJetPt_" ] = store_->book1D("TaggedJetPt" , "pt_{L2L3}(Tagged jet)" , 60, 0., 300.);
249 
250  // eta and pt of the jet not passing b-tag (filled only when nJets==2)
251  hists_["UnTaggedJetEta_" ] = store_->book1D("UnTaggedJetEta" , "#eta (UnTagged jet)" , 50, -5., 5.);
252  hists_["UnTaggedJetPt_" ] = store_->book1D("UnTaggedJetPt" , "pt_{L2L3}(UnTagged jet)" , 60, 0., 300.);
253 
254  // eta and pt of the most forward jet in the event with nJets==2
255  hists_["FwdJetEta_" ] = store_->book1D("FwdJetEta" , "#eta (Fwd jet)" , 50, -5., 5.);
256  hists_["FwdJetPt_" ] = store_->book1D("FwdJetPt" , "pt_{L2L3}(Fwd jet)" , 60, 0., 300.);
257 
258 
259  // 2D histogram (pt,eta) of the b-tagged jet (filled only when nJets==2)
260  hists_["TaggedJetPtEta_" ] = store_->book2D("TaggedJetPt_Eta" , "(pt vs #eta)_{L2L3}(Tagged jet)" , 60, 0., 300., 50, -5., 5.);
261 
262  // 2D histogram (pt,eta) of the not-b tagged jet (filled only when nJets==2)
263  hists_["UnTaggedJetPtEta_" ] = store_->book2D("UnTaggedJetPt_Eta" , "(pt vs #eta)_{L2L3}(UnTagged jet)" , 60, 0., 300., 50, -5., 5.);
264 
265 
266 
267  // MET (tc)
268  hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.);
269  // MET (pflow)
270  hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.);
271 
272  // dz for muons (to suppress cosmis)
273  hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.);
274  // dxy for muons (to suppress cosmics)
275  hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
276 
277  // set axes titles for dxy for muons
278  hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2);
279 
280  if( verbosity_==VERBOSE) return;
281 
282  // --- [DEBUG] --- //
283 
284  // relative muon isolation from charged hadrons for the leading muon
285  hists_["muonChHadIso_" ] = store_->book1D("MuonChHadIso" , "Iso_{ChHad}(#mu)" , 100, 0., 1.);
286  // relative muon isolation from neutral hadrons for the leading muon
287  hists_["muonNeuHadIso_" ] = store_->book1D("MuonNeuHadIso" , "Iso_{NeuHad}(#mu)" , 100, 0., 1.);
288  // relative muon isolation from photons for the leading muon
289  hists_["muonPhIso_" ] = store_->book1D("MuonPhIso" , "Iso_{Ph}(#mu)" , 100, 0., 1.);
290 
291  // relative electron isolation from charged hadrons for the leading electron
292  hists_["elecChHadIso_" ] = store_->book1D("ElecChHadIso" , "Iso_{ChHad}(e)" , 100, 0., 1.);
293  // relative electron isolation from neutral hadrons for the leading electron
294  hists_["elecNeuHadIso_" ] = store_->book1D("ElecNeuHadIso" , "Iso_{NeuHad}(e)" , 100, 0., 1.);
295  // relative electron isolation from photons for the leading electron
296  hists_["elecPhIso_" ] = store_->book1D("ElecPhIso" , "Iso_{Ph}(e)" , 100, 0., 1.);
297 
298  // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>30
299  hists_["jetMultBPur_"] = store_->book1D("JetMultBPur", "N_{30}(b/pur)" , 10, 0., 10.);
300  // btag discriminator for track counting high purity
301  hists_["jetBDiscPur_"] = store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 200, -10., 10.);
302  // btag discriminator for track counting high purity for 1. leading jet
303  hists_["jet1BDiscPur_"] = store_->book1D("Jet1BDiscPur", "Disc_{b/pur}(Jet1)", 200, -10., 10.);
304  // btag discriminator for track counting high purity for 2. leading jet
305  hists_["jet2BDiscPur_"] = store_->book1D("Jet2BDiscPur", "Disc_{b/pur}(Jet2)", 200, -10., 10.);
306 
307 
308  // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30
309  hists_["jetMultBVtx_"] = store_->book1D("JetMultBVtx", "N_{30}(b/vtx)" , 10, 0., 10.);
310  // btag discriminator for simple secondary vertex
311  hists_["jetBDiscVtx_"] = store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.);
312 
313 
314  // multiplicity of btagged jets (for combined secondary vertex) with pt(L2L3)>30
315  hists_["jetMultBCombVtx_"] = store_->book1D("JetMultBCombVtx", "N_{30}(b/CSV)" , 10, 0., 10.);
316  // btag discriminator for combined secondary vertex
317  hists_["jetBDiscCombVtx_"] = store_->book1D("JetBDiscCombVtx", "Disc_{b/CSV}(Jet)", 60, -1., 2.);
318  // btag discriminator for combined secondary vertex for 1. leading jet
319  hists_["jet1BDiscCombVtx_"] = store_->book1D("Jet1BDiscCombVtx", "Disc_{b/CSV}(Jet1)", 60, -1., 2.);
320  // btag discriminator for combined secondary vertex for 2. leading jet
321  hists_["jet2BDiscCombVtx_"] = store_->book1D("Jet2BDiscCombVtx", "Disc_{b/CSV}(Jet2)", 60, -1., 2.);
322 
323 
324  // pt of the 1. leading jet (uncorrected)
325  hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.);
326  // pt of the 2. leading jet (uncorrected)
327  hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.);
328 
329  // selected events
330  hists_["eventLogger_"] = store_->book2D("EventLogger", "Logged Events" , 9, 0., 9., 10, 0., 10.);
331 
332  // set axes titles for selected events
333  hists_["eventLogger_"]->getTH1()->SetOption("TEXT");
334  hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1);
335  hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1);
336  hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1);
337  hists_["eventLogger_"]->setBinLabel( 4 , "pt_{L2L3}(jet1)" , 1);
338  hists_["eventLogger_"]->setBinLabel( 5 , "pt_{L2L3}(jet2)" , 1);
339  hists_["eventLogger_"]->setBinLabel( 6 , "pt_{L2L3}(jet3)" , 1);
340  hists_["eventLogger_"]->setBinLabel( 7 , "pt_{L2L3}(jet4)" , 1);
341  hists_["eventLogger_"]->setBinLabel( 8 , "M_{W}" , 1);
342  hists_["eventLogger_"]->setBinLabel( 9 , "M_{Top}" , 1);
343  hists_["eventLogger_"]->setAxisTitle("logged evts" , 2);
344  return;
345  }
346 
347  void
349  {
350  // fetch trigger event if configured such
353  if( !event.getByToken(triggerTable_, triggerTable) ) return;
354 
355  }
356 
357  /*
358  ------------------------------------------------------------
359 
360  Primary Vertex Monitoring
361 
362  ------------------------------------------------------------
363  */
364 
365  // fill monitoring plots for primary vertices
367  if( !event.getByToken(pvs_, pvs) ) return;
368  unsigned int pvMult = 0;
369  for(edm::View<reco::Vertex>::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){
370  if(!pvSelect_ || (*pvSelect_)(*pv))
371  pvMult++;
372  }
373  fill("pvMult_", pvMult );
374 
375  /*
376  ------------------------------------------------------------
377 
378  Electron Monitoring
379 
380  ------------------------------------------------------------
381  */
382 
383  /*
384  reco::BeamSpot beamSpot;
385  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
386  if( !event.getByToken("offlineBeamSpot",recoBeamSpotHandle)) return;
387  beamSpot = *recoBeamSpotHandle;
388  */
389 
390  // fill monitoring plots for electrons
397 
398  if( !event.getByToken(elecs_, elecs) ) return;
399  if( !event.getByToken(elecs_gsf_, elecs_gsf) ) return;
400  // check availability of electron id
401  edm::Handle<edm::ValueMap<float> > electronId;
403  if( !event.getByToken(electronId_, electronId) ) return;
404  }
405  // loop electron collection
406  unsigned int eMult=0, eMultIso=0;
407  std::vector<const reco::GsfElectron*> isoElecs;
409 
410  unsigned int idx_gsf = 0;
411  for(elec_it=elecs->begin(); elec_it!=elecs->end(); ++elec_it){
412  if(elec_it->gsfElectronRef().isNull()) continue ;
413 
414  reco::GsfElectronRef elec = elec_it->gsfElectronRef();
415  if(elec->gsfTrack().isNull()) continue ;
416 
417  // restrict to electrons with good electronId
418  int eID = 0;
420  eID = (int)(*electronId)[elecs_gsf->refAt(idx_gsf)];
421 
422  if( electronId_.isUninitialized() ? true : ( (eID & eidPattern_) && (eID >=5)) ){
423 
424  if( elecSelect(*elec_it)){
425  double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
426 
427  double isolationChHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumChargedHadronPt);
428  double isolationNeuHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumNeutralHadronEt);
429  double isolationPhoton = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumPhotonEt);
430  double PFisolationRel = (elec->pfIsolationVariables().sumChargedHadronPt+elec->pfIsolationVariables().sumNeutralHadronEt+elec->pfIsolationVariables().sumPhotonEt)/elec->pt();
431 
432  if( eMult==0 ){
433  // restrict to the leading electron
434  fill("elecPt_" , elec->pt() );
435  fill("elecEta_", elec->eta());
436  fill("elecRelIso_" , isolationRel );
437  fill("elecPFRelIso_",PFisolationRel );
438  fill("elecChHadIso_" , isolationChHad );
439  fill("elecNeuHadIso_" , isolationNeuHad );
440  fill("elecPhIso_" , isolationPhoton );
441 
442  }
443  // in addition to the multiplicity counter buffer the iso
444  // electron candidates for later overlap check with jets
445  ++eMult; if( (elecIso)(*elec_it)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso; }
446  }
447  }
448  idx_gsf++;
449  }
450 
451  fill("elecMult_", eMult );
452  fill("elecMultIso_", eMultIso);
453 
454 
455  /*
456  ------------------------------------------------------------
457 
458  Muon Monitoring
459 
460  ------------------------------------------------------------
461  */
462 
463  // fill monitoring plots for muons
464  unsigned int mMult=0, mMultIso=0;
465 
471  reco::Muon mu;
472 
473 
474  /*
475  if (muons_.label() == "muons"){
476  edm::Handle<edm::View<reco::Muon> > muons;
477  edm::View<reco::Muon>::const_iterator muon;
478  StringCutObjectSelector<reco::Muon> *muonSelect = new StringCutObjectSelector<reco::Muon>(muonSelect_);
479  StringCutObjectSelector<reco::Muon> *muonIso = new StringCutObjectSelector<reco::Muon>(muonIso_);
480  }
481  */
482 
483  if( !event.getByToken(muons_, muons )) return;
484  for(muonit = muons->begin(); muonit != muons->end(); ++muonit){ // for now, to use Reco::Muon need to substitute muonit with muon
485  // and comment the MuonRef and PFCandidate parts
486 
487  if(muonit->muonRef().isNull()) continue ;
488  reco::MuonRef muon = muonit->muonRef();
489 
490  if(muon->innerTrack().isNull()) continue ;
491 
492 
493  // restrict to globalMuons
494  if( muon->isGlobalMuon() ){
495  fill("muonDelZ_" , muon->globalTrack()->vz());
496  fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy());
497 
498  // apply selection
499  if( !muonSelect || (*muonSelect)(*muonit)) {
500 
501 
502 
503  double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt();
504  double isolationChHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumChargedHadronPt);
505  double isolationNeuHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumNeutralHadronEt);
506  double isolationPhoton = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumPhotonEt);
507  double PFisolationRel = (muon->pfIsolationR04().sumChargedHadronPt + muon->pfIsolationR04().sumNeutralHadronEt + muon->pfIsolationR04().sumPhotonEt)/muon->pt();
508 
509 
510 
511  if( mMult==0 ){
512  // restrict to leading muon
513  fill("muonPt_" , muon->pt() );
514  fill("muonEta_" , muon->eta());
515  fill("muonRelIso_" , isolationRel );
516  fill("muonChHadIso_" , isolationChHad );
517  fill("muonNeuHadIso_" , isolationNeuHad );
518  fill("muonPhIso_" , isolationPhoton );
519  fill("muonPFRelIso_" , PFisolationRel );
520 
521  }
522  ++mMult;
523 
524  if( !muonIso || (*muonIso)(*muonit)) {if(mMultIso == 0) mu = *muon; ++mMultIso;}
525  }
526  }
527  }
528  fill("muonMult_", mMult );
529  fill("muonMultIso_", mMultIso);
530 
531  /*
532  ------------------------------------------------------------
533 
534  Jet Monitoring
535 
536  ------------------------------------------------------------
537  */
538  // check availability of the btaggers
539  edm::Handle<reco::JetTagCollection> btagEff, btagPur, btagVtx, btagCombVtx;
540  if( includeBTag_ ){
541  if( !event.getByToken(btagEff_, btagEff) ) return;
542  if( !event.getByToken(btagPur_, btagPur) ) return;
543  if( !event.getByToken(btagVtx_, btagVtx) ) return;
544  if( !event.getByToken(btagCombVtx_, btagCombVtx) ) return;
545  }
546 
547  // load jet corrector if configured such
548  const JetCorrector* corrector=0;
549  if(!jetCorrector_.empty()){
550  // check whether a jet correcto is in the event setup or not
551  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
552  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
553  }
554  else{
555  edm::LogVerbatim( "SingleTopTChannelLeptonDQM" )
556  << "\n"
557  << "------------------------------------------------------------------------------------- \n"
558  << " No JetCorrectionsRecord available from EventSetup: \n"
559  << " - Jets will not be corrected. \n"
560  << " - If you want to change this add the following lines to your cfg file: \n"
561  << " \n"
562  << " ## load jet corrections \n"
563  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
564  << " process.prefer(\"ak5CaloL2L3\") \n"
565  << " \n"
566  << "------------------------------------------------------------------------------------- \n";
567  }
568  }
569 
570  // loop jet collection
571  std::vector<reco::Jet> correctedJets;
572  unsigned int mult=0, multBEff=0, multBPur=0, multNoBPur=0, multBVtx=0, multBCombVtx=0;
573 
574 
576  if( !event.getByToken(jets_, jets) ) return;
577 
578 
580  if(jetIDSelect_){
581  if( !event.getByToken(jetIDLabel_, jetID) ) return;
582  }
583 
584  vector<double> bJetDiscVal;
585  vector<double> NobJetDiscVal;
586  reco::Jet TaggedJetCand;
587  reco::Jet UnTaggedJetCand;
588  reco::Jet FwdJetCand;
589  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
590  // check jetID for calo jets
591  unsigned int idx = jet-jets->begin();
592  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
593  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
594  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
595  }
596  }
597 
598  // check additional jet selection for calo, pf and bare reco jets
599  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
600  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
602  if(!jetSelect(sel)){ continue;}
603  }
604  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
605  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
607  if(!jetSelect(sel)) continue;
608  }
609  else{
610  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
612  if(!jetSelect(sel)) continue;
613  }
614  // check for overlaps -- comment this to be synchronous with the selection
615  //bool overlap=false;
616  //for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
617  // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;}
618  //} if(overlap){continue;}
619 
620 
621  // prepare jet to fill monitor histograms
622  reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
623  correctedJets.push_back(monitorJet);
624 
625 
626  ++mult; // determine jet multiplicity
627  if( includeBTag_ ){
628  // fill b-discriminators
629  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
630  if( (*btagVtx)[jetRef]>btagVtxWP_ ) ++multBVtx;
631  if( (*btagCombVtx)[jetRef]>btagCombVtxWP_ ) ++multBCombVtx;
632  if( (*btagPur)[jetRef]>btagPurWP_ ){
633  if (multBPur == 0){
634  TaggedJetCand = monitorJet;
635  // TaggedJetCand = *jet;
636  bJetDiscVal.push_back((*btagPur)[jetRef]);
637 
638  }
639  else if (multBPur == 1){
640  bJetDiscVal.push_back((*btagPur)[jetRef]);
641  if (bJetDiscVal[1]>bJetDiscVal[0])
642  TaggedJetCand = monitorJet;
643  //TaggedJetCand = *jet;
644  }
645  ++multBPur;
646  }
647 
648  else{
649  if (multNoBPur == 0){
650  UnTaggedJetCand = monitorJet;
651  NobJetDiscVal.push_back((*btagPur)[jetRef]);
652 
653  }
654  else if (multNoBPur == 1){
655  NobJetDiscVal.push_back((*btagPur)[jetRef]);
656  if (NobJetDiscVal[1]<NobJetDiscVal[0])
657  UnTaggedJetCand = monitorJet;
658  }
659 
660  ++multNoBPur;
661  }
662 
663  if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff;
664 
665  if(mult==1) {
666  fill("jet1BDiscPur_", (*btagPur)[jetRef]);
667  fill("jet1BDiscCombVtx_", (*btagCombVtx)[jetRef]);
668  }
669 
670  else if(mult==2) {
671  fill("jet2BDiscPur_", (*btagPur)[jetRef]);
672  fill("jet2BDiscCombVtx_", (*btagCombVtx)[jetRef]);
673  }
674 
675  fill("jetBDiscEff_", (*btagEff)[jetRef]);
676  fill("jetBDiscPur_", (*btagPur)[jetRef]);
677  fill("jetBDiscVtx_", (*btagVtx)[jetRef]);
678  fill("jetBDiscCombVtx_", (*btagCombVtx)[jetRef]);
679 
680  }
681  // fill pt (raw or L2L3) for the leading jets
682  if(mult==1) {
683  fill("jet1Pt_" , monitorJet.pt());
684  fill("jet1Eta_", monitorJet.eta());
685  fill("jet1PtRaw_", jet->pt() );
686  FwdJetCand = monitorJet;
687 
688  }
689 
690  if(mult==2) {
691  fill("jet2Pt_" , monitorJet.pt());
692  fill("jet2Eta_", monitorJet.eta());
693  fill("jet2PtRaw_", jet->pt() );
694 
695  if ( abs(monitorJet.eta()) > abs(FwdJetCand.eta()) ){
696  FwdJetCand = monitorJet;
697  }
698 
699  fill("FwdJetPt_" , FwdJetCand.pt());
700  fill("FwdJetEta_", FwdJetCand.eta());
701 
702  }
703 
704 
705 
706  }
707 
708  if (multNoBPur == 1 && multBPur == 1){
709 
710  fill("TaggedJetPtEta_" , TaggedJetCand.pt(), TaggedJetCand.eta());
711  fill("UnTaggedJetPtEta_" , UnTaggedJetCand.pt(), UnTaggedJetCand.eta());
712 
713 
714  fill("TaggedJetPt_" , TaggedJetCand.pt());
715  fill("TaggedJetEta_", TaggedJetCand.eta());
716  fill("UnTaggedJetPt_" , UnTaggedJetCand.pt());
717  fill("UnTaggedJetEta_", UnTaggedJetCand.eta());
718  }
719 
720  fill("jetMult_" , mult );
721  fill("jetMultBEff_", multBEff);
722  fill("jetMultBPur_", multBPur);
723  fill("jetMultBVtx_", multBVtx);
724  fill("jetMultBCombVtx_", multBCombVtx);
725 
726 
727  /*
728  ------------------------------------------------------------
729 
730  MET Monitoring
731 
732  ------------------------------------------------------------
733  */
734 
735  // fill monitoring histograms for met
736  reco::MET mET;
737  for(std::vector<edm::EDGetTokenT<edm::View<reco::MET> > >::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
739  if( !event.getByToken(*met_, met) ) continue;
740  if(met->begin()!=met->end()){
741  unsigned int idx=met_-mets_.begin();
742  if(idx==0) { fill("metCalo_" , met->begin()->et()); }
743  if(idx==1) { fill("metTC_" , met->begin()->et()); }
744  if(idx==2) { fill("metPflow_", met->begin()->et()); mET = *(met->begin()); }
745  }
746  }
747 
748 
749  /*
750  ------------------------------------------------------------
751 
752  Event Monitoring
753 
754  ------------------------------------------------------------
755  */
756 
757  // fill W boson and top mass estimates
758  Calculate eventKinematics(MAXJETS, WMASS);
759  double wMass = eventKinematics.massWBoson (correctedJets);
760  double topMass = eventKinematics.massTopQuark(correctedJets);
761  if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);}
762  // fill plots for trigger monitoring
763  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<wMass && wMass<upperEdge_) ){
764  if(!triggerTable_.isUninitialized()) fill(event, *triggerTable, "trigger", triggerPaths_);
765  if(logged_<=hists_.find("eventLogger_")->second->getNbinsY()){
766  // log runnumber, lumi block, event number & some
767  // more pysics infomation for interesting events
768  fill("eventLogger_", 0.5, logged_+0.5, event.eventAuxiliary().run());
769  fill("eventLogger_", 1.5, logged_+0.5, event.eventAuxiliary().luminosityBlock());
770  fill("eventLogger_", 2.5, logged_+0.5, event.eventAuxiliary().event());
771  if(correctedJets.size()>0) fill("eventLogger_", 3.5, logged_+0.5, correctedJets[0].pt());
772  if(correctedJets.size()>1) fill("eventLogger_", 4.5, logged_+0.5, correctedJets[1].pt());
773  if(correctedJets.size()>2) fill("eventLogger_", 5.5, logged_+0.5, correctedJets[2].pt());
774  if(correctedJets.size()>3) fill("eventLogger_", 6.5, logged_+0.5, correctedJets[3].pt());
775  fill("eventLogger_", 7.5, logged_+0.5, wMass );
776  fill("eventLogger_", 8.5, logged_+0.5, topMass);
777  ++logged_;
778  }
779  }
780  if(multBPur != 0 && mMultIso == 1 ){
781 
782  double mtW = eventKinematics.tmassWBoson(&mu,mET,TaggedJetCand); fill("MTWm_",mtW);
783  double MTT = eventKinematics.tmassTopQuark(&mu,mET,TaggedJetCand); fill("mMTT_", MTT);
784 
785  }
786 
787  if(multBPur != 0 && eMultIso == 1 ){
788  double mtW = eventKinematics.tmassWBoson(&e,mET,TaggedJetCand); fill("MTWe_",mtW);
789  double MTT = eventKinematics.tmassTopQuark(&e,mET,TaggedJetCand); fill("eMTT_", MTT);
790  }
791 
792  }
793 
794 }
795 
796 
797 SingleTopTChannelLeptonDQM::SingleTopTChannelLeptonDQM(const edm::ParameterSet& cfg): vertexSelect_(0), beamspot_(""), beamspotSelect_(0),
798  MuonStep(0), PFMuonStep(0), ElectronStep(0), PFElectronStep(0), PvStep(0), METStep(0)
799 
800 {
801  JetSteps.clear();
802  CaloJetSteps.clear();
803  PFJetSteps.clear();
804 
805  // configure preselection
806  edm::ParameterSet presel=cfg.getParameter<edm::ParameterSet>("preselection");
807  if( presel.existsAs<edm::ParameterSet>("trigger") ){
808  edm::ParameterSet trigger=presel.getParameter<edm::ParameterSet>("trigger");
809  triggerTable__=consumes<edm::TriggerResults>(trigger.getParameter<edm::InputTag>("src"));
810  triggerPaths_=trigger.getParameter<std::vector<std::string> >("select");
811  }
812  if( presel.existsAs<edm::ParameterSet>("vertex" ) ){
813  edm::ParameterSet vertex=presel.getParameter<edm::ParameterSet>("vertex");
814  vertex_= vertex.getParameter<edm::InputTag>("src");
815  vertex__= consumes<reco::Vertex>(vertex.getParameter<edm::InputTag>("src"));
817  }
818  if( presel.existsAs<edm::ParameterSet>("beamspot" ) ){
819  edm::ParameterSet beamspot=presel.getParameter<edm::ParameterSet>("beamspot");
820  beamspot_= beamspot.getParameter<edm::InputTag>("src");
821  beamspot__= consumes<reco::BeamSpot>(beamspot.getParameter<edm::InputTag>("src"));
823  }
824  // conifgure the selection
825  std::vector<edm::ParameterSet> sel=cfg.getParameter<std::vector<edm::ParameterSet> >("selection");
826  for(unsigned int i=0; i<sel.size(); ++i){
827  selectionOrder_.push_back(sel.at(i).getParameter<std::string>("label"));
828  selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new SingleTopTChannelLepton::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter<edm::ParameterSet>("setup"), cfg.getParameter<std::vector<edm::ParameterSet> >("selection"), consumesCollector()));
829  }
830  for(std::vector<std::string>::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){
831  std::string key = selectionStep(*selIt), type = objectType(*selIt);
832  if(selection_.find(key)!=selection_.end()){
833  if(type=="muons"){
835  }
836  if(type=="muons/pf"){
838  }
839  if(type=="elecs"){
841  }
842  if(type=="elecs/pf"){
844  }
845  if(type=="pvs"){
847  }
848  if(type=="jets" ){
850  }
851  if(type=="jets/pf" ){
853  }
854  if(type=="jets/calo" ){
856  }
857  if(type=="met"){
859  }
860  }
861  }
862 }
863 
864 
865 void
867 {
870  if(!event.getByToken(triggerTable__, triggerTable) ) return;
871  if(!accept(event, *triggerTable, triggerPaths_)) return;
872  }
875  if( !event.getByToken(beamspot__, beamspot) ) return;
876  if(!(*beamspotSelect_)(*beamspot)) return;
877  }
878 
879  if(!vertex__.isUninitialized()){
881  if( !event.getByToken(vertex__, vertex) ) return;
882  edm::View<reco::Vertex>::const_iterator pv = vertex->begin();
883  //if ((pv->isFake()) || (pv->ndof() < 4) || (abs(pv->z())>24.) || (pv->position().Rho() > 2.0))
884  if(!(*vertexSelect_)(*pv)) return;
885  }
886 
887 
888  // apply selection steps
889  unsigned int passed=0;
890  unsigned int nJetSteps = -1;
891  unsigned int nPFJetSteps = -1;
892  unsigned int nCaloJetSteps = -1;
893  for(std::vector<std::string>::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){
894  std::string key = selectionStep(*selIt), type = objectType(*selIt);
895  if(selection_.find(key)!=selection_.end()){
896  if(type=="empty"){
897  selection_[key].second->fill(event, setup);
898  }
899  if(type=="presel" ){
900  selection_[key].second->fill(event, setup);
901  }
902  if(type=="elecs" && ElectronStep != 0){
903  if(ElectronStep->select(event)){ ++passed;
904  selection_[key].second->fill(event, setup);
905  } else break;
906  }
907  if(type=="elecs/pf" && PFElectronStep != 0){
908 
909  if(PFElectronStep->select(event, "electron")){ ++passed;
910 
911  selection_[key].second->fill(event, setup);
912 
913  } else break;
914  }
915  if(type=="muons" && MuonStep != 0){
916  if(MuonStep->select(event)){ ++passed;
917  selection_[key].second->fill(event, setup);
918  } else break;
919  }
920  if(type=="muons/pf" && PFMuonStep != 0){
921  // cout << "MUON SELECTION" << endl;
922  if(PFMuonStep->select(event, "muon")){ ++passed;
923  selection_[key].second->fill(event, setup);
924  } else break;
925  }
926  if(type=="jets" ){
927  nJetSteps++;
928  if(JetSteps[nJetSteps] != NULL){
929  if(JetSteps[nJetSteps]->select(event, setup)){ ++passed;
930  selection_[key].second->fill(event, setup);
931  } else break;
932  }
933  }
934  if(type=="jets/pf" ){
935  // cout << "JET SELECTION" << endl;
936  nPFJetSteps++;
937  if(PFJetSteps[nPFJetSteps] != NULL){
938  if(PFJetSteps[nPFJetSteps]->select(event, setup)){ ++passed;
939  selection_[key].second->fill(event, setup);
940  }else break;
941  }
942  }
943  if(type=="jets/calo" ){
944  nCaloJetSteps++;
945  if(CaloJetSteps[nCaloJetSteps] != NULL){
946  if(CaloJetSteps[nCaloJetSteps]->select(event, setup)){ ++passed;
947  selection_[key].second->fill(event, setup);
948  } else break;
949  }
950  }
951  if(type=="met" && METStep != 0 ){
952  if(METStep->select(event)){ ++passed;
953  selection_[key].second->fill(event, setup);
954  } else break;
955  }
956  }
957  }
958 }
959 
960 
std::vector< std::string > selectionOrder_
type
Definition: HCALResponse.h:21
std::string objectType(const std::string &label)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< reco::JetIDValueMap > jetIDLabel_
jetID as an extra selection type
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:4
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool select(const edm::Event &event)
apply selection
std::vector< std::string > triggerPaths_
trigger paths
Level verbosity_
verbosity level for booking
virtual float pt() const
transverse momentum
SelectionStep< reco::MET > * METStep
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
std::vector< ParameterSet > VParameterSet
Definition: ParameterSet.h:33
Base class for all types of Jets.
Definition: Jet.h:20
int logged_
number of logged interesting events
double massTopQuark(const std::vector< reco::Jet > &jets)
calculate t-quark mass estimate
edm::EDGetTokenT< reco::JetTagCollection > btagCombVtx_
RunNumber_t run() const
std::vector< SelectionStep< reco::CaloJet > * > CaloJetSteps
edm::EDGetTokenT< edm::TriggerResults > triggerTable__
trigger table
#define NULL
Definition: scimark2.h:8
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:444
std::string muonIso_
extra isolation criterion on muon
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
std::string muonSelect_
extra selection on muons
edm::EDGetTokenT< edm::View< reco::PFCandidate > > muons_
std::map< std::string, std::pair< edm::ParameterSet, SingleTopTChannelLepton::MonitorEnsemble * > > selection_
Jets made from PFObjects.
Definition: PFJet.h:21
double massWBoson(const std::vector< reco::Jet > &jets)
calculate W boson mass estimate
SingleTopTChannelLeptonDQM(const edm::ParameterSet &cfg)
default constructor
#define MAXJETS
Definition: myFastSimVal.cc:30
LuminosityBlockNumber_t luminosityBlock() const
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
edm::InputTag vertex_
primary vertex
StringCutObjectSelector< reco::Vertex > * vertexSelect_
string cut selector
Helper class for the calculation of a top and a W boson mass estime.
Definition: TopDQMHelpers.h:69
std::string elecSelect_
extra selection on electrons
double lowerEdge_
mass window upper and lower edge
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
bool isNull() const
Checks for null.
Definition: Ref.h:247
SelectionStep< reco::Vertex > * PvStep
Definition: MET.h:39
virtual float eta() const
momentum pseudorapidity
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
vector< PseudoJet > jets
edm::EDGetTokenT< edm::View< reco::GsfElectron > > elecs_gsf_
SelectionStep< reco::GsfElectron > * ElectronStep
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int mu
Definition: Constants.h:22
edm::EDGetTokenT< reco::JetTagCollection > btagPur_
double tmassTopQuark(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate top quark transverse mass estimate
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::EDGetTokenT< reco::JetTagCollection > btagEff_
btag discriminator labels
bool first
Definition: L1TdeRCT.cc:75
std::map< std::string, MonitorElement * > hists_
histogram container
edm::EDGetTokenT< edm::TriggerResults > triggerTable_
trigger table
std::vector< SelectionStep< reco::Jet > * > JetSteps
edm::EDGetTokenT< edm::ValueMap< float > > electronId_
electronId label
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:72
std::string selectionStep(const std::string &label)
double tmassWBoson(reco::RecoCandidate *lep, const reco::MET &met, const reco::Jet &b)
calculate W boson transverse mass estimate
edm::EDGetTokenT< reco::JetTagCollection > btagVtx_
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
Definition: JetCorrector.cc:50
edm::EDGetTokenT< edm::View< reco::PFCandidate > > elecs_
SelectionStep< reco::Muon > * MuonStep
static const unsigned int MAXJETS
std::vector< SelectionStep< reco::PFJet > * > PFJetSteps
std::vector< edm::EDGetTokenT< edm::View< reco::MET > > > mets_
considers a vector of METs
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
SelectionStep< reco::PFCandidate > * PFMuonStep
edm::EDGetTokenT< edm::View< reco::Jet > > jets_
input sources for monitoring
virtual void analyze(const edm::Event &event, const edm::EventSetup &setup)
do this during the event loop
list key
Definition: combine.py:13
tuple muons
Definition: patZpeak.py:38
StringCutObjectSelector< reco::BeamSpot > * beamspotSelect_
string cut selector
edm::EDGetTokenT< reco::Vertex > vertex__
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
edm::EDGetTokenT< reco::BeamSpot > beamspot__
bool isUninitialized() const
Definition: EDGetToken.h:71
SelectionStep< reco::PFCandidate > * PFElectronStep
volatile std::atomic< bool > shutdown_flag false
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
EventNumber_t event() const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void book(std::string directory)
book histograms in subdirectory directory
std::string elecIso_
extra isolation criterion on electron