41 hPtRec = fileService->
make<TH1F>(
"pT",
"p_{T}^{rec}",250,0,120);
42 hPtReso = fileService->
make<TH2F>(
"pT_Reso",
"(p_{T}^{rec}-p_{T}^{sim})/p_{T}^{sim}",250,0,120,100,-0.2,0.2);
43 hNMuons = fileService->
make<TH1I>(
"NMuons",
"Number of muons per event",20,0,20);
45 hEHcal = fileService->
make<TH1F>(
"EHCal",
"Energy deposit in HCAL",100,0,10);
48 hMuonType = fileService->
make<TH1I>(
"MuonType",
"Type of Muons", 5, 1, 6);
49 hPtSTATKDiff = fileService->
make<TH1F>(
"DiffPt_STA_TK",
"p^{TK}_{T}-p^{STA}_T",200,-50,50);
50 hMuCaloCompatibility = fileService->
make<TH1F>(
"CaloCompatibility",
"Muon HP using Calorimeters only",100,0,1);
51 hMuSegCompatibility = fileService->
make<TH1F>(
"SegmentCompatibility",
"Muon HP using segments only",100,0,1);
52 hChamberMatched = fileService->
make<TH1I>(
"NumMatchedChamber",
"Number of matched chambers", 7, 0, 7);
53 hMuIdAlgo = fileService->
make<TH1I>(
"MuonIDSelectors",
"Results of muon id selectors", 13, 0, 13);
56 hMuIso03SumPt = fileService->
make<TH1F>(
"MuIso03SumPt",
"Isolation #Delta(R)=0.3: SumPt",200,0,10);
57 hMuIso03CaloComb = fileService->
make<TH1F>(
"MuIso03CaloComb",
"Isolation #Delta(R)=0.3: 1.2*ECAL+0.8HCAL",200,0,10);
60 h4MuInvMass = fileService->
make<TH1F>(
"InvMass4MuSystem",
"Invariant mass of the 4 muons system",200,0,500);
72 event.getByToken(theMuonToken, muons);
75 hNMuons->Fill(muons->size());
81 for (pat::MuonCollection::const_iterator
muon = muons->begin();
muon != muons->end(); ++
muon){
84 hPtRec->Fill(
muon->pt());
88 if(
muon->genLepton()!=
nullptr){
89 double reso = (
muon->pt() -
muon->genLepton()->pt())/
muon->genLepton()->pt();
90 hPtReso->Fill(
muon->genLepton()->pt(),reso);
94 if(
muon->isEnergyValid())
95 hEHcal->Fill(
muon->calEnergy().had);
98 if(
muon->isStandAloneMuon())
99 if(
muon->isGlobalMuon())
100 if(
muon->isTrackerMuon()) hMuonType->Fill(1);
101 else hMuonType->Fill(2);
103 if(
muon->isTrackerMuon()) hMuonType->Fill(3);
104 else hMuonType->Fill(5);
106 if(
muon->isTrackerMuon()) hMuonType->Fill(4);
110 if(
muon->isGlobalMuon()){
111 double diff =
muon->innerTrack()->pt() -
muon->standAloneMuon()->pt();
112 hPtSTATKDiff->Fill(diff);
118 if(
muon->isCaloCompatibilityValid())
119 hMuCaloCompatibility->Fill(
muon->caloCompatibility());
126 hChamberMatched->Fill(
muon->numberOfChambers());
166 if(
muon->isIsolationValid()){
167 hMuIso03CaloComb->Fill(1.2*
muon->isolationR03().emEt + 0.8*
muon->isolationR03().hadEt);
168 hMuIso03SumPt->Fill(
muon->isolationR03().sumPt);
177 if(
muon->isolationR03().sumPt< 0.2){
178 if(
muon->isGlobalMuon() ||
181 selectedMuons.push_back(*
muon);
186 if(selectedMuons.size() == 4){
188 for (pat::MuonCollection::const_iterator
muon = selectedMuons.begin();
muon != selectedMuons.end(); ++
muon){
189 p4CM = p4CM +
muon->p4();
191 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