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 | 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
 
 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
 

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
< StripClusterizerAlgorithm
algorithm
 
const std::vector< edm::InputTaginputTags
 
token_v inputTokens
 

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 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 8 of file SiStripClusterizer.cc.

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

9  : inputTags(conf.getParameter<std::vector<edm::InputTag>>("DigiProducersList")),
11  conf.getParameter<edm::ParameterSet>("Clusterizer"))) {
12  produces<edmNew::DetSetVector<SiStripCluster>>();
14  inputTags, [this](edm::InputTag const& tag) { return consumes<edm::DetSetVector<SiStripDigi>>(tag); });
15 }
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
std::unique_ptr< StripClusterizerAlgorithm > algorithm
const std::vector< edm::InputTag > inputTags
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static std::unique_ptr< StripClusterizerAlgorithm > create(edm::ConsumesCollector &&, const edm::ParameterSet &)

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 40 of file SiStripClusterizer.cc.

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

Referenced by produce().

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

Definition at line 17 of file SiStripClusterizer.cc.

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

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

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

Definition at line 21 of file SiStripClusterizer.h.

Referenced by SiStripClusterizer().

token_v SiStripClusterizer::inputTokens
private

Definition at line 25 of file SiStripClusterizer.h.

Referenced by produce(), and SiStripClusterizer().