CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
SiStripClusterizer Class Reference

#include <SiStripClusterizer.h>

Inheritance diagram for SiStripClusterizer:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 
 SiStripClusterizer (const edm::ParameterSet &conf)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Types

typedef edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > token_t
 
typedef std::vector< token_ttoken_v
 

Private Member Functions

template<class T >
bool findInput (const edm::EDGetTokenT< T > &, edm::Handle< T > &, const edm::Event &)
 

Private Attributes

std::unique_ptr< StripClusterizerAlgorithmalgorithm
 
const std::vector< edm::InputTaginputTags
 
token_v inputTokens
 

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 13 of file SiStripClusterizer.h.

Member Typedef Documentation

◆ token_t

Definition at line 23 of file SiStripClusterizer.h.

◆ token_v

typedef std::vector<token_t> SiStripClusterizer::token_v
private

Definition at line 24 of file SiStripClusterizer.h.

Constructor & Destructor Documentation

◆ SiStripClusterizer()

SiStripClusterizer::SiStripClusterizer ( const edm::ParameterSet conf)
explicit

Definition at line 7 of file SiStripClusterizer.cc.

8  : inputTags(conf.getParameter<std::vector<edm::InputTag>>("DigiProducersList")),
10  conf.getParameter<edm::ParameterSet>("Clusterizer"))) {
11  produces<edmNew::DetSetVector<SiStripCluster>>();
13  inputTags, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripDigi>>(tag); });
14 }

References inputTags, inputTokens, GlobalPosition_Frontier_DevDB_cff::tag, and edm::vector_transform().

Member Function Documentation

◆ findInput()

template<class T >
bool SiStripClusterizer::findInput ( const edm::EDGetTokenT< T > &  tag,
edm::Handle< T > &  handle,
const edm::Event e 
)
inlineprivate

Definition at line 39 of file SiStripClusterizer.cc.

39  {
40  e.getByToken(tag, handle);
41  return handle.isValid();
42 }

References MillePedeFileConverter_cfg::e, patZpeak::handle, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by produce().

◆ produce()

void SiStripClusterizer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 16 of file SiStripClusterizer.cc.

16  {
17  auto output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
18  output->reserve(10000, 4 * 10000);
19 
21  // edm::Handle< edmNew::DetSetVector<SiStripDigi> > inputNew;
22 
23  algorithm->initialize(es);
24 
25  for (auto const& token : inputTokens) {
26  if (findInput(token, inputOld, event))
27  algorithm->clusterize(*inputOld, *output);
28  // else if( findInput( tag, inputNew, event) ) algorithm->clusterize(*inputNew, *output);
29  else
30  edm::LogError("Input Not Found") << "[SiStripClusterizer::produce] "; // << tag;
31  }
32 
33  LogDebug("Output") << output->dataSize() << " clusters from " << output->size() << " modules";
34  output->shrink_to_fit();
35  event.put(std::move(output));
36 }

References algorithm, findInput(), inputTokens, LogDebug, eostools::move(), convertSQLitetoXML_cfg::output, and unpackBuffers-CaloStage2::token.

Member Data Documentation

◆ algorithm

std::unique_ptr<StripClusterizerAlgorithm> SiStripClusterizer::algorithm
private

Definition at line 22 of file SiStripClusterizer.h.

Referenced by produce().

◆ inputTags

const std::vector<edm::InputTag> SiStripClusterizer::inputTags
private

Definition at line 21 of file SiStripClusterizer.h.

Referenced by SiStripClusterizer().

◆ inputTokens

token_v SiStripClusterizer::inputTokens
private

Definition at line 25 of file SiStripClusterizer.h.

Referenced by produce(), and SiStripClusterizer().

convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
patZpeak.handle
handle
Definition: patZpeak.py:23
SiStripClusterizer::algorithm
std::unique_ptr< StripClusterizerAlgorithm > algorithm
Definition: SiStripClusterizer.h:22
SiStripClusterizer::inputTags
const std::vector< edm::InputTag > inputTags
Definition: SiStripClusterizer.h:21
edm::Handle
Definition: AssociativeIterator.h:50
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
edm::vector_transform
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
SiStripClusterizer::findInput
bool findInput(const edm::EDGetTokenT< T > &, edm::Handle< T > &, const edm::Event &)
Definition: SiStripClusterizer.cc:39
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripClusterizer::inputTokens
token_v inputTokens
Definition: SiStripClusterizer.h:25
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
StripClusterizerAlgorithmFactory::create
static std::unique_ptr< StripClusterizerAlgorithm > create(edm::ConsumesCollector &&, const edm::ParameterSet &)
Definition: StripClusterizerAlgorithmFactory.cc:8
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:318