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

Definition at line 23 of file SiStripClusterizer.h.

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

Definition at line 24 of file SiStripClusterizer.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file SiStripClusterizer.cc.

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

8  : inputTags(conf.getParameter<std::vector<edm::InputTag>>("DigiProducersList")),
10  produces<edmNew::DetSetVector<SiStripCluster>>();
12  inputTags, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripDigi>>(tag); });
13 }
T getParameter(std::string const &) const
static std::unique_ptr< StripClusterizerAlgorithm > create(const edm::ParameterSet &)
std::unique_ptr< StripClusterizerAlgorithm > algorithm
const std::vector< edm::InputTag > inputTags
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

Member Function Documentation

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

Definition at line 38 of file SiStripClusterizer.cc.

References edm::Event::getByToken(), and edm::HandleBase::isValid().

Referenced by produce().

38  {
39  e.getByToken(tag, handle);
40  return handle.isValid();
41 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool isValid() const
Definition: HandleBase.h:70
void SiStripClusterizer::produce ( edm::Event event,
const edm::EventSetup es 
)
override

Definition at line 15 of file SiStripClusterizer.cc.

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

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

Member Data Documentation

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

Definition at line 22 of file SiStripClusterizer.h.

Referenced by produce().

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

Definition at line 25 of file SiStripClusterizer.h.

Referenced by produce(), and SiStripClusterizer().