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")),
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) {
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";
Log< level::Info, true > LogVerbatim
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > theMFToken_
const_iterator begin() const
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 GeomDet * idToDet(DetId) const override
std::vector< int > pdgId_
GlobalPoint position() const
std::vector< const TrackingParticle * > container
CosmicTrackingParticleSelector(const edm::ParameterSet &cfg, edm::ConsumesCollector &&iC)
GlobalVector momentum() const
FTS const & trackStateAtPCA() const
bool getData(T &iHolder) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssoc
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
const Plane & surface() const
The nominal surface of the GeomDet.
edm::ESGetToken< GlobalTrackingGeometry, GlobalTrackingGeometryRecord > globalTrackingGeomToken_
TrackingParticleCollection collection
CosmicTrackingParticleSelector()
container::const_iterator const_iterator
const_iterator end() const
edm::Ref< edm::PSimHitContainer > TrackPSimHitRef
void initEvent(edm::Handle< SimHitTPAssociationProducer::SimHitTPAssociationList > simHitsTPAssocToSet) const
bool operator()(const TrackingParticleRef tpr, const reco::BeamSpot *bs, const edm::Event &iEvent, const edm::EventSetup &iSetup) const
std::vector< TrackingParticle > TrackingParticleCollection
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