2 #include "TLorentzVector.h"
20 #include "TLorentzVector.h"
26 #include "Math/GenVector/VectorUtil.h"
43 PFTauDis_.push_back(consumes<reco::PFTauDiscriminator>(
tag));
56 e_ctfTrackCollection_ = consumes<reco::TrackCollection>(e_ctfTrackCollectionSrc_);
76 Towers_ = consumes<CaloTowerCollection>(towers.getUntrackedParameter<
InputTag>(
"TowerCollection"));
77 doTowers_ = towers.getUntrackedParameter<
bool>(
"doTowers");
78 ptMinTower_= towers.getUntrackedParameter<
double>(
"etMin");
79 towerIsol_= towers.getUntrackedParameter<
double>(
"towerIsolation");
82 Photons_ = consumes<reco::PhotonCollection>(photons.getUntrackedParameter<
InputTag>(
"PhotonCollection"));
83 doPhotons_ = photons.getUntrackedParameter<
bool>(
"doPhotons");
84 ptMinPhoton_= photons.getUntrackedParameter<
double>(
"etMin");
85 photonEcalIso_= photons.getUntrackedParameter<
double>(
"ECALIso");
88 MET_ = consumes<reco::CaloMETCollection>(met.getUntrackedParameter<
InputTag>(
"METCollection"));
89 doMET_ = met.getUntrackedParameter<
bool>(
"doMET",
false);
90 ptMinMET_= met.getUntrackedParameter<
double>(
"ptMin",15.);
97 produces<LorentzVectorCollection>(
"PFTaus");
98 produces<LorentzVectorCollection>(
"Electrons");
99 produces<LorentzVectorCollection>(
"Muons");
100 produces<LorentzVectorCollection>(
"Jets");
101 produces<LorentzVectorCollection>(
"Photons");
102 produces<LorentzVectorCollection>(
"Towers");
103 produces<LorentzVectorCollection>(
"MET");
112 doPFTaus(iEvent,iES);
114 doElectrons(iEvent,iES);
120 doPhotons(iEvent,iES);
122 doTowers(iEvent,iES);
134 for(
unsigned int i=0;
i<pftaus->size(); ++
i) {
135 if((*pftaus)[
i].pt()>ptMinPFTau_&&fabs((*pftaus)[
i].
eta())<
etaMax)
142 if((*pftaudis)[thePFTau] < 0.5) {
153 product_PFTaus->push_back(vec);
158 iEvent.
put(product_PFTaus,
"PFTaus");
174 edm::LogInfo(
"")<<
"Error! Can't get electronIDAssocProducer by label. ";
179 iEvent.
getByToken(e_ctfTrackCollection_, pCtfTracks);
181 edm::LogInfo(
"")<<
"Error! Can't get " << e_ctfTrackCollectionSrc_.label() <<
" by label. ";
182 iEvent.
put(product_Electrons,
"Electrons");
188 for(
size_t i=0;
i<electrons->size();++
i)
194 tagIDAssocItr = pEleID->find(electronRef);
196 idDec=id_tag->cutBasedDecision();
198 if((*electrons)[
i].
pt()>ptMinElectron_&&fabs((*electrons)[
i].
eta())<
etaMax&&idDec)
201 reco::TrackCollection::const_iterator tr = ctfTracks->begin();
202 double sum_of_pt_ele=0;
203 for(;tr != ctfTracks->end();++tr)
205 double lip = (*electrons)[
i].gsfTrack()->dz() - tr->dz();
206 if(tr->pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_){
207 double dphi=fabs(tr->phi()-(*electrons)[
i].trackMomentumAtVtx().phi());
208 if(dphi>acos(-1.))dphi=2*acos(-1.)-dphi;
209 double deta=fabs(tr->eta()-(*electrons)[
i].trackMomentumAtVtx().eta());
210 double dr_ctf_ele =
sqrt(deta*deta+dphi*dphi);
211 if((dr_ctf_ele>e_minIsoDR_) && (dr_ctf_ele<e_maxIsoDR_)){
212 double cft_pt_2 = (tr->pt())*(tr->pt());
213 sum_of_pt_ele += cft_pt_2;
217 double isolation_value_ele = sum_of_pt_ele/((*electrons)[
i].trackMomentumAtVtx().Rho()*(*electrons)[
i].trackMomentumAtVtx().Rho());
218 if(isolation_value_ele<e_isoMaxSumPt_){
220 product_Electrons->push_back(vec);
226 product_Electrons->push_back(vec);
231 iEvent.
put(product_Electrons,
"Electrons");
242 for(
size_t i = 0 ;
i<muons->size();++
i)
245 if((*muons)[
i].pt()>ptMinMuon_&&fabs((*muons)[
i].
eta())<
etaMax)
248 product_Muons->push_back(vec);
253 iEvent.
put(product_Muons,
"Muons");
265 for(
size_t i = 0 ;
i<jets->size();++
i)
267 if((*jets)[
i].et()>ptMinJet_&&fabs((*jets)[
i].
eta())<
etaMax)
270 product_Jets->push_back(vec);
273 iEvent.
put(product_Jets,
"Jets");
283 for(
size_t i = 0 ;
i<towers->size();++
i)
285 if((*towers)[
i].pt()>ptMinTower_&&fabs((*towers)[
i].
eta())<
etaMax)
289 for(
unsigned int j=0;
j<towers->size();++
j)
292 isolET+=(*towers)[
j].pt();
294 isolET-=(*towers)[
i].pt();
295 if(isolET<towerIsol_)
298 product_Towers->push_back(vec);
302 iEvent.
put(product_Towers,
"Towers");
313 for(
size_t i = 0 ;
i<photons->size();++
i)
314 if((*photons)[
i].ecalRecHitSumEtConeDR04()<photonEcalIso_)
316 if((*photons)[
i].et()>ptMinPhoton_&&fabs((*photons)[
i].
eta())<
etaMax)
319 product_Gammas->push_back(vec);
322 iEvent.
put(product_Gammas,
"Photons");
332 double px = met->front().p4().Px();
333 double py = met->front().p4().Py();
334 double pt = met->front().p4().Pt();
336 product_MET->push_back(vec);
338 iEvent.
put(product_MET,
"MET");
T getUntrackedParameter(std::string const &, T const &) const
void doPFTaus(edm::Event &, const edm::EventSetup &)
friend struct const_iterator
virtual void produce(edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string id_tag("id")
std::vector< Track > TrackCollection
collection of Tracks
HLTTauRefProducer(const edm::ParameterSet &)
void doTowers(edm::Event &, const edm::EventSetup &)
void doJets(edm::Event &, const edm::EventSetup &)
math::XYZTLorentzVectorD LorentzVector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void doMET(edm::Event &, const edm::EventSetup &)
void doMuons(edm::Event &, const edm::EventSetup &)
T const * product() const
std::vector< LorentzVector > LorentzVectorCollection
void doPhotons(edm::Event &, const edm::EventSetup &)
void doElectrons(edm::Event &, const edm::EventSetup &)