CMS 3D CMS Logo

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT< FTLRecHitCollectionbtlHits_
 
std::unique_ptr< MTDClusterizerBaseclusterizer_
 
const std::string clusterMode_
 
const edm::EDGetTokenT< FTLRecHitCollectionetlHits_
 
const std::string ftlbInstance_
 
const std::string ftleInstance_
 
const MTDGeometrygeom_
 
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecordmtdgeoToken_
 
edm::ESGetToken< MTDTopology, MTDTopologyRcdmtdtopoToken_
 
const MTDTopologytopo_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

EDProducer to cluster FTLRecHits into FTLClusters.

Definition at line 39 of file MTDClusterProducer.cc.

Constructor & Destructor Documentation

◆ MTDClusterProducer()

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.

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  clusterizer_(nullptr) // the default, in case we fail to make one
79 {
80  //--- Declare to the EDM what kind of collections we will be making.
81  produces<FTLClusterCollection>(ftlbInstance_);
82  produces<FTLClusterCollection>(ftleInstance_);
83 
84  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
85  mtdtopoToken_ = esConsumes<MTDTopology, MTDTopologyRcd>();
86 
87  //--- Make the algorithm(s) according to what the user specified
88  //--- in the ParameterSet.
89  if (clusterMode_ == "MTDThresholdClusterizer") {
90  clusterizer_ = std::make_unique<MTDThresholdClusterizer>(conf);
91  } else {
92  throw cms::Exception("MTDClusterProducer") << "[MTDClusterProducer]:"
93  << " choice " << clusterMode_ << " is invalid.\n"
94  << "Possible choices:\n"
95  << " MTDThresholdClusterizer";
96  }
97 }

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

◆ ~MTDClusterProducer()

MTDClusterProducer::~MTDClusterProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 100 of file MTDClusterProducer.cc.

100  {
102  desc.add<edm::InputTag>("srcBarrel", edm::InputTag("mtdRecHits:FTLBarrel"));
103  desc.add<edm::InputTag>("srcEndcap", edm::InputTag("mtdRecHits:FTLEndcap"));
104  desc.add<std::string>("BarrelClusterName", "FTLBarrel");
105  desc.add<std::string>("EndcapClusterName", "FTLEndcap");
106  desc.add<std::string>("ClusterMode", "MTDThresholdClusterizer");
108  descriptions.add("mtdClusterProducer", desc);
109 }

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

◆ produce()

void MTDClusterProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
override

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

Definition at line 114 of file MTDClusterProducer.cc.

114  {
115  // Step A.1: get input data
118  e.getByToken(btlHits_, inputBarrel);
119  e.getByToken(etlHits_, inputEndcap);
120 
121  // Step A.2: get event setup
122  auto geom = es.getTransientHandle(mtdgeoToken_);
123  geom_ = geom.product();
124 
125  auto mtdTopo = es.getTransientHandle(mtdtopoToken_);
126  topo_ = mtdTopo.product();
127 
128  // Step B: create the final output collection
129  auto outputBarrel = std::make_unique<FTLClusterCollection>();
130  auto outputEndcap = std::make_unique<FTLClusterCollection>();
131 
132  run(*inputBarrel, *outputBarrel);
133  run(*inputEndcap, *outputEndcap);
134 
135  e.put(std::move(outputBarrel), ftlbInstance_);
136  e.put(std::move(outputEndcap), ftleInstance_);
137 }

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

◆ run()

template<typename T >
void MTDClusterProducer::run ( const T input,
FTLClusterCollection output 
)

Iterate over DetUnits, and invoke the PixelClusterizer on each.

Definition at line 143 of file MTDClusterProducer.cc.

143  {
144  if (!clusterizer_) {
145  throw cms::Exception("MTDClusterProducer") << " at least one clusterizer is not ready -- can't run!";
146  }
147 
148  clusterizer_->clusterize(input, geom_, topo_, output);
149 
150  LogDebug("MTDClusterProducer") << " Executing " << clusterMode_ << " resulted in " << output.size()
151  << " MTDClusters for " << input.size() << " Hits.";
152 }

References clusterizer_, clusterMode_, Exception, geom_, input, LogDebug, convertSQLitetoXML_cfg::output, and topo_.

Referenced by produce().

Member Data Documentation

◆ btlHits_

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

Definition at line 54 of file MTDClusterProducer.cc.

Referenced by produce().

◆ clusterizer_

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

Definition at line 61 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and run().

◆ clusterMode_

const std::string MTDClusterProducer::clusterMode_
private

Definition at line 60 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and run().

◆ etlHits_

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

Definition at line 55 of file MTDClusterProducer.cc.

Referenced by produce().

◆ ftlbInstance_

const std::string MTDClusterProducer::ftlbInstance_
private

Definition at line 57 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

◆ ftleInstance_

const std::string MTDClusterProducer::ftleInstance_
private

Definition at line 58 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

◆ geom_

const MTDGeometry* MTDClusterProducer::geom_
private

Definition at line 63 of file MTDClusterProducer.cc.

Referenced by produce(), and run().

◆ mtdgeoToken_

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

Definition at line 65 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

◆ mtdtopoToken_

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

Definition at line 66 of file MTDClusterProducer.cc.

Referenced by MTDClusterProducer(), and produce().

◆ topo_

const MTDTopology* MTDClusterProducer::topo_
private

Definition at line 64 of file MTDClusterProducer.cc.

Referenced by produce(), and run().

MTDClusterProducer::run
void run(const T &input, FTLClusterCollection &output)
Iterate over DetUnits, and invoke the PixelClusterizer on each.
Definition: MTDClusterProducer.cc:143
input
static const std::string input
Definition: EdmProvDump.cc:48
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
MTDClusterProducer::ftlbInstance_
const std::string ftlbInstance_
Definition: MTDClusterProducer.cc:57
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MTDClusterProducer::etlHits_
const edm::EDGetTokenT< FTLRecHitCollection > etlHits_
Definition: MTDClusterProducer.cc:55
MTDClusterProducer::mtdgeoToken_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
Definition: MTDClusterProducer.cc:65
edm::Handle
Definition: AssociativeIterator.h:50
MTDClusterProducer::ftleInstance_
const std::string ftleInstance_
Definition: MTDClusterProducer.cc:58
MTDClusterProducer::mtdtopoToken_
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
Definition: MTDClusterProducer.cc:66
MTDClusterProducer::topo_
const MTDTopology * topo_
Definition: MTDClusterProducer.cc:64
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
MTDClusterProducer::geom_
const MTDGeometry * geom_
Definition: MTDClusterProducer.cc:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
MTDClusterProducer::clusterMode_
const std::string clusterMode_
Definition: MTDClusterProducer.cc:60
MTDThresholdClusterizer::fillDescriptions
static void fillDescriptions(edm::ParameterSetDescription &desc)
Definition: MTDThresholdClusterizer.cc:50
MTDClusterProducer::clusterizer_
std::unique_ptr< MTDClusterizerBase > clusterizer_
Definition: MTDClusterProducer.cc:61
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
Exception
Definition: hltDiff.cc:245
MTDClusterProducer::btlHits_
const edm::EDGetTokenT< FTLRecHitCollection > btlHits_
Definition: MTDClusterProducer.cc:54
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37