CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackMultiSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_TrackMultiSelector_h
2 #define RecoAlgos_TrackMultiSelector_h
3 
15 #include <utility>
16 #include <vector>
17 #include <memory>
18 #include <algorithm>
19 #include <map>
24 
32 
34 
35 namespace reco { namespace modules {
36 
38  private:
39  struct Block {
40  std::pair<double,double> pt;
41  std::pair<uint32_t,uint32_t> vlayers, lhits;
42  std::pair<double,double> chi2n;
43  double d0, dz,d0Rel,dzRel;
44 
45  explicit Block(const edm::ParameterSet & cfg) ;
46  private:
47  template<typename T> std::pair<T,T> p2p(const edm::ParameterSet & cfg, const std::string name);
48  };
49  public:
51  explicit TrackMultiSelector( const edm::ParameterSet & cfg ) ;
53  virtual ~TrackMultiSelector() ;
54 
55  private:
58  void produce( edm::Event& evt, const edm::EventSetup& es ) override;
60  short select ( const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector<Point> &points);
61  void selectVertices ( const reco::VertexCollection &vtxs, std::vector<Point> &points);
62  inline bool testVtx ( const reco::Track &tk, const reco::BeamSpot &beamSpot,
63  const std::vector<Point> &points, const Block &cut);
76  std::vector<Block> blocks_;
78  int32_t vtxNumber_;
79  size_t vtxTracks_;
80  double vtxChi2Prob_;
82  std::vector<std::string> labels_;
84  std::auto_ptr<reco::TrackCollection> *selTracks_;
85  std::auto_ptr<reco::TrackExtraCollection> *selTrackExtras_;
86  std::auto_ptr< TrackingRecHitCollection> *selHits_;
87  std::auto_ptr< std::vector<Trajectory> > *selTrajs_;
88  std::auto_ptr< TrajTrackAssociationCollection > *selTTAss_;
89  std::vector<reco::TrackRefProd> rTracks_;
90  std::vector<reco::TrackExtraRefProd> rTrackExtras_;
91  std::vector<TrackingRecHitRefProd> rHits_;
92  std::vector< edm::RefProd< std::vector<Trajectory> > > rTrajectories_;
93  std::vector< std::pair<short, reco::TrackRef> > whereItWent_;
94 
95  };
96 
97 } }
98 
99 // template method to be implemented here?
100 template<typename T> std::pair<T,T> reco::modules::TrackMultiSelector::Block::p2p(const edm::ParameterSet & cfg, const std::string name) {
101  typedef typename std::vector<T> Ts;
102  Ts ret = cfg.getParameter<Ts>(name);
103  if (ret.size() != 2) throw cms::Exception("Invalid configuration") << "Parameter '" << name << "' must be given as {min,max}";
104  return std::pair<T,T>(ret[0],ret[1]);
105 }
106 #endif
T getParameter(std::string const &) const
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
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< reco::TrackExtraRefProd > rTrackExtras_
std::vector< reco::TrackRefProd > rTracks_
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
std::pair< T, T > p2p(const edm::ParameterSet &cfg, const std::string name)
std::vector< edm::RefProd< std::vector< Trajectory > > > rTrajectories_
std::auto_ptr< TrackingRecHitCollection > * selHits_
bool copyTrajectories_
copy also trajectories and trajectory-&gt;track associations
std::vector< std::string > labels_
output labels
std::pair< uint32_t, uint32_t > lhits
std::auto_ptr< reco::TrackExtraCollection > * selTrackExtras_
std::pair< uint32_t, uint32_t > vlayers
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
std::vector< TrackingRecHitRefProd > rHits_
std::auto_ptr< reco::TrackCollection > * selTracks_
some storage
bool splitOutputs_
split selections in more sets
std::auto_ptr< TrajTrackAssociationCollection > * selTTAss_
bool testVtx(const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector< Point > &points, const Block &cut)
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_
edm::InputTag src_
source collection label
short select(const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector< Point > &points)
return class, or -1 if rejected