13 trigger_( iConfig.getParameter< edm::InputTag >(
"trigger" ) ),
15 triggerEvent_( iConfig.getParameter< edm::InputTag >(
"triggerEvent" ) ),
17 muons_( iConfig.getParameter< edm::InputTag >(
"muons" ) ),
19 muonMatch_( iConfig.getParameter< std::string >(
"muonMatch" ) ),
21 minID_( iConfig.getParameter< unsigned >(
"minID" ) ),
23 maxID_( iConfig.getParameter< unsigned >(
"maxID" ) ),
24 histos1D_(), histos2D_()
37 histos2D_[
"ptTrigCand" ] = fileService->
make< TH2D >(
"ptTrigCand",
"Object vs. candidate p_{T} (GeV)", 60, 0., 300., 60, 0., 300. );
38 histos2D_[
"ptTrigCand" ]->SetXTitle(
"candidate p_{T} (GeV)" );
39 histos2D_[
"ptTrigCand" ]->SetYTitle(
"object p_{T} (GeV)" );
41 histos2D_[
"etaTrigCand" ] = fileService->
make< TH2D >(
"etaTrigCand",
"Object vs. candidate #eta", 50, -2.5, 2.5, 50, -2.5, 2.5 );
42 histos2D_[
"etaTrigCand" ]->SetXTitle(
"candidate #eta" );
43 histos2D_[
"etaTrigCand" ]->SetYTitle(
"object #eta" );
46 histos2D_[
"phiTrigCand" ]->SetXTitle(
"candidate #phi" );
47 histos2D_[
"phiTrigCand" ]->SetYTitle(
"object #phi" );
49 histos1D_[
"turnOn" ] = fileService->
make< TH1D >(
"turnOn",
"p_{T} (GeV) of matched candidate", 10, 0., 50.);
50 histos1D_[
"turnOn" ]->SetXTitle(
"candidate p_{T} (GeV)" );
51 histos1D_[
"turnOn" ]->SetYTitle(
"# of objects" );
53 histos1D_[
"ptMean" ] = fileService->
make< TH1D >(
"ptMean",
"Mean p_{T} (GeV) per trigger object type",
maxID_ -
minID_ + 1, minID_ - 0.5,
maxID_ + 0.5);
54 histos1D_[
"ptMean" ]->SetXTitle(
"trigger object type" );
55 histos1D_[
"ptMean" ]->SetYTitle(
"mean p_{T} (GeV)" );
58 for(
unsigned id = minID_;
id <=
maxID_; ++id ){
75 const helper::TriggerMatchHelper matchHelper;
82 for(
size_t iMuon = 0; iMuon < muons->size(); ++iMuon ) {
86 if ( trigRef.isAvailable() && trigRef.isNonnull() ) {
87 histos2D_[
"ptTrigCand" ]->Fill( muons->at( iMuon ).pt(), trigRef->pt() );
88 histos2D_[
"etaTrigCand" ]->Fill( muons->at( iMuon ).eta(), trigRef->eta() );
89 histos2D_[
"phiTrigCand" ]->Fill( muons->at( iMuon ).phi(), trigRef->phi() );
103 if ( candRefs.empty() )
continue;
108 if ( muonRef.isAvailable() && muonRef.isNonnull() ) {
109 histos1D_[
"turnOn" ]->Fill( muonRef->pt() );
124 sumN_[ id ] += objRefs.size();
127 sumPt_[ id ] += ( *iRef )->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