CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SingleTopTChannelLepton::MonitorEnsemble Class Reference

#include <SingleTopTChannelLeptonDQM.h>

Public Types

enum  Level { STANDARD, VERBOSE, DEBUG }
 different verbosity levels More...
 

Public Member Functions

void book (std::string directory)
 book histograms in subdirectory directory More...
 
void fill (const edm::Event &event, const edm::EventSetup &setup)
 fill monitor histograms with electronId and jetCorrections More...
 
 MonitorEnsemble (const char *label, const edm::ParameterSet &cfg, const edm::VParameterSet &vcfg)
 default contructor More...
 
 ~MonitorEnsemble ()
 default destructor More...
 

Private Member Functions

bool booked (const std::string histName) const
 check if histogram was booked More...
 
void fill (const edm::Event &event, const edm::TriggerResults &triggerTable, std::string channel, const std::vector< std::string > labels) const
 fill trigger monitoring histograms More...
 
void fill (const std::string histName, double value) const
 fill histogram if it had been booked before More...
 
void fill (const std::string histName, double xValue, double yValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
void fill (const std::string histName, double xValue, double yValue, double zValue) const
 fill histogram if it had been booked before (2-dim version) More...
 
std::string monitorPath (const std::string &label) const
 
std::string selectionPath (const std::string &label) const
 
void triggerBinLabels (std::string channel, const std::vector< std::string > labels)
 set configurable labels for trigger monitoring histograms More...
 

Private Attributes

edm::InputTag btagCombVtx_
 
double btagCombVtxWP_
 
edm::InputTag btagEff_
 btag discriminator labels More...
 
double btagEffWP_
 btag working points More...
 
edm::InputTag btagPur_
 
double btagPurWP_
 
edm::InputTag btagVtx_
 
double btagVtxWP_
 
int eidPattern_
 
std::string elecIso_
 extra isolation criterion on electron More...
 
edm::InputTag elecs_
 input sources for monitoring More...
 
edm::InputTag elecs_gsf_
 
std::string elecSelect_
 extra selection on electrons More...
 
edm::InputTag electronId_
 electronId label More...
 
std::map< std::string,
MonitorElement * > 
hists_
 histogram container More...
 
bool includeBTag_
 
std::string jetCorrector_
 jetCorrector More...
 
edm::InputTag jetIDLabel_
 jetID as an extra selection type More...
 
StringCutObjectSelector
< reco::JetID > * 
jetIDSelect_
 extra jetID selection on calo jets More...
 
edm::InputTag jets_
 
std::string jetSelect_
 
std::string label_
 instance label More...
 
int logged_
 number of logged interesting events More...
 
double lowerEdge_
 mass window upper and lower edge More...
 
std::vector< edm::InputTagmets_
 considers a vector of METs More...
 
std::string muonIso_
 extra isolation criterion on muon More...
 
edm::InputTag muons_
 
edm::InputTag muons_reco_
 
std::string muonSelect_
 extra selection on muons More...
 
edm::InputTag pvs_
 
StringCutObjectSelector
< reco::Vertex > * 
pvSelect_
 extra selection on primary vertices; meant to investigate the pile-up effect More...
 
DQMStorestore_
 storage manager More...
 
std::vector< std::string > triggerPaths_
 
edm::InputTag triggerTable_
 trigger table More...
 
double upperEdge_
 
Level verbosity_
 verbosity level for booking More...
 

Detailed Description

Definition at line 39 of file SingleTopTChannelLeptonDQM.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

MonitorEnsemble::MonitorEnsemble ( const char *  label,
const edm::ParameterSet cfg,
const edm::VParameterSet vcfg 
)

default contructor

Definition at line 22 of file SingleTopTChannelLeptonDQM.cc.

References book(), btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, DEBUG, eidPattern_, elecIso_, elecs_, elecs_gsf_, elecSelect_, electronId_, edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), includeBTag_, jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, jets_, jetSelect_, lowerEdge_, mets_, muonIso_, muons_, muonSelect_, pvs_, pvSelect_, STANDARD, AlCaHLTBitMon_QueryRunRegistry::string, triggerPaths_, triggerTable_, upperEdge_, VERBOSE, and verbosity_.

22  :
24 
25  {
26  // sources have to be given; this PSet is not optional
27  edm::ParameterSet sources=cfg.getParameter<edm::ParameterSet>("sources");
28  muons_ = sources.getParameter<edm::InputTag>("muons");
29  elecs_gsf_ = sources.getParameter<edm::InputTag>("elecs_gsf");
30  elecs_ = sources.getParameter<edm::InputTag>("elecs");
31  jets_ = sources.getParameter<edm::InputTag>("jets" );
32  mets_ = sources.getParameter<std::vector<edm::InputTag> >("mets" );
33  pvs_ = sources.getParameter<edm::InputTag>("pvs" );
34  // electronExtras are optional; they may be omitted or
35  // empty
36  if( cfg.existsAs<edm::ParameterSet>("elecExtras") ){
37  edm::ParameterSet elecExtras=cfg.getParameter<edm::ParameterSet>("elecExtras");
38  // select is optional; in case it's not found no
39  // selection will be applied
40  if( elecExtras.existsAs<std::string>("select") ){
41  // elecSelect_= new StringCutObjectSelector<reco::GsfElectron>(elecExtras.getParameter<std::string>("select"));
42  elecSelect_ = vcfg[1].getParameter<std::string>("select");
43  }
44  // isolation is optional; in case it's not found no
45  // isolation will be applied
46  if( elecExtras.existsAs<std::string>("isolation") ){
47  //elecIso_= new StringCutObjectSelector<reco::GsfElectron>(elecExtras.getParameter<std::string>("isolation"));
48  elecIso_= elecExtras.getParameter<std::string>("isolation");
49  }
50  // electronId is optional; in case it's not found the
51  // InputTag will remain empty
52  edm::ParameterSet elecId=vcfg[1].getParameter<edm::ParameterSet>("electronId");
53  electronId_= elecId.getParameter<edm::InputTag>("src");
54  eidPattern_= elecId.getParameter<int>("pattern");
55 
56  }
57  // pvExtras are opetional; they may be omitted or empty
58  if(cfg.existsAs<edm::ParameterSet>("pvExtras")){
59  edm::ParameterSet pvExtras=cfg.getParameter<edm::ParameterSet>("pvExtras");
60  // select is optional; in case it's not found no
61  // selection will be applied
62  if( pvExtras.existsAs<std::string>("select") ){
64  }
65  }
66  // muonExtras are optional; they may be omitted or empty
67  if( cfg.existsAs<edm::ParameterSet>("muonExtras")){ // && vcfg.existsAs<std::vector<edm::ParameterSet> >("selection")){
68  edm::ParameterSet muonExtras=cfg.getParameter<edm::ParameterSet>("muonExtras");
69 
70  // select is optional; in case it's not found no
71  // selection will be applied
72  if( muonExtras.existsAs<std::string>("select") ){
73  // muonSelect_= new StringCutObjectSelector<reco::Muon>(muonExtras.getParameter<std::string>("select"));
74  // muonSelect_= muonExtras.getParameter<std::string>("select");
75  muonSelect_ = vcfg[1].getParameter<std::string>("select");
76  }
77  // isolation is optional; in case it's not found no
78  // isolation will be applied
79  if( muonExtras.existsAs<std::string>("isolation") ){
80  // muonIso_= new StringCutObjectSelector<reco::Muon>(muonExtras.getParameter<std::string>("isolation"));
81  muonIso_= muonExtras.getParameter<std::string>("isolation");
82  }
83  }
84 
85  // jetExtras are optional; they may be omitted or
86  // empty
87  if( cfg.existsAs<edm::ParameterSet>("jetExtras") ){
88  edm::ParameterSet jetExtras=cfg.getParameter<edm::ParameterSet>("jetExtras");
89  // jetCorrector is optional; in case it's not found
90  // the InputTag will remain empty
91  if( jetExtras.existsAs<std::string>("jetCorrector") ){
92  jetCorrector_= jetExtras.getParameter<std::string>("jetCorrector");
93  }
94  // read jetID information if it exists
95  if(jetExtras.existsAs<edm::ParameterSet>("jetID")){
97  jetIDLabel_ =jetID.getParameter<edm::InputTag>("label");
99  }
100  // select is optional; in case it's not found no
101  // selection will be applied (only implemented for
102  // CaloJets at the moment)
103  if( jetExtras.existsAs<std::string>("select") ){
104 
105  jetSelect_= jetExtras.getParameter<std::string>("select");
106  jetSelect_ = vcfg[2].getParameter<std::string>("select");
107  }
108  // jetBDiscriminators are optional; in case they are
109  // not found the InputTag will remain empty; they
110  // consist of pairs of edm::JetFlavorAssociation's &
111  // corresponding working points
112  includeBTag_=jetExtras.existsAs<edm::ParameterSet>("jetBTaggers");
113  if( includeBTag_ ){
114  edm::ParameterSet btagEff=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingEff");
115  btagEff_= btagEff.getParameter<edm::InputTag>("label"); btagEffWP_= btagEff.getParameter<double>("workingPoint");
116  edm::ParameterSet btagPur=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("trackCountingPur");
117  btagPur_= btagPur.getParameter<edm::InputTag>("label"); btagPurWP_= btagPur.getParameter<double>("workingPoint");
118  edm::ParameterSet btagVtx=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("secondaryVertex" );
119  btagVtx_= btagVtx.getParameter<edm::InputTag>("label"); btagVtxWP_= btagVtx.getParameter<double>("workingPoint");
120  edm::ParameterSet btagCombVtx=jetExtras.getParameter<edm::ParameterSet>("jetBTaggers").getParameter<edm::ParameterSet>("combinedSecondaryVertex" );
121  btagCombVtx_= btagCombVtx.getParameter<edm::InputTag>("label"); btagCombVtxWP_= btagCombVtx.getParameter<double>("workingPoint");
122  }
123  }
124 
125  // triggerExtras are optional; they may be omitted or empty
126  if( cfg.existsAs<edm::ParameterSet>("triggerExtras") ){
127  edm::ParameterSet triggerExtras=cfg.getParameter<edm::ParameterSet>("triggerExtras");
128  triggerTable_=triggerExtras.getParameter<edm::InputTag>("src");
129  triggerPaths_=triggerExtras.getParameter<std::vector<std::string> >("paths");
130  }
131 
132  // massExtras is optional; in case it's not found no mass
133  // window cuts are applied for the same flavor monitor
134  // histograms
135  if( cfg.existsAs<edm::ParameterSet>("massExtras") ){
136  edm::ParameterSet massExtras=cfg.getParameter<edm::ParameterSet>("massExtras");
137  lowerEdge_= massExtras.getParameter<double>("lowerEdge");
138  upperEdge_= massExtras.getParameter<double>("upperEdge");
139  }
140 
141  // setup the verbosity level for booking histograms;
142  // per default the verbosity level will be set to
143  // STANDARD. This will also be the chosen level in
144  // the case when the monitoring PSet is not found
146  if( cfg.existsAs<edm::ParameterSet>("monitoring") ){
147  edm::ParameterSet monitoring=cfg.getParameter<edm::ParameterSet>("monitoring");
148  if(monitoring.getParameter<std::string>("verbosity") == "DEBUG" )
149  verbosity_= DEBUG;
150  if(monitoring.getParameter<std::string>("verbosity") == "VERBOSE" )
152  if(monitoring.getParameter<std::string>("verbosity") == "STANDARD")
154  }
155  // and don't forget to do the histogram booking
156  book(cfg.getParameter<std::string>("directory"));
157  }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
Level verbosity_
verbosity level for booking
int logged_
number of logged interesting events
edm::InputTag elecs_
input sources for monitoring
std::string muonIso_
extra isolation criterion on muon
edm::InputTag jetIDLabel_
jetID as an extra selection type
std::string muonSelect_
extra selection on muons
StringCutObjectSelector< reco::Vertex > * pvSelect_
extra selection on primary vertices; meant to investigate the pile-up effect
edm::InputTag btagEff_
btag discriminator labels
std::string elecSelect_
extra selection on electrons
double lowerEdge_
mass window upper and lower edge
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
void book(std::string directory)
book histograms in subdirectory directory
std::vector< edm::InputTag > mets_
considers a vector of METs
std::string elecIso_
extra isolation criterion on electron
SingleTopTChannelLepton::MonitorEnsemble::~MonitorEnsemble ( )
inline

default destructor

Definition at line 48 of file SingleTopTChannelLeptonDQM.h.

48 {};

Member Function Documentation

void MonitorEnsemble::book ( std::string  directory)

book histograms in subdirectory directory

Definition at line 160 of file SingleTopTChannelLeptonDQM.cc.

References DQMStore::book1D(), DQMStore::book2D(), cond::rpcobimon::current, hists_, label_, cppFunctionSkipper::operator, DQMStore::setCurrentFolder(), STANDARD, store_, AlCaHLTBitMon_QueryRunRegistry::string, triggerBinLabels(), triggerPaths_, VERBOSE, and verbosity_.

Referenced by MonitorEnsemble().

161  {
162  //set up the current directory path
166 
167  // determine number of bins for trigger monitoring
168  unsigned int nPaths=triggerPaths_.size();
169 
170  // --- [STANDARD] --- //
171  // number of selected primary vertices
172  hists_["pvMult_" ] = store_->book1D("PvMult" , "N_{pvs}" , 100, 0., 100.);
173  // pt of the leading muon
174  hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 250.);
175  // muon multiplicity before std isolation
176  hists_["muonMult_" ] = store_->book1D("MuonMult" , "N_{20}(#mu)" , 10, 0., 10.);
177  // muon multiplicity after std isolation
178  hists_["muonMultIso_"] = store_->book1D("MuonMultIso", "N_{Iso}(#mu)" , 10, 0., 10.);
179  // pt of the leading electron
180  hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 250.);
181  // electron multiplicity before std isolation
182  hists_["elecMult_" ] = store_->book1D("ElecMult" , "N_{30}(e)" , 10, 0., 10.);
183  // electron multiplicity after std isolation
184  hists_["elecMultIso_"] = store_->book1D("ElecMultIso", "N_{Iso}(e)" , 10, 0., 10.);
185  // multiplicity of jets with pt>20 (corrected to L2+L3)
186  hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 10, 0., 10.);
187  // trigger efficiency estimates for single lepton triggers
188  hists_["triggerEff_" ] = store_->book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths);
189  // monitored trigger occupancy for single lepton triggers
190  hists_["triggerMon_" ] = store_->book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths);
191  // MET (calo)
192  hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.);
193  // W mass estimate
194  hists_["massW_" ] = store_->book1D("MassW" , "M(W)" , 60, 0., 300.);
195  // Top mass estimate
196  hists_["massTop_" ] = store_->book1D("MassTop" , "M(Top)" , 50, 0., 500.);
197  // W mass transverse estimate mu
198  hists_["MTWm_" ] = store_->book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.);
199  // Top mass transverse estimate mu
200  hists_["mMTT_" ] = store_->book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.);
201 
202  // W mass transverse estimate e
203  hists_["MTWe_" ] = store_->book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.);
204  // Top mass transverse estimate e
205  hists_["eMTT_" ] = store_->book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.);
206 
207  // set bin labels for trigger monitoring
209 
210  if( verbosity_==STANDARD) return;
211 
212  // --- [VERBOSE] --- //
213 
214  // eta of the leading muon
215  hists_["muonEta_" ] = store_->book1D("MuonEta" , "#eta(#mu)" , 30, -3., 3.);
216  // std isolation variable of the leading muon
217  hists_["muonPFRelIso_" ] = store_->book1D("MuonPFRelIso","PFIso_{Rel}(#mu)", 50, 0., 1.);
218  hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.);
219 
220  // eta of the leading electron
221  hists_["elecEta_" ] = store_->book1D("ElecEta" , "#eta(e)" , 30, -3., 3.);
222  // std isolation variable of the leading electron
223  hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.);
224  hists_["elecPFRelIso_" ] = store_->book1D("ElecPFRelIso" , "PFIso_{Rel}(e)", 50, 0., 1.);
225 
226  // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>30
227  hists_["jetMultBEff_"] = store_->book1D("JetMultBEff", "N_{30}(b/eff)" , 10, 0., 10.);
228  // btag discriminator for track counting high efficiency for jets with pt(L2L3)>30
229  hists_["jetBDiscEff_"] = store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.);
230 
231 
232  // eta of the 1. leading jet
233  hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta (jet1)" , 50, -5., 5.);
234  // eta of the 2. leading jet
235  hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta (jet2)" , 50, -5., 5.);
236 
237  // pt of the 1. leading jet (corrected to L2+L3)
238  hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.);
239  // pt of the 2. leading jet (corrected to L2+L3)
240  hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.);
241 
242 
243  // eta and pt of the b-tagged jet (filled only when nJets==2)
244  hists_["TaggedJetEta_" ] = store_->book1D("TaggedJetEta" , "#eta (Tagged jet)" , 50, -5., 5.);
245  hists_["TaggedJetPt_" ] = store_->book1D("TaggedJetPt" , "pt_{L2L3}(Tagged jet)" , 60, 0., 300.);
246 
247  // eta and pt of the jet not passing b-tag (filled only when nJets==2)
248  hists_["UnTaggedJetEta_" ] = store_->book1D("UnTaggedJetEta" , "#eta (UnTagged jet)" , 50, -5., 5.);
249  hists_["UnTaggedJetPt_" ] = store_->book1D("UnTaggedJetPt" , "pt_{L2L3}(UnTagged jet)" , 60, 0., 300.);
250 
251  // eta and pt of the most forward jet in the event with nJets==2
252  hists_["FwdJetEta_" ] = store_->book1D("FwdJetEta" , "#eta (Fwd jet)" , 50, -5., 5.);
253  hists_["FwdJetPt_" ] = store_->book1D("FwdJetPt" , "pt_{L2L3}(Fwd jet)" , 60, 0., 300.);
254 
255 
256  // 2D histogram (pt,eta) of the b-tagged jet (filled only when nJets==2)
257  hists_["TaggedJetPtEta_" ] = store_->book2D("TaggedJetPt_Eta" , "(pt vs #eta)_{L2L3}(Tagged jet)" , 60, 0., 300., 50, -5., 5.);
258 
259  // 2D histogram (pt,eta) of the not-b tagged jet (filled only when nJets==2)
260  hists_["UnTaggedJetPtEta_" ] = store_->book2D("UnTaggedJetPt_Eta" , "(pt vs #eta)_{L2L3}(UnTagged jet)" , 60, 0., 300., 50, -5., 5.);
261 
262 
263 
264  // MET (tc)
265  hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.);
266  // MET (pflow)
267  hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.);
268 
269  // dz for muons (to suppress cosmis)
270  hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.);
271  // dxy for muons (to suppress cosmics)
272  hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1);
273 
274  // set axes titles for dxy for muons
275  hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2);
276 
277  if( verbosity_==VERBOSE) return;
278 
279  // --- [DEBUG] --- //
280 
281  // relative muon isolation from charged hadrons for the leading muon
282  hists_["muonChHadIso_" ] = store_->book1D("MuonChHadIso" , "Iso_{ChHad}(#mu)" , 100, 0., 1.);
283  // relative muon isolation from neutral hadrons for the leading muon
284  hists_["muonNeuHadIso_" ] = store_->book1D("MuonNeuHadIso" , "Iso_{NeuHad}(#mu)" , 100, 0., 1.);
285  // relative muon isolation from photons for the leading muon
286  hists_["muonPhIso_" ] = store_->book1D("MuonPhIso" , "Iso_{Ph}(#mu)" , 100, 0., 1.);
287 
288  // relative electron isolation from charged hadrons for the leading electron
289  hists_["elecChHadIso_" ] = store_->book1D("ElecChHadIso" , "Iso_{ChHad}(e)" , 100, 0., 1.);
290  // relative electron isolation from neutral hadrons for the leading electron
291  hists_["elecNeuHadIso_" ] = store_->book1D("ElecNeuHadIso" , "Iso_{NeuHad}(e)" , 100, 0., 1.);
292  // relative electron isolation from photons for the leading electron
293  hists_["elecPhIso_" ] = store_->book1D("ElecPhIso" , "Iso_{Ph}(e)" , 100, 0., 1.);
294 
295  // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>30
296  hists_["jetMultBPur_"] = store_->book1D("JetMultBPur", "N_{30}(b/pur)" , 10, 0., 10.);
297  // btag discriminator for track counting high purity
298  hists_["jetBDiscPur_"] = store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 200, -10., 10.);
299  // btag discriminator for track counting high purity for 1. leading jet
300  hists_["jet1BDiscPur_"] = store_->book1D("Jet1BDiscPur", "Disc_{b/pur}(Jet1)", 200, -10., 10.);
301  // btag discriminator for track counting high purity for 2. leading jet
302  hists_["jet2BDiscPur_"] = store_->book1D("Jet2BDiscPur", "Disc_{b/pur}(Jet2)", 200, -10., 10.);
303 
304 
305  // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30
306  hists_["jetMultBVtx_"] = store_->book1D("JetMultBVtx", "N_{30}(b/vtx)" , 10, 0., 10.);
307  // btag discriminator for simple secondary vertex
308  hists_["jetBDiscVtx_"] = store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.);
309 
310 
311  // multiplicity of btagged jets (for combined secondary vertex) with pt(L2L3)>30
312  hists_["jetMultBCombVtx_"] = store_->book1D("JetMultBCombVtx", "N_{30}(b/CSV)" , 10, 0., 10.);
313  // btag discriminator for combined secondary vertex
314  hists_["jetBDiscCombVtx_"] = store_->book1D("JetBDiscCombVtx", "Disc_{b/CSV}(Jet)", 60, -1., 2.);
315  // btag discriminator for combined secondary vertex for 1. leading jet
316  hists_["jet1BDiscCombVtx_"] = store_->book1D("Jet1BDiscCombVtx", "Disc_{b/CSV}(Jet1)", 60, -1., 2.);
317  // btag discriminator for combined secondary vertex for 2. leading jet
318  hists_["jet2BDiscCombVtx_"] = store_->book1D("Jet2BDiscCombVtx", "Disc_{b/CSV}(Jet2)", 60, -1., 2.);
319 
320 
321  // pt of the 1. leading jet (uncorrected)
322  hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.);
323  // pt of the 2. leading jet (uncorrected)
324  hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.);
325 
326  // selected events
327  hists_["eventLogger_"] = store_->book2D("EventLogger", "Logged Events" , 9, 0., 9., 10, 0., 10.);
328 
329  // set axes titles for selected events
330  hists_["eventLogger_"]->getTH1()->SetOption("TEXT");
331  hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1);
332  hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1);
333  hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1);
334  hists_["eventLogger_"]->setBinLabel( 4 , "pt_{L2L3}(jet1)" , 1);
335  hists_["eventLogger_"]->setBinLabel( 5 , "pt_{L2L3}(jet2)" , 1);
336  hists_["eventLogger_"]->setBinLabel( 6 , "pt_{L2L3}(jet3)" , 1);
337  hists_["eventLogger_"]->setBinLabel( 7 , "pt_{L2L3}(jet4)" , 1);
338  hists_["eventLogger_"]->setBinLabel( 8 , "M_{W}" , 1);
339  hists_["eventLogger_"]->setBinLabel( 9 , "M_{Top}" , 1);
340  hists_["eventLogger_"]->setAxisTitle("logged evts" , 2);
341  return;
342  }
Level verbosity_
verbosity level for booking
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
void triggerBinLabels(std::string channel, const std::vector< std::string > labels)
set configurable labels for trigger monitoring histograms
std::map< std::string, MonitorElement * > hists_
histogram container
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:1000
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
bool SingleTopTChannelLepton::MonitorEnsemble::booked ( const std::string  histName) const
inlineprivate

check if histogram was booked

Definition at line 69 of file SingleTopTChannelLeptonDQM.h.

References hists_.

Referenced by fill().

69 { return hists_.find(histName.c_str())!=hists_.end(); };
std::map< std::string, MonitorElement * > hists_
histogram container
void MonitorEnsemble::fill ( const edm::Event event,
const edm::EventSetup setup 
)

fill monitor histograms with electronId and jetCorrections

Definition at line 345 of file SingleTopTChannelLeptonDQM.cc.

References funct::abs(), SiPixelRawToDigiRegional_cfi::beamSpot, btagCombVtx_, btagCombVtxWP_, btagEff_, btagEffWP_, btagPur_, btagPurWP_, btagVtx_, btagVtxWP_, JetCorrector::correction(), alignCSCRings::e, eidPattern_, elecIso_, elecs_, elecs_gsf_, elecSelect_, electronId_, reco::LeafCandidate::eta(), edm::EventAuxiliary::event(), edm::Event::eventAuxiliary(), edm::EventSetup::find(), edm::Event::getByLabel(), JetCorrector::getJetCorrector(), hists_, customizeTrackingMonitorSeedNumber::idx, includeBTag_, edm::Ref< C, T, F >::isNull(), metsig::jet, jetCorrector_, bTagSequences_cff::jetID, jetIDLabel_, jetIDSelect_, fwrapper::jets, jets_, jetSelect_, edm::InputTag::label(), logged_, lowerEdge_, edm::EventAuxiliary::luminosityBlock(), Calculate::massTopQuark(), Calculate::massWBoson(), SingleTopTChannelLepton::MAXJETS, CaloMET_cfi::met, mets_, RPCpg::mu, VarParsing::mult, metsig::muon, muonIso_, patZpeak::muons, muons_, muonSelect_, RecoTauCleanerPlugins::pt, reco::LeafCandidate::pt(), pvs_, pvSelect_, edm::EventAuxiliary::run(), reco::Jet::scaleEnergy(), EgammaValidation_Wenu_cff::sel, Calculate::tmassTopQuark(), Calculate::tmassWBoson(), triggerPaths_, triggerTable_, upperEdge_, and SingleTopTChannelLepton::WMASS.

Referenced by fill().

346  {
347  // fetch trigger event if configured such
349  if(!triggerTable_.label().empty()) {
350  if( !event.getByLabel(triggerTable_, triggerTable) ) return;
351  }
352 
353  /*
354  ------------------------------------------------------------
355 
356  Primary Vertex Monitoring
357 
358  ------------------------------------------------------------
359  */
360 
361  // fill monitoring plots for primary vertices
363  if( !event.getByLabel(pvs_, pvs) ) return;
364  unsigned int pvMult = 0;
365  for(edm::View<reco::Vertex>::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){
366  if(!pvSelect_ || (*pvSelect_)(*pv))
367  pvMult++;
368  }
369 
370  fill("pvMult_", pvMult );
371 
372  /*
373  ------------------------------------------------------------
374 
375  Electron Monitoring
376 
377  ------------------------------------------------------------
378  */
379 
381  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
382  if( !event.getByLabel("offlineBeamSpot",recoBeamSpotHandle)) return;
383  beamSpot = *recoBeamSpotHandle;
384 
385 
386  // fill monitoring plots for electrons
388 
394 
395 
396  if( !event.getByLabel(elecs_, elecs) ) return;
397  if( !event.getByLabel(elecs_gsf_, elecs_gsf) ) return;
398 
399  // check availability of electron id
400  edm::Handle<edm::ValueMap<float> > electronId;
401  if(!electronId_.label().empty())
402  if( !event.getByLabel(electronId_, electronId) ) return;
403 
404  // loop electron collection
405  unsigned int eMult=0, eMultIso=0;
406  std::vector<const reco::GsfElectron*> isoElecs;
408 
409 
410  unsigned int idx_gsf = 0;
411  for(elec_it=elecs->begin(); elec_it!=elecs->end(); ++elec_it){
412 
413  if(elec_it->gsfElectronRef().isNull()) continue ;
414 
415  reco::GsfElectronRef elec = elec_it->gsfElectronRef();
416  if(elec->gsfTrack().isNull()) continue ;
417 
418  // restrict to electrons with good electronId
419  int eID = 0;
420  if (!electronId_.label().empty())
421  eID = (int)(*electronId)[elecs_gsf->refAt(idx_gsf)];
422 
423  if( electronId_.label().empty() ? true : ( (eID & eidPattern_) && (eID >=5)) ){ // NEED TO CHECK
424 
425  if(!elecSelect || (*elecSelect)(*elec_it)){
426  double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt();
427 
428  double isolationChHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumChargedHadronPt);
429  double isolationNeuHad = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumNeutralHadronEt);
430  double isolationPhoton = elec->pt()/(elec->pt()+elec->pfIsolationVariables().sumPhotonEt);
431  double PFisolationRel = (elec->pfIsolationVariables().sumChargedHadronPt+elec->pfIsolationVariables().sumNeutralHadronEt+elec->pfIsolationVariables().sumPhotonEt)/elec->pt();
432 
433  if( eMult==0 ){
434  // restrict to the leading electron
435  fill("elecPt_" , elec->pt() );
436  fill("elecEta_", elec->eta());
437  fill("elecRelIso_" , isolationRel );
438  fill("elecPFRelIso_",PFisolationRel );
439  fill("elecChHadIso_" , isolationChHad );
440  fill("elecNeuHadIso_" , isolationNeuHad );
441  fill("elecPhIso_" , isolationPhoton );
442 
443  }
444  // in addition to the multiplicity counter buffer the iso
445  // electron candidates for later overlap check with jets
446  ++eMult; if( !elecIso || (*elecIso)(*elec_it)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso; }
447  }
448  }
449  idx_gsf++;
450  }
451 
452  fill("elecMult_", eMult );
453  fill("elecMultIso_", eMultIso);
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 
466 
472  reco::Muon mu;
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.getByLabel(muons_, muons )) return;
484 
485 
486  for(muonit = muons->begin(); muonit != muons->end(); ++muonit){ // for now, to use Reco::Muon need to substitute muonit with muon
487  // and comment the MuonRef and PFCandidate parts
488 
489  // if (muonit->particleId() != reco::PFCandidate::mu) continue;
490  if(muonit->muonRef().isNull()) continue ;
491  reco::MuonRef muon = muonit->muonRef();
492 
493  if(muon->innerTrack().isNull()) continue ;
494 
495  // double impact_parameter = muon->innerTrack()->dxy(beamSpot.position());
496  // if (abs(impact_parameter) > 0.02) continue;
497 
498 
499  // restrict to globalMuons
500  if( muon->isGlobalMuon() ){
501  fill("muonDelZ_" , muon->globalTrack()->vz());
502  fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy());
503 
504  // apply selection
505  if( !muonSelect || (*muonSelect)(*muonit)) {
506 
507  // if ((muon->pt() == 0. )&&( muon->eta() == 0.)) continue;
508 
509  double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt();
510  double isolationChHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumChargedHadronPt);
511  double isolationNeuHad = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumNeutralHadronEt);
512  double isolationPhoton = muon->pt()/(muon->pt()+muon->pfIsolationR04().sumPhotonEt);
513  double PFisolationRel = (muon->pfIsolationR04().sumChargedHadronPt + muon->pfIsolationR04().sumNeutralHadronEt + muon->pfIsolationR04().sumPhotonEt)/muon->pt();
514 
515 
516 
517  if( mMult==0 ){
518  // cout << "BEFORE Muon - PFRelIso: " << (muon->pfIsolationR04().sumChargedHadronPt +
519  // muon->pfIsolationR04().sumNeutralHadronEt + muon->pfIsolationR04().sumPhotonEt)/muon->pt()
520  // << " pt: " << muon->pt() << endl;
521  // restrict to leading muon
522  fill("muonPt_" , muon->pt() );
523  fill("muonEta_" , muon->eta());
524  fill("muonRelIso_" , isolationRel );
525  fill("muonChHadIso_" , isolationChHad );
526  fill("muonNeuHadIso_" , isolationNeuHad );
527  fill("muonPhIso_" , isolationPhoton );
528  fill("muonPFRelIso_" , PFisolationRel );
529 
530  }
531  ++mMult;
532 
533  if( !muonIso || (*muonIso)(*muonit)) {if(mMultIso == 0) mu = *muon; ++mMultIso;}
534  }
535  }
536  }
537 
538  fill("muonMult_", mMult );
539  fill("muonMultIso_", mMultIso);
540 
541 
542  /*
543  ------------------------------------------------------------
544 
545  Jet Monitoring
546 
547  ------------------------------------------------------------
548  */
549 
550  // check availability of the btaggers
551  edm::Handle<reco::JetTagCollection> btagEff, btagPur, btagVtx, btagCombVtx;
552  if( includeBTag_ ){
553  if( !event.getByLabel(btagEff_, btagEff) ) return;
554  if( !event.getByLabel(btagPur_, btagPur) ) return;
555  if( !event.getByLabel(btagVtx_, btagVtx) ) return;
556  if( !event.getByLabel(btagCombVtx_, btagCombVtx) ) return;
557  }
558  // load jet corrector if configured such
559  const JetCorrector* corrector=0;
560  if(!jetCorrector_.empty()){
561  // check whether a jet correcto is in the event setup or not
562  if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey<JetCorrectionsRecord>() )){
563  corrector = JetCorrector::getJetCorrector(jetCorrector_, setup);
564  }
565  else{
566  edm::LogVerbatim( "SingleTopTChannelLeptonDQM" )
567  << "\n"
568  << "------------------------------------------------------------------------------------- \n"
569  << " No JetCorrectionsRecord available from EventSetup: \n"
570  << " - Jets will not be corrected. \n"
571  << " - If you want to change this add the following lines to your cfg file: \n"
572  << " \n"
573  << " ## load jet corrections \n"
574  << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n"
575  << " process.prefer(\"ak5CaloL2L3\") \n"
576  << " \n"
577  << "------------------------------------------------------------------------------------- \n";
578  }
579  }
580 
581  // loop jet collection
582  std::vector<reco::Jet> correctedJets;
583  unsigned int mult=0, multBEff=0, multBPur=0, multNoBPur=0, multBVtx=0, multBCombVtx=0;
584 
586  if( !event.getByLabel(jets_, jets) ) return;
587 
589  if(jetIDSelect_){
590  if( !event.getByLabel(jetIDLabel_, jetID) ) return;
591  }
592 
593  vector<double> bJetDiscVal;
594  vector<double> NobJetDiscVal;
595  reco::Jet TaggedJetCand;
596  reco::Jet UnTaggedJetCand;
597  reco::Jet FwdJetCand;
598  for(edm::View<reco::Jet>::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){
599  // check jetID for calo jets
600  unsigned int idx = jet-jets->begin();
601  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
602  if( jetIDSelect_ && dynamic_cast<const reco::CaloJet*>(jets->refAt(idx).get())){
603  if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue;
604  }
605  }
606 
607  // check additional jet selection for calo, pf and bare reco jets
608  if(dynamic_cast<const reco::CaloJet*>(&*jet)){
609  reco::CaloJet sel = dynamic_cast<const reco::CaloJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
611  if(!jetSelect(sel)){ continue;}
612  }
613  else if(dynamic_cast<const reco::PFJet*>(&*jet)){
614  reco::PFJet sel= dynamic_cast<const reco::PFJet&>(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
616  if(!jetSelect(sel)) continue;
617  }
618  else{
619  reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
621  if(!jetSelect(sel)) continue;
622  }
623 
624  // check for overlaps -- comment this to be synchronous with the selection
625  //bool overlap=false;
626  //for(std::vector<const reco::GsfElectron*>::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){
627  // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;}
628  //} if(overlap){continue;}
629 
630 
631 
632  // prepare jet to fill monitor histograms
633  reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.);
634  correctedJets.push_back(monitorJet);
635 
636 
637  ++mult; // determine jet multiplicity
638 
639  if( includeBTag_ ){
640  // fill b-discriminators
641  edm::RefToBase<reco::Jet> jetRef = jets->refAt(idx);
642  if( (*btagVtx)[jetRef]>btagVtxWP_ ) ++multBVtx;
643  if( (*btagCombVtx)[jetRef]>btagCombVtxWP_ ) ++multBCombVtx;
644  // cout << "btag: " << (*btagPur)[jetRef] << " jet eta: " << monitorJet.eta() << endl;
645  if( (*btagPur)[jetRef]>btagPurWP_ ){
646  if (multBPur == 0){
647  TaggedJetCand = monitorJet;
648  // TaggedJetCand = *jet;
649  bJetDiscVal.push_back((*btagPur)[jetRef]);
650 
651  }
652  else if (multBPur == 1){
653  bJetDiscVal.push_back((*btagPur)[jetRef]);
654  if (bJetDiscVal[1]>bJetDiscVal[0])
655  TaggedJetCand = monitorJet;
656  //TaggedJetCand = *jet;
657  }
658  ++multBPur;
659  }
660 
661  else{
662  if (multNoBPur == 0){
663  UnTaggedJetCand = monitorJet;
664  NobJetDiscVal.push_back((*btagPur)[jetRef]);
665 
666  }
667  else if (multNoBPur == 1){
668  NobJetDiscVal.push_back((*btagPur)[jetRef]);
669  if (NobJetDiscVal[1]<NobJetDiscVal[0])
670  UnTaggedJetCand = monitorJet;
671  }
672 
673  ++multNoBPur;
674  }
675 
676  if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff;
677 
678 
679  if(mult==1) {
680  fill("jet1BDiscPur_", (*btagPur)[jetRef]);
681  fill("jet1BDiscCombVtx_", (*btagCombVtx)[jetRef]);
682  }
683 
684  else if(mult==2) {
685  fill("jet2BDiscPur_", (*btagPur)[jetRef]);
686  fill("jet2BDiscCombVtx_", (*btagCombVtx)[jetRef]);
687  }
688 
689  fill("jetBDiscEff_", (*btagEff)[jetRef]);
690  fill("jetBDiscPur_", (*btagPur)[jetRef]);
691  fill("jetBDiscVtx_", (*btagVtx)[jetRef]);
692  fill("jetBDiscCombVtx_", (*btagCombVtx)[jetRef]);
693 
694  }
695  // fill pt (raw or L2L3) for the leading jets
696  if(mult==1) {
697  fill("jet1Pt_" , monitorJet.pt());
698  fill("jet1Eta_", monitorJet.eta());
699  fill("jet1PtRaw_", jet->pt() );
700  FwdJetCand = monitorJet;
701 
702  }
703 
704  if(mult==2) {
705  fill("jet2Pt_" , monitorJet.pt());
706  fill("jet2Eta_", monitorJet.eta());
707  fill("jet2PtRaw_", jet->pt() );
708 
709  if ( abs(monitorJet.eta()) > abs(FwdJetCand.eta()) ){
710  FwdJetCand = monitorJet;
711  }
712 
713  fill("FwdJetPt_" , FwdJetCand.pt());
714  fill("FwdJetEta_", FwdJetCand.eta());
715 
716  }
717 
718 
719 
720  }
721 
722  if (multNoBPur == 1 && multBPur == 1){
723 
724  fill("TaggedJetPtEta_" , TaggedJetCand.pt(), TaggedJetCand.eta());
725  fill("UnTaggedJetPtEta_" , UnTaggedJetCand.pt(), UnTaggedJetCand.eta());
726 
727 
728  fill("TaggedJetPt_" , TaggedJetCand.pt());
729  fill("TaggedJetEta_", TaggedJetCand.eta());
730  fill("UnTaggedJetPt_" , UnTaggedJetCand.pt());
731  fill("UnTaggedJetEta_", UnTaggedJetCand.eta());
732  }
733 
734  fill("jetMult_" , mult );
735  fill("jetMultBEff_", multBEff);
736  fill("jetMultBPur_", multBPur);
737  fill("jetMultBVtx_", multBVtx);
738  fill("jetMultBCombVtx_", multBCombVtx);
739 
740  /*
741  ------------------------------------------------------------
742 
743  MET Monitoring
744 
745  ------------------------------------------------------------
746  */
747 
748  // fill monitoring histograms for met
749  reco::MET mET;
750  for(std::vector<edm::InputTag>::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){
752  if( !event.getByLabel(*met_, met) ) continue;
753  if(met->begin()!=met->end()){
754  unsigned int idx=met_-mets_.begin();
755  if(idx==0) { fill("metCalo_" , met->begin()->et()); }
756  if(idx==1) { fill("metTC_" , met->begin()->et()); }
757  if(idx==2) { fill("metPflow_", met->begin()->et()); mET = *(met->begin()); }
758  }
759  }
760 
761 
762 
763  /*
764  ------------------------------------------------------------
765 
766  Event Monitoring
767 
768  ------------------------------------------------------------
769  */
770 
771  // fill W boson and top mass estimates
772  Calculate eventKinematics(MAXJETS, WMASS);
773  double wMass = eventKinematics.massWBoson (correctedJets);
774  double topMass = eventKinematics.massTopQuark(correctedJets);
775  if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);}
776  // fill plots for trigger monitoring
777  if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_<wMass && wMass<upperEdge_) ){
778  if(!triggerTable_.label().empty()) fill(event, *triggerTable, "trigger", triggerPaths_);
779  if(logged_<=hists_.find("eventLogger_")->second->getNbinsY()){
780  // log runnumber, lumi block, event number & some
781  // more pysics infomation for interesting events
782  fill("eventLogger_", 0.5, logged_+0.5, event.eventAuxiliary().run());
783  fill("eventLogger_", 1.5, logged_+0.5, event.eventAuxiliary().luminosityBlock());
784  fill("eventLogger_", 2.5, logged_+0.5, event.eventAuxiliary().event());
785  if(correctedJets.size()>0) fill("eventLogger_", 3.5, logged_+0.5, correctedJets[0].pt());
786  if(correctedJets.size()>1) fill("eventLogger_", 4.5, logged_+0.5, correctedJets[1].pt());
787  if(correctedJets.size()>2) fill("eventLogger_", 5.5, logged_+0.5, correctedJets[2].pt());
788  if(correctedJets.size()>3) fill("eventLogger_", 6.5, logged_+0.5, correctedJets[3].pt());
789  fill("eventLogger_", 7.5, logged_+0.5, wMass );
790  fill("eventLogger_", 8.5, logged_+0.5, topMass);
791  ++logged_;
792  }
793  }
794 
795  if(multBPur != 0 && mMultIso == 1 ){
796 
797  double mtW = eventKinematics.tmassWBoson(&mu,mET,TaggedJetCand); fill("MTWm_",mtW);
798  double MTT = eventKinematics.tmassTopQuark(&mu,mET,TaggedJetCand); fill("mMTT_", MTT);
799 
800  }
801 
802  if(multBPur != 0 && eMultIso == 1 ){
803  double mtW = eventKinematics.tmassWBoson(&e,mET,TaggedJetCand); fill("MTWe_",mtW);
804  double MTT = eventKinematics.tmassTopQuark(&e,mET,TaggedJetCand); fill("eMTT_", MTT);
805  }
806 
807  }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:7
Jets made from CaloTowers.
Definition: CaloJet.h:29
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
Base class for all types of Jets.
Definition: Jet.h:20
int logged_
number of logged interesting events
edm::InputTag elecs_
input sources for monitoring
RunNumber_t run() const
virtual void scaleEnergy(double fScale)
scale energy of the jet
Definition: Jet.cc:444
std::string muonIso_
extra isolation criterion on muon
edm::InputTag jetIDLabel_
jetID as an extra selection type
std::string muonSelect_
extra selection on muons
Jets made from PFObjects.
Definition: PFJet.h:21
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 btagEff_
btag discriminator labels
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
bool isNull() const
Checks for null.
Definition: Ref.h:247
Definition: MET.h:32
vector< PseudoJet > jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int mu
Definition: Constants.h:22
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:390
std::map< std::string, MonitorElement * > hists_
histogram container
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
EventAuxiliary const & eventAuxiliary() const
Definition: Event.h:72
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
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
static const unsigned int MAXJETS
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
std::string const & label() const
Definition: InputTag.h:42
tuple muons
Definition: patZpeak.py:38
StringCutObjectSelector< reco::JetID > * jetIDSelect_
extra jetID selection on calo jets
virtual float pt() const GCC11_FINAL
transverse momentum
EventNumber_t event() const
std::vector< edm::InputTag > mets_
considers a vector of METs
std::string elecIso_
extra isolation criterion on electron
void MonitorEnsemble::fill ( const edm::Event event,
const edm::TriggerResults triggerTable,
std::string  channel,
const std::vector< std::string >  labels 
) const
inlineprivate

fill trigger monitoring histograms

Definition at line 160 of file SingleTopTChannelLeptonDQM.h.

References accept(), fill(), hists_, customizeTrackingMonitorSeedNumber::idx, monitorPath(), selectionPath(), and relativeConstraints::value.

161  {
162  for(unsigned int idx=0; idx<labels.size(); ++idx){
163  if( accept(event, triggerTable, monitorPath(labels[idx])) ){
164  fill((channel+"Mon_").c_str(), idx+0.5 );
165  // take care to fill triggerMon_ before evts is being called
166  int evts = hists_.find((channel+"Mon_").c_str())->second->getBinContent(idx+1);
167  double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1);
168  fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(accept(event, triggerTable, selectionPath(labels[idx]))-value));
169  }
170  }
171  }
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_
histogram container
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void fill(const edm::Event &event, const edm::EventSetup &setup)
fill monitor histograms with electronId and jetCorrections
void SingleTopTChannelLepton::MonitorEnsemble::fill ( const std::string  histName,
double  value 
) const
inlineprivate

fill histogram if it had been booked before

Definition at line 71 of file SingleTopTChannelLeptonDQM.h.

References booked(), hists_, and edm::second().

71 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
std::map< std::string, MonitorElement * > hists_
histogram container
void SingleTopTChannelLepton::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 73 of file SingleTopTChannelLeptonDQM.h.

References booked(), hists_, and edm::second().

73 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
std::map< std::string, MonitorElement * > hists_
histogram container
void SingleTopTChannelLepton::MonitorEnsemble::fill ( const std::string  histName,
double  xValue,
double  yValue,
double  zValue 
) const
inlineprivate

fill histogram if it had been booked before (2-dim version)

Definition at line 75 of file SingleTopTChannelLeptonDQM.h.

75 { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); };
bool booked(const std::string histName) const
check if histogram was booked
U second(std::pair< T, U > const &p)
std::map< std::string, MonitorElement * > hists_
histogram container
std::string SingleTopTChannelLepton::MonitorEnsemble::monitorPath ( const std::string &  label) const
inlineprivate

deduce monitorPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 58 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and triggerBinLabels().

58 { return label.substr(label.find(':')+1); };
std::string SingleTopTChannelLepton::MonitorEnsemble::selectionPath ( const std::string &  label) const
inlineprivate

deduce selectionPath from label, the label is expected to be of type 'selectionPath:monitorPath'

Definition at line 61 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and triggerBinLabels().

61 { return label.substr(0, label.find(':')); };
void MonitorEnsemble::triggerBinLabels ( std::string  channel,
const std::vector< std::string >  labels 
)
inlineprivate

set configurable labels for trigger monitoring histograms

Definition at line 151 of file SingleTopTChannelLeptonDQM.h.

References hists_, customizeTrackingMonitorSeedNumber::idx, monitorPath(), and selectionPath().

Referenced by book().

152  {
153  for(unsigned int idx=0; idx<labels.size(); ++idx){
154  hists_[(channel+"Mon_").c_str()]->setBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1);
155  hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1);
156  }
157  }
std::string monitorPath(const std::string &label) const
std::string selectionPath(const std::string &label) const
std::map< std::string, MonitorElement * > hists_
histogram container
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...

Member Data Documentation

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::btagCombVtx_
private

Definition at line 136 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagCombVtxWP_
private

Definition at line 138 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::btagEff_
private

btag discriminator labels

Definition at line 136 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagEffWP_
private

btag working points

Definition at line 138 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::btagPur_
private

Definition at line 136 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagPurWP_
private

Definition at line 138 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::btagVtx_
private

Definition at line 136 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::btagVtxWP_
private

Definition at line 138 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

int SingleTopTChannelLepton::MonitorEnsemble::eidPattern_
private

electronId pattern we expect the following pattern: 0: fails 1: passes electron ID only 2: passes electron Isolation only 3: passes electron ID and Isolation only 4: passes conversion rejection 5: passes conversion rejection and ID 6: passes conversion rejection and Isolation 7: passes the whole selection As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID

Definition at line 105 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::elecIso_
private

extra isolation criterion on electron

Definition at line 108 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::elecs_
private

input sources for monitoring

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::elecs_gsf_
private

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::elecSelect_
private

extra selection on electrons

Definition at line 111 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::electronId_
private

electronId label

Definition at line 94 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::map<std::string,MonitorElement*> SingleTopTChannelLepton::MonitorEnsemble::hists_
private

histogram container

Definition at line 147 of file SingleTopTChannelLeptonDQM.h.

Referenced by book(), booked(), fill(), and triggerBinLabels().

bool SingleTopTChannelLepton::MonitorEnsemble::includeBTag_
private

include btag information or not to be determined from the cfg

Definition at line 134 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::jetCorrector_
private

jetCorrector

Definition at line 124 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::jetIDLabel_
private

jetID as an extra selection type

Definition at line 126 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::JetID>* SingleTopTChannelLepton::MonitorEnsemble::jetIDSelect_
private

extra jetID selection on calo jets

Definition at line 128 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::jets_
private

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::jetSelect_
private

extra selection on jets (here given as std::string as it depends on the the jet type, which selections are valid and which not)

Definition at line 131 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::label_
private
int SingleTopTChannelLepton::MonitorEnsemble::logged_
private

number of logged interesting events

Definition at line 143 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill().

double SingleTopTChannelLepton::MonitorEnsemble::lowerEdge_
private

mass window upper and lower edge

Definition at line 140 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::vector<edm::InputTag> SingleTopTChannelLepton::MonitorEnsemble::mets_
private

considers a vector of METs

Definition at line 83 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

std::string SingleTopTChannelLepton::MonitorEnsemble::muonIso_
private

extra isolation criterion on muon

Definition at line 118 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::muons_
private

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::muons_reco_
private

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

std::string SingleTopTChannelLepton::MonitorEnsemble::muonSelect_
private

extra selection on muons

Definition at line 121 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::pvs_
private

Definition at line 85 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

StringCutObjectSelector<reco::Vertex>* SingleTopTChannelLepton::MonitorEnsemble::pvSelect_
private

extra selection on primary vertices; meant to investigate the pile-up effect

Definition at line 114 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

DQMStore* SingleTopTChannelLepton::MonitorEnsemble::store_
private

storage manager

Definition at line 145 of file SingleTopTChannelLeptonDQM.h.

Referenced by book().

std::vector<std::string> SingleTopTChannelLepton::MonitorEnsemble::triggerPaths_
private

trigger paths for monitoring, expected to be of form signalPath:MonitorPath

Definition at line 91 of file SingleTopTChannelLeptonDQM.h.

Referenced by book(), fill(), and MonitorEnsemble().

edm::InputTag SingleTopTChannelLepton::MonitorEnsemble::triggerTable_
private

trigger table

Definition at line 88 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

double SingleTopTChannelLepton::MonitorEnsemble::upperEdge_
private

Definition at line 140 of file SingleTopTChannelLeptonDQM.h.

Referenced by fill(), and MonitorEnsemble().

Level SingleTopTChannelLepton::MonitorEnsemble::verbosity_
private

verbosity level for booking

Definition at line 75 of file SingleTopTChannelLeptonDQM.h.

Referenced by book(), and MonitorEnsemble().