37 hPtRec = fileService->
make<TH1F>(
"pT",
"p_{T}^{rec}", 250, 0, 120);
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());
73 for (pat::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon) {
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) {
172 selectedMuons.push_back(*
muon);
177 if (selectedMuons.size() == 4) {
179 for (pat::MuonCollection::const_iterator
muon = selectedMuons.begin();
muon != selectedMuons.end(); ++
muon) {
180 p4CM = p4CM +
muon->p4();
182 h4MuInvMass->Fill(p4CM.mass());
void analyze(const edm::Event &event, const edm::EventSetup &eventSetup) override
T getParameter(std::string const &) const
selectedMuons
====================================== Muons
T * make(const Args &...args) const
make new ROOT object
#define DEFINE_FWK_MODULE(type)
~ExampleMuonAnalyzer() override
Destructor.
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
edm::Service< TFileService > fileService
ExampleMuonAnalyzer(const edm::ParameterSet &pset)
Constructor.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
std::vector< Muon > MuonCollection