CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombinedHitPairGenerator.cc
Go to the documentation of this file.
9 
10 
11 using namespace std;
12 using namespace ctfseeding;
13 
15  : initialised(false), theConfig(cfg)
16 {
17  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
18 }
19 
21 {
22  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
23 
24  std::string layerBuilderName = cfg.getParameter<std::string>("SeedingLayers");
26  es.get<TrackerDigiGeometryRecord>().get(layerBuilderName, layerBuilder);
27 
28  SeedingLayerSets layerSets = layerBuilder->layers(es);
29  init(layerSets);
30 }
31 
33 {
34  initialised = true;
35  typedef SeedingLayerSets::const_iterator IL;
36  for (IL il=layerSets.begin(), ilEnd=layerSets.end(); il != ilEnd; ++il) {
37  const SeedingLayers & set = *il;
38  if (set.size() != 2) continue;
39  add( set[0], set[1] );
40  }
41 }
42 
44 {
45  Container::const_iterator it;
46  for (it = theGenerators.begin(); it!= theGenerators.end(); it++) {
47  delete (*it);
48  }
49  theGenerators.clear();
50 }
51 
53 
55 {
56  theGenerators.push_back( new HitPairGeneratorFromLayerPair( inner, outer, &theLayerCache, 0, theMaxElement));
57 }
58 
60  const TrackingRegion& region, OrderedHitPairs & result,
61  const edm::Event& ev, const edm::EventSetup& es)
62 {
63  if (theESWatcher.check(es) || !initialised ) {
64  cleanup();
65  init(theConfig,es);
66  }
67 
68  Container::const_iterator i;
69  for (i=theGenerators.begin(); i!=theGenerators.end(); i++) {
70  (**i).hitPairs( region, result, ev, es);
71  }
73 
74  LogDebug("CombinedHitPairGenerator")<<" total number of pairs provided back CHPG : "<<result.size();
75 
76 }
#define LogDebug(id)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
CombinedHitPairGenerator(const edm::ParameterSet &cfg)
virtual unsigned int size() const
edm::ESWatcher< TrackerDigiGeometryRecord > theESWatcher
tuple result
Definition: query.py:137
virtual void hitPairs(const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
form base class
const T & get() const
Definition: EventSetup.h:55
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
void init(const ctfseeding::SeedingLayerSets &layerSets)
std::vector< SeedingLayer > SeedingLayers
void add(const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
std::vector< std::vector< SeedingLayer > > SeedingLayerSets