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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 45 of file FastTrackerRecHitCombiner.cc.

46  : simHitsToken(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("simHits")))
47  , simHit2RecHitMapToken(consumes<FastTrackerRecHitRefCollection>(iConfig.getParameter<edm::InputTag>("simHit2RecHitMap")))
48  , minNHits(iConfig.getParameter<unsigned int>("minNHits"))
49 {
50  produces<FastTrackerRecHitCombinationCollection>();
51 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
FastTrackerRecHitCombiner::~FastTrackerRecHitCombiner ( )
inlineoverride

Definition at line 28 of file FastTrackerRecHitCombiner.cc.

References fillDescriptions().

28 {;}

Member Function Documentation

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

Definition at line 34 of file FastTrackerRecHitCombiner.cc.

References produce().

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

Definition at line 36 of file FastTrackerRecHitCombiner.cc.

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

Definition at line 97 of file FastTrackerRecHitCombiner.cc.

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

Referenced by ~FastTrackerRecHitCombiner().

97  {
98  //The following says we do not know what parameters are allowed so do no validation
99  // Please change this to state exactly what you do use, even if it is no parameters
101  desc.setUnknown();
102  descriptions.addDefault(desc);
103 }
void addDefault(ParameterSetDescription const &psetDescription)
void FastTrackerRecHitCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 55 of file FastTrackerRecHitCombiner.cc.

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

Referenced by beginStream(), JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

56 {
57 
58  // input
60  iEvent.getByToken(simHitsToken,simHits);
61 
63  iEvent.getByToken(simHit2RecHitMapToken,simHit2RecHitMap);
64 
65  // output
66  std::unique_ptr<FastTrackerRecHitCombinationCollection> output(new FastTrackerRecHitCombinationCollection);
67 
68  FastTrackerRecHitCombination currentCombination;
69  for(unsigned int simHitCounter = 0;simHitCounter < simHits->size();simHitCounter++){
70 
71  // get simHit and recHit
72  const PSimHit & simHit = (*simHits)[simHitCounter];
73  const FastTrackerRecHitRef & recHit = (*simHit2RecHitMap)[simHitCounter];
74 
75  // add recHit to latest combination
76  if(!recHit.isNull())
77  currentCombination.push_back(recHit);
78 
79  // if simTrackId is about to change, add combination
80  if(simHits->size()-simHitCounter == 1 || simHit.trackId() != (*simHits)[simHitCounter+1].trackId() ){
81  // combination must have sufficient hits
82  if(currentCombination.size() >= minNHits){
83  currentCombination.shrink_to_fit();
84  output->push_back(currentCombination);
85  }
86  currentCombination.clear();
87  }
88  }
89 
90  // put output in event
91  iEvent.put(std::move(output));
92 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
bool isNull() const
Checks for null.
Definition: Ref.h:250
std::vector< FastTrackerRecHitRef > FastTrackerRecHitCombination
std::vector< FastTrackerRecHitCombination > FastTrackerRecHitCombinationCollection
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
unsigned int trackId() const
Definition: PSimHit.h:102
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

unsigned int FastTrackerRecHitCombiner::minNHits
private

Definition at line 41 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 40 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 39 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().