test
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);
69 
78  std::vector<Block> blocks_;
80  int32_t vtxNumber_;
81  size_t vtxTracks_;
82  double vtxChi2Prob_;
84  std::vector<std::string> labels_;
86  std::auto_ptr<reco::TrackCollection> *selTracks_;
87  std::auto_ptr<reco::TrackExtraCollection> *selTrackExtras_;
88  std::auto_ptr< TrackingRecHitCollection> *selHits_;
89  std::auto_ptr< std::vector<Trajectory> > *selTrajs_;
90  std::auto_ptr< TrajTrackAssociationCollection > *selTTAss_;
91  std::vector<reco::TrackRefProd> rTracks_;
92  std::vector<reco::TrackExtraRefProd> rTrackExtras_;
93  std::vector<TrackingRecHitRefProd> rHits_;
94  std::vector< edm::RefProd< std::vector<Trajectory> > > rTrajectories_;
95  std::vector< std::pair<short, reco::TrackRef> > whereItWent_;
96 
97  };
98 
99 } }
100 
101 // template method to be implemented here?
102 template<typename T> std::pair<T,T> reco::modules::TrackMultiSelector::Block::p2p(const edm::ParameterSet & cfg, const std::string name) {
103  typedef typename std::vector<T> Ts;
104  Ts ret = cfg.getParameter<Ts>(name);
105  if (ret.size() != 2) throw cms::Exception("Invalid configuration") << "Parameter '" << name << "' must be given as {min,max}";
106  return std::pair<T,T>(ret[0],ret[1]);
107 }
108 #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_
edm::EDGetTokenT< std::vector< Trajectory > > tokenTraj
std::pair< uint32_t, uint32_t > vlayers
edm::EDGetTokenT< reco::TrackCollection > tokenTracks
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
edm::EDGetTokenT< reco::VertexCollection > vertices_
edm::EDGetTokenT< TrajTrackAssociationCollection > tokenTrajTrack
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
edm::EDGetTokenT< reco::BeamSpot > beamspot_
short select(const reco::Track &tk, const reco::BeamSpot &beamSpot, const std::vector< Point > &points)
return class, or -1 if rejected