6 #include <Math/DistFunc.h>
44 produces<edm::ValueMap<float> >(
"MVAVals");
56 if (copyTrajectories_) {
88 cfg.
existsAs<int32_t>(
"max_minMissHitOutOrIn") ?
89 cfg.
getParameter<int32_t>(
"max_minMissHitOutOrIn") : 99);
91 cfg.
existsAs<
double>(
"max_lostHitFraction") ?
107 edm::LogError(
"MisConfiguration")<<
"vector of size less then 2";
111 if (cfg.
exists(
"qualityBit")) {
113 if (qualityStr !=
"") {
120 "If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
122 "You can't set the quality bit " << cfg.
getParameter<
std::string>(
"qualityBit") <<
" as it is 'undefQuality' or unknown.\n";
133 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks");
135 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras");
136 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits");
138 if (copyTrajectories_) {
139 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories");
140 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations");
151 using namespace reco;
162 vertexBeamSpot = *hBsp;
166 std::vector<Point> points;
167 std::vector<float> vterr, vzerr;
172 LogDebug(
"SelectVertex") << points.size() <<
" good pixel vertices";
193 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
194 const Track & trk = * it;
197 LogTrace(
"TrackSelection") <<
"ready to check track with pt="<< trk.
pt() ;
201 bool ok =
select(0,vertexBeamSpot, trk, points, vterr, vzerr,mvaVal);
204 LogTrace(
"TrackSelection") <<
"track with pt="<< trk.
pt() <<
" NOT selected";
209 LogTrace(
"TrackSelection") <<
"track with pt="<< trk.
pt() <<
" selected";
220 if (!points.empty()) {
242 selHits_->push_back( (*hit)->clone() );
255 selTrajs_ = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
258 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
261 if (match != hTTAss->end()) {
263 short oldKey =
static_cast<short>(trkRef.
key());
std::vector< double > chi2n_par_
T getParameter(std::string const &) const
std::vector< double > max_d0NoPV_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > max_d0_
Impact parameter absolute cuts.
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
std::vector< std::vector< double > > dz_par1_
friend struct const_iterator
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::vector< double > > d0_par1_
std::vector< std::vector< double > > d0_par2_
reco::TrackRefProd rTracks_
std::vector< bool > applyAbsCutsIfNoPV_
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
std::vector< double > max_z0NoPV_
std::vector< Track > TrackCollection
collection of Tracks
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::auto_ptr< std::vector< Trajectory > > selTrajs_
bool innerOk() const
return true if the innermost hit is valid
std::vector< uint32_t > min_3Dlayers_
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
std::vector< int32_t > vtxNumber_
vertex cuts
const math::XYZPoint & outerPosition() const
position of the outermost hit
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
std::vector< double > nSigmaZ_
edm::RefProd< std::vector< Trajectory > > rTrajectories_
const math::XYZPoint & innerPosition() const
position of the innermost hit
std::vector< bool > keepAllTracks_
std::auto_ptr< TrajTrackAssociationCollection > selTTAss_
std::vector< std::vector< double > > res_par_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
void processMVA(edm::Event &evt, const edm::EventSetup &es)
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double pt() const
track transverse momentum
std::vector< uint32_t > min_nhits_
reco::TrackExtraRefProd rTrackExtras_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
std::vector< reco::TrackRef > trackRefs_
std::vector< unsigned int > preFilter_
std::vector< double > max_eta_
std::vector< double > max_relpterr_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
std::vector< uint32_t > min_hits_bypass_
RefProd< PROD > getRefBeforePut()
void selectVertices(unsigned int tsNum, const reco::VertexCollection &vtxs, std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr)
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
edm::RefToBase< TrajectorySeed > seedRef() const
static TrackQuality qualityByName(const std::string &name)
std::vector< double > chi2n_no1Dmod_par_
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
bool outerOk() const
return true if the outermost hit is valid
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
edm::EDGetTokenT< reco::BeamSpot > beamspot_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
key_type key() const
Accessor for product key.
bool select(unsigned tsNum, const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk, const std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr, double mvaVal)
return class, or -1 if rejected
std::vector< TrackBase::TrackQuality > qualityToSet_
TrackingRecHitRefProd rHits_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
edm::EDGetTokenT< reco::VertexCollection > vertices_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
static std::string const emptyString("")
std::auto_ptr< reco::TrackCollection > selTracks_
storage
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
std::vector< double > max_z0_
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
const TrackResiduals & residuals() const
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
PropagationDirection seedDirection() const
direction of how the hits were sorted in the original seed
virtual ~AnalyticalTrackSelector()
destructor
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::vector< uint32_t > max_lostLayers_
std::vector< double > mvaVals_
std::vector< double > min_eta_
std::vector< std::vector< double > > dz_par2_
std::auto_ptr< TrackingRecHitCollection > selHits_
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
std::vector< int32_t > max_minMissHitOutOrIn_
tuple size
Write out results.
std::vector< bool > applyAdaptedPVCuts_
std::vector< int32_t > max_lostHitFraction_
bool copyTrajectories_
copy also trajectories and trajectory->track associations
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.