CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CombinedHitQuadrupletGeneratorForPhotonConversion.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 {
57 }
58 
60 {
61  thePairs.clear();
62  hitPairs(region, thePairs, ev, es);
63  return thePairs;
64 }
65 
66 
68  const edm::Event& ev, const edm::EventSetup& es)
69 {
70  if (theESWatcher.check(es) || !initialised ) {
71  cleanup();
72  init(theConfig,es);
73  }
74 
75  size_t maxHitQuadruplets=1000000;
76  Container::const_iterator i;
77  for (i=theGenerators.begin(); i!=theGenerators.end() && result.size() < maxHitQuadruplets; i++) {
78  (**i).hitPairs(region, result, ev, es);
79  }
81 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
virtual unsigned int size() const
virtual void hitPairs(const TrackingRegion &, OrderedHitPairs &, const edm::Event &, const edm::EventSetup &)
form base class
const OrderedHitPairs & run(const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
tuple result
Definition: query.py:137
const T & get() const
Definition: EventSetup.h:55
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
void add(const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
std::vector< SeedingLayer > SeedingLayers
std::vector< std::vector< SeedingLayer > > SeedingLayerSets
void set(const std::string &name, int value)
set the flag, with a run-time name