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) {
150 product_PFTaus->push_back(vec);
155 iEvent.
put(product_PFTaus,
"PFTaus");
171 edm::LogInfo(
"")<<
"Error! Can't get electronIDAssocProducer by label. ";
176 iEvent.
getByToken(e_ctfTrackCollection_, pCtfTracks);
178 edm::LogInfo(
"")<<
"Error! Can't get " << e_ctfTrackCollectionSrc_.label() <<
" by label. ";
179 iEvent.
put(product_Electrons,
"Electrons");
185 for(
size_t i=0;
i<electrons->size();++
i)
191 tagIDAssocItr = pEleID->find(electronRef);
193 idDec=id_tag->cutBasedDecision();
195 if((*electrons)[
i].
pt()>ptMinElectron_&&fabs((*electrons)[
i].
eta())<
etaMax&&idDec)
198 reco::TrackCollection::const_iterator tr = ctfTracks->begin();
199 double sum_of_pt_ele=0;
200 for(;tr != ctfTracks->end();++tr)
202 double lip = (*electrons)[
i].gsfTrack()->dz() - tr->dz();
203 if(tr->pt() > e_trackMinPt_ && fabs(lip) < e_lipCut_){
204 double dphi=fabs(tr->phi()-(*electrons)[
i].trackMomentumAtVtx().phi());
205 if(dphi>acos(-1.))dphi=2*acos(-1.)-dphi;
206 double deta=fabs(tr->eta()-(*electrons)[
i].trackMomentumAtVtx().eta());
207 double dr_ctf_ele =
sqrt(deta*deta+dphi*dphi);
208 if((dr_ctf_ele>e_minIsoDR_) && (dr_ctf_ele<e_maxIsoDR_)){
209 double cft_pt_2 = (tr->pt())*(tr->pt());
210 sum_of_pt_ele += cft_pt_2;
214 double isolation_value_ele = sum_of_pt_ele/((*electrons)[
i].trackMomentumAtVtx().Rho()*(*electrons)[
i].trackMomentumAtVtx().Rho());
215 if(isolation_value_ele<e_isoMaxSumPt_){
217 product_Electrons->push_back(vec);
223 product_Electrons->push_back(vec);
228 iEvent.
put(product_Electrons,
"Electrons");
239 for(
size_t i = 0 ;
i<muons->size();++
i)
242 if((*muons)[
i].pt()>ptMinMuon_&&fabs((*muons)[
i].
eta())<
etaMax)
245 product_Muons->push_back(vec);
250 iEvent.
put(product_Muons,
"Muons");
262 for(
size_t i = 0 ;
i<jets->size();++
i)
264 if((*jets)[
i].et()>ptMinJet_&&fabs((*jets)[
i].
eta())<
etaMax)
267 product_Jets->push_back(vec);
270 iEvent.
put(product_Jets,
"Jets");
280 for(
size_t i = 0 ;
i<towers->size();++
i)
282 if((*towers)[
i].pt()>ptMinTower_&&fabs((*towers)[
i].
eta())<
etaMax)
286 for(
unsigned int j=0;
j<towers->size();++
j)
289 isolET+=(*towers)[
j].pt();
291 isolET-=(*towers)[
i].pt();
292 if(isolET<towerIsol_)
295 product_Towers->push_back(vec);
299 iEvent.
put(product_Towers,
"Towers");
310 for(
size_t i = 0 ;
i<photons->size();++
i)
311 if((*photons)[
i].ecalRecHitSumEtConeDR04()<photonEcalIso_)
313 if((*photons)[
i].et()>ptMinPhoton_&&fabs((*photons)[
i].
eta())<
etaMax)
316 product_Gammas->push_back(vec);
319 iEvent.
put(product_Gammas,
"Photons");
329 double px = met->front().p4().Px();
330 double py = met->front().p4().Py();
331 double pt = met->front().p4().Pt();
333 product_MET->push_back(vec);
335 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 &)