CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FastTrackerRecHitCombiner Class Reference
Inheritance diagram for FastTrackerRecHitCombiner:
edm::stream::EDProducer<>

Public Member Functions

 FastTrackerRecHitCombiner (const edm::ParameterSet &)
 
 ~FastTrackerRecHitCombiner () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginStream (edm::StreamID) override
 
void endStream () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

unsigned int minNHits
 
edm::EDGetTokenT< FastTrackerRecHitRefCollectionsimHit2RecHitMapToken
 
edm::EDGetTokenT< edm::PSimHitContainersimHitsToken
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 24 of file FastTrackerRecHitCombiner.cc.

Constructor & Destructor Documentation

◆ FastTrackerRecHitCombiner()

FastTrackerRecHitCombiner::FastTrackerRecHitCombiner ( const edm::ParameterSet iConfig)
explicit

Definition at line 42 of file FastTrackerRecHitCombiner.cc.

43  : simHitsToken(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("simHits"))),
45  consumes<FastTrackerRecHitRefCollection>(iConfig.getParameter<edm::InputTag>("simHit2RecHitMap"))),
46  minNHits(iConfig.getParameter<unsigned int>("minNHits")) {
47  produces<FastTrackerRecHitCombinationCollection>();
48 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken

◆ ~FastTrackerRecHitCombiner()

FastTrackerRecHitCombiner::~FastTrackerRecHitCombiner ( )
inlineoverride

Definition at line 27 of file FastTrackerRecHitCombiner.cc.

27 { ; }

Member Function Documentation

◆ beginStream()

void FastTrackerRecHitCombiner::beginStream ( edm::StreamID  )
inlineoverrideprivate

Definition at line 32 of file FastTrackerRecHitCombiner.cc.

32 { ; }

◆ endStream()

void FastTrackerRecHitCombiner::endStream ( )
inlineoverrideprivate

Definition at line 34 of file FastTrackerRecHitCombiner.cc.

34 { ; }

◆ fillDescriptions()

void FastTrackerRecHitCombiner::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 87 of file FastTrackerRecHitCombiner.cc.

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

87  {
88  //The following says we do not know what parameters are allowed so do no validation
89  // Please change this to state exactly what you do use, even if it is no parameters
91  desc.setUnknown();
92  descriptions.addDefault(desc);
93 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

void FastTrackerRecHitCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 50 of file FastTrackerRecHitCombiner.cc.

References iEvent, minNHits, eostools::move(), convertSQLitetoXML_cfg::output, rpcPointValidation_cfi::recHit, rpcPointValidation_cfi::simHit, Reconstruction_BefMix_cff::simHit2RecHitMap, simHit2RecHitMapToken, FastTrackerRecHitCombiner_cfi::simHits, and simHitsToken.

50  {
51  // input
53  iEvent.getByToken(simHitsToken, simHits);
54 
57 
58  // output
59  std::unique_ptr<FastTrackerRecHitCombinationCollection> output(new FastTrackerRecHitCombinationCollection);
60 
61  FastTrackerRecHitCombination currentCombination;
62  for (unsigned int simHitCounter = 0; simHitCounter < simHits->size(); simHitCounter++) {
63  // get simHit and recHit
64  const PSimHit& simHit = (*simHits)[simHitCounter];
65  const FastTrackerRecHitRef& recHit = (*simHit2RecHitMap)[simHitCounter];
66 
67  // add recHit to latest combination
68  if (!recHit.isNull())
69  currentCombination.push_back(recHit);
70 
71  // if simTrackId is about to change, add combination
72  if (simHits->size() - simHitCounter == 1 || simHit.trackId() != (*simHits)[simHitCounter + 1].trackId()) {
73  // combination must have sufficient hits
74  if (currentCombination.size() >= minNHits) {
75  currentCombination.shrink_to_fit();
76  output->push_back(currentCombination);
77  }
78  currentCombination.clear();
79  }
80  }
81 
82  // put output in event
83  iEvent.put(std::move(output));
84 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
std::vector< FastTrackerRecHitCombination > FastTrackerRecHitCombinationCollection
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ minNHits

unsigned int FastTrackerRecHitCombiner::minNHits
private

Definition at line 39 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

◆ simHit2RecHitMapToken

edm::EDGetTokenT<FastTrackerRecHitRefCollection> FastTrackerRecHitCombiner::simHit2RecHitMapToken
private

Definition at line 38 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

◆ simHitsToken

edm::EDGetTokenT<edm::PSimHitContainer> FastTrackerRecHitCombiner::simHitsToken
private

Definition at line 37 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().