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" ) ),
24 vertices_( cfg.getParameter<edm::InputTag>(
"vertices" ) ),
28 vtxNumber_( cfg.getParameter<int32_t>(
"vtxNumber") ),
29 vtxTracks_( cfg.getParameter<uint32_t>(
"vtxTracks") ),
37 typedef std::vector<edm::ParameterSet> VPSet;
40 for (VPSet::const_iterator it = psets.begin(), ed = psets.end(); it != ed; ++it) {
47 sprintf(buff,
"set%d", static_cast<int>(
i+1));
48 labels_.push_back(std::string(buff));
51 labels_.push_back(std::string(
""));
54 std::string alias( cfg.
getParameter<std::string>(
"@module_label" ) );
55 for (std::vector<std::string>::const_iterator li =
labels_.begin(),
le =
labels_.end(); li !=
le; ++li) {
56 const char *
l= li->c_str();
57 produces<reco::TrackCollection>(
l).setBranchAlias( alias +
"Tracks" + l);
59 produces<reco::TrackExtraCollection>(
l).setBranchAlias( alias +
"TrackExtras" + l);
60 produces<TrackingRecHitCollection>(
l).setBranchAlias( alias +
"RecHits" + l);
62 produces< std::vector<Trajectory> >(
l).setBranchAlias( alias +
"Trajectories" + l);
63 produces< TrajTrackAssociationCollection >(
l).setBranchAlias( alias +
"TrajectoryTrackAssociations" + l);
69 selTracks_ =
new std::auto_ptr<reco::TrackCollection>[nblocks];
70 selTrackExtras_ =
new std::auto_ptr<reco::TrackExtraCollection>[nblocks];
71 selHits_ =
new std::auto_ptr<TrackingRecHitCollection>[nblocks];
72 selTrajs_ =
new std::auto_ptr< std::vector<Trajectory> >[nblocks];
73 selTTAss_ =
new std::auto_ptr< TrajTrackAssociationCollection >[nblocks];
74 rTracks_ = std::vector<reco::TrackRefProd>(nblocks);
75 rHits_ = std::vector<TrackingRecHitRefProd>(nblocks);
76 rTrackExtras_ = std::vector<reco::TrackExtraRefProd>(nblocks);
77 rTrajectories_ = std::vector< edm::RefProd< std::vector<Trajectory> > >(nblocks);
78 for (
size_t i = 0;
i < nblocks;
i++) {
82 selTrajs_[
i] = std::auto_ptr< std::vector<Trajectory> >(
new std::vector<Trajectory>());
100 using namespace reco;
110 std::vector<Point> points;
118 for (
size_t i = 0;
i < nblocks;
i++) {
131 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
132 const Track & trk = * it;
133 short where =
select(trk, *hBsp, points);
153 selHits_[where]->push_back( (*hit)->clone() );
165 for (
size_t i = 0;
i < nblocks;
i++) {
167 selTrajs_[
i] = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
170 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
173 if (match != hTTAss->end()) {
175 short oldKey =
static_cast<short>(trkRef.
key());
187 for (
size_t i = 0;
i < nblocks;
i++) {
202 const std::vector<Point> &points,
206 if (points.empty()) {
211 for (std::vector<Point>::const_iterator
point = points.begin(),
end = points.end();
point !=
end; ++
point) {
213 if ((dz < cut.
dz) && (
d0 < cut.
d0)
223 for (std::vector<TrackMultiSelector::Block>::const_iterator itb =
blocks_.begin(), edb =
blocks_.end(); itb != edb; ++itb, ++which) {
224 if ( ( itb->vlayers.first <= vlayers ) && ( vlayers <= itb->vlayers.second ) &&
225 ( itb->chi2n.first <= chi2n ) && ( chi2n <= itb->chi2n.second ) &&
226 ( itb->pt.first <= pt ) && ( pt <= itb->pt.second ) &&
227 ( itb->lhits.first <= lhits ) && ( lhits <= itb->lhits.second ) &&
228 testVtx(tk, beamSpot, points, *itb) )
236 using namespace reco;
239 for (VertexCollection::const_iterator it = vtxs.begin(), ed = vtxs.end(); it != ed; ++it) {
241 ( (it->chi2() == 0.0) || (TMath::Prob(it->chi2(),
static_cast<int32_t
>(it->ndof()) ) >=
vtxChi2Prob_) ) ) {
242 points.push_back(it->position());
243 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
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
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
int trackerLayersWithMeasurement() const
const math::XYZPoint & innerPosition() const
position of the innermost hit
U second(std::pair< T, U > const &p)
int32_t vtxNumber_
vertex cuts
std::vector< edm::RefProd< std::vector< Trajectory > > > rTrajectories_
const T & max(const T &a, const T &b)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::auto_ptr< TrackingRecHitCollection > * selHits_
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double pt() const
track transverse momentum
void produce(edm::Event &evt, const edm::EventSetup &es)
process one event
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
bool outerOk() const
return true if the outermost hit is valid
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.
static std::string const emptyString("")
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
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_
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
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