28 theMuonToken = consumes<pat::MuonCollection>(
pset.getParameter<
InputTag>(
"MuonCollection"));
38 hPtReso =
fileService->
make<TH2F>(
"pT_Reso",
"(p_{T}^{rec}-p_{T}^{sim})/p_{T}^{sim}", 250, 0, 120, 100, -0.2, 0.2);
39 hNMuons =
fileService->
make<TH1I>(
"NMuons",
"Number of muons per event", 20, 0, 20);
41 hEHcal =
fileService->
make<TH1F>(
"EHCal",
"Energy deposit in HCAL", 100, 0, 10);
44 hMuonType =
fileService->
make<TH1I>(
"MuonType",
"Type of Muons", 5, 1, 6);
45 hPtSTATKDiff =
fileService->
make<TH1F>(
"DiffPt_STA_TK",
"p^{TK}_{T}-p^{STA}_T", 200, -50, 50);
46 hMuCaloCompatibility =
fileService->
make<TH1F>(
"CaloCompatibility",
"Muon HP using Calorimeters only", 100, 0, 1);
47 hMuSegCompatibility =
fileService->
make<TH1F>(
"SegmentCompatibility",
"Muon HP using segments only", 100, 0, 1);
48 hChamberMatched =
fileService->
make<TH1I>(
"NumMatchedChamber",
"Number of matched chambers", 7, 0, 7);
49 hMuIdAlgo =
fileService->
make<TH1I>(
"MuonIDSelectors",
"Results of muon id selectors", 13, 0, 13);
52 hMuIso03SumPt =
fileService->
make<TH1F>(
"MuIso03SumPt",
"Isolation #Delta(R)=0.3: SumPt", 200, 0, 10);
54 fileService->
make<TH1F>(
"MuIso03CaloComb",
"Isolation #Delta(R)=0.3: 1.2*ECAL+0.8HCAL", 200, 0, 10);
57 h4MuInvMass =
fileService->
make<TH1F>(
"InvMass4MuSystem",
"Invariant mass of the 4 muons system", 200, 0, 500);
65 event.getByToken(theMuonToken,
muons);
68 hNMuons->Fill(
muons->size());
75 hPtRec->Fill(
muon->pt());
79 if (
muon->genLepton() !=
nullptr) {
80 double reso = (
muon->pt() -
muon->genLepton()->pt()) /
muon->genLepton()->pt();
81 hPtReso->Fill(
muon->genLepton()->pt(), reso);
85 if (
muon->isEnergyValid())
86 hEHcal->Fill(
muon->calEnergy().had);
89 if (
muon->isStandAloneMuon())
90 if (
muon->isGlobalMuon())
91 if (
muon->isTrackerMuon())
95 else if (
muon->isTrackerMuon())
99 else if (
muon->isTrackerMuon())
104 if (
muon->isGlobalMuon()) {
105 double diff =
muon->innerTrack()->pt() -
muon->standAloneMuon()->pt();
106 hPtSTATKDiff->Fill(
diff);
112 if (
muon->isCaloCompatibilityValid())
113 hMuCaloCompatibility->Fill(
muon->caloCompatibility());
119 hChamberMatched->Fill(
muon->numberOfChambers());
158 if (
muon->isIsolationValid()) {
159 hMuIso03CaloComb->Fill(1.2 *
muon->isolationR03().emEt + 0.8 *
muon->isolationR03().hadEt);
160 hMuIso03SumPt->Fill(
muon->isolationR03().sumPt);
169 if (
muon->isolationR03().sumPt < 0.2) {
180 p4CM = p4CM +
muon->p4();
182 h4MuInvMass->Fill(p4CM.mass());