26 virtual void endJob()
override ;
76 #include "Math/VectorUtil.h"
79 minPt_ (cfg.getParameter<double>(
"minPt")),
80 maxEta_ (cfg.getParameter<double>(
"maxEta")),
81 mode_ (cfg.getParameter<unsigned int>(
"mode")),
82 electronID_ (cfg.getParameter<std::
string>(
"electronID")),
83 electronSrcToken_ (consumes<std::vector<pat::
Electron> >(cfg.getParameter<edm::
InputTag>(
"electronSrc"))),
85 genMatchMode_(cfg.getParameter<edm::
ParameterSet>(
"genMatchMode")),
86 tagAndProbeMode_(cfg.getParameter<edm::
ParameterSet>(
"tagAndProbeMode"))
96 nr_ = fs->make<TH1I>(
"nr",
"nr", 10, 0 , 10 );
97 pt_ = fs->make<TH1F>(
"pt",
"pt", 20, 0., 100.);
98 eta_ = fs->make<TH1F>(
"eta",
"eta", 30, -3., 3.);
99 phi_ = fs->make<TH1F>(
"phi",
"phi", 35, -3.5, 3.5);
100 genPt_ = fs->make<TH1F>(
"genPt",
"pt", 20, 0., 100.);
101 genEta_ = fs->make<TH1F>(
"genEta",
"eta", 30, -3., 3.);
102 genPhi_ = fs->make<TH1F>(
"genPhi",
"phi", 35, -3.5, 3.5);
103 deltaR_ = fs->make<TH1F>(
"deltaR",
"log(dR)", 50, -5., 0.);
104 isoTag_ = fs->make<TH1F>(
"isoTag",
"iso", 50, 0., 10.);
105 invMass_ = fs->make<TH1F>(
"invMass",
"m", 100, 50., 150.);
106 deltaPhi_= fs->make<TH1F>(
"deltaPhi",
"deltaPhi", 100, -3.5, 3.5);
123 nr_->Fill( electrons->size() );
132 for(reco::GenParticleCollection::const_iterator
part=particles->begin();
145 for( std::vector<pat::Electron>::const_iterator elec=electrons->begin(); elec!=electrons->end(); ++elec ){
146 if( elec->genLepton() ){
148 deltaR_->Fill(TMath::Log10(deltaR));
155 pt_ ->Fill( elec->pt() );
156 eta_->Fill( elec->eta() );
157 phi_->Fill( elec->phi() );
171 for( std::vector<pat::Electron>::const_iterator elec=electrons->begin(); elec!=electrons->end(); ++elec ){
172 isoTag_->Fill(elec->trackIso());
173 if( elec->trackIso()<
maxTagIso_ && elec->electronID(
"eidTight")>0.5 ){
175 for( std::vector<pat::Electron>::const_iterator probe=electrons->begin(); probe!=electrons->end(); ++probe ){
177 if( probe==elec )
continue;
179 float zMass = (probe->p4()+elec->p4()).
mass();
191 pt_ ->Fill( probe->pt() );
192 eta_->Fill( probe->eta() );
193 phi_->Fill( probe->phi() );
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< pat::Electron > > electronSrcToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void beginJob() override
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< reco::GenParticleCollection > particleSrcToken_
double deltaR(double eta1, double eta2, double phi1, double phi2)
edm::ParameterSet tagAndProbeMode_
edm::ParameterSet genMatchMode_
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
PatElectronAnalyzer(const edm::ParameterSet &)
virtual void endJob() override