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
CombinedHitPairGeneratorForPhotonConversion Class Reference

#include <CombinedHitPairGeneratorForPhotonConversion.h>

Inheritance diagram for CombinedHitPairGeneratorForPhotonConversion:
HitPairGenerator OrderedHitsGenerator

Public Types

typedef LayerHitMapCache LayerCacheType
 

Public Member Functions

void add (const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
 
void clearLayerCache ()
 
virtual
CombinedHitPairGeneratorForPhotonConversion
clone () const
 from base class More...
 
 CombinedHitPairGeneratorForPhotonConversion (const edm::ParameterSet &cfg)
 
virtual void hitPairs (const TrackingRegion &, OrderedHitPairs &, const edm::Event &, const edm::EventSetup &)
 form base class More...
 
void hitPairs (const ConversionRegion &convRegion, const TrackingRegion &reg, OrderedHitPairs &result, const edm::Event &ev, const edm::EventSetup &es)
 
const OrderedHitPairsrun (const ConversionRegion &convRegion, const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es)
 
virtual ~CombinedHitPairGeneratorForPhotonConversion ()
 
- Public Member Functions inherited from HitPairGenerator
virtual void clear ()
 
virtual HitDoublets doublets (const TrackingRegion &reg, const edm::Event &ev, const edm::EventSetup &es)
 
 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
< HitPairGeneratorFromLayerPairForPhotonConversion * > 
Container
 

Private Member Functions

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

Private Attributes

bool initialised
 
uint32_t maxHitPairsPerTrackAndGenerator
 
edm::ParameterSet theConfig
 
edm::ESWatcher
< TrackerDigiGeometryRecord
theESWatcher
 
Container theGenerators
 
LayerCacheType theLayerCache
 
OrderedHitPairs thePairs
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Hides set of HitPairGeneratorFromLayerPairForPhotonConversion generators.

Definition at line 26 of file CombinedHitPairGeneratorForPhotonConversion.h.

Member Typedef Documentation

Constructor & Destructor Documentation

CombinedHitPairGeneratorForPhotonConversion::CombinedHitPairGeneratorForPhotonConversion ( const edm::ParameterSet cfg)
CombinedHitPairGeneratorForPhotonConversion::~CombinedHitPairGeneratorForPhotonConversion ( )
virtual
CombinedHitPairGeneratorForPhotonConversion::CombinedHitPairGeneratorForPhotonConversion ( const CombinedHitPairGeneratorForPhotonConversion cb)
private

Member Function Documentation

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

Definition at line 46 of file CombinedHitPairGeneratorForPhotonConversion.cc.

References theGenerators.

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

47 {
48  Container::const_iterator it;
49  for (it = theGenerators.begin(); it!= theGenerators.end(); it++) {
50  delete (*it);
51  }
52  theGenerators.clear();
53 }
void CombinedHitPairGeneratorForPhotonConversion::clearLayerCache ( )
inline
virtual CombinedHitPairGeneratorForPhotonConversion* CombinedHitPairGeneratorForPhotonConversion::clone ( void  ) const
inlinevirtual
virtual void CombinedHitPairGeneratorForPhotonConversion::hitPairs ( const TrackingRegion ,
OrderedHitPairs ,
const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

form base class

Implements HitPairGenerator.

Definition at line 38 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by run().

38 {};
void CombinedHitPairGeneratorForPhotonConversion::hitPairs ( const ConversionRegion convRegion,
const TrackingRegion reg,
OrderedHitPairs result,
const edm::Event ev,
const edm::EventSetup es 
)

Definition at line 72 of file CombinedHitPairGeneratorForPhotonConversion.cc.

References edm::ESWatcher< T >::check(), cleanup(), i, init(), initialised, maxHitPairsPerTrackAndGenerator, OrderedHitPairs::size(), theConfig, theESWatcher, theGenerators, and OrderedHitsGenerator::theMaxElement.

76 {
77  if (theESWatcher.check(es) || !initialised ) {
78  cleanup();
79  init(theConfig,es);
80  }
81 
82  Container::const_iterator i;
83  OrderedHitPairs resultTmp;
84  resultTmp.reserve(maxHitPairsPerTrackAndGenerator);
85 
86  for (i=theGenerators.begin(); i!=theGenerators.end() && result.size() < theMaxElement; i++) {
87  resultTmp.clear();
88  (**i).hitPairs(convRegion, region, resultTmp, ev, es);
89  result.insert(result.end(),resultTmp.begin(),resultTmp.end());
90  }
91  //theLayerCache.clear(); //Don't want to clear now, because have to loop on all the tracks. will be cleared later, calling a specific method
92 }
int i
Definition: DBlmapReader.cc:9
virtual unsigned int size() const
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:58
void init(const ctfseeding::SeedingLayerSets &layerSets)
void CombinedHitPairGeneratorForPhotonConversion::init ( const ctfseeding::SeedingLayerSets layerSets)
private

Definition at line 35 of file CombinedHitPairGeneratorForPhotonConversion.cc.

References add(), and initialised.

Referenced by hitPairs(), and init().

36 {
37  initialised = true;
38  typedef SeedingLayerSets::const_iterator IL;
39  for (IL il=layerSets.begin(), ilEnd=layerSets.end(); il != ilEnd; ++il) {
40  const SeedingLayers & set = *il;
41  if (set.size() != 2) continue;
42  add( set[0], set[1] );
43  }
44 }
void add(const ctfseeding::SeedingLayer &inner, const ctfseeding::SeedingLayer &outer)
std::vector< SeedingLayer > SeedingLayers
void CombinedHitPairGeneratorForPhotonConversion::init ( const edm::ParameterSet cfg,
const edm::EventSetup es 
)
private

Definition at line 22 of file CombinedHitPairGeneratorForPhotonConversion.cc.

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

23 {
24  theMaxElement = cfg.getParameter<unsigned int>("maxElement");
25  maxHitPairsPerTrackAndGenerator = cfg.getParameter<unsigned int>("maxHitPairsPerTrackAndGenerator");
26 
27  std::string layerBuilderName = cfg.getParameter<std::string>("SeedingLayers");
29  es.get<TrackerDigiGeometryRecord>().get(layerBuilderName, layerBuilder);
30 
31  SeedingLayerSets layerSets = layerBuilder->layers(es);
32  init(layerSets);
33 }
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
const OrderedHitPairs & CombinedHitPairGeneratorForPhotonConversion::run ( const ConversionRegion convRegion,
const TrackingRegion region,
const edm::Event ev,
const edm::EventSetup es 
)

Definition at line 62 of file CombinedHitPairGeneratorForPhotonConversion.cc.

References hitPairs(), and thePairs.

Referenced by PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::inspectTrack().

65 {
66  thePairs.clear();
67  hitPairs(convRegion, region, thePairs, ev, es);
68  return thePairs;
69 }
virtual void hitPairs(const TrackingRegion &, OrderedHitPairs &, const edm::Event &, const edm::EventSetup &)
form base class

Member Data Documentation

bool CombinedHitPairGeneratorForPhotonConversion::initialised
mutableprivate

Definition at line 63 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by hitPairs(), and init().

uint32_t CombinedHitPairGeneratorForPhotonConversion::maxHitPairsPerTrackAndGenerator
private
edm::ParameterSet CombinedHitPairGeneratorForPhotonConversion::theConfig
private

Definition at line 64 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by clone(), and hitPairs().

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

Definition at line 69 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by hitPairs().

Container CombinedHitPairGeneratorForPhotonConversion::theGenerators
private

Definition at line 72 of file CombinedHitPairGeneratorForPhotonConversion.h.

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

LayerCacheType CombinedHitPairGeneratorForPhotonConversion::theLayerCache
private

Definition at line 67 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by add(), and clearLayerCache().

OrderedHitPairs CombinedHitPairGeneratorForPhotonConversion::thePairs
private

Definition at line 74 of file CombinedHitPairGeneratorForPhotonConversion.h.

Referenced by run().