50 std::map< unsigned, unsigned >
sumN_;
67 trigger_( iConfig.getParameter<
edm::InputTag >(
"trigger" ) ),
75 minID_( iConfig.getParameter< unsigned >(
"minID" ) ),
77 maxID_( iConfig.getParameter< unsigned >(
"maxID" ) ),
91 histos2D_[
"ptTrigCand" ] = fileService->
make< TH2D >(
"ptTrigCand",
"Object vs. candidate p_{T} (GeV)", 60, 0., 300., 60, 0., 300. );
92 histos2D_[
"ptTrigCand" ]->SetXTitle(
"candidate p_{T} (GeV)" );
93 histos2D_[
"ptTrigCand" ]->SetYTitle(
"object p_{T} (GeV)" );
95 histos2D_[
"etaTrigCand" ] = fileService->
make< TH2D >(
"etaTrigCand",
"Object vs. candidate #eta", 50, -2.5, 2.5, 50, -2.5, 2.5 );
96 histos2D_[
"etaTrigCand" ]->SetXTitle(
"candidate #eta" );
97 histos2D_[
"etaTrigCand" ]->SetYTitle(
"object #eta" );
100 histos2D_[
"phiTrigCand" ]->SetXTitle(
"candidate #phi" );
101 histos2D_[
"phiTrigCand" ]->SetYTitle(
"object #phi" );
103 histos1D_[
"turnOn" ] = fileService->
make< TH1D >(
"turnOn",
"p_{T} (GeV) of matched candidate", 10, 0., 50.);
104 histos1D_[
"turnOn" ]->SetXTitle(
"candidate p_{T} (GeV)" );
105 histos1D_[
"turnOn" ]->SetYTitle(
"# of objects" );
107 histos1D_[
"ptMean" ] = fileService->
make< TH1D >(
"ptMean",
"Mean p_{T} (GeV) per trigger object type",
maxID_ -
minID_ + 1, minID_ - 0.5,
maxID_ + 0.5);
108 histos1D_[
"ptMean" ]->SetXTitle(
"trigger object type" );
109 histos1D_[
"ptMean" ]->SetYTitle(
"mean p_{T} (GeV)" );
112 for(
unsigned id = minID_;
id <=
maxID_; ++
id ){
129 const helper::TriggerMatchHelper matchHelper;
136 for(
size_t iMuon = 0; iMuon < muons->size(); ++iMuon ) {
140 if ( trigRef.isAvailable() && trigRef.isNonnull() ) {
141 histos2D_[
"ptTrigCand" ]->Fill( muons->at( iMuon ).pt(), trigRef->pt() );
142 histos2D_[
"etaTrigCand" ]->Fill( muons->at( iMuon ).eta(), trigRef->eta() );
143 histos2D_[
"phiTrigCand" ]->Fill( muons->at( iMuon ).phi(), trigRef->phi() );
157 if ( candRefs.empty() )
continue;
162 if ( muonRef.isAvailable() && muonRef.isNonnull() ) {
163 histos1D_[
"turnOn" ]->Fill( muonRef->pt() );
void beginJob() override
everythin that needs to be done before the event loop
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
T * make(const Args &...args) const
make new ROOT object
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
~PatTriggerAnalyzer() override
default destructor
const TriggerObjectCollection * objects() const
edm::EDGetTokenT< pat::MuonCollection > muonsToken_
input for muons
PatTriggerAnalyzer(const edm::ParameterSet &iConfig)
default constructor
void endJob() override
everythin that needs to be done after the event loop
std::map< std::string, TH1D * > histos1D_
histogram management
Analysis-level trigger event class.
unsigned minID_
minimal id for meanPt plot
edm::Service< TFileService > fileService
std::vector< Muon > MuonCollection
std::map< unsigned, double > sumPt_
edm::InputTag trigger_
input for patTrigger
std::map< std::string, TH2D * > histos2D_
std::map< unsigned, unsigned > sumN_
internals for meanPt histogram calculation
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