1 #ifndef RecoSelectors_CosmicTrackingParticleSelector_h
2 #define RecoSelectors_CosmicTrackingParticleSelector_h
42 typedef std::vector<const TrackingParticle*>
container;
54 const std::vector<int>& pdgId = std::vector<int>())
65 :
ptMin_(cfg.getParameter<double>(
"ptMin")),
68 tip_(cfg.getParameter<double>(
"tip")),
69 lip_(cfg.getParameter<double>(
"lip")),
70 minHit_(cfg.getParameter<int>(
"minHit")),
81 for (TrackingParticleCollection::const_iterator itp = c->begin(); itp != c->end(); ++itp)
122 <<
"TOT Number of PSimHits = " << tpr->numberOfHits()
123 <<
", Number of Tracker PSimHits = " << tpr->numberOfTrackerHits() <<
"\n";
126 edm::LogError(
"CosmicTrackingParticleSelector") <<
"Invalid handle!";
129 std::pair<TrackingParticleRef, TrackPSimHitRef> clusterTPpairWithDummyTP(
134 clusterTPpairWithDummyTP,
136 for (
auto ip =
range.first; ip !=
range.second; ++ip) {
139 const GeomDet* tmpDet = theGeometry->idToDet(
DetId(it->detUnitId()));
142 <<
"***WARNING: PSimHit " << ii <<
", no GeomDet for: " << it->detUnitId() <<
". Skipping it.";
145 det =
DetId(it->detUnitId()).det();
146 subdet =
DetId(it->detUnitId()).subdetId();
154 <<
"PSimHit " << ii <<
", Detector = " << det <<
", subdet = " << subdet <<
"\t Radius = " << gp.
perp()
155 <<
", z = " << gp.
z() <<
"\t pt = " << gv.
perp() <<
", pz = " << gv.
z();
157 <<
"\t trackId = " << it->trackId() <<
", particleType = " << it->particleType()
158 <<
", processType = " << it->processType();
161 if (it->processType() != 0)
173 <<
"FINAL State at InnerMost Hit: Radius = " << finalGP.
perp() <<
", z = " << finalGP.
z()
174 <<
", pt = " << finalGV.
perp() <<
", pz = " << finalGV.
z();
183 if (!tsAtClosestApproach.
isValid()) {
185 <<
"*** WARNING in CosmicTrackingParticleSelector: tsAtClosestApproach is not valid."
193 <<
"FINAL State extrapolated at PCA: Radius = " << vertex.
perp() <<
", z = " << vertex.
z()
194 <<
", pt = " << momentum.
perp() <<
", pz = " << momentum.
z() <<
"\n";
198 fabs(vertex.
z()) <=
lip_);
Log< level::Info, true > LogVerbatim
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const edm::EventSetup & c
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken_
static bool simHitTPAssociationListGreater(SimHitTPPair i, SimHitTPPair j)
void select(const edm::Handle< collection > &c, const edm::Event &event, const edm::EventSetup &setup)
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Log< level::Error, false > LogError
const Plane & surface() const
The nominal surface of the GeomDet.
std::vector< int > pdgId_
bool operator()(const TrackingParticleRef tpr, const reco::BeamSpot *bs, const edm::Event &iEvent, const edm::EventSetup &iSetup) const
const uint16_t range(const Frame &aFrame)
bool getData(T &iHolder) const
std::vector< const TrackingParticle * > container
CosmicTrackingParticleSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
const_iterator begin() const
void initEvent(edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssoc
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
GlobalPoint position() const
const_iterator end() const
T const * product() const
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globalTrackingGeomToken_
TrackingParticleCollection collection
CosmicTrackingParticleSelector()
container::const_iterator const_iterator
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
std::vector< TrackingParticle > TrackingParticleCollection
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
CosmicTrackingParticleSelector(double ptMin, double minRapidity, double maxRapidity, double tip, double lip, int minHit, bool chargedOnly, const std::vector< int > &pdgId=std::vector< int >())
edm::Ref< TrackingParticleCollection > TrackingParticleRef