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 | Static Public Member Functions | Private Attributes
MTDClusterProducer Class Reference

EDProducer to cluster FTLRecHits into FTLClusters. More...

Inheritance diagram for MTDClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

 MTDClusterProducer (const edm::ParameterSet &conf)
 Constructor: set the ParameterSet and defer all thinking to setupClusterizer(). More...
 
void produce (edm::Event &e, const edm::EventSetup &c) override
 The "Event" entrypoint: gets called by framework for every event. More...
 
template<typename T >
void run (const T &input, FTLClusterCollection &output)
 Iterate over DetUnits, and invoke the PixelClusterizer on each. More...
 
 ~MTDClusterProducer () override=default
 
- 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT
< FTLRecHitCollection
btlHits_
 
std::unique_ptr
< MTDClusterizerBase
clusterizer_
 
const std::string clusterMode_
 
const edm::EDGetTokenT
< FTLRecHitCollection
etlHits_
 
const std::string ftlbInstance_
 
const std::string ftleInstance_
 
const MTDGeometrygeom_
 
edm::ESGetToken< MTDGeometry,
MTDDigiGeometryRecord
mtdgeoToken_
 
edm::ESGetToken< MTDTopology,
MTDTopologyRcd
mtdtopoToken_
 
const MTDTopologytopo_
 

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

EDProducer to cluster FTLRecHits into FTLClusters.

Definition at line 39 of file MTDClusterProducer.cc.

Constructor & Destructor Documentation

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

Constructor: set the ParameterSet and defer all thinking to setupClusterizer().

Definition at line 72 of file MTDClusterProducer.cc.

References clusterizer_, clusterMode_, Exception, ftlbInstance_, ftleInstance_, mtdgeoToken_, and mtdtopoToken_.

73  : btlHits_(consumes<FTLRecHitCollection>(conf.getParameter<edm::InputTag>("srcBarrel"))),
74  etlHits_(consumes<FTLRecHitCollection>(conf.getParameter<edm::InputTag>("srcEndcap"))),
75  ftlbInstance_(conf.getParameter<std::string>("BarrelClusterName")),
76  ftleInstance_(conf.getParameter<std::string>("EndcapClusterName")),
77  clusterMode_(conf.getParameter<std::string>("ClusterMode")) {
78  //--- Declare to the EDM what kind of collections we will be making.
79  produces<FTLClusterCollection>(ftlbInstance_);
80  produces<FTLClusterCollection>(ftleInstance_);
81 
82  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
83  mtdtopoToken_ = esConsumes<MTDTopology, MTDTopologyRcd>();
84 
85  //--- Make the algorithm(s) according to what the user specified
86  //--- in the ParameterSet.
87  if (clusterMode_ == "MTDThresholdClusterizer") {
88  clusterizer_ = std::make_unique<MTDThresholdClusterizer>(conf);
89  } else {
90  throw cms::Exception("MTDClusterProducer") << "[MTDClusterProducer]:"
91  << " choice " << clusterMode_ << " is invalid.\n"
92  << "Possible choices:\n"
93  << " MTDThresholdClusterizer";
94  }
95 }
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
std::unique_ptr< MTDClusterizerBase > clusterizer_
const edm::EDGetTokenT< FTLRecHitCollection > btlHits_
const edm::EDGetTokenT< FTLRecHitCollection > etlHits_
const std::string clusterMode_
const std::string ftlbInstance_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
const std::string ftleInstance_
MTDClusterProducer::~MTDClusterProducer ( )
overridedefault

Member Function Documentation

void MTDClusterProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 98 of file MTDClusterProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, MTDThresholdClusterizer::fillPSetDescription(), HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

98  {
100  desc.add<edm::InputTag>("srcBarrel", edm::InputTag("mtdRecHits:FTLBarrel"));
101  desc.add<edm::InputTag>("srcEndcap", edm::InputTag("mtdRecHits:FTLEndcap"));
102  desc.add<std::string>("BarrelClusterName", "FTLBarrel");
103  desc.add<std::string>("EndcapClusterName", "FTLEndcap");
104  desc.add<std::string>("ClusterMode", "MTDThresholdClusterizer");
106  descriptions.add("mtdClusterProducer", desc);
107 }
static void fillPSetDescription(edm::ParameterSetDescription &desc)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void MTDClusterProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

The "Event" entrypoint: gets called by framework for every event.

Definition at line 112 of file MTDClusterProducer.cc.

References btlHits_, etlHits_, ftlbInstance_, ftleInstance_, relativeConstraints::geom, geom_, edm::Event::getByToken(), edm::EventSetup::getTransientHandle(), eostools::move(), mtdgeoToken_, mtdtopoToken_, edm::Event::put(), run(), and topo_.

112  {
113  // Step A.1: get input data
116  e.getByToken(btlHits_, inputBarrel);
117  e.getByToken(etlHits_, inputEndcap);
118 
119  // Step A.2: get event setup
120  auto geom = es.getTransientHandle(mtdgeoToken_);
121  geom_ = geom.product();
122 
123  auto mtdTopo = es.getTransientHandle(mtdtopoToken_);
124  topo_ = mtdTopo.product();
125 
126  // Step B: create the final output collection
127  auto outputBarrel = std::make_unique<FTLClusterCollection>();
128  auto outputEndcap = std::make_unique<FTLClusterCollection>();
129 
130  run(*inputBarrel, *outputBarrel);
131  run(*inputEndcap, *outputEndcap);
132 
133  e.put(std::move(outputBarrel), ftlbInstance_);
134  e.put(std::move(outputEndcap), ftleInstance_);
135 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
const edm::EDGetTokenT< FTLRecHitCollection > btlHits_
const edm::EDGetTokenT< FTLRecHitCollection > etlHits_
const MTDTopology * topo_
def move
Definition: eostools.py:511
void run(const T &input, FTLClusterCollection &output)
Iterate over DetUnits, and invoke the PixelClusterizer on each.
const std::string ftlbInstance_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
const std::string ftleInstance_
const MTDGeometry * geom_
template<typename T >
void MTDClusterProducer::run ( const T input,
FTLClusterCollection output 
)

Iterate over DetUnits, and invoke the PixelClusterizer on each.

Definition at line 141 of file MTDClusterProducer.cc.

References clusterizer_, clusterMode_, Exception, geom_, LogDebug, edmNew::DetSetVector< T >::size(), and topo_.

Referenced by produce().

141  {
142  if (!clusterizer_) {
143  throw cms::Exception("MTDClusterProducer") << " at least one clusterizer is not ready -- can't run!";
144  }
145 
146  clusterizer_->clusterize(input, geom_, topo_, output);
147 
148  LogDebug("MTDClusterProducer") << " Executing " << clusterMode_ << " resulted in " << output.size()
149  << " MTDClusters for " << input.size() << " Hits.";
150 }
std::unique_ptr< MTDClusterizerBase > clusterizer_
static std::string const input
Definition: EdmProvDump.cc:47
const MTDTopology * topo_
const std::string clusterMode_
size_type size() const
const MTDGeometry * geom_
#define LogDebug(id)

Member Data Documentation

const edm::EDGetTokenT<FTLRecHitCollection> MTDClusterProducer::btlHits_
private

Definition at line 54 of file MTDClusterProducer.cc.

Referenced by produce().

std::unique_ptr<MTDClusterizerBase> MTDClusterProducer::clusterizer_
private

Definition at line 61 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and run().

const std::string MTDClusterProducer::clusterMode_
private

Definition at line 60 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and run().

const edm::EDGetTokenT<FTLRecHitCollection> MTDClusterProducer::etlHits_
private

Definition at line 55 of file MTDClusterProducer.cc.

Referenced by produce().

const std::string MTDClusterProducer::ftlbInstance_
private

Definition at line 57 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

const std::string MTDClusterProducer::ftleInstance_
private

Definition at line 58 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

const MTDGeometry* MTDClusterProducer::geom_
private

Definition at line 63 of file MTDClusterProducer.cc.

Referenced by produce(), and run().

edm::ESGetToken<MTDGeometry, MTDDigiGeometryRecord> MTDClusterProducer::mtdgeoToken_
private

Definition at line 65 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

edm::ESGetToken<MTDTopology, MTDTopologyRcd> MTDClusterProducer::mtdtopoToken_
private

Definition at line 66 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

const MTDTopology* MTDClusterProducer::topo_
private

Definition at line 64 of file MTDClusterProducer.cc.

Referenced by produce(), and run().