42 #include<unordered_map> 77 debug_(iConfig.getParameter<bool>(
"debug")),
78 DPtovPtCut_(iConfig.getParameter<
std::vector<double> >(
"DPtOverPtCuts_byTrackAlgo")),
79 NHitCut_(iConfig.getParameter<
std::vector<unsigned> >(
"NHitCuts_byTrackAlgo")),
83 LogDebug(
"HGCalTrackCollectionProducer") <<
" HGCalTrackCollectionProducer::HGCalTrackCollectionProducer " << std::endl;
88 produces<reco::PFRecTrackCollection>(
"TracksInHGCal");
89 produces<reco::PFRecTrackCollection>(
"TracksNotInHGCal");
113 std::map<float,float> zrhoCoord;
114 std::map<float,float> innerRadiusCoord;
116 const auto& firstLayerIt = theTrForms.back();
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");
const double Z[kNumberCalorimeter]
T getParameter(std::string const &) const
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
#define DEFINE_FWK_MODULE(type)
GlobalPoint globalPosition() const
const std::vector< unsigned > NHitCut_
std::array< std::string, 1 > hgc_names_
edm::EDGetTokenT< edm::View< reco::PFRecTrack > > src_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::array< std::vector< ReferenceCountingPointer< BoundDisk > >, 1 > plusSurface_
std::vector< HGCalParameters::hgtrform > getTrForms() const
std::unique_ptr< PropagatorWithMaterial > mat_prop_
Abs< T >::type abs(const T &t)
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
const bool useIterTracking_
edm::ESHandle< MagneticField > bField_
HGCalTrackCollectionProducer(const edm::ParameterSet &)
ParameterSet const & getParameterSet(std::string const &) const
const std::vector< double > DPtovPtCut_
std::array< edm::ESHandle< HGCalGeometry >, 1 > hgcGeometries_
edm::ESHandle< TrackerGeometry > tkGeom_
T const * product() const
void produce(edm::Event &, const edm::EventSetup &) override