CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  std::auto_ptr< edmNew::DetSetVector<SiStripCluster> > output(new 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(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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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 &)
const std::vector< edm::InputTag > inputTags
virtual void produce(edm::Event &, const edm::EventSetup &)
tuple handle
Definition: patZpeak.py:22
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool isValid() const
Definition: HandleBase.h:75
tuple conf
Definition: dbtoconf.py:185
std::auto_ptr< StripClusterizerAlgorithm > algorithm
SurfaceDeformation * create(int type, const std::vector< double > &params)