CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< FastTrackerRecHitRefCollection
simHit2RecHitMapToken
 
edm::EDGetTokenT
< edm::PSimHitContainer
simHitsToken
 

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 ( 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 }
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
FastTrackerRecHitCombiner::~FastTrackerRecHitCombiner ( )
inlineoverride

Definition at line 27 of file FastTrackerRecHitCombiner.cc.

27 { ; }

Member Function Documentation

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

Definition at line 32 of file FastTrackerRecHitCombiner.cc.

32 { ; }
void FastTrackerRecHitCombiner::endStream ( )
inlineoverrideprivate

Definition at line 34 of file FastTrackerRecHitCombiner.cc.

34 { ; }
void FastTrackerRecHitCombiner::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 87 of file FastTrackerRecHitCombiner.cc.

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

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)
void FastTrackerRecHitCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 50 of file FastTrackerRecHitCombiner.cc.

References edm::Event::getByToken(), edm::Ref< C, T, F >::isNull(), minNHits, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), dedxEstimators_cff::simHit2RecHitMap, simHit2RecHitMapToken, trackerHits::simHits, simHitsToken, and PSimHit::trackId().

50  {
51  // input
53  iEvent.getByToken(simHitsToken, simHits);
54 
56  iEvent.getByToken(simHit2RecHitMapToken, simHit2RecHitMap);
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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
def move
Definition: eostools.py:511
bool isNull() const
Checks for null.
Definition: Ref.h:235
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
tuple simHits
Definition: trackerHits.py:16
std::vector< FastTrackerRecHitCombination > FastTrackerRecHitCombinationCollection
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
unsigned int trackId() const
Definition: PSimHit.h:106

Member Data Documentation

unsigned int FastTrackerRecHitCombiner::minNHits
private

Definition at line 39 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 38 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 37 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().