48 std::map<unsigned, unsigned>
sumN_;
70 minID_(iConfig.getParameter<unsigned>(
"minID")),
72 maxID_(iConfig.getParameter<unsigned>(
"maxID")),
83 fileService->
make<TH2D>(
"ptTrigCand",
"Object vs. candidate p_{T} (GeV)", 60, 0., 300., 60, 0., 300.);
84 histos2D_[
"ptTrigCand"]->SetXTitle(
"candidate p_{T} (GeV)");
85 histos2D_[
"ptTrigCand"]->SetYTitle(
"object p_{T} (GeV)");
88 fileService->
make<TH2D>(
"etaTrigCand",
"Object vs. candidate #eta", 50, -2.5, 2.5, 50, -2.5, 2.5);
89 histos2D_[
"etaTrigCand"]->SetXTitle(
"candidate #eta");
90 histos2D_[
"etaTrigCand"]->SetYTitle(
"object #eta");
94 histos2D_[
"phiTrigCand"]->SetXTitle(
"candidate #phi");
95 histos2D_[
"phiTrigCand"]->SetYTitle(
"object #phi");
97 histos1D_[
"turnOn"] = fileService->
make<TH1D>(
"turnOn",
"p_{T} (GeV) of matched candidate", 10, 0., 50.);
98 histos1D_[
"turnOn"]->SetXTitle(
"candidate p_{T} (GeV)");
99 histos1D_[
"turnOn"]->SetYTitle(
"# of objects");
102 "ptMean",
"Mean p_{T} (GeV) per trigger object type",
maxID_ -
minID_ + 1, minID_ - 0.5,
maxID_ + 0.5);
103 histos1D_[
"ptMean"]->SetXTitle(
"trigger object type");
104 histos1D_[
"ptMean"]->SetYTitle(
"mean p_{T} (GeV)");
107 for (
unsigned id = minID_;
id <=
maxID_; ++
id) {
123 const helper::TriggerMatchHelper matchHelper;
130 for (
size_t iMuon = 0; iMuon < muons->size(); ++iMuon) {
134 if (trigRef.isAvailable() && trigRef.isNonnull()) {
135 histos2D_[
"ptTrigCand"]->Fill(muons->at(iMuon).pt(), trigRef->pt());
136 histos2D_[
"etaTrigCand"]->Fill(muons->at(iMuon).eta(), trigRef->eta());
137 histos2D_[
"phiTrigCand"]->Fill(muons->at(iMuon).phi(), trigRef->phi());
151 matchHelper.triggerMatchCandidates((*iTrig),
muonMatch_, iEvent, *triggerEvent));
152 if (candRefs.empty())
158 if (muonRef.isAvailable() && muonRef.isNonnull()) {
159 histos1D_[
"turnOn"]->Fill(muonRef->pt());
void beginJob() override
everythin that needs to be done before the event loop
std::map< unsigned, unsigned > sumN_
internals for meanPt histogram calculation
std::map< std::string, TH2D * > histos2D_
std::map< unsigned, double > sumPt_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
T * make(const Args &...args) const
make new ROOT object
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::map< std::string, TH1D * > histos1D_
histogram management
~PatTriggerAnalyzer() override
default destructor
const TriggerObjectCollection * objects() const
#define DEFINE_FWK_MODULE(type)
PatTriggerAnalyzer(const edm::ParameterSet &iConfig)
default constructor
void endJob() override
everythin that needs to be done after the event loop
Analysis-level trigger event class.
unsigned minID_
minimal id for meanPt plot
edm::Service< TFileService > fileService
edm::EDGetTokenT< pat::MuonCollection > muonsToken_
input for muons
std::vector< Muon > MuonCollection
edm::InputTag trigger_
input for patTrigger
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
everythin that needs to be done during the event loop
unsigned maxID_
maximal id for meanPt plot
std::string muonMatch_
input for trigger match objects
edm::EDGetTokenT< pat::TriggerEvent > triggerEventToken_
input for patTriggerEvent