CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HitPairGenerator.h
Go to the documentation of this file.
1 #ifndef HitPairGenerator_H
2 #define HitPairGenerator_H
3 
4 #include <vector>
5 
13 
14 class TrackingRegion;
15 namespace edm { class Event; class EventSetup; }
16 
18 public:
19 
20  explicit HitPairGenerator(unsigned int size=7500);
21 
22  virtual ~HitPairGenerator() { }
23 
24  virtual const OrderedHitPairs & run(
25  const TrackingRegion& region, const edm::Event & ev, const edm::EventSetup& es);
26 
27  // temporary interface for backward compatibility only
28  virtual void hitPairs(
29  const TrackingRegion& reg, OrderedHitPairs & prs, const edm::EventSetup& es) {}
30 
31  virtual void hitPairs( const TrackingRegion& reg, OrderedHitPairs & prs,
32  const edm::Event & ev, const edm::EventSetup& es) = 0;
33 
34  virtual HitPairGenerator* clone() const = 0;
35 
36  virtual void clear() {
37  // back to initial allocation if too large
38  if (thePairs.capacity()> 4*m_capacity) {
39  OrderedHitPairs tmp; tmp.reserve(m_capacity); tmp.swap(thePairs);
40  }
41  thePairs.clear();
42  }
43 
44 private:
46  unsigned int m_capacity;
47 
48 };
49 
50 #endif
virtual HitPairGenerator * clone() const =0
HitPairGenerator(unsigned int size=7500)
unsigned int m_capacity
virtual void hitPairs(const TrackingRegion &reg, OrderedHitPairs &prs, const edm::EventSetup &es)
virtual void clear()
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
OrderedHitPairs thePairs
virtual const OrderedHitPairs & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
tuple size
Write out results.
virtual ~HitPairGenerator()