4 #include <Math/DistFunc.h>
11 pt(p2p<double>(cfg,
"pt")),
12 vlayers(p2p<uint32_t>(cfg,
"validLayers")),
13 lhits(p2p<uint32_t>(cfg,
"lostHits")),
14 chi2n(p2p<double>(cfg,
"chi2n")),
15 d0(cfg.getParameter<double>(
"d0")),
16 dz(cfg.getParameter<double>(
"dz")),
17 d0Rel(cfg.getParameter<double>(
"d0Rel")),
18 dzRel(cfg.getParameter<double>(
"dzRel"))
23 src_( cfg.getParameter<edm::InputTag>(
"src" ) ),
27 vtxNumber_( cfg.getParameter<int32_t>(
"vtxNumber") ),
28 vtxTracks_( cfg.getParameter<uint32_t>(
"vtxTracks") ),
42 typedef std::vector<edm::ParameterSet> VPSet;
45 for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
52 sprintf(buff,
"set%d", static_cast<int>(
i+1));
60 for (std::vector<std::string>::const_iterator li =
labels_.begin(),
le =
labels_.end(); li !=
le; ++li) {
61 const char *
l= li->c_str();
62 produces<reco::TrackCollection>(
l).setBranchAlias( alias +
"Tracks" + l);
64 produces<reco::TrackExtraCollection>(
l).setBranchAlias( alias +
"TrackExtras" + l);
65 produces<TrackingRecHitCollection>(
l).setBranchAlias( alias +
"RecHits" + l);
67 produces< std::vector<Trajectory> >(
l).setBranchAlias( alias +
"Trajectories" + l);
68 produces< TrajTrackAssociationCollection >(
l).setBranchAlias( alias +
"TrajectoryTrackAssociations" + l);
74 selTracks_ =
new std::auto_ptr<reco::TrackCollection>[nblocks];
75 selTrackExtras_ =
new std::auto_ptr<reco::TrackExtraCollection>[nblocks];
76 selHits_ =
new std::auto_ptr<TrackingRecHitCollection>[nblocks];
77 selTrajs_ =
new std::auto_ptr< std::vector<Trajectory> >[nblocks];
78 selTTAss_ =
new std::auto_ptr< TrajTrackAssociationCollection >[nblocks];
79 rTracks_ = std::vector<reco::TrackRefProd>(nblocks);
80 rHits_ = std::vector<TrackingRecHitRefProd>(nblocks);
81 rTrackExtras_ = std::vector<reco::TrackExtraRefProd>(nblocks);
82 rTrajectories_ = std::vector< edm::RefProd< std::vector<Trajectory> > >(nblocks);
83 for (
size_t i = 0;
i < nblocks;
i++) {
87 selTrajs_[
i] = std::auto_ptr< std::vector<Trajectory> >(
new std::vector<Trajectory>());
105 using namespace reco;
115 std::vector<Point> points;
123 for (
size_t i = 0;
i < nblocks;
i++) {
136 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
137 const Track & trk = * it;
138 short where =
select(trk, *hBsp, points);
158 selHits_[where]->push_back( (*hit)->clone() );
170 for (
size_t i = 0;
i < nblocks;
i++) {
172 selTrajs_[
i] = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
175 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
178 if (match != hTTAss->end()) {
180 short oldKey =
static_cast<short>(trkRef.
key());
192 for (
size_t i = 0;
i < nblocks;
i++) {
207 const std::vector<Point> &points,
211 if (points.empty()) {
213 double dz =
abs(tk.
dz(spot)), d0 =
abs(tk.
dxy(spot));
216 for (std::vector<Point>::const_iterator
point = points.begin(),
end = points.end();
point !=
end; ++
point) {
218 if ((dz < cut.
dz) && (d0 < cut.
d0)
228 for (std::vector<TrackMultiSelector::Block>::const_iterator itb =
blocks_.begin(), edb =
blocks_.end(); itb != edb; ++itb, ++which) {
229 if ( ( itb->vlayers.first <= vlayers ) && ( vlayers <= itb->vlayers.second ) &&
230 ( itb->chi2n.first <= chi2n ) && ( chi2n <= itb->chi2n.second ) &&
231 ( itb->pt.first <= pt ) && ( pt <= itb->pt.second ) &&
232 ( itb->lhits.first <= lhits ) && ( lhits <= itb->lhits.second ) &&
233 testVtx(tk, beamSpot, points, *itb) )
241 using namespace reco;
244 for (VertexCollection::const_iterator it = vtxs.begin(), ed = vtxs.end(); it != ed; ++it) {
246 ( (it->chi2() == 0.0) || (TMath::Prob(it->chi2(),
static_cast<int32_t
>(it->ndof()) ) >=
vtxChi2Prob_) ) ) {
247 points.push_back(it->position());
248 toTake--;
if (toTake == 0)
break;
T getParameter(std::string const &) const
double d0Error() const
error on d0
TrackMultiSelector(const edm::ParameterSet &cfg)
constructor
virtual ~TrackMultiSelector()
destructor
void selectVertices(const reco::VertexCollection &vtxs, std::vector< Point > &points)
std::vector< Block > blocks_
filter psets
friend struct const_iterator
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< Track > TrackCollection
collection of Tracks
bool innerOk() const
return true if the innermost hit is valid
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
std::vector< Vertex > VertexCollection
collection of Vertex objects
std::vector< reco::TrackExtraRefProd > rTrackExtras_
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
std::vector< reco::TrackRefProd > rTracks_
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZPoint & innerPosition() const
position of the innermost hit
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
U second(std::pair< T, U > const &p)
int32_t vtxNumber_
vertex cuts
std::vector< edm::RefProd< std::vector< Trajectory > > > rTrajectories_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::auto_ptr< TrackingRecHitCollection > * selHits_
int trackerLayersWithMeasurement() const
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double pt() const
track transverse momentum
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Abs< T >::type abs(const T &t)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
bool copyTrajectories_
copy also trajectories and trajectory->track associations
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
RefProd< PROD > getRefBeforePut()
std::vector< std::string > labels_
output labels
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
std::auto_ptr< reco::TrackExtraCollection > * selTrackExtras_
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
edm::RefToBase< TrajectorySeed > seedRef() const
edm::EDGetTokenT< std::vector< Trajectory > > tokenTraj
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
bool outerOk() const
return true if the outermost hit is valid
edm::EDGetTokenT< reco::TrackCollection > tokenTracks
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
double sigmaZ() const
sigma z
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
key_type key() const
Accessor for product key.
edm::EDGetTokenT< reco::VertexCollection > vertices_
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
edm::EDGetTokenT< TrajTrackAssociationCollection > tokenTrajTrack
std::vector< TrackingRecHitRefProd > rHits_
const TrackResiduals & residuals() const
std::auto_ptr< reco::TrackCollection > * selTracks_
some storage
PropagationDirection seedDirection() const
direction of how the hits were sorted in the original seed
bool splitOutputs_
split selections in more sets
std::auto_ptr< TrajTrackAssociationCollection > * selTTAss_
const Point & position() const
position
bool testVtx(const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector< Point > &points, const Block &cut)
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
std::auto_ptr< std::vector< Trajectory > > * selTrajs_
volatile std::atomic< bool > shutdown_flag false
std::vector< std::pair< short, reco::TrackRef > > whereItWent_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
tuple size
Write out results.
edm::InputTag src_
source collection label
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
edm::EDGetTokenT< reco::BeamSpot > beamspot_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
short select(const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector< Point > &points)
return class, or -1 if rejected