CMS 3D CMS Logo

SiStripClusterizer.cc
Go to the documentation of this file.
6 #include "boost/foreach.hpp"
7 
8 
11  : inputTags( conf.getParameter<std::vector<edm::InputTag> >("DigiProducersList") ),
12  algorithm( StripClusterizerAlgorithmFactory::create(conf.getParameter<edm::ParameterSet>("Clusterizer")) ) {
13  produces< edmNew::DetSetVector<SiStripCluster> > ();
14  inputTokens = edm::vector_transform( inputTags, [this](edm::InputTag const & tag) { return consumes< edm::DetSetVector<SiStripDigi> >(tag);} );
15 }
16 
19 
20  auto output = std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
21  output->reserve(10000,4*10000);
22 
24 // edm::Handle< edmNew::DetSetVector<SiStripDigi> > inputNew;
25 
26  algorithm->initialize(es);
27 
28  BOOST_FOREACH( const edm::EDGetTokenT< edm::DetSetVector<SiStripDigi> >& token, inputTokens) {
29  if( findInput( token, inputOld, event) ) algorithm->clusterize(*inputOld, *output);
30 // else if( findInput( tag, inputNew, event) ) algorithm->clusterize(*inputNew, *output);
31  else edm::LogError("Input Not Found") << "[SiStripClusterizer::produce] ";// << tag;
32  }
33 
34  LogDebug("Output") << output->dataSize() << " clusters from "
35  << output->size() << " modules";
36  output->shrink_to_fit();
37  event.put(std::move(output));
38 }
39 
40 template<class T>
41 inline
44  e.getByToken( tag, handle);
45  return handle.isValid();
46 }
#define LogDebug(id)
SiStripClusterizer(const edm::ParameterSet &conf)
def create(alignables, pedeDump, additionalData, outputFile, config)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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
bool findInput(const edm::EDGetTokenT< T > &, edm::Handle< T > &, const edm::Event &)
std::unique_ptr< StripClusterizerAlgorithm > algorithm
const std::vector< edm::InputTag > inputTags
virtual void produce(edm::Event &, const edm::EventSetup &)
bool isValid() const
Definition: HandleBase.h:74
HLT enums.
def move(src, dest)
Definition: eostools.py:510
Definition: event.py:1