CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GenericPairGenerator Class Reference

#include <GenericPairGenerator.h>

Inheritance diagram for GenericPairGenerator:
OrderedHitsGenerator

Public Member Functions

void clear () override
 
 GenericPairGenerator (const edm::ParameterSet &conf, edm::ConsumesCollector &iC)
 
const OrderedSeedingHitsrun (const TrackingRegion &region, const edm::Event &ev, const edm::EventSetup &es) override
 
 ~GenericPairGenerator () override
 
- Public Member Functions inherited from OrderedHitsGenerator
 OrderedHitsGenerator ()
 
virtual ~OrderedHitsGenerator ()
 

Private Attributes

OrderedHitPairs hitPairs
 
edm::EDGetTokenT< SeedingLayerSetsHitstheSeedingLayerToken
 

Additional Inherited Members

- Public Attributes inherited from OrderedHitsGenerator
unsigned int theMaxElement
 

Detailed Description

Definition at line 16 of file GenericPairGenerator.h.

Constructor & Destructor Documentation

GenericPairGenerator::GenericPairGenerator ( const edm::ParameterSet conf,
edm::ConsumesCollector iC 
)

Definition at line 10 of file GenericPairGenerator.cc.

10  :
12  edm::LogInfo("CtfSpecialSeedGenerator|GenericPairGenerator") << "Constructing GenericPairGenerator";
13 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
GenericPairGenerator::~GenericPairGenerator ( )
inlineoverride

Definition at line 19 of file GenericPairGenerator.h.

References ev, and run().

19 {};

Member Function Documentation

void GenericPairGenerator::clear ( void  )
inlineoverridevirtual

Reimplemented from OrderedHitsGenerator.

Definition at line 23 of file GenericPairGenerator.h.

References hitPairs.

23 { hitPairs.clear();}
const OrderedSeedingHits & GenericPairGenerator::run ( const TrackingRegion region,
const edm::Event ev,
const edm::EventSetup es 
)
overridevirtual

Implements OrderedHitsGenerator.

Definition at line 16 of file GenericPairGenerator.cc.

References edm::Event::getByToken(), hitPairs, TrackingRegion::hits(), LayerTriplets::layers(), eostools::ls(), SeedingLayerSetsHits::numberOfLayersInSet(), and theSeedingLayerToken.

Referenced by ~GenericPairGenerator().

18  {
19  hitPairs.clear();
20  hitPairs.reserve(0);
22  e.getByToken(theSeedingLayerToken, hlayers);
23  const SeedingLayerSetsHits& layers = *hlayers;
24  if(layers.numberOfLayersInSet() != 2)
25  throw cms::Exception("CtfSpecialSeedGenerator") << "You are using " << layers.numberOfLayersInSet() <<" layers in set instead of 2 ";
26 
28  auto innerHits = region.hits(es, ls[0]);
29  auto outerHits = region.hits(es, ls[1]);
30  for (auto iOuterHit = outerHits.begin(); iOuterHit != outerHits.end(); iOuterHit++){
31  for (auto iInnerHit = innerHits.begin(); iInnerHit != innerHits.end(); iInnerHit++){
32  hitPairs.push_back(OrderedHitPair(&(**iInnerHit),
33  &(**iOuterHit))
34  );
35  }
36  }
37  }
38  return hitPairs;
39 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
edm::EDGetTokenT< SeedingLayerSetsHits > theSeedingLayerToken
def ls(path, rec=False)
Definition: eostools.py:349
virtual Hits hits(const edm::EventSetup &es, const SeedingLayerSetsHits::SeedingLayer &layer) const =0
get hits from layer compatible with region constraints

Member Data Documentation

OrderedHitPairs GenericPairGenerator::hitPairs
private

Definition at line 26 of file GenericPairGenerator.h.

Referenced by clear(), and run().

edm::EDGetTokenT<SeedingLayerSetsHits> GenericPairGenerator::theSeedingLayerToken
private

Definition at line 25 of file GenericPairGenerator.h.

Referenced by run().