2 #include "TLorentzVector.h"
20 #include "TLorentzVector.h"
26 #include "Math/GenVector/VectorUtil.h"
71 doTowers_ = towers.getUntrackedParameter<
bool>(
"doTowers");
72 ptMinTower_= towers.getUntrackedParameter<
double>(
"etMin");
73 towerIsol_= towers.getUntrackedParameter<
double>(
"towerIsolation");
77 doPhotons_ = photons.getUntrackedParameter<
bool>(
"doPhotons");
78 ptMinPhoton_= photons.getUntrackedParameter<
double>(
"etMin");
79 photonEcalIso_= photons.getUntrackedParameter<
double>(
"ECALIso");
86 produces<LorentzVectorCollection>(
"PFTaus");
87 produces<LorentzVectorCollection>(
"Electrons");
88 produces<LorentzVectorCollection>(
"Muons");
89 produces<LorentzVectorCollection>(
"Jets");
90 produces<LorentzVectorCollection>(
"Photons");
91 produces<LorentzVectorCollection>(
"Towers");
100 doPFTaus(iEvent,iES);
102 doElectrons(iEvent,iES);
108 doPhotons(iEvent,iES);
110 doTowers(iEvent,iES);
122 for(
unsigned int i=0;
i<pftaus->size();++
i)
123 if((*pftaus)[
i].pt()>ptMinPFTau_&&fabs((*pftaus)[
i].
eta())<
etaMax)
126 for(
unsigned int j=0;
j<PFTauDis_.size();++
j)
131 if((*pftaudis)[thePFTau]>0.5)
134 product_PFTaus->push_back(vec);
141 iEvent.
put(product_PFTaus,
"PFTaus");
158 edm::LogInfo(
"")<<
"Error! Can't get electronIDAssocProducer by label. ";
163 iEvent.
getByLabel(e_ctfTrackCollection_, pCtfTracks);
165 edm::LogInfo(
"")<<
"Error! Can't get " << e_ctfTrackCollection_.label() <<
" by label. ";
166 iEvent.
put(product_Electrons,
"Electrons");
172 for(
size_t i=0;
i<electrons->size();++
i)
178 tagIDAssocItr = pEleID->find(electronRef);
180 idDec=id_tag->cutBasedDecision();
182 if((*electrons)[
i].pt()>ptMinElectron_&&fabs((*electrons)[
i].
eta())<
etaMax&&idDec)
185 reco::TrackCollection::const_iterator tr = ctfTracks->begin();
186 double sum_of_pt_ele=0;
187 for(;tr != ctfTracks->end();++tr)
189 double lip = (*electrons)[
i].gsfTrack()->dz() - tr->dz();
190 if(tr->pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_){
191 double dphi=fabs(tr->phi()-(*electrons)[
i].trackMomentumAtVtx().phi());
192 if(dphi>acos(-1.))dphi=2*acos(-1.)-dphi;
193 double deta=fabs(tr->eta()-(*electrons)[
i].trackMomentumAtVtx().eta());
194 double dr_ctf_ele =
sqrt(deta*deta+dphi*dphi);
195 if((dr_ctf_ele>e_minIsoDR_) && (dr_ctf_ele<e_maxIsoDR_)){
196 double cft_pt_2 = (tr->pt())*(tr->pt());
197 sum_of_pt_ele += cft_pt_2;
201 double isolation_value_ele = sum_of_pt_ele/((*electrons)[
i].trackMomentumAtVtx().Rho()*(*electrons)[
i].trackMomentumAtVtx().Rho());
202 if(isolation_value_ele<e_isoMaxSumPt_){
204 product_Electrons->push_back(vec);
210 product_Electrons->push_back(vec);
215 iEvent.
put(product_Electrons,
"Electrons");
226 for(
size_t i = 0 ;
i<muons->size();++
i)
229 if((*muons)[
i].pt()>ptMinMuon_&&fabs((*muons)[
i].
eta())<
etaMax)
232 product_Muons->push_back(vec);
237 iEvent.
put(product_Muons,
"Muons");
249 for(
size_t i = 0 ;
i<jets->size();++
i)
251 if((*jets)[
i].et()>ptMinJet_&&fabs((*jets)[
i].
eta())<
etaMax)
254 product_Jets->push_back(vec);
257 iEvent.
put(product_Jets,
"Jets");
267 for(
size_t i = 0 ;
i<towers->size();++
i)
269 if((*towers)[
i].pt()>ptMinTower_&&fabs((*towers)[
i].
eta())<
etaMax)
273 for(
unsigned int j=0;
j<towers->size();++
j)
275 if(ROOT::Math::VectorUtil::DeltaR((*towers)[
i].
p4(),(*towers)[
j].
p4())<0.5)
276 isolET+=(*towers)[
j].pt();
278 isolET-=(*towers)[
i].pt();
279 if(isolET<towerIsol_)
282 product_Towers->push_back(vec);
286 iEvent.
put(product_Towers,
"Towers");
297 for(
size_t i = 0 ;
i<photons->size();++
i)
298 if((*photons)[
i].ecalRecHitSumEtConeDR04()<photonEcalIso_)
300 if((*photons)[
i].et()>ptMinPhoton_&&fabs((*photons)[
i].
eta())<
etaMax)
303 product_Gammas->push_back(vec);
306 iEvent.
put(product_Gammas,
"Photons");
T getUntrackedParameter(std::string const &, T const &) const
void doPFTaus(edm::Event &, const edm::EventSetup &)
virtual void produce(edm::Event &, const edm::EventSetup &)
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.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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 &)