CMS 3D CMS Logo

Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes

CombinedHitTripletGenerator Class Reference

#include <CombinedHitTripletGenerator.h>

Inheritance diagram for CombinedHitTripletGenerator:
HitTripletGenerator OrderedHitsGenerator

List of all members.

Public Types

typedef LayerHitMapCache LayerCacheType

Public Member Functions

 CombinedHitTripletGenerator (const edm::ParameterSet &cfg)
virtual void hitTriplets (const TrackingRegion &reg, OrderedHitTriplets &triplets, const edm::Event &ev, const edm::EventSetup &es)
 from base class
virtual ~CombinedHitTripletGenerator ()

Private Types

typedef std::vector
< HitTripletGeneratorFromPairAndLayers * > 
GeneratorContainer

Private Member Functions

void init (const edm::ParameterSet &cfg, const edm::EventSetup &es)

Private Attributes

bool initialised
edm::ParameterSet theConfig
GeneratorContainer theGenerators
LayerCacheType theLayerCache

Detailed Description

Definition at line 21 of file CombinedHitTripletGenerator.h.


Member Typedef Documentation

Definition at line 43 of file CombinedHitTripletGenerator.h.

Definition at line 23 of file CombinedHitTripletGenerator.h.


Constructor & Destructor Documentation

CombinedHitTripletGenerator::CombinedHitTripletGenerator ( const edm::ParameterSet cfg)

Definition at line 17 of file CombinedHitTripletGenerator.cc.

  : initialised(false), theConfig(cfg)
{ }
CombinedHitTripletGenerator::~CombinedHitTripletGenerator ( ) [virtual]

Definition at line 57 of file CombinedHitTripletGenerator.cc.

References theGenerators.

{
  GeneratorContainer::const_iterator it;
  for (it = theGenerators.begin(); it!= theGenerators.end(); it++) {
    delete (*it);
  }
}

Member Function Documentation

void CombinedHitTripletGenerator::hitTriplets ( const TrackingRegion reg,
OrderedHitTriplets triplets,
const edm::Event ev,
const edm::EventSetup es 
) [virtual]

from base class

Implements HitTripletGenerator.

Definition at line 66 of file CombinedHitTripletGenerator.cc.

References LayerHitMapCache::clear(), i, init(), initialised, theConfig, theGenerators, and theLayerCache.

{
  if (!initialised) init(theConfig,es);

  GeneratorContainer::const_iterator i;
  for (i=theGenerators.begin(); i!=theGenerators.end(); i++) {
    (**i).hitTriplets( region, result, ev, es);
  }
  theLayerCache.clear();
}
void CombinedHitTripletGenerator::init ( const edm::ParameterSet cfg,
const edm::EventSetup es 
) [private]

Definition at line 21 of file CombinedHitTripletGenerator.cc.

References first, edm::EventSetup::get(), reco::get(), edm::ParameterSet::getParameter(), initialised, LayerTriplets::layers(), edm::second(), theConfig, theGenerators, and theLayerCache.

Referenced by hitTriplets().

{
//  edm::ParameterSet leyerPSet = cfg.getParameter<edm::ParameterSet>("LayerPSet");
//  SeedingLayerSets layerSets  = SeedingLayerSetsBuilder(leyerPSet).layers(es);

  std::string layerBuilderName = cfg.getParameter<std::string>("SeedingLayers");
  edm::ESHandle<SeedingLayerSetsBuilder> layerBuilder;
  es.get<TrackerDigiGeometryRecord>().get(layerBuilderName, layerBuilder);

  SeedingLayerSets layerSets  =  layerBuilder->layers(es);


  vector<LayerTriplets::LayerPairAndLayers>::const_iterator it;
  vector<LayerTriplets::LayerPairAndLayers> trilayers=LayerTriplets(layerSets).layers();

  for (it = trilayers.begin(); it != trilayers.end(); it++) {
    SeedingLayer first = (*it).first.first;
    SeedingLayer second = (*it).first.second;
    vector<SeedingLayer> thirds = (*it).second;

    edm::ParameterSet generatorPSet = theConfig.getParameter<edm::ParameterSet>("GeneratorPSet");
    std::string       generatorName = generatorPSet.getParameter<std::string>("ComponentName");

    HitTripletGeneratorFromPairAndLayers * aGen =
        HitTripletGeneratorFromPairAndLayersFactory::get()->create(generatorName,generatorPSet);

    aGen->init( HitPairGeneratorFromLayerPair( first, second, &theLayerCache),
                thirds, &theLayerCache);

    theGenerators.push_back( aGen);
  }

  initialised = true;

}

Member Data Documentation

Definition at line 38 of file CombinedHitTripletGenerator.h.

Referenced by hitTriplets(), and init().

Definition at line 40 of file CombinedHitTripletGenerator.h.

Referenced by hitTriplets(), and init().

Definition at line 44 of file CombinedHitTripletGenerator.h.

Referenced by hitTriplets(), init(), and ~CombinedHitTripletGenerator().

Definition at line 41 of file CombinedHitTripletGenerator.h.

Referenced by hitTriplets(), and init().