14 trigger_( iConfig.getParameter< edm::InputTag >(
"trigger" ) ),
16 triggerEvent_( iConfig.getParameter< edm::InputTag >(
"triggerEvent" ) ),
18 muons_( iConfig.getParameter< edm::InputTag >(
"muons" ) ),
20 muonMatch_( iConfig.getParameter< std::string >(
"muonMatch" ) ),
22 minID_( iConfig.getParameter< unsigned >(
"minID" ) ),
24 maxID_( iConfig.getParameter< unsigned >(
"maxID" ) ),
25 histos1D_(), histos2D_()
38 histos2D_[
"ptTrigCand" ] = fileService->
make< TH2D >(
"ptTrigCand",
"Object vs. candidate p_{T} (GeV)", 60, 0., 300., 60, 0., 300. );
39 histos2D_[
"ptTrigCand" ]->SetXTitle(
"candidate p_{T} (GeV)" );
40 histos2D_[
"ptTrigCand" ]->SetYTitle(
"object p_{T} (GeV)" );
42 histos2D_[
"etaTrigCand" ] = fileService->
make< TH2D >(
"etaTrigCand",
"Object vs. candidate #eta", 50, -2.5, 2.5, 50, -2.5, 2.5 );
43 histos2D_[
"etaTrigCand" ]->SetXTitle(
"candidate #eta" );
44 histos2D_[
"etaTrigCand" ]->SetYTitle(
"object #eta" );
47 histos2D_[
"phiTrigCand" ]->SetXTitle(
"candidate #phi" );
48 histos2D_[
"phiTrigCand" ]->SetYTitle(
"object #phi" );
50 histos1D_[
"turnOn" ] = fileService->
make< TH1D >(
"turnOn",
"p_{T} (GeV) of matched candidate", 10, 0., 50.);
51 histos1D_[
"turnOn" ]->SetXTitle(
"candidate p_{T} (GeV)" );
52 histos1D_[
"turnOn" ]->SetYTitle(
"# of objects" );
55 histos1D_[
"ptMean" ]->SetXTitle(
"filter ID" );
56 histos1D_[
"ptMean" ]->SetYTitle(
"mean p_{T} (GeV)" );
59 for(
unsigned id = minID_;
id <=
maxID_; ++
id ){
76 const helper::TriggerMatchHelper matchHelper;
83 for(
size_t iMuon = 0; iMuon < muons->size(); ++iMuon ) {
87 if ( trigRef.isAvailable() && trigRef.isNonnull() ) {
88 histos2D_[
"ptTrigCand" ]->Fill( muons->at( iMuon ).pt(), trigRef->pt() );
89 histos2D_[
"etaTrigCand" ]->Fill( muons->at( iMuon ).eta(), trigRef->eta() );
90 histos2D_[
"phiTrigCand" ]->Fill( muons->at( iMuon ).phi(), trigRef->phi() );
104 if ( candRefs.empty() )
continue;
109 if ( muonRef.isAvailable() && muonRef.isNonnull() ) {
110 histos1D_[
"turnOn" ]->Fill( muonRef->pt() );
virtual void beginJob()
everythin that needs to be done before the event loop
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
everythin that needs to be done during the event loop
~PatTriggerAnalyzer()
default destructor
virtual void endJob()
everythin that needs to be done after the event loop
PatTriggerAnalyzer(const edm::ParameterSet &iConfig)
default constructor
std::map< std::string, TH1D * > histos1D_
histogram management
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned minID_
minimal id for meanPt plot
edm::Service< TFileService > fileService
edm::InputTag triggerEvent_
input for patTriggerEvent
std::map< unsigned, double > sumPt_
edm::InputTag muons_
input for muons
std::map< std::string, TH2D * > histos2D_
std::map< unsigned, unsigned > sumN_
internals for meanPt histogram calculation
T * make() const
make new ROOT object
unsigned maxID_
maximal id for meanPt plot
std::string muonMatch_
input for trigger match objects