75 static const double positionTol = 1e-3 ;
83 std::map<const reco::SiStripElectron*, bool> alreadySeen;
84 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectrons->begin(); strippyIter != siStripElectrons->end(); ++strippyIter) {
85 alreadySeen[&(*strippyIter)] =
false;
91 LogDebug(
"SiStripElectronAssociator") <<
" About to loop over tracks " << std::endl ;
92 LogDebug(
"SiStripElectronAssociator") <<
" Number of tracks in Associator " << tracks.
product()->size() ;
93 LogDebug(
"SiStripElectronAssociator") <<
" Number of SiStripElectron Candidates " << siStripElectrons->size();
97 int countSiElFit = 0 ;
98 for (
unsigned int i = 0;
i < tracks.
product()->size();
i++) {
109 uint32_t
id = (*trackPtr->
recHitsBegin())->geographicalId().rawId();
112 LogDebug(
"SiStripElectronAssociator") <<
" New Track Candidate " <<
i
114 <<
" pos " << pos <<
"\n";
117 bool foundElectron =
false;
118 for (reco::SiStripElectronCollection::const_iterator strippyIter = siStripElectrons->begin(); strippyIter != siStripElectrons->end(); ++strippyIter) {
119 if (!alreadySeen[&(*strippyIter)]) {
121 bool hitInCommon =
false;
122 LogDebug(
"SiStripElectronAssociator") <<
" Looping over Mono hits " <<
"\n" ;
124 for (std::vector<SiStripRecHit2D>::const_iterator hitIter = strippyIter->rphiRecHits().begin(); hitIter != strippyIter->rphiRecHits().end(); ++hitIter) {
126 LogDebug(
"SiStripElectronAssociator") <<
" SiStripCand "
127 <<
" DetId " << hitIter->geographicalId().rawId()
128 <<
" localPos " << hitIter->localPosition()
129 <<
" deltasPos " << (hitIter->localPosition() -
pos).
mag() ;
131 if (hitIter->geographicalId().rawId() ==
id &&
132 (hitIter->localPosition() -
pos).
mag() < positionTol ) {
134 LogDebug(
"SiStripElectronAssociator") <<
" hitInCommon True " <<
"\n" ;
137 LogDebug(
"SiStripElectronAssociator") <<
" hitInCommon False " <<
"\n" ;
142 LogDebug(
"SiStripElectronAssociator") <<
" Looping over Stereo hits " <<
"\n" ;
144 for (std::vector<SiStripRecHit2D>::const_iterator hitIter = strippyIter->stereoRecHits().begin(); hitIter != strippyIter->stereoRecHits().end(); ++hitIter) {
146 LogDebug(
"SiStripElectronAssociator") <<
" SiStripCand "
147 <<
" DetId " << hitIter->geographicalId().rawId()
148 <<
" localPos " << hitIter->localPosition()
149 <<
" deltasPos " << (hitIter->localPosition() -
pos).
mag() ;
151 if (hitIter->geographicalId().rawId() ==
id &&
152 (hitIter->localPosition() -
pos).
mag() < positionTol) {
154 LogDebug(
"SiStripElectronAssociator") <<
" hitInCommon True " <<
"\n" ;
157 LogDebug(
"SiStripElectronAssociator") <<
" hitInCommon False " <<
"\n" ;
164 LogDebug(
"SiStripElectronAssociator") <<
" Hit in Common Found \n" ;
166 foundElectron =
true;
167 alreadySeen[&(*strippyIter)] =
true;
180 output->push_back(electron);
184 LogDebug(
"SiStripElectronAssociator") <<
"Hit in Common NOT found \n" ;
190 LogDebug(
"SiStripElectronAssociator") <<
"Done with this electron " <<
"\n\n\n";
193 LogDebug(
"SiStripElectronAssociator") <<
"Testing if foundElectron " << foundElectron << std::endl;
195 if (!foundElectron) {
197 <<
" It is possible that the trackcollection used '"
201 <<
"' --- Please check your cfg file " <<
"\n";
204 LogDebug(
"SiStripElectronAssociator") <<
"At end of track loop \n" << std::endl;
209 LogDebug(
"SiStripElectronAssociator") <<
" Number of SiStripElectrons returned with a good fit "
210 << countSiElFit <<
"\n"<< std::endl ;
double p() const
momentum vector magnitude
edm::InputTag electronsLabel_
T getParameter(std::string const &) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
edm::InputTag trackCollection_
double px() const
x coordinate of momentum vector
virtual void produce(edm::Event &, const edm::EventSetup &)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
~SiStripElectronAssociator()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::vector< Electron > ElectronCollection
collectin of Electron objects
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
double pz() const
z coordinate of momentum vector
edm::InputTag siStripElectronCollection_
double vz() const
z coordinate of the reference point on track
edm::InputTag siStripElectronProducer_
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
T const * product() const
edm::InputTag trackProducer_
double vy() const
y coordinate of the reference point on track
int charge() const
track electric charge
SiStripElectronAssociator(const edm::ParameterSet &)
void setSuperCluster(const reco::SuperClusterRef &r)
set refrence to Photon component
void setTrack(const reco::TrackRef &r)
set refrence to Track component
double py() const
y coordinate of momentum vector
double vx() const
x coordinate of the reference point on track
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.