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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 }

◆ ~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.

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 }

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

◆ produce()

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

Definition at line 50 of file FastTrackerRecHitCombiner.cc.

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 }

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

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().

convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
edm::Handle< edm::PSimHitContainer >
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
edm::Ref
Definition: AssociativeIterator.h:58
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
Reconstruction_BefMix_cff.simHit2RecHitMap
simHit2RecHitMap
Definition: Reconstruction_BefMix_cff.py:22
FastTrackerRecHitCombiner::minNHits
unsigned int minNHits
Definition: FastTrackerRecHitCombiner.cc:39
FastTrackerRecHitCombinationCollection
std::vector< FastTrackerRecHitCombination > FastTrackerRecHitCombinationCollection
Definition: FastTrackerRecHitCollection.h:12
FastTrackerRecHitCombiner::simHitsToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
Definition: FastTrackerRecHitCombiner.cc:37
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
FastTrackerRecHitCombiner::simHit2RecHitMapToken
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
Definition: FastTrackerRecHitCombiner.cc:38
eostools.move
def move(src, dest)
Definition: eostools.py:511
FastTrackerRecHitCombination
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
Definition: FastTrackerRecHitCollection.h:11
PSimHit
Definition: PSimHit.h:15
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15