37 #include <unordered_map> 65 std::array<edm::ESGetToken<HGCalGeometry, IdealGeometryRecord>, 1>
68 std::array<std::vector<ReferenceCountingPointer<BoundDisk>>, 1>
plusSurface_,
80 desc.add<
bool>(
"useIterativeTracking",
true);
81 desc.add<std::vector<double>>(
"DPtOverPtCuts_byTrackAlgo", {10.0, 10.0, 10.0, 10.0, 10.0, 5.0});
82 desc.add<std::vector<uint32_t>>(
"NHitCuts_byTrackAlgo", {3, 3, 3, 3, 3, 3});
86 descriptions.
add(
"hgcalTrackCollection",
desc);
92 DPtovPtCut_(iConfig.getParameter<
std::
vector<double>>(
"DPtOverPtCuts_byTrackAlgo")),
93 NHitCut_(iConfig.getParameter<
std::
vector<unsigned>>(
"NHitCuts_byTrackAlgo")),
94 useIterTracking_(iConfig.getParameter<
bool>(
"useIterativeTracking")),
97 LogDebug(
"HGCalTrackCollectionProducer")
98 <<
" HGCalTrackCollectionProducer::HGCalTrackCollectionProducer " << std::endl;
106 produces<reco::PFRecTrackCollection>(
"TracksInHGCal");
107 produces<reco::PFRecTrackCollection>(
"TracksNotInHGCal");
130 std::map<float, float> zrhoCoord;
131 std::map<float, float> innerRadiusCoord;
133 const auto& firstLayerIt = theTrForms.back();
150 const auto&
tracks = *trackHandle;
152 auto outputInHGCal = std::make_unique<reco::PFRecTrackCollection>();
153 auto outputNotInHGCal = std::make_unique<reco::PFRecTrackCollection>();
155 for (
unsigned int i = 0;
i <
tracks.size();
i++) {
159 LogDebug(
"HGCalTrackCollectionProducer") <<
"HGCalTrackCollectionProducer Track number " <<
i 160 <<
" has a goodPtResolution result of " << isGood << std::endl;
168 for (
auto det = detbegin; det != detend; ++det) {
169 LogDebug(
"HGCalTrackCollectionProducer") <<
"at HGC detector: " <<
std::distance(detbegin, det) << std::endl;
170 unsigned layer_count = 1;
171 for (
const auto&
layer : *det) {
172 LogDebug(
"HGCalTrackCollectionProducer") <<
" at DET layer: " << layer_count++ << std::endl;
174 if (piStateAtSurface.
isValid()) {
175 LogDebug(
"HGCalTrackCollectionProducer") <<
"Extrapolation is valid!" << std::endl;
179 LogDebug(
"HGCalTrackCollectionProducer")
180 <<
"(x,y,z,r)=(" <<
pt.x() <<
", " <<
pt.y() <<
", " <<
pt.z() <<
", " 181 <<
sqrt(
pt.x() *
pt.x() +
pt.y() *
pt.y()) <<
")" << std::endl;
183 LogDebug(
"HGCalTrackCollectionProducer") <<
" ETA IN BARREL REGION: " <<
track->trackRef()->eta()
184 <<
" (PT: " <<
track->trackRef()->pt() <<
")" << std::endl;
187 LogDebug(
"HGCalTrackCollectionProducer")
188 <<
" but r=" <<
pt.perp() <<
" < diskInnerRadius=" <<
diskInnerRadius_ <<
" so skipping " 192 LogDebug(
"HGCalTrackCollectionProducer")
193 <<
" but r=" <<
pt.perp() <<
" > diskOuterRadius=" <<
diskOuterRadius_ <<
" so skipping " << std::endl;
196 LogDebug(
"HGCalTrackCollectionProducer") <<
"Extrapolation is NOT valid!" << std::endl;
201 LogDebug(
"HGCalTrackCollectionProducer") <<
" Track going to outputInHGCal pt eta " <<
track->trackRef()->pt()
202 <<
" " <<
track->trackRef()->eta() << std::endl;
203 outputInHGCal->push_back(*
track);
205 outputNotInHGCal->push_back(*
track);
210 evt.
put(
std::move(outputNotInHGCal),
"TracksNotInHGCal");
std::array< edm::ESGetToken< HGCalGeometry, IdealGeometryRecord >, 1 > hgcGeometryTokens_
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Quality qualityByName(std::string const &name)
TrackQuality
track quality
std::array< std::string, 1 > hgc_names_
ParameterSet const & getParameterSet(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::array< std::vector< ReferenceCountingPointer< BoundDisk > >, 1 > minusSurface_
const std::vector< unsigned > NHitCut_
edm::EDGetTokenT< edm::View< reco::PFRecTrack > > src_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
GlobalPoint globalPosition() const
std::array< const HGCalGeometry *, 1 > hgcGeometries_
const MagneticField * bField_
std::unique_ptr< PropagatorWithMaterial > mat_prop_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkerGeomToken_
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
const bool useIterTracking_
HGCalTrackCollectionProducer(const edm::ParameterSet &)
const TrackerGeometry * tkGeom_
const reco::TrackBase::TrackQuality trackQuality_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const std::vector< double > DPtovPtCut_
std::array< std::vector< ReferenceCountingPointer< BoundDisk > >, 1 > plusSurface_
std::vector< HGCalParameters::hgtrform > getTrForms() const
void produce(edm::Event &, const edm::EventSetup &) override