53 std::map< unsigned, unsigned >
sumN_;
69 trigger_( iConfig.getParameter< edm::InputTag >(
"trigger" ) ),
71 triggerEvent_( iConfig.getParameter< edm::InputTag >(
"triggerEvent" ) ),
73 muons_( iConfig.getParameter< edm::InputTag >(
"muons" ) ),
75 muonMatch_( iConfig.getParameter< std::
string >(
"muonMatch" ) ),
77 nBins_( iConfig.getParameter< unsigned >(
"nBins" ) ),
78 binWidth_( iConfig.getParameter< double >(
"binWidth" ) ),
80 minID_( iConfig.getParameter< unsigned >(
"minID" ) ),
82 maxID_( iConfig.getParameter< unsigned >(
"maxID" ) ),
83 histos1D_(), histos2D_()
96 histos2D_[
"ptTrigCand" ] = fileService->
make< TH2D >(
"ptTrigCand",
"Object vs. candidate p_{T} (GeV)", 60, 0., 300., 60, 0., 300. );
97 histos2D_[
"ptTrigCand" ]->SetXTitle(
"candidate p_{T} (GeV)" );
98 histos2D_[
"ptTrigCand" ]->SetYTitle(
"object p_{T} (GeV)" );
100 histos2D_[
"etaTrigCand" ] = fileService->
make< TH2D >(
"etaTrigCand",
"Object vs. candidate #eta", 50, -2.5, 2.5, 50, -2.5, 2.5 );
101 histos2D_[
"etaTrigCand" ]->SetXTitle(
"candidate #eta" );
102 histos2D_[
"etaTrigCand" ]->SetYTitle(
"object #eta" );
105 histos2D_[
"phiTrigCand" ]->SetXTitle(
"candidate #phi" );
106 histos2D_[
"phiTrigCand" ]->SetYTitle(
"object #phi" );
109 histos1D_[
"countCand" ]->SetXTitle(
"candidate p_{T} (GeV)" );
110 histos1D_[
"countCand" ]->SetYTitle(
"# of candidates" );
113 histos1D_[
"turnOn" ]->SetXTitle(
"candidate p_{T} (GeV)" );
114 histos1D_[
"turnOn" ]->SetYTitle(
"efficiency" );
116 histos1D_[
"ptMean" ] = fileService->
make< TH1D >(
"ptMean",
"Mean p_{T} (GeV) per trigger object type",
maxID_ -
minID_ + 1, minID_ - 0.5,
maxID_ + 0.5);
117 histos1D_[
"ptMean" ]->SetXTitle(
"trigger object type" );
118 histos1D_[
"ptMean" ]->SetYTitle(
"mean p_{T} (GeV)" );
121 for(
unsigned id = minID_;
id <=
maxID_; ++id ) {
138 const helper::TriggerMatchHelper matchHelper;
145 for(
size_t iMuon = 0; iMuon < muons->size(); ++iMuon ) {
149 if ( trigRef.isAvailable() && trigRef.isNonnull() ) {
150 histos2D_[
"ptTrigCand" ]->Fill( muons->at( iMuon ).pt(), trigRef->pt() );
151 histos2D_[
"etaTrigCand" ]->Fill( muons->at( iMuon ).eta(), trigRef->eta() );
152 histos2D_[
"phiTrigCand" ]->Fill( muons->at( iMuon ).phi(), trigRef->phi() );
161 for(
size_t iMuon = 0; iMuon < muons->size(); ++iMuon ) {
163 histos1D_[
"countCand" ]->Fill( muons->at( iMuon ).pt() );
172 if ( candRefs.empty() )
continue;
177 if ( muonRef.isAvailable() && muonRef.isNonnull() ) {
178 histos1D_[
"turnOn" ]->Fill( muonRef->pt() );
193 sumN_[ id ] += objRefs.size();
196 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
edm::InputTag trigger_
input for patTrigger
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
unsigned nBins_
binning for turn-on curve