CMS 3D CMS Logo

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