CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
CombinedHitPairGenerator Class Reference

#include <CombinedHitPairGenerator.h>

Inheritance diagram for CombinedHitPairGenerator:
HitPairGenerator OrderedHitsGenerator

Public Types

typedef LayerHitMapCache LayerCacheType
 

Public Member Functions

void add (const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
 
virtual CombinedHitPairGeneratorclone () const
 from base class More...
 
 CombinedHitPairGenerator (const edm::ParameterSet &cfg)
 
virtual void hitPairs (const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
 form base class More...
 
virtual ~CombinedHitPairGenerator ()
 
- Public Member Functions inherited from HitPairGenerator
virtual void clear ()
 
 HitPairGenerator (unsigned int size=7500)
 
virtual void hitPairs (const TrackingRegion &reg, OrderedHitPairs &prs, const edm::EventSetup &es)
 
virtual const OrderedHitPairsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~HitPairGenerator ()
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Types

typedef std::vector
< HitPairGeneratorFromLayerPair * > 
Container
 

Private Member Functions

void cleanup ()
 
 CombinedHitPairGenerator (const CombinedHitPairGenerator &cb)
 
void init (const ctfseeding::SeedingLayerSets &layerSets)
 
void init (const edm::ParameterSet &cfg, const edm::EventSetup &es)
 

Private Attributes

bool initialised
 
edm::ParameterSet theConfig
 
edm::ESWatcher
< TrackerDigiGeometryRecord
theESWatcher
 
Container theGenerators
 
LayerCacheType theLayerCache
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Hides set of HitPairGeneratorFromLayerPair generators.

Definition at line 24 of file CombinedHitPairGenerator.h.

Member Typedef Documentation

Definition at line 57 of file CombinedHitPairGenerator.h.

Definition at line 26 of file CombinedHitPairGenerator.h.

Constructor & Destructor Documentation

CombinedHitPairGenerator::CombinedHitPairGenerator ( const edm::ParameterSet cfg)

Definition at line 14 of file CombinedHitPairGenerator.cc.

References edm::ParameterSet::getParameter(), and OrderedHitsGenerator::theMaxElement.

Referenced by clone().

15  : initialised(false), theConfig(cfg)
16 {
17  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
18 }
T getParameter(std::string const &) const
CombinedHitPairGenerator::~CombinedHitPairGenerator ( )
virtual

Definition at line 52 of file CombinedHitPairGenerator.cc.

References cleanup().

CombinedHitPairGenerator::CombinedHitPairGenerator ( const CombinedHitPairGenerator cb)
private

Member Function Documentation

void CombinedHitPairGenerator::add ( const ctfseeding::SeedingLayer inner,
const ctfseeding::SeedingLayer outer 
)
void CombinedHitPairGenerator::cleanup ( void  )
private

Definition at line 43 of file CombinedHitPairGenerator.cc.

References theGenerators.

Referenced by hitPairs(), and ~CombinedHitPairGenerator().

44 {
45  Container::const_iterator it;
46  for (it = theGenerators.begin(); it!= theGenerators.end(); it++) {
47  delete (*it);
48  }
49  theGenerators.clear();
50 }
virtual CombinedHitPairGenerator* CombinedHitPairGenerator::clone ( void  ) const
inlinevirtual

from base class

Implements HitPairGenerator.

Definition at line 40 of file CombinedHitPairGenerator.h.

References CombinedHitPairGenerator(), and theConfig.

41  { return new CombinedHitPairGenerator(theConfig); }
CombinedHitPairGenerator(const edm::ParameterSet &cfg)
void CombinedHitPairGenerator::hitPairs ( const TrackingRegion reg,
OrderedHitPairs result,
const edm::Event ev,
const edm::EventSetup es 
)
virtual

form base class

Implements HitPairGenerator.

Definition at line 59 of file CombinedHitPairGenerator.cc.

References edm::ESWatcher< T >::check(), cleanup(), LayerHitMapCache::clear(), i, init(), initialised, LogDebug, OrderedHitPairs::size(), theConfig, theESWatcher, theGenerators, and theLayerCache.

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)
int i
Definition: DBlmapReader.cc:9
virtual unsigned int size() const
edm::ESWatcher< TrackerDigiGeometryRecord > theESWatcher
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:59
void init(const ctfseeding::SeedingLayerSets &layerSets)
void CombinedHitPairGenerator::init ( const ctfseeding::SeedingLayerSets layerSets)
private

Definition at line 32 of file CombinedHitPairGenerator.cc.

References add(), initialised, and runtimedef::set().

Referenced by hitPairs(), and init().

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 }
std::vector< SeedingLayer > SeedingLayers
void add(const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
void set(const std::string &name, int value)
set the flag, with a run-time name
void CombinedHitPairGenerator::init ( const edm::ParameterSet cfg,
const edm::EventSetup es 
)
private

Definition at line 20 of file CombinedHitPairGenerator.cc.

References edm::EventSetup::get(), edm::ParameterSet::getParameter(), init(), and OrderedHitsGenerator::theMaxElement.

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 }
T getParameter(std::string const &) const
const T & get() const
Definition: EventSetup.h:55
void init(const ctfseeding::SeedingLayerSets &layerSets)
std::vector< std::vector< SeedingLayer > > SeedingLayerSets

Member Data Documentation

bool CombinedHitPairGenerator::initialised
mutableprivate

Definition at line 50 of file CombinedHitPairGenerator.h.

Referenced by hitPairs(), and init().

edm::ParameterSet CombinedHitPairGenerator::theConfig
private

Definition at line 51 of file CombinedHitPairGenerator.h.

Referenced by clone(), and hitPairs().

edm::ESWatcher<TrackerDigiGeometryRecord> CombinedHitPairGenerator::theESWatcher
private

Definition at line 55 of file CombinedHitPairGenerator.h.

Referenced by hitPairs().

Container CombinedHitPairGenerator::theGenerators
private

Definition at line 58 of file CombinedHitPairGenerator.h.

Referenced by add(), cleanup(), and hitPairs().

LayerCacheType CombinedHitPairGenerator::theLayerCache
private

Definition at line 53 of file CombinedHitPairGenerator.h.

Referenced by add(), and hitPairs().