#include <TrackExtractor.h>
Public Member Functions | |
virtual reco::IsoDeposit | deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const |
virtual void | fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &track) |
TrackExtractor () | |
TrackExtractor (const edm::ParameterSet &par) | |
virtual reco::IsoDeposit::Vetos | vetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const |
virtual | ~TrackExtractor () |
Private Member Functions | |
reco::IsoDeposit::Veto | veto (const reco::IsoDeposit::Direction &dir) const |
Private Attributes | |
std::string | theBeamlineOption |
Veto cone angle. | |
edm::InputTag | theBeamSpotLabel |
"NONE", "BeamSpotFromEvent" | |
double | theChi2Ndof_Max |
trk.numberOfValidHits >= theNHits_Min | |
double | theChi2Prob_Min |
trk.normalizedChi2 < theChi2Ndof_Max | |
std::string | theDepositLabel |
Track Collection Label. | |
double | theDiff_r |
name for deposit | |
double | theDiff_z |
transverse distance to vertex | |
double | theDR_Max |
z distance to vertex | |
double | theDR_Veto |
Maximum cone angle for deposits. | |
unsigned int | theNHits_Min |
BeamSpot name. | |
double | thePt_Min |
ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min. | |
edm::InputTag | theTrackCollectionTag |
Definition at line 15 of file TrackExtractor.h.
muonisolation::TrackExtractor::TrackExtractor | ( | ) | [inline] |
Definition at line 19 of file TrackExtractor.h.
{};
TrackExtractor::TrackExtractor | ( | const edm::ParameterSet & | par | ) |
Definition at line 19 of file TrackExtractor.cc.
: theTrackCollectionTag(par.getParameter<edm::InputTag>("inputTrackCollection")), theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")), theDiff_r(par.getParameter<double>("Diff_r")), theDiff_z(par.getParameter<double>("Diff_z")), theDR_Max(par.getParameter<double>("DR_Max")), theDR_Veto(par.getParameter<double>("DR_Veto")), theBeamlineOption(par.getParameter<string>("BeamlineOption")), theBeamSpotLabel(par.getParameter<edm::InputTag>("BeamSpotLabel")), theNHits_Min(par.getParameter<unsigned int>("NHits_Min")), theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")), theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")), thePt_Min(par.getParameter<double>("Pt_Min")) { }
virtual muonisolation::TrackExtractor::~TrackExtractor | ( | ) | [inline, virtual] |
Definition at line 22 of file TrackExtractor.h.
{}
IsoDeposit TrackExtractor::deposit | ( | const edm::Event & | ev, |
const edm::EventSetup & | evSetup, | ||
const reco::Track & | track | ||
) | const [virtual] |
make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations
Implements reco::isodeposit::IsoDepositExtractor.
Definition at line 50 of file TrackExtractor.cc.
References reco::TrackBase::eta(), edm::HandleBase::isValid(), LogTrace, metname, reco::TrackBase::phi(), reco::TrackBase::pt(), elec_selection::selection(), theBeamlineOption, theBeamSpotLabel, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theNHits_Min, thePt_Min, theTrackCollectionTag, veto(), and reco::TrackBase::vz().
{ static std::string metname = "MuonIsolation|TrackExtractor"; reco::isodeposit::Direction muonDir(muon.eta(), muon.phi()); IsoDeposit deposit(muonDir ); deposit.setVeto( veto(muonDir) ); deposit.addCandEnergy(muon.pt()); Handle<View<Track> > tracksH; event.getByLabel(theTrackCollectionTag, tracksH); // const TrackCollection tracks = *(tracksH.product()); LogTrace(metname)<<"***** TRACK COLLECTION SIZE: "<<tracksH->size(); double vtx_z = muon.vz(); LogTrace(metname)<<"***** Muon vz: "<<vtx_z; reco::TrackBase::Point beamPoint(0,0, 0); if (theBeamlineOption.compare("BeamSpotFromEvent") == 0){ //pick beamSpot reco::BeamSpot beamSpot; edm::Handle<reco::BeamSpot> beamSpotH; event.getByLabel(theBeamSpotLabel,beamSpotH); if (beamSpotH.isValid()){ beamPoint = beamSpotH->position(); LogTrace(metname)<<"Extracted beam point at "<<beamPoint<<std::endl; } } LogTrace(metname)<<"Using beam point at "<<beamPoint<<std::endl; TrackSelector::Parameters pars(TrackSelector::Range(vtx_z-theDiff_z, vtx_z+theDiff_z), theDiff_r, muonDir, theDR_Max, beamPoint); pars.nHitsMin = theNHits_Min; pars.chi2NdofMax = theChi2Ndof_Max; pars.chi2ProbMin = theChi2Prob_Min; pars.ptMin = thePt_Min; TrackSelector selection(pars); TrackSelector::result_type sel_tracks = selection(*tracksH); LogTrace(metname)<<"all tracks: "<<tracksH->size()<<" selected: "<<sel_tracks.size(); TrackSelector::result_type::const_iterator tkI = sel_tracks.begin(); for (; tkI != sel_tracks.end(); ++tkI) { const reco::Track* tk = *tkI; LogTrace(metname) << "This track has: pt= " << tk->pt() << ", eta= " << tk->eta() <<", phi= "<<tk->phi(); reco::isodeposit::Direction dirTrk(tk->eta(), tk->phi()); deposit.addDeposit(dirTrk, tk->pt()); } return deposit; }
virtual void muonisolation::TrackExtractor::fillVetos | ( | const edm::Event & | ev, |
const edm::EventSetup & | evSetup, | ||
const reco::TrackCollection & | tracks | ||
) | [inline, virtual] |
fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !
Implements reco::isodeposit::IsoDepositExtractor.
Definition at line 24 of file TrackExtractor.h.
{}
reco::IsoDeposit::Veto TrackExtractor::veto | ( | const reco::IsoDeposit::Direction & | dir | ) | const [private] |
Definition at line 42 of file TrackExtractor.cc.
References dir, reco::IsoDeposit::Veto::dR, query::result, theDR_Veto, and reco::IsoDeposit::Veto::vetoDir.
Referenced by deposit(), and vetos().
{ reco::IsoDeposit::Veto result; result.vetoDir = dir; result.dR = theDR_Veto; return result; }
reco::IsoDeposit::Vetos TrackExtractor::vetos | ( | const edm::Event & | ev, |
const edm::EventSetup & | evSetup, | ||
const reco::Track & | track | ||
) | const [virtual] |
Definition at line 35 of file TrackExtractor.cc.
References dir, reco::TrackBase::eta(), reco::TrackBase::phi(), and veto().
{ reco::isodeposit::Direction dir(track.eta(),track.phi()); return reco::IsoDeposit::Vetos(1,veto(dir)); }
std::string muonisolation::TrackExtractor::theBeamlineOption [private] |
"NONE", "BeamSpotFromEvent"
Definition at line 44 of file TrackExtractor.h.
Referenced by deposit().
double muonisolation::TrackExtractor::theChi2Ndof_Max [private] |
trk.numberOfValidHits >= theNHits_Min
Definition at line 46 of file TrackExtractor.h.
Referenced by deposit().
double muonisolation::TrackExtractor::theChi2Prob_Min [private] |
trk.normalizedChi2 < theChi2Ndof_Max
Definition at line 47 of file TrackExtractor.h.
Referenced by deposit().
std::string muonisolation::TrackExtractor::theDepositLabel [private] |
Track Collection Label.
Definition at line 38 of file TrackExtractor.h.
double muonisolation::TrackExtractor::theDiff_r [private] |
double muonisolation::TrackExtractor::theDiff_z [private] |
transverse distance to vertex
Definition at line 40 of file TrackExtractor.h.
Referenced by deposit().
double muonisolation::TrackExtractor::theDR_Max [private] |
double muonisolation::TrackExtractor::theDR_Veto [private] |
Maximum cone angle for deposits.
Definition at line 42 of file TrackExtractor.h.
Referenced by veto().
unsigned int muonisolation::TrackExtractor::theNHits_Min [private] |
double muonisolation::TrackExtractor::thePt_Min [private] |
ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.
Definition at line 48 of file TrackExtractor.h.
Referenced by deposit().
Definition at line 37 of file TrackExtractor.h.
Referenced by deposit().