CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 FastTrackerRecHitCombiner (const edm::ParameterSet &)
 
 ~FastTrackerRecHitCombiner ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void beginStream (edm::StreamID) override
 
virtual void endStream () override
 
virtual 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<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 17 of file FastTrackerRecHitCombiner.cc.

Constructor & Destructor Documentation

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

Definition at line 38 of file FastTrackerRecHitCombiner.cc.

39  : simHitsToken(consumes<edm::PSimHitContainer>(iConfig.getParameter<edm::InputTag>("simHits")))
40  , simHit2RecHitMapToken(consumes<FastTrackerRecHitRefCollection>(iConfig.getParameter<edm::InputTag>("simHit2RecHitMap")))
41  , minNHits(iConfig.getParameter<unsigned int>("minNHits"))
42 {
43  produces<FastTrackerRecHitCombinationCollection>();
44 }
T getParameter(std::string const &) const
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
edm::EDGetTokenT< edm::PSimHitContainer > simHitsToken
FastTrackerRecHitCombiner::~FastTrackerRecHitCombiner ( )
inline

Definition at line 21 of file FastTrackerRecHitCombiner.cc.

21 {;}

Member Function Documentation

virtual void FastTrackerRecHitCombiner::beginStream ( edm::StreamID  )
inlineoverrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 27 of file FastTrackerRecHitCombiner.cc.

27 {;}
virtual void FastTrackerRecHitCombiner::endStream ( )
inlineoverrideprivatevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 29 of file FastTrackerRecHitCombiner.cc.

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

Definition at line 90 of file FastTrackerRecHitCombiner.cc.

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

90  {
91  //The following says we do not know what parameters are allowed so do no validation
92  // Please change this to state exactly what you do use, even if it is no parameters
94  desc.setUnknown();
95  descriptions.addDefault(desc);
96 }
void addDefault(ParameterSetDescription const &psetDescription)
void FastTrackerRecHitCombiner::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::stream::EDProducerBase.

Definition at line 48 of file FastTrackerRecHitCombiner.cc.

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

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

49 {
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 
64  // get simHit and recHit
65  const PSimHit & simHit = (*simHits)[simHitCounter];
66  const FastTrackerRecHitRef & recHit = (*simHit2RecHitMap)[simHitCounter];
67 
68  // add recHit to latest combination
69  if(!recHit.isNull())
70  currentCombination.push_back(recHit);
71 
72  // if simTrackId is about to change, add combination
73  if(simHits->size()-simHitCounter == 1 || simHit.trackId() != (*simHits)[simHitCounter+1].trackId() ){
74  // combination must have sufficient hits
75  if(currentCombination.size() >= minNHits){
76  currentCombination.shrink_to_fit();
77  output->push_back(currentCombination);
78  }
79  currentCombination.clear();
80  }
81  }
82 
83  // put output in event
84  iEvent.put(std::move(output));
85 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< FastTrackerRecHitRefCollection > simHit2RecHitMapToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
bool isNull() const
Checks for null.
Definition: Ref.h:249
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:102

Member Data Documentation

unsigned int FastTrackerRecHitCombiner::minNHits
private

Definition at line 34 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 33 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().

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

Definition at line 32 of file FastTrackerRecHitCombiner.cc.

Referenced by produce().