Definition at line 129 of file HGCalTrackCollectionProducer.cc.
References funct::abs(), bField_, debug_, DEFINE_FWK_MODULE, diskInnerRadius_, diskOuterRadius_, SoftLeptonByDistance_cfi::distance, DPtovPtCut_, runEdmFileComparison::found, edm::Event::getByToken(), TrajectoryStateOnSurface::globalPosition(), PFTrackAlgoTools::goodPtResolution(), mps_fire::i, TrajectoryStateOnSurface::isValid(), LogDebug, mat_prop_, minusSurface_, eostools::move(), NHitCut_, trajectoryStateTransform::outerStateOnSurface(), PV3DBase< T, PVType, FrameType >::perp(), plusSurface_, edm::ESHandle< T >::product(), EnergyCorrector::pt, edm::Event::put(), mathSSE::sqrt(), src_, tkGeom_, HiIsolationCommonParameters_cff::track, l1t::tracks, useIterTracking_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
133 const auto&
tracks = *trackHandle;
135 auto outputInHGCal = std::make_unique<reco::PFRecTrackCollection>();
136 auto outputNotInHGCal = std::make_unique<reco::PFRecTrackCollection>();
138 for (
unsigned int i = 0 ;
i <
tracks.size() ;
i++) {
141 LogDebug(
"HGCalTrackCollectionProducer") <<
"HGCalTrackCollectionProducer Track number " <<
i <<
" has a goodPtResolution result of " << isGood << std::endl;
142 if (!isGood)
continue;
147 for(
auto det = detbegin; det != detend; ++det ) {
148 LogDebug(
"HGCalTrackCollectionProducer") <<
"at HGC detector: " <<
std::distance(detbegin,det) << std::endl;
149 unsigned layer_count = 1;
150 for(
const auto& layer : *det ) {
151 LogDebug(
"HGCalTrackCollectionProducer") <<
" at DET layer: " << layer_count++ << std::endl;
153 if( piStateAtSurface.
isValid() ) {
154 LogDebug(
"HGCalTrackCollectionProducer") <<
"Extrapolation is valid!" << std::endl;
158 LogDebug(
"HGCalTrackCollectionProducer") <<
"(x,y,z,r)=(" << pt.
x() <<
", " << pt.
y() <<
", " << pt.
z() <<
", " <<
sqrt(pt.
x()*pt.
x() + pt.
y()*pt.
y()) <<
")" << std::endl;
159 if (
std::abs(
track->trackRef()->eta()) < 1.47)
LogDebug(
"HGCalTrackCollectionProducer") <<
" ETA IN BARREL REGION: " <<
track->trackRef()->eta()
160 <<
" (PT: " <<
track->trackRef()->pt() <<
")" << std::endl;
163 LogDebug(
"HGCalTrackCollectionProducer") <<
" but r=" << pt.
perp() <<
" < diskInnerRadius=" <<
diskInnerRadius_ <<
" so skipping " << std::endl;
166 LogDebug(
"HGCalTrackCollectionProducer") <<
" but r=" << pt.
perp() <<
" > diskOuterRadius=" <<
diskOuterRadius_ <<
" so skipping " << std::endl;
169 LogDebug(
"HGCalTrackCollectionProducer") <<
"Extrapolation is NOT valid!" << std::endl;
174 LogDebug(
"HGCalTrackCollectionProducer") <<
" Track going to outputInHGCal pt eta " <<
track->trackRef()->pt() <<
" " <<
track->trackRef()->eta() << std::endl;
175 outputInHGCal->push_back(*
track);
177 outputNotInHGCal->push_back(*
track);
182 evt.
put(
std::move(outputNotInHGCal),
"TracksNotInHGCal");
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::array< std::vector< ReferenceCountingPointer< BoundDisk > >, 1 > minusSurface_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
GlobalPoint globalPosition() const
const std::vector< unsigned > NHitCut_
edm::EDGetTokenT< edm::View< reco::PFRecTrack > > src_
std::array< std::vector< ReferenceCountingPointer< BoundDisk > >, 1 > plusSurface_
std::unique_ptr< PropagatorWithMaterial > mat_prop_
Abs< T >::type abs(const T &t)
const bool useIterTracking_
edm::ESHandle< MagneticField > bField_
const std::vector< double > DPtovPtCut_
edm::ESHandle< TrackerGeometry > tkGeom_
T const * product() const