Public Member Functions | |
ZMuMuTrackUserData (const edm::ParameterSet &) | |
Private Member Functions | |
template<typename T > | |
vector< double > | isolation (const T &t, double ptThreshold, double etEcalThreshold, double etHcalThreshold, double dRVetoTrk, double dRTrk, double dREcal, double dRHcal, double alpha, double beta) |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
double | alpha_ |
InputTag | beamSpot_ |
double | beta_ |
double | dREcal_ |
double | dRHcal_ |
double | dRTrk_ |
double | dRVetoTrk_ |
double | etEcalThreshold_ |
double | etHcalThreshold_ |
InputTag | primaryVertices_ |
double | ptThreshold_ |
InputTag | src_ |
Definition at line 27 of file ZMuMuTrackUserData.cc.
ZMuMuTrackUserData::ZMuMuTrackUserData | ( | const edm::ParameterSet & | cfg | ) |
Definition at line 81 of file ZMuMuTrackUserData.cc.
: src_( cfg.getParameter<InputTag>( "src" ) ), beamSpot_(cfg.getParameter<InputTag>( "beamSpot" ) ), primaryVertices_(cfg.getParameter<InputTag>( "primaryVertices" ) ), ptThreshold_(cfg.getParameter<double >("ptThreshold") ), etEcalThreshold_(cfg.getParameter<double >("etEcalThreshold") ), etHcalThreshold_(cfg.getParameter<double >("etHcalThreshold") ), dRVetoTrk_(cfg.getParameter<double >("dRVetoTrk") ), dRTrk_(cfg.getParameter<double >("dRTrk") ), dREcal_(cfg.getParameter<double >("dREcal") ), dRHcal_(cfg.getParameter<double >("dRHcal") ), alpha_(cfg.getParameter<double>("alpha") ), beta_(cfg.getParameter<double>("beta") ){ produces<std::vector<pat::GenericParticle> >(); }
vector< double > ZMuMuTrackUserData::isolation | ( | const T & | t, |
double | ptThreshold, | ||
double | etEcalThreshold, | ||
double | etHcalThreshold, | ||
double | dRVetoTrk, | ||
double | dRTrk, | ||
double | dREcal, | ||
double | dRHcal, | ||
double | alpha, | ||
double | beta | ||
) | [private] |
Definition at line 42 of file ZMuMuTrackUserData.cc.
References beta, dir, pat::EcalIso, pat::HcalIso, reco::IsoDeposit::sumWithin(), and pat::TrackIso.
Referenced by produce().
{ vector<double> iso; const pat::IsoDeposit * trkIso = t.isoDeposit(pat::TrackIso); const pat::IsoDeposit * ecalIso = t.isoDeposit(pat::EcalIso); const pat::IsoDeposit * hcalIso = t.isoDeposit(pat::HcalIso); Direction dir = Direction(t.eta(), t.phi()); pat::IsoDeposit::AbsVetos vetosTrk; vetosTrk.push_back(new ConeVeto( dir, dRVetoTrk )); vetosTrk.push_back(new ThresholdVeto( ptThreshold )); pat::IsoDeposit::AbsVetos vetosEcal; vetosEcal.push_back(new ConeVeto( dir, 0.)); vetosEcal.push_back(new ThresholdVeto( etEcalThreshold )); pat::IsoDeposit::AbsVetos vetosHcal; vetosHcal.push_back(new ConeVeto( dir, 0. )); vetosHcal.push_back(new ThresholdVeto( etHcalThreshold )); double isovalueTrk = (trkIso->sumWithin(dRTrk,vetosTrk)); double isovalueEcal = (ecalIso->sumWithin(dREcal,vetosEcal)); double isovalueHcal = (hcalIso->sumWithin(dRHcal,vetosHcal)); iso.push_back(isovalueTrk); iso.push_back(isovalueEcal); iso.push_back(isovalueHcal); //double iso = isovalueTrk + isovalueEcal + isovalueHcal; double combIso = alpha*( ((1+beta)/2*isovalueEcal) + ((1-beta)/2*isovalueHcal) ) + ((1-alpha)*isovalueTrk); iso.push_back(combIso); double relIso = combIso /= t.pt(); iso.push_back(relIso); return iso; }
void ZMuMuTrackUserData::produce | ( | edm::Event & | evt, |
const edm::EventSetup & | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 97 of file ZMuMuTrackUserData.cc.
References pat::PATObject< ObjectType >::addUserFloat(), alpha_, beamSpot_, beta_, dREcal_, dRHcal_, dRTrk_, dRVetoTrk_, etEcalThreshold_, etHcalThreshold_, edm::Event::getByLabel(), i, edm::Ref< C, T, F >::isNonnull(), isolation(), primaryVertices_, ptThreshold_, edm::Event::put(), pat::GenericParticle::setIsolation(), src_, pat::GenericParticle::track(), testEve_cfg::tracks, pat::User1Iso, pat::User2Iso, pat::User3Iso, pat::User4Iso, and pat::User5Iso.
{ Handle<vector<pat::GenericParticle> > tracks; evt.getByLabel(src_,tracks); Handle<BeamSpot> beamSpotHandle; evt.getByLabel(beamSpot_, beamSpotHandle); Handle<VertexCollection> primaryVertices; // Collection of primary Vertices evt.getByLabel(primaryVertices_, primaryVertices); auto_ptr<vector<pat::GenericParticle> > tkColl( new vector<pat::GenericParticle> (*tracks) ); for (unsigned int i = 0; i< tkColl->size();++i){ pat::GenericParticle & tk = (*tkColl)[i]; vector<double> iso = isolation(tk,ptThreshold_, etEcalThreshold_, etHcalThreshold_ ,dRVetoTrk_, dRTrk_, dREcal_ , dRHcal_, alpha_, beta_); tk.setIsolation(pat::User1Iso, iso[0]); // cout << "track User1Iso " << iso[0] << endl; tk.setIsolation(pat::User2Iso, iso[1]); //cout << "track User2Iso " << iso[1] << endl; tk.setIsolation(pat::User3Iso, iso[2]); //cout << "track User3Iso " << iso[2] << endl; tk.setIsolation(pat::User4Iso, iso[3]); //cout << "track User4Iso " << iso[3] << endl; tk.setIsolation(pat::User5Iso, iso[4]); //cout << "track User5Iso " << iso[4] << endl; float zDaudxyFromBS = -1 ; float zDaudzFromBS = -1; float zDaudxyFromPV = -1; float zDaudzFromPV = -1; float zDauNofMuChambers = -1; float zDauNofMuMatches = -1; float zDauChi2 = -1; float zDauTrkChi2 = -1; float zDauSaChi2 = -1; float zDauNofMuonHits =- 1; float zDauNofStripHits = -1; float zDauNofPixelHits = -1; float zDauMuEnergyEm = -1; float zDauMuEnergyHad = -1; TrackRef muTrkRef = tk.track(); if (muTrkRef.isNonnull()){ zDaudxyFromBS = muTrkRef->dxy(beamSpotHandle->position()); zDaudzFromBS = muTrkRef->dz(beamSpotHandle->position()); zDaudxyFromPV = muTrkRef->dxy(primaryVertices->begin()->position() ); zDaudzFromPV = muTrkRef->dz(primaryVertices->begin()->position() ); zDauChi2 = muTrkRef->normalizedChi2(); zDauTrkChi2 = muTrkRef->normalizedChi2(); zDauNofStripHits = muTrkRef->hitPattern().numberOfValidStripHits(); zDauNofPixelHits = muTrkRef->hitPattern().numberOfValidPixelHits(); } tk.addUserFloat("zDau_dxyFromBS", zDaudxyFromBS); tk.addUserFloat("zDau_dzFromBS", zDaudzFromBS); tk.addUserFloat("zDau_dxyFromPV", zDaudxyFromPV); tk.addUserFloat("zDau_dzFromPV", zDaudzFromPV); tk.addUserFloat("zDau_NofMuonHits" , zDauNofMuonHits ); tk.addUserFloat("zDau_TrkNofStripHits" , zDauNofStripHits ); tk.addUserFloat("zDau_TrkNofPixelHits" , zDauNofPixelHits ); tk.addUserFloat("zDau_NofMuChambers", zDauNofMuChambers); tk.addUserFloat("zDau_NofMuMatches", zDauNofMuMatches); tk.addUserFloat("zDau_Chi2", zDauChi2); tk.addUserFloat("zDau_TrkChi2", zDauTrkChi2); tk.addUserFloat("zDau_SaChi2", zDauSaChi2); tk.addUserFloat("zDau_MuEnergyEm", zDauMuEnergyEm); tk.addUserFloat("zDau_MuEnergyHad", zDauMuEnergyHad); } evt.put( tkColl); }
double ZMuMuTrackUserData::alpha_ [private] |
Definition at line 35 of file ZMuMuTrackUserData.cc.
Referenced by produce().
InputTag ZMuMuTrackUserData::beamSpot_ [private] |
Definition at line 33 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::beta_ [private] |
Definition at line 35 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::dREcal_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::dRHcal_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::dRTrk_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::dRVetoTrk_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::etEcalThreshold_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::etHcalThreshold_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
InputTag ZMuMuTrackUserData::primaryVertices_ [private] |
Definition at line 33 of file ZMuMuTrackUserData.cc.
Referenced by produce().
double ZMuMuTrackUserData::ptThreshold_ [private] |
Definition at line 34 of file ZMuMuTrackUserData.cc.
Referenced by produce().
InputTag ZMuMuTrackUserData::src_ [private] |
Definition at line 33 of file ZMuMuTrackUserData.cc.
Referenced by produce().