CMS 3D CMS Logo

muonisolation::PixelTrackExtractor Class Reference

#include <RecoMuon/MuonIsolation/plugins/PixelTrackExtractor.h>

Inheritance diagram for muonisolation::PixelTrackExtractor:

reco::isodeposit::IsoDepositExtractor

List of all members.

Public Member Functions

virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &muon) const
 make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &track)
 fill vetoes: to exclude deposits at IsoDeposit creation stage check concrete extractors if it's no-op !
 PixelTrackExtractor (const edm::ParameterSet &par)
 PixelTrackExtractor ()
virtual reco::IsoDeposit::Vetos vetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
virtual ~PixelTrackExtractor ()

Private Member Functions

reco::isodeposit::Direction directionAtPresetRadius (const reco::Track &tk, double bz) const
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.
double theDR_VetoPt
 .. it is above this threshold
uint theNHits_Min
 BeamSpot name.
bool thePropagateTracksToRadius
 min track pt to include into iso deposit
double thePt_Min
 ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.
double thePtVeto_Min
 will veto leading track if
double theReferenceRadius
 If set to true will compare track eta-phi at ...
edm::InputTag theTrackCollectionTag
bool theVetoLeadingTrack
 ... this radius


Detailed Description

Definition at line 15 of file PixelTrackExtractor.h.


Constructor & Destructor Documentation

muonisolation::PixelTrackExtractor::PixelTrackExtractor (  )  [inline]

Definition at line 19 of file PixelTrackExtractor.h.

00019 {};

PixelTrackExtractor::PixelTrackExtractor ( const edm::ParameterSet par  ) 

Definition at line 24 of file PixelTrackExtractor.cc.

00024                                                                   :
00025   theTrackCollectionTag(par.getParameter<edm::InputTag>("inputTrackCollection")),
00026   theDepositLabel(par.getUntrackedParameter<string>("DepositLabel")),
00027   theDiff_r(par.getParameter<double>("Diff_r")),
00028   theDiff_z(par.getParameter<double>("Diff_z")),
00029   theDR_Max(par.getParameter<double>("DR_Max")),
00030   theDR_Veto(par.getParameter<double>("DR_Veto")),
00031   theBeamlineOption(par.getParameter<string>("BeamlineOption")),
00032   theBeamSpotLabel(par.getParameter<edm::InputTag>("BeamSpotLabel")),
00033   theNHits_Min(par.getParameter<uint>("NHits_Min")),
00034   theChi2Ndof_Max(par.getParameter<double>("Chi2Ndof_Max")),
00035   theChi2Prob_Min(par.getParameter<double>("Chi2Prob_Min")),
00036   thePt_Min(par.getParameter<double>("Pt_Min")),
00037   thePropagateTracksToRadius(par.getParameter<bool>("PropagateTracksToRadius")),
00038   theReferenceRadius(par.getParameter<double>("ReferenceRadius")),
00039   theVetoLeadingTrack(par.getParameter<bool>("VetoLeadingTrack")), 
00040   thePtVeto_Min(par.getParameter<double>("PtVeto_Min")),           
00041   theDR_VetoPt(par.getParameter<double>("DR_VetoPt"))              
00042 {
00043 }

virtual muonisolation::PixelTrackExtractor::~PixelTrackExtractor (  )  [inline, virtual]

Definition at line 22 of file PixelTrackExtractor.h.

00022 {}


Member Function Documentation

IsoDeposit PixelTrackExtractor::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 76 of file PixelTrackExtractor.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), deltaR(), directionAtPresetRadius(), lat::endl(), reco::TrackBase::eta(), edm::EventSetup::get(), edm::Handle< T >::isValid(), LogTrace, pars, reco::TrackBase::phi(), reco::TrackBase::pt(), reco::IsoDeposit::setVeto(), theBeamlineOption, theBeamSpotLabel, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theDR_VetoPt, theNHits_Min, thePt_Min, thePtVeto_Min, theTrackCollectionTag, theVetoLeadingTrack, veto(), and reco::TrackBase::vz().

00077 {
00078   static std::string metname = "MuonIsolation|PixelTrackExtractor";
00079 
00080   edm::ESHandle<MagneticField> bField;
00081   eventSetup.get<IdealMagneticFieldRecord>().get(bField);
00082   double bz = bField->inInverseGeV(GlobalPoint(0.,0.,0.)).z();
00083 
00084   Direction muonDir(directionAtPresetRadius(muon, bz));
00085   IsoDeposit deposit(muonDir );
00087   deposit.setVeto( veto(muonDir) );
00088 
00089   deposit.addCandEnergy(muon.pt());
00090 
00091   Handle<View<Track> > tracksH;
00092   event.getByLabel(theTrackCollectionTag, tracksH);
00093   //  const TrackCollection tracks = *(tracksH.product());
00094   LogTrace(metname)<<"***** TRACK COLLECTION SIZE: "<<tracksH->size();
00095 
00096   double vtx_z = muon.vz();
00097   LogTrace(metname)<<"***** Muon vz: "<<vtx_z;
00098   reco::TrackBase::Point beamPoint(0,0, 0);
00099 
00100   if (theBeamlineOption.compare("BeamSpotFromEvent") == 0){
00101     //pick beamSpot
00102     reco::BeamSpot beamSpot;
00103     edm::Handle<reco::BeamSpot> beamSpotH;
00104 
00105     event.getByLabel(theBeamSpotLabel,beamSpotH);
00106 
00107     if (beamSpotH.isValid()){
00108       beamPoint = beamSpotH->position();
00109       LogTrace(metname)<<"Extracted beam point at "<<beamPoint<<std::endl;
00110     }
00111   }
00112 
00113   LogTrace(metname)<<"Using beam point at "<<beamPoint<<std::endl;
00114 
00115   TrackSelector::Parameters pars(TrackSelector::Range(vtx_z-theDiff_z, vtx_z+theDiff_z),
00116                                  theDiff_r, muonDir, theDR_Max, beamPoint);
00117 
00118   pars.nHitsMin = theNHits_Min;
00119   pars.chi2NdofMax = theChi2Ndof_Max;
00120   pars.chi2ProbMin = theChi2Prob_Min;
00121   pars.ptMin = thePt_Min;
00122 
00123   TrackSelector selection(pars);
00124   TrackSelector::result_type sel_tracks = selection(*tracksH);
00125   LogTrace(metname)<<"all tracks: "<<tracksH->size()<<" selected: "<<sel_tracks.size();
00126 
00127   
00128   double maxPt = -1;
00129   Direction maxPtDir;
00130   TrackSelector::result_type::const_iterator tkI = sel_tracks.begin();
00131   for (; tkI != sel_tracks.end(); ++tkI) {
00132     const reco::Track* tk = *tkI;
00133     LogTrace(metname) << "This track has: pt= " << tk->pt() << ", eta= " 
00134         << tk->eta() <<", phi= "<<tk->phi();
00135     Direction dirTrk(directionAtPresetRadius(*tk, bz));
00136     deposit.addDeposit(dirTrk, tk->pt());
00137     double tkDr = (muonDir-dirTrk).deltaR;
00138     double tkPt = tk->pt();
00139     if (theVetoLeadingTrack && tkPt > thePtVeto_Min 
00140         && tkDr < theDR_VetoPt  
00141         && maxPt < tkPt ){
00142       maxPt = tkPt;
00143       maxPtDir = dirTrk;
00144     }
00145   }
00146   if (maxPt > 0){
00147     deposit.setVeto(veto(maxPtDir));
00148     LogTrace(metname)<<" Set track veto the leading track with pt "
00149                      <<maxPt<<" in direction  (eta,phi) "
00150                      <<maxPtDir.eta()<<", "<<maxPtDir.phi();
00151   }
00152 
00153   return deposit;
00154 }

Direction PixelTrackExtractor::directionAtPresetRadius ( const reco::Track tk,
double  bz 
) const [private]

Definition at line 60 of file PixelTrackExtractor.cc.

References reco::TrackBase::charge(), dPhi(), reco::TrackBase::dxy(), reco::TrackBase::eta(), reco::TrackBase::phi(), reco::TrackBase::pt(), funct::sqrt(), thePropagateTracksToRadius, and theReferenceRadius.

Referenced by deposit().

00060                                                                                        {
00061   if (! thePropagateTracksToRadius ){
00062     return Direction(tk.eta(), tk.phi());
00063   }
00064 
00065   // this should represent a cylinder in global frame at R=refRadius cm, roughly where mid-layer of pixels is
00066   double psRadius = theReferenceRadius;
00067   double tkDxy = tk.dxy();
00068   double s2D = fabs(tk.dxy()) < psRadius ? sqrt(psRadius*psRadius - tkDxy*tkDxy) : 0;
00069 
00070   // the field we get from the caller is already in units of GeV/cm
00071   double dPhi = -s2D*tk.charge()*bz/tk.pt();
00072 
00073   return Direction(tk.eta(), tk.phi()+dPhi);
00074 }

virtual void muonisolation::PixelTrackExtractor::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 PixelTrackExtractor.h.

00025                                                                         {}

reco::IsoDeposit::Veto muonisolation::PixelTrackExtractor::veto ( const reco::IsoDeposit::Direction dir  )  const [private]

Referenced by deposit(), and vetos().

reco::IsoDeposit::Vetos PixelTrackExtractor::vetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const [virtual]

Definition at line 45 of file PixelTrackExtractor.cc.

References dir, reco::TrackBase::eta(), reco::TrackBase::phi(), and veto().

00047 {
00048   Direction dir(track.eta(),track.phi());
00049   return reco::IsoDeposit::Vetos(1,veto(dir));
00050 }


Member Data Documentation

std::string muonisolation::PixelTrackExtractor::theBeamlineOption [private]

Veto cone angle.

Definition at line 45 of file PixelTrackExtractor.h.

Referenced by deposit().

edm::InputTag muonisolation::PixelTrackExtractor::theBeamSpotLabel [private]

"NONE", "BeamSpotFromEvent"

Definition at line 46 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theChi2Ndof_Max [private]

trk.numberOfValidHits >= theNHits_Min

Definition at line 48 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theChi2Prob_Min [private]

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 49 of file PixelTrackExtractor.h.

Referenced by deposit().

std::string muonisolation::PixelTrackExtractor::theDepositLabel [private]

Track Collection Label.

Definition at line 40 of file PixelTrackExtractor.h.

double muonisolation::PixelTrackExtractor::theDiff_r [private]

name for deposit

Definition at line 41 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDiff_z [private]

transverse distance to vertex

Definition at line 42 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDR_Max [private]

z distance to vertex

Definition at line 43 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theDR_Veto [private]

Maximum cone angle for deposits.

Definition at line 44 of file PixelTrackExtractor.h.

double muonisolation::PixelTrackExtractor::theDR_VetoPt [private]

.. it is above this threshold

Definition at line 57 of file PixelTrackExtractor.h.

Referenced by deposit().

uint muonisolation::PixelTrackExtractor::theNHits_Min [private]

BeamSpot name.

Definition at line 47 of file PixelTrackExtractor.h.

Referenced by deposit().

bool muonisolation::PixelTrackExtractor::thePropagateTracksToRadius [private]

min track pt to include into iso deposit

Definition at line 52 of file PixelTrackExtractor.h.

Referenced by directionAtPresetRadius().

double muonisolation::PixelTrackExtractor::thePt_Min [private]

ChiSquaredProbability(trk.chi2,trk.ndof) > theChi2Prob_Min.

Definition at line 50 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::thePtVeto_Min [private]

will veto leading track if

Definition at line 56 of file PixelTrackExtractor.h.

Referenced by deposit().

double muonisolation::PixelTrackExtractor::theReferenceRadius [private]

If set to true will compare track eta-phi at ...

Definition at line 53 of file PixelTrackExtractor.h.

Referenced by directionAtPresetRadius().

edm::InputTag muonisolation::PixelTrackExtractor::theTrackCollectionTag [private]

Definition at line 39 of file PixelTrackExtractor.h.

Referenced by deposit().

bool muonisolation::PixelTrackExtractor::theVetoLeadingTrack [private]

... this radius

Definition at line 55 of file PixelTrackExtractor.h.

Referenced by deposit().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:14 2009 for CMSSW by  doxygen 1.5.4