79 std::map<std::string, TH1D*>
h1_;
80 std::map<std::string, TH2D*>
h2_;
100 using namespace reco;
104 plotHistograms_(
cfg.getUntrackedParameter<
bool>(
"plotHistograms",
true)),
117 muonTrig_(
cfg.getUntrackedParameter<
std::
string>(
"MuonTrig",
"HLT_Mu9")),
118 ptThrForZ1_(
cfg.getUntrackedParameter<double>(
"PtThrForZ1", 20.)),
119 ptThrForZ2_(
cfg.getUntrackedParameter<double>(
"PtThrForZ2", 10.)),
120 eJetMin_(
cfg.getUntrackedParameter<double>(
"EJetMin", 999999.)),
121 nJetMax_(
cfg.getUntrackedParameter<
int>(
"NJetMax", 999999)),
124 ptCut_(
cfg.getUntrackedParameter<double>(
"PtCut", 25.)),
125 etaCut_(
cfg.getUntrackedParameter<double>(
"EtaCut", 2.1)),
126 isRelativeIso_(
cfg.getUntrackedParameter<
bool>(
"IsRelativeIso",
true)),
127 isCombinedIso_(
cfg.getUntrackedParameter<
bool>(
"IsCombinedIso",
false)),
128 isoCut03_(
cfg.getUntrackedParameter<double>(
"IsoCut03", 0.1)),
129 mtMin_(
cfg.getUntrackedParameter<double>(
"MtMin", 50.)),
130 mtMax_(
cfg.getUntrackedParameter<double>(
"MtMax", 200.)),
131 metMin_(
cfg.getUntrackedParameter<double>(
"MetMin", -999999.)),
132 metMax_(
cfg.getUntrackedParameter<double>(
"MetMax", 999999.)),
133 acopCut_(
cfg.getUntrackedParameter<double>(
"AcopCut", 2.)),
136 dxyCut_(
cfg.getUntrackedParameter<double>(
"DxyCut", 0.2)),
137 normalizedChi2Cut_(
cfg.getUntrackedParameter<double>(
"NormalizedChi2Cut", 10.)),
138 trackerHitsCut_(
cfg.getUntrackedParameter<
int>(
"TrackerHitsCut", 11)),
139 isAlsoTrackerMuon_(
cfg.getUntrackedParameter<
bool>(
"IsAlsoTrackerMuon",
true)),
142 selectByCharge_(
cfg.getUntrackedParameter<
int>(
"SelectByCharge", 0)) {}
158 fs->
make<TH1D>(
"NWCand_sel",
"Nb. of WCandidates passing pre-selection (ordered by pt)", 10, 0., 10.);
159 h1_[
"hPtMu_sel"] = fs->
make<TH1D>(
"ptMu_sel",
"Pt mu", 100, 0., 100.);
160 h1_[
"hEtaMu_sel"] = fs->
make<TH1D>(
"etaMu_sel",
"Eta mu", 50, -2.5, 2.5);
161 h1_[
"hd0_sel"] = fs->
make<TH1D>(
"d0_sel",
"Impact parameter", 1000, -1., 1.);
162 h1_[
"hNHits_sel"] = fs->
make<TH1D>(
"NumberOfValidHits_sel",
"Number of Hits in Silicon", 100, 0., 100.);
163 h1_[
"hNormChi2_sel"] = fs->
make<TH1D>(
"NormChi2_sel",
"Chi2/ndof of global track", 1000, 0., 50.);
164 h1_[
"hTracker_sel"] = fs->
make<TH1D>(
"isTrackerMuon_sel",
"is Tracker Muon?", 2, 0., 2.);
165 h1_[
"hMET_sel"] = fs->
make<TH1D>(
"MET_sel",
"Missing Transverse Energy (GeV)", 300, 0., 300.);
166 h1_[
"hTMass_sel"] = fs->
make<TH1D>(
"TMass_sel",
"Rec. Transverse Mass (GeV)", 300, 0., 300.);
167 h1_[
"hAcop_sel"] = fs->
make<TH1D>(
"Acop_sel",
"Mu-MET acoplanarity", 50, 0.,
M_PI);
168 h1_[
"hPtSum_sel"] = fs->
make<TH1D>(
"ptSum_sel",
"Track Isolation, Sum pT (GeV)", 200, 0., 100.);
169 h1_[
"hPtSumN_sel"] = fs->
make<TH1D>(
"ptSumN_sel",
"Track Isolation, Sum pT/pT", 1000, 0., 10.);
170 h1_[
"hCal_sel"] = fs->
make<TH1D>(
"Cal_sel",
"Calorimetric isolation, HCAL+ECAL (GeV)", 200, 0., 100.);
171 h1_[
"hIsoTotN_sel"] = fs->
make<TH1D>(
"isoTotN_sel",
"(Sum pT + Cal)/pT", 1000, 0., 10.);
172 h1_[
"hIsoTot_sel"] = fs->
make<TH1D>(
"isoTot_sel",
"(Sum pT + Cal)", 200, 0., 100.);
173 h2_[
"hTMass_PtSum_inclusive"] = fs->
make<TH2D>(
174 "TMass_PtSum_inclusive",
"Rec. Transverse Mass (GeV) vs Sum pT (GeV)", 200, 0., 100., 300, 0., 300.);
175 h2_[
"hTMass_PtSumNorm_inclusive"] = fs->
make<TH2D>(
176 "TMass_PtSumNorm_inclusive",
"Rec. Transverse Mass (GeV) vs Sum Pt / Pt", 1000, 0, 10, 300, 0, 300);
177 h2_[
"hTMass_TotIsoNorm_inclusive"] = fs->
make<TH2D>(
178 "TMass_TotIsoNorm_inclusive",
"Rec. Transverse Mass (GeV) vs (Sum Pt + Cal)/Pt", 10000, 0, 10, 200, 0, 200);
179 h2_[
"hMET_PtSum_inclusive"] = fs->
make<TH2D>(
180 "MET_PtSum_inclusive",
"Missing Transverse Energy (GeV) vs Sum Pt (GeV)", 200, 0., 100., 300, 0., 300.);
181 h2_[
"hMET_PtSumNorm_inclusive"] = fs->
make<TH2D>(
182 "MET_PtSumNorm_inclusive",
"Missing Transverse Energy (GeV) vs Sum Pt/Pt", 1000, 0, 10, 300, 0, 300);
183 h2_[
"hMET_TotIsoNorm_inclusive"] = fs->
make<TH2D>(
184 "MET_TotIsoNorm_inclusive",
"Missing Transverse Energy (GeV) vs (SumPt + Cal)/Pt", 10000, 0, 10, 200, 0, 200);
198 LogVerbatim(
"") <<
"\n>>>>>> W SELECTION SUMMARY BEGIN >>>>>>>>>>>>>>>";
199 LogVerbatim(
"") <<
"Total number of events analyzed: " <<
nall <<
" [events]";
200 LogVerbatim(
"") <<
"Total number of events triggered: " <<
ntrig <<
" [events]";
202 LogVerbatim(
"") <<
"Total number of events after kinematic cuts: " <<
nkin <<
" [events]";
203 LogVerbatim(
"") <<
"Total number of events after Muon ID cuts: " <<
nid <<
" [events]";
204 LogVerbatim(
"") <<
"Total number of events after Acop cut: " <<
nacop <<
" [events]";
205 LogVerbatim(
"") <<
"Total number of events after iso cut: " <<
niso <<
" [events]";
206 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
209 <<
"(" << setprecision(4) << etrig * 100. <<
" +/- " << setprecision(2)
210 <<
sqrt(etrig * (1 - etrig) /
all) * 100. <<
")%";
212 <<
"(" << setprecision(4) << epresel * 100. <<
" +/- " << setprecision(2)
213 <<
sqrt(epresel * (1 - epresel) /
all) * 100. <<
")%";
214 LogVerbatim(
"") <<
"Pt, Eta Selection Efficiency: "
215 <<
"(" << setprecision(4) << ekin * 100. <<
" +/- " << setprecision(2)
216 <<
sqrt(ekin * (1 - ekin) /
all) * 100. <<
")%";
218 <<
"(" << setprecision(4) <<
eid * 100. <<
" +/- " << setprecision(2)
221 <<
"(" << setprecision(4) << eacop * 100. <<
" +/- " << setprecision(2)
222 <<
sqrt(eacop * (1 - eacop) /
all) * 100. <<
")%";
224 <<
"(" << setprecision(4) << eiso * 100. <<
" +/- " << setprecision(2)
225 <<
sqrt(eiso * (1 - eiso) /
all) * 100. <<
")%";
227 <<
"(" << setprecision(4) << esel * 100. <<
" +/- " << setprecision(2)
228 <<
sqrt(esel * (1 - esel) /
nall) * 100. <<
")%";
232 LogVerbatim(
"") <<
"\n>>>>>> W+(-) SELECTION >>>>>>>>>>>>>>>";
233 LogVerbatim(
"") <<
"Total number of W+(-) events pre-selected: " <<
ncharge <<
" [events]";
234 LogVerbatim(
"") <<
"Total number of events selected: " <<
nsel <<
" [events]";
235 LogVerbatim(
"") <<
"Selection Efficiency only W+(-): "
236 <<
"(" << setprecision(4) << esel * 100. <<
" +/- " << setprecision(2)
237 <<
sqrt(esel * (1 - esel) /
ncharge) * 100. <<
")%";
239 LogVerbatim(
"") <<
">>>>>> W SELECTION SUMMARY END >>>>>>>>>>>>>>>\n";
249 LogError(
"") <<
">>> Muon collection does not exist !!!";
257 LogError(
"") <<
">>> TRIGGER collection does not exist !!!";
261 bool trigger_fired =
false;
264 trigger_fired =
true;
265 LogTrace(
"") <<
">>> Trigger bit: " << trigger_fired <<
" (" <<
muonTrig_ <<
")";
268 unsigned int nmuonsForZ1 = 0;
269 unsigned int nmuonsForZ2 = 0;
270 for (
unsigned int i = 0;
i < muonCollectionSize;
i++) {
272 if (!
mu.isGlobalMuon())
286 LogError(
"") <<
">>> JET collection does not exist !!!";
291 for (
unsigned int i = 0;
i < jetCollectionSize;
i++) {
296 LogTrace(
"") <<
">>> Total number of jets: " << jetCollectionSize;
302 LogTrace(
"") <<
">>> No beam spot found !!!";
310 LogTrace(
"") <<
">>> WMuNu not found !!!";
314 if (WMuNuCollection->empty()) {
315 LogTrace(
"") <<
"No WMuNu Candidates in the Event!";
318 if (WMuNuCollection->size() > 1) {
319 LogTrace(
"") <<
"This event contains more than one W Candidate";
324 LogTrace(
"") <<
"> WMuNu Candidate with: ";
332 h1_[
"hNWCand_sel"]->Fill(WMuNuCollection->size());
337 if (!trigger_fired) {
338 LogTrace(
"") <<
"Event did not fire the Trigger";
343 if (nmuonsForZ1 >= 1 && nmuonsForZ2 >= 2) {
348 LogTrace(
"") <<
"NJets > threshold";
362 if (!
mu.isGlobalMuon())
370 double eta =
mu.eta();
371 LogTrace(
"") <<
"\t... Muon pt, eta: " <<
pt <<
" [GeV], " <<
eta;
373 h1_[
"hPtMu_sel"]->Fill(
pt);
378 h1_[
"hEtaMu_sel"]->Fill(
eta);
389 double trackerHits = gm->hitPattern().numberOfValidTrackerHits();
394 h1_[
"hd0_sel"]->Fill(
dxy);
409 h1_[
"hTracker_sel"]->Fill(
mu.isTrackerMuon());
411 if (!
mu.isTrackerMuon())
417 double acop = WMuNu.
acop();
418 LogTrace(
"") <<
"\t... acoplanarity: " << acop;
421 double SumPt =
mu.isolationR03().sumPt;
422 double isovar = SumPt;
423 double Cal =
mu.isolationR03().emEt +
mu.isolationR03().hadEt;
427 h1_[
"hPtSum_sel"]->Fill(SumPt);
428 h1_[
"hPtSumN_sel"]->Fill(SumPt /
pt);
429 h1_[
"hCal_sel"]->Fill(Cal);
430 h1_[
"hIsoTot_sel"]->Fill((SumPt + Cal));
431 h1_[
"hIsoTotN_sel"]->Fill((SumPt + Cal) /
pt);
437 LogTrace(
"") <<
"\t... isolation value" << isovar <<
", isolated? " << iso;
439 double met_et =
met.pt();
442 double massT = WMuNu.
massT();
443 double w_et = WMuNu.
eT();
445 LogTrace(
"") <<
"\t... W mass, W_et, W_px, W_py: " << massT <<
", " << w_et <<
", " << WMuNu.
px() <<
", "
446 << WMuNu.
py() <<
" [GeV]";
450 h2_[
"hTMass_PtSum_inclusive"]->Fill(SumPt, massT);
451 h2_[
"hTMass_PtSumNorm_inclusive"]->Fill(SumPt /
pt, massT);
452 h2_[
"hTMass_TotIsoNorm_inclusive"]->Fill((SumPt + Cal) /
pt, massT);
453 h2_[
"hMET_PtSum_inclusive"]->Fill(SumPt, met_et);
454 h2_[
"hMET_PtSumNorm_inclusive"]->Fill(SumPt /
pt, met_et);
455 h2_[
"hMET_TotIsoNorm_inclusive"]->Fill((SumPt + Cal) /
pt, met_et);
464 h1_[
"hAcop_sel"]->Fill(acop);
472 h1_[
"hMET_sel"]->Fill(met_et);
473 h1_[
"hTMass_sel"]->Fill(massT);
476 if (massT <= mtMin_ || massT >=
mtMax_)
478 if (met_et <= metMin_ || met_et >=
metMax_)
481 LogTrace(
"") <<
">>>> Event ACCEPTED";