CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

egammaisolation::EgammaTrackExtractor Class Reference

#include <EgammaTrackExtractor.h>

Inheritance diagram for egammaisolation::EgammaTrackExtractor:
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
virtual reco::IsoDeposit deposit (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Candidate &muon) const
 EgammaTrackExtractor (const edm::ParameterSet &par)
 EgammaTrackExtractor ()
virtual void fillVetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::TrackCollection &track)
virtual reco::IsoDeposit::Vetos vetos (const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const
virtual ~EgammaTrackExtractor ()

Private Member Functions

reco::IsoDeposit::Veto veto (const reco::IsoDeposit::Direction &dir) const

Private Attributes

edm::InputTag barrelEcalHitsTag_
 "NONE", "BeamSpotFromEvent"
int dzOption
std::string dzOptionString
 Endcap requirements to determine if isolated for selective filling.
edm::InputTag endcapEcalHitsTag_
double minCandEt_
 name for deposit
std::vector< double > paramForIsolBarrel_
 min track pt to include into iso deposit
std::vector< double > paramForIsolEndcap_
 Barrel requirements to determine if isolated for selective filling.
std::string theBeamlineOption
 Veto cone angle.
edm::InputTag theBeamSpotLabel
double theChi2Ndof_Max
 trk.numberOfValidHits >= theNHits_Min
double theChi2Prob_Min
 trk.normalizedChi2 < theChi2Ndof_Max
std::string theDepositLabel
 Track Collection Label.
double theDiff_r
 minimum candidate et
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

Detailed Description

Definition at line 17 of file EgammaTrackExtractor.h.


Constructor & Destructor Documentation

egammaisolation::EgammaTrackExtractor::EgammaTrackExtractor ( ) [inline]

Definition at line 21 of file EgammaTrackExtractor.h.

{};
EgammaTrackExtractor::EgammaTrackExtractor ( const edm::ParameterSet par)

Definition at line 30 of file EgammaTrackExtractor.cc.

References egammaisolation::EgammaTrackSelector::bs, egammaisolation::EgammaTrackSelector::dz, dzOption, dzOptionString, egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

                                                                    :
    theTrackCollectionTag(par.getParameter<edm::InputTag>("inputTrackCollection")),
    theDepositLabel(par.getUntrackedParameter<std::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<std::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")),
    dzOptionString(par.getParameter<std::string>("dzOption"))
{
    if( ! dzOptionString.compare("dz") )      dzOption = EgammaTrackSelector::dz;
    else if( ! dzOptionString.compare("vz") ) dzOption = EgammaTrackSelector::vz;
    else if( ! dzOptionString.compare("bs") ) dzOption = EgammaTrackSelector::bs;
    else if( ! dzOptionString.compare("vtx") )dzOption = EgammaTrackSelector::vtx;
    else                                      dzOption = EgammaTrackSelector::dz;

}
virtual egammaisolation::EgammaTrackExtractor::~EgammaTrackExtractor ( ) [inline, virtual]

Definition at line 24 of file EgammaTrackExtractor.h.

{}

Member Function Documentation

virtual reco::IsoDeposit egammaisolation::EgammaTrackExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const [inline, virtual]

make single IsoDeposit based on track as input purely virtual: have to implement in concrete implementations

Implements reco::isodeposit::IsoDepositExtractor.

Definition at line 32 of file EgammaTrackExtractor.h.

Referenced by deposit().

                                                                   {
        edm::LogWarning("EgammaIsolationAlgos|EgammaTrackExtractor") 
           << "This Function is not implemented, bad IsoDeposit Returned";
        return reco::IsoDeposit( reco::isodeposit::Direction(1,1) );
      }
IsoDeposit EgammaTrackExtractor::deposit ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Candidate track 
) const [virtual]

make single IsoDeposit based on a candidate as input purely virtual: have to implement in concrete implementations

Reimplemented from reco::isodeposit::IsoDepositExtractor.

Definition at line 68 of file EgammaTrackExtractor.cc.

References reco::IsoDeposit::addCandEnergy(), reco::IsoDeposit::addDeposit(), SiPixelRawToDigiRegional_cfi::beamSpot, egammaisolation::EgammaTrackSelector::bs, ChiSquaredProbability(), reco::isodeposit::Direction::deltaR(), deposit(), egammaisolation::EgammaTrackSelector::dz, dzOption, reco::Candidate::et(), reco::Candidate::eta(), reco::GsfElectron::gsfTrack(), reco::Candidate::isElectron(), edm::HandleBase::isValid(), metname, reco::Candidate::phi(), reco::IsoDeposit::setVeto(), AlCaHLTBitMon_QueryRunRegistry::string, theBeamlineOption, theBeamSpotLabel, theChi2Ndof_Max, theChi2Prob_Min, theDiff_r, theDiff_z, theDR_Max, theNHits_Min, thePt_Min, theTrackCollectionTag, reco::Candidate::vertex(), veto(), egammaisolation::EgammaTrackSelector::vtx, and egammaisolation::EgammaTrackSelector::vz.

{
    static std::string metname = "EgammaIsolationAlgos|EgammaTrackExtractor";

    reco::isodeposit::Direction candDir;
    double dzCut=0; 

    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();  
        }
    }

    Handle<View<Track> > tracksH;
    event.getByLabel(theTrackCollectionTag, tracksH);

    if( candTk.isElectron() ){ 
        const reco::GsfElectron* elec = dynamic_cast<const reco::GsfElectron*>(&candTk);
        candDir = reco::isodeposit::Direction(elec->gsfTrack()->eta(), elec->gsfTrack()->phi());
    } else {
        candDir = reco::isodeposit::Direction(candTk.eta(), candTk.phi());
    }

    IsoDeposit deposit(candDir );
    deposit.setVeto( veto(candDir) );
    deposit.addCandEnergy(candTk.et());

    View<Track>::const_iterator itrTr = tracksH->begin();
    View<Track>::const_iterator trEnd = tracksH->end();
    for (itrTr = tracksH->begin();itrTr != trEnd; ++itrTr) {

        if(candDir.deltaR( reco::isodeposit::Direction(itrTr->eta(),itrTr->phi()) ) > theDR_Max ) 
            continue;

        if(itrTr->normalizedChi2() > theChi2Ndof_Max) 
            continue;

        if(itrTr->pt() < thePt_Min) 
            continue;

        if(theChi2Prob_Min > 0 && ChiSquaredProbability(itrTr->chi2(), itrTr->ndof()) < theChi2Prob_Min ) 
            continue;

        if(theNHits_Min > 0 && itrTr->numberOfValidHits() < theNHits_Min) 
            continue;

        if( candTk.isElectron() ){ 
            const reco::GsfElectron* elec = dynamic_cast<const reco::GsfElectron*>(&candTk);
            switch(dzOption) {
                case EgammaTrackSelector::dz : dzCut = elec->gsfTrack()->dz() - itrTr->dz() ; break;
                case EgammaTrackSelector::vz : dzCut = elec->gsfTrack()->vz() - itrTr->vz() ; break;
                case EgammaTrackSelector::bs : dzCut = elec->gsfTrack()->dz(beamPoint) - itrTr->dz(beamPoint) ; break;
                case EgammaTrackSelector::vtx: dzCut = itrTr->dz(elec->gsfTrack()->vertex()) ; break;
                default: dzCut = elec->gsfTrack()->vz() - itrTr->vz() ; break;
            }
        } else {
            switch(dzOption) {
                case EgammaTrackSelector::dz : dzCut = (*itrTr).dz() - candTk.vertex().z() ; break;
                case EgammaTrackSelector::vz : dzCut = (*itrTr).vz() - candTk.vertex().z() ; break;
                case EgammaTrackSelector::bs : dzCut = (*itrTr).dz(beamPoint) - candTk.vertex().z() ; break;
                case EgammaTrackSelector::vtx: dzCut = (*itrTr).dz(candTk.vertex()); break;
                default : dzCut = (*itrTr).vz() - candTk.vertex().z(); break;
            }
        }

        if(fabs(dzCut) > theDiff_z) 
            continue;

        if(fabs(itrTr->dxy(beamPoint) ) > theDiff_r) 
            continue;
        
        deposit.addDeposit(reco::isodeposit::Direction(itrTr->eta(), itrTr->phi()), itrTr->pt());

    }

    return deposit;
}
virtual void egammaisolation::EgammaTrackExtractor::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 26 of file EgammaTrackExtractor.h.

                                                                        {}
reco::IsoDeposit::Veto EgammaTrackExtractor::veto ( const reco::IsoDeposit::Direction dir) const [private]
reco::IsoDeposit::Vetos EgammaTrackExtractor::vetos ( const edm::Event ev,
const edm::EventSetup evSetup,
const reco::Track track 
) const [virtual]

Member Data Documentation

"NONE", "BeamSpotFromEvent"

Definition at line 54 of file EgammaTrackExtractor.h.

Definition at line 64 of file EgammaTrackExtractor.h.

Referenced by deposit(), and EgammaTrackExtractor().

Endcap requirements to determine if isolated for selective filling.

Definition at line 63 of file EgammaTrackExtractor.h.

Referenced by EgammaTrackExtractor().

Definition at line 55 of file EgammaTrackExtractor.h.

name for deposit

Definition at line 48 of file EgammaTrackExtractor.h.

min track pt to include into iso deposit

Definition at line 61 of file EgammaTrackExtractor.h.

Barrel requirements to determine if isolated for selective filling.

Definition at line 62 of file EgammaTrackExtractor.h.

Veto cone angle.

Definition at line 53 of file EgammaTrackExtractor.h.

Referenced by deposit().

Definition at line 56 of file EgammaTrackExtractor.h.

Referenced by deposit().

trk.numberOfValidHits >= theNHits_Min

Definition at line 58 of file EgammaTrackExtractor.h.

Referenced by deposit().

trk.normalizedChi2 < theChi2Ndof_Max

Definition at line 59 of file EgammaTrackExtractor.h.

Referenced by deposit().

Track Collection Label.

Definition at line 47 of file EgammaTrackExtractor.h.

minimum candidate et

Definition at line 49 of file EgammaTrackExtractor.h.

Referenced by deposit().

transverse distance to vertex

Definition at line 50 of file EgammaTrackExtractor.h.

Referenced by deposit().

z distance to vertex

Definition at line 51 of file EgammaTrackExtractor.h.

Referenced by deposit().

Maximum cone angle for deposits.

Definition at line 52 of file EgammaTrackExtractor.h.

Referenced by veto().

BeamSpot name.

Definition at line 57 of file EgammaTrackExtractor.h.

Referenced by deposit().

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

Definition at line 60 of file EgammaTrackExtractor.h.

Referenced by deposit().

Definition at line 46 of file EgammaTrackExtractor.h.

Referenced by deposit().