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");
92 produces<LorentzVectorCollection>(
"PFTaus");
93 produces<LorentzVectorCollection>(
"Electrons");
94 produces<LorentzVectorCollection>(
"Muons");
95 produces<LorentzVectorCollection>(
"Jets");
96 produces<LorentzVectorCollection>(
"Photons");
97 produces<LorentzVectorCollection>(
"Towers");
106 doPFTaus(iEvent,iES);
108 doElectrons(iEvent,iES);
114 doPhotons(iEvent,iES);
116 doTowers(iEvent,iES);
127 for(
unsigned int i=0;
i<pftaus->size(); ++
i) {
128 if((*pftaus)[
i].pt()>ptMinPFTau_&&fabs((*pftaus)[
i].
eta())<etaMax)
135 if((*pftaudis)[thePFTau] < 0.5) {
143 product_PFTaus->push_back(vec);
148 iEvent.
put(product_PFTaus,
"PFTaus");
164 edm::LogInfo(
"")<<
"Error! Can't get electronIDAssocProducer by label. ";
169 iEvent.
getByToken(e_ctfTrackCollection_, pCtfTracks);
171 edm::LogInfo(
"")<<
"Error! Can't get " << e_ctfTrackCollectionSrc_.label() <<
" by label. ";
172 iEvent.
put(product_Electrons,
"Electrons");
178 for(
size_t i=0;
i<electrons->size();++
i)
184 tagIDAssocItr = pEleID->find(electronRef);
186 idDec=id_tag->cutBasedDecision();
188 if((*electrons)[
i].
pt()>ptMinElectron_&&fabs((*electrons)[
i].
eta())<etaMax&&idDec)
191 reco::TrackCollection::const_iterator tr = ctfTracks->begin();
192 double sum_of_pt_ele=0;
193 for(;tr != ctfTracks->end();++tr)
195 double lip = (*electrons)[
i].gsfTrack()->dz() - tr->dz();
196 if(tr->pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_){
197 double dphi=fabs(tr->phi()-(*electrons)[
i].trackMomentumAtVtx().phi());
198 if(dphi>acos(-1.))dphi=2*acos(-1.)-dphi;
199 double deta=fabs(tr->eta()-(*electrons)[
i].trackMomentumAtVtx().eta());
200 double dr_ctf_ele =
sqrt(deta*deta+dphi*dphi);
201 if((dr_ctf_ele>e_minIsoDR_) && (dr_ctf_ele<e_maxIsoDR_)){
202 double cft_pt_2 = (tr->pt())*(tr->pt());
203 sum_of_pt_ele += cft_pt_2;
207 double isolation_value_ele = sum_of_pt_ele/((*electrons)[
i].trackMomentumAtVtx().Rho()*(*electrons)[
i].trackMomentumAtVtx().Rho());
208 if(isolation_value_ele<e_isoMaxSumPt_){
210 product_Electrons->push_back(vec);
216 product_Electrons->push_back(vec);
221 iEvent.
put(product_Electrons,
"Electrons");
232 for(
size_t i = 0 ;
i<muons->size();++
i)
235 if((*muons)[
i].pt()>ptMinMuon_&&fabs((*muons)[
i].
eta())<etaMax)
238 product_Muons->push_back(vec);
243 iEvent.
put(product_Muons,
"Muons");
255 for(
size_t i = 0 ;
i<jets->size();++
i)
257 if((*jets)[
i].et()>ptMinJet_&&fabs((*jets)[
i].
eta())<etaMax)
260 product_Jets->push_back(vec);
263 iEvent.
put(product_Jets,
"Jets");
273 for(
size_t i = 0 ;
i<towers->size();++
i)
275 if((*towers)[
i].pt()>ptMinTower_&&fabs((*towers)[
i].
eta())<etaMax)
279 for(
unsigned int j=0;
j<towers->size();++
j)
281 if(ROOT::Math::VectorUtil::DeltaR((*towers)[
i].
p4(),(*towers)[
j].
p4())<0.5)
282 isolET+=(*towers)[
j].pt();
284 isolET-=(*towers)[
i].pt();
285 if(isolET<towerIsol_)
288 product_Towers->push_back(vec);
292 iEvent.
put(product_Towers,
"Towers");
303 for(
size_t i = 0 ;
i<photons->size();++
i)
304 if((*photons)[
i].ecalRecHitSumEtConeDR04()<photonEcalIso_)
306 if((*photons)[
i].et()>ptMinPhoton_&&fabs((*photons)[
i].
eta())<etaMax)
309 product_Gammas->push_back(vec);
312 iEvent.
put(product_Gammas,
"Photons");
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 doMuons(edm::Event &, const edm::EventSetup &)
std::vector< LorentzVector > LorentzVectorCollection
T const * product() const
void doPhotons(edm::Event &, const edm::EventSetup &)
void doElectrons(edm::Event &, const edm::EventSetup &)