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 
13 #include <utility>
14 #include <vector>
15 #include <memory>
16 #include <algorithm>
17 #include <map>
22 
30 
32 
33 namespace reco { namespace modules {
34 
36  private:
37  struct Block {
38  std::pair<double,double> pt;
39  std::pair<uint32_t,uint32_t> vlayers, lhits;
40  std::pair<double,double> chi2n;
41  double d0, dz,d0Rel,dzRel;
42 
43  explicit Block(const edm::ParameterSet & cfg) ;
44  private:
45  template<typename T> std::pair<T,T> p2p(const edm::ParameterSet & cfg, const std::string name);
46  };
47  public:
49  explicit TrackMultiSelector( const edm::ParameterSet & cfg ) ;
51  virtual ~TrackMultiSelector() ;
52 
53  private:
56  void produce( edm::Event& evt, const edm::EventSetup& es ) override;
58  short select ( const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector<Point> &points);
59  void selectVertices ( const reco::VertexCollection &vtxs, std::vector<Point> &points);
60  inline bool testVtx ( const reco::Track &tk, const reco::BeamSpot &beamSpot,
61  const std::vector<Point> &points, const Block &cut);
74  std::vector<Block> blocks_;
76  int32_t vtxNumber_;
77  size_t vtxTracks_;
78  double vtxChi2Prob_;
80  std::vector<std::string> labels_;
82  std::auto_ptr<reco::TrackCollection> *selTracks_;
83  std::auto_ptr<reco::TrackExtraCollection> *selTrackExtras_;
84  std::auto_ptr< TrackingRecHitCollection> *selHits_;
85  std::auto_ptr< std::vector<Trajectory> > *selTrajs_;
86  std::auto_ptr< TrajTrackAssociationCollection > *selTTAss_;
87  std::vector<reco::TrackRefProd> rTracks_;
88  std::vector<reco::TrackExtraRefProd> rTrackExtras_;
89  std::vector<TrackingRecHitRefProd> rHits_;
90  std::vector< edm::RefProd< std::vector<Trajectory> > > rTrajectories_;
91  std::vector< std::pair<short, reco::TrackRef> > whereItWent_;
92 
93  };
94 
95 } }
96 
97 // template method to be implemented here?
98 template<typename T> std::pair<T,T> reco::modules::TrackMultiSelector::Block::p2p(const edm::ParameterSet & cfg, const std::string name) {
99  typedef typename std::vector<T> Ts;
100  Ts ret = cfg.getParameter<Ts>(name);
101  if (ret.size() != 2) throw cms::Exception("Invalid configuration") << "Parameter '" << name << "' must be given as {min,max}";
102  return std::pair<T,T>(ret[0],ret[1]);
103 }
104 #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:12
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