18 using namespace reco ;
25 desc.
add<
bool>(
"useGsfPfRecTracks",
true) ;
30 produces<GsfElectronCoreCollection>() ;
34 useGsfPfRecTracks_ = config.
getParameter<
bool>(
"useGsfPfRecTracks") ;
48 if (useGsfPfRecTracks_)
49 {
event.getByToken(gsfPfRecTracksTag_,gsfPfRecTracksH_) ; }
50 event.getByToken(gsfTracksTag_,gsfTracksH_) ;
51 event.getByToken(ctfTracksTag_,ctfTracksH_) ;
58 std::pair<TrackRef,float> ctfpair = getCtfTrackRef(gsfTrackRef) ;
59 eleCore->
setCtfTrack(ctfpair.first,ctfpair.second) ;
70 float maxFracShared = 0;
75 const HitPattern& gsfHitPattern = gsfTrackRef->hitPattern();
78 TrackCollection::const_iterator ctfTkIter ;
79 for ( ctfTkIter = ctfTrackCollection->begin() , counter = 0 ;
80 ctfTkIter != ctfTrackCollection->end() ; ctfTkIter++, counter++ )
83 double dEta = gsfTrackRef->eta() - ctfTkIter->eta();
84 double dPhi = gsfTrackRef->phi() - ctfTkIter->phi();
85 double pi = acos(-1.);
89 if(
sqrt(dEta*dEta + dPhi*dPhi) > 0.3)
continue;
91 unsigned int shared = 0 ;
92 int gsfHitCounter = 0 ;
93 int numGsfInnerHits = 0 ;
94 int numCtfInnerHits = 0 ;
99 for ( elHitsIt = gsfTrackRef->recHitsBegin() ;
100 elHitsIt != gsfTrackRef->recHitsEnd() ;
101 elHitsIt++, gsfHitCounter++ )
103 if(!((**elHitsIt).isValid()))
115 int ctfHitsCounter = 0 ;
116 numCtfInnerHits = 0 ;
118 for ( ctfHitsIt = ctfTkIter->recHitsBegin() ;
119 ctfHitsIt != ctfTkIter->recHitsEnd() ;
120 ctfHitsIt++, ctfHitsCounter++ )
122 if(!((**ctfHitsIt).isValid()))
143 if ((numGsfInnerHits==0)||(numCtfInnerHits==0))
146 if ( static_cast<float>(shared)/
std::min(numGsfInnerHits,numCtfInnerHits) > maxFracShared )
148 maxFracShared =
static_cast<float>(shared)/
std::min(numGsfInnerHits, numCtfInnerHits);
149 ctfTrackRef =
TrackRef(ctfTracksH_,counter);
154 return make_pair(ctfTrackRef,maxFracShared) ;
void initEvent(edm::Event &event, const edm::EventSetup &setup)
T getParameter(std::string const &) const
void setCtfTrack(const TrackRef &closestCtfTrack, float ctfGsfOverlap)
static bool pixelHitFilter(uint16_t pattern)
const GsfTrackRef & gsfTrack() const
std::vector< Track > TrackCollection
collection of Tracks
GsfElectronCoreBaseProducer(const edm::ParameterSet &conf)
virtual ~GsfElectronCoreBaseProducer()
uint16_t hitPattern[ARRAY_LENGTH]
double dPhi(double phi1, double phi2)
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::pair< reco::TrackRef, float > getCtfTrackRef(const reco::GsfTrackRef &)
static void fillDescription(edm::ParameterSetDescription &)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
static bool stripTIBHitFilter(uint16_t pattern)
static std::atomic< unsigned int > counter
uint16_t getHitPattern(HitCategory category, int position) const
static bool stripTIDHitFilter(uint16_t pattern)
void fillElectronCore(reco::GsfElectronCore *)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection