#include <GsfElectronCoreBaseProducer.h>
Public Member Functions | |
GsfElectronCoreBaseProducer (const edm::ParameterSet &conf) | |
virtual | ~GsfElectronCoreBaseProducer () |
Static Public Member Functions | |
static void | fillDescription (edm::ParameterSetDescription &) |
Protected Member Functions | |
void | fillElectronCore (reco::GsfElectronCore *) |
void | initEvent (edm::Event &event, const edm::EventSetup &setup) |
Protected Attributes | |
edm::Handle < reco::TrackCollection > | ctfTracksH_ |
edm::Handle < reco::GsfPFRecTrackCollection > | gsfPfRecTracksH_ |
edm::Handle < reco::GsfTrackCollection > | gsfTracksH_ |
bool | useGsfPfRecTracks_ |
Private Member Functions | |
std::pair< reco::TrackRef, float > | getCtfTrackRef (const reco::GsfTrackRef &) |
Private Attributes | |
edm::InputTag | ctfTracksTag_ |
edm::InputTag | gsfPfRecTracksTag_ |
edm::InputTag | gsfTracksTag_ |
Definition at line 31 of file GsfElectronCoreBaseProducer.h.
GsfElectronCoreBaseProducer::GsfElectronCoreBaseProducer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 28 of file GsfElectronCoreBaseProducer.cc.
References edm::ParameterSet::getParameter().
{ produces<GsfElectronCoreCollection>() ; gsfPfRecTracksTag_ = config.getParameter<edm::InputTag>("gsfPfRecTracks") ; gsfTracksTag_ = config.getParameter<edm::InputTag>("gsfTracks") ; ctfTracksTag_ = config.getParameter<edm::InputTag>("ctfTracks") ; useGsfPfRecTracks_ = config.getParameter<bool>("useGsfPfRecTracks") ; }
GsfElectronCoreBaseProducer::~GsfElectronCoreBaseProducer | ( | ) | [virtual] |
Definition at line 37 of file GsfElectronCoreBaseProducer.cc.
{}
void GsfElectronCoreBaseProducer::fillDescription | ( | edm::ParameterSetDescription & | desc | ) | [static] |
Definition at line 20 of file GsfElectronCoreBaseProducer.cc.
References edm::ParameterSetDescription::add().
Referenced by GEDGsfElectronCoreProducer::fillDescriptions().
{ desc.add<edm::InputTag>("gsfPfRecTracks",edm::InputTag("pfTrackElec")) ; desc.add<edm::InputTag>("gsfTracks",edm::InputTag("electronGsfTracks")) ; desc.add<edm::InputTag>("ctfTracks",edm::InputTag("generalTracks")) ; desc.add<bool>("useGsfPfRecTracks",true) ; }
void GsfElectronCoreBaseProducer::fillElectronCore | ( | reco::GsfElectronCore * | eleCore | ) | [protected] |
Definition at line 54 of file GsfElectronCoreBaseProducer.cc.
References reco::GsfElectronCore::gsfTrack(), and reco::GsfElectronCore::setCtfTrack().
Referenced by GsfElectronCoreEcalDrivenProducer::produceEcalDrivenCore(), GEDGsfElectronCoreProducer::produceElectronCore(), and GsfElectronCoreProducer::produceTrackerDrivenCore().
{ const GsfTrackRef & gsfTrackRef = eleCore->gsfTrack() ; std::pair<TrackRef,float> ctfpair = getCtfTrackRef(gsfTrackRef) ; eleCore->setCtfTrack(ctfpair.first,ctfpair.second) ; }
std::pair< TrackRef, float > GsfElectronCoreBaseProducer::getCtfTrackRef | ( | const reco::GsfTrackRef & | gsfTrackRef | ) | [private] |
Definition at line 68 of file GsfElectronCoreBaseProducer.cc.
References abs, TrackingRecHit::all, dPhi(), reco::HitPattern::getHitPattern(), min, pi, reco::HitPattern::pixelHitFilter(), mathSSE::sqrt(), reco::HitPattern::stripTIBHitFilter(), and reco::HitPattern::stripTIDHitFilter().
{ float maxFracShared = 0; TrackRef ctfTrackRef = TrackRef() ; const TrackCollection * ctfTrackCollection = ctfTracksH_.product() ; // get the Hit Pattern for the gsfTrack const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern(); unsigned int counter ; TrackCollection::const_iterator ctfTkIter ; for ( ctfTkIter = ctfTrackCollection->begin() , counter = 0 ; ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ ) { double dEta = gsfTrackRef->eta() - ctfTkIter->eta(); double dPhi = gsfTrackRef->phi() - ctfTkIter->phi(); double pi = acos(-1.); if(std::abs(dPhi) > pi) dPhi = 2*pi - std::abs(dPhi); // dont want to look at every single track in the event! if(sqrt(dEta*dEta + dPhi*dPhi) > 0.3) continue; unsigned int shared = 0 ; int gsfHitCounter = 0 ; int numGsfInnerHits = 0 ; int numCtfInnerHits = 0 ; // get the CTF Track Hit Pattern const HitPattern& ctfHitPattern = ctfTkIter->hitPattern() ; trackingRecHit_iterator elHitsIt ; for ( elHitsIt = gsfTrackRef->recHitsBegin() ; elHitsIt != gsfTrackRef->recHitsEnd() ; elHitsIt++, gsfHitCounter++ ) { if(!((**elHitsIt).isValid())) //count only valid Hits { continue ; } // look only in the pixels/TIB/TID uint32_t gsfHit = gsfHitPattern.getHitPattern(gsfHitCounter) ; if (!(gsfHitPattern.pixelHitFilter(gsfHit) || gsfHitPattern.stripTIBHitFilter(gsfHit) || gsfHitPattern.stripTIDHitFilter(gsfHit) ) ) { continue ; } numGsfInnerHits++ ; int ctfHitsCounter = 0 ; numCtfInnerHits = 0 ; trackingRecHit_iterator ctfHitsIt ; for ( ctfHitsIt = ctfTkIter->recHitsBegin() ; ctfHitsIt != ctfTkIter->recHitsEnd() ; ctfHitsIt++, ctfHitsCounter++ ) { if(!((**ctfHitsIt).isValid())) //count only valid Hits! { continue ; } uint32_t ctfHit = ctfHitPattern.getHitPattern(ctfHitsCounter); if( !(ctfHitPattern.pixelHitFilter(ctfHit) || ctfHitPattern.stripTIBHitFilter(ctfHit) || ctfHitPattern.stripTIDHitFilter(ctfHit) ) ) { continue ; } numCtfInnerHits++ ; if( (**elHitsIt).sharesInput(&(**ctfHitsIt),TrackingRecHit::all) ) { shared++ ; break ; } } //ctfHits iterator } //gsfHits iterator if ((numGsfInnerHits==0)||(numCtfInnerHits==0)) { continue ; } if ( static_cast<float>(shared)/std::min(numGsfInnerHits,numCtfInnerHits) > maxFracShared ) { maxFracShared = static_cast<float>(shared)/std::min(numGsfInnerHits, numCtfInnerHits); ctfTrackRef = TrackRef(ctfTracksH_,counter); } } //ctfTrack iterator return make_pair(ctfTrackRef,maxFracShared) ; }
void GsfElectronCoreBaseProducer::initEvent | ( | edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [protected] |
Definition at line 46 of file GsfElectronCoreBaseProducer.cc.
Referenced by GEDGsfElectronCoreProducer::produce(), GsfElectronCoreProducer::produce(), and GsfElectronCoreEcalDrivenProducer::produce().
{ if (useGsfPfRecTracks_) { event.getByLabel(gsfPfRecTracksTag_,gsfPfRecTracksH_) ; } event.getByLabel(gsfTracksTag_,gsfTracksH_) ; event.getByLabel(ctfTracksTag_,ctfTracksH_) ; }
Definition at line 47 of file GsfElectronCoreBaseProducer.h.
Definition at line 56 of file GsfElectronCoreBaseProducer.h.
edm::Handle<reco::GsfPFRecTrackCollection> GsfElectronCoreBaseProducer::gsfPfRecTracksH_ [protected] |
Definition at line 45 of file GsfElectronCoreBaseProducer.h.
Referenced by GsfElectronCoreProducer::produce(), and GsfElectronCoreEcalDrivenProducer::produce().
Definition at line 54 of file GsfElectronCoreBaseProducer.h.
Definition at line 46 of file GsfElectronCoreBaseProducer.h.
Referenced by GsfElectronCoreProducer::produce(), and GsfElectronCoreEcalDrivenProducer::produce().
Definition at line 55 of file GsfElectronCoreBaseProducer.h.
bool GsfElectronCoreBaseProducer::useGsfPfRecTracks_ [protected] |
Definition at line 48 of file GsfElectronCoreBaseProducer.h.
Referenced by GsfElectronCoreProducer::produce(), and GsfElectronCoreEcalDrivenProducer::produce().