CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
MTDTrackingRecHitProducer Class Reference
Inheritance diagram for MTDTrackingRecHitProducer:
edm::stream::EDProducer<>

Public Member Functions

 MTDTrackingRecHitProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &evt, const edm::EventSetup &es) override
 
void run (edm::Handle< edmNew::DetSetVector< FTLCluster > > inputHandle, MTDTrackingDetSetVector &output)
 
 ~MTDTrackingRecHitProducer () 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 MTDClusterParameterEstimatorcpe_
 
edm::ESGetToken< MTDClusterParameterEstimator, MTDCPERecordcpeToken_
 
const edm::EDGetTokenT< FTLClusterCollectionftlbClusters_
 
const edm::EDGetTokenT< FTLClusterCollectionftleClusters_
 
const MTDGeometrygeom_
 
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecordmtdgeoToken_
 

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

Definition at line 32 of file MTDTrackingRecHitProducer.cc.

Constructor & Destructor Documentation

◆ MTDTrackingRecHitProducer()

MTDTrackingRecHitProducer::MTDTrackingRecHitProducer ( const edm::ParameterSet ps)
explicit

Definition at line 51 of file MTDTrackingRecHitProducer.cc.

52  : ftlbClusters_(consumes<FTLClusterCollection>(ps.getParameter<edm::InputTag>("barrelClusters"))),
53  ftleClusters_(consumes<FTLClusterCollection>(ps.getParameter<edm::InputTag>("endcapClusters"))) {
54  produces<MTDTrackingDetSetVector>();
55  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
56  cpeToken_ = esConsumes<MTDClusterParameterEstimator, MTDCPERecord>(edm::ESInputTag("", "MTDCPEBase"));
57 }

References cpeToken_, and mtdgeoToken_.

◆ ~MTDTrackingRecHitProducer()

MTDTrackingRecHitProducer::~MTDTrackingRecHitProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 60 of file MTDTrackingRecHitProducer.cc.

60  {
62  desc.add<edm::InputTag>("barrelClusters", edm::InputTag("mtdClusters:FTLBarrel"));
63  desc.add<edm::InputTag>("endcapClusters", edm::InputTag("mtdClusters:FTLEndcap"));
64  descriptions.add("mtdTrackingRecHitProducer", desc);
65 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void MTDTrackingRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 67 of file MTDTrackingRecHitProducer.cc.

67  {
69  geom_ = geom.product();
70 
71  auto cpe = es.getTransientHandle(cpeToken_);
72  cpe_ = cpe.product();
73 
75  evt.getByToken(ftlbClusters_, inputBarrel);
76 
78  evt.getByToken(ftleClusters_, inputEndcap);
79 
80  auto outputhits = std::make_unique<MTDTrackingDetSetVector>();
81  auto& theoutputhits = *outputhits;
82 
83  run(inputBarrel, theoutputhits);
84  run(inputEndcap, theoutputhits);
85 
86  evt.put(std::move(outputhits));
87 }

References cpe_, cpeToken_, ftlbClusters_, ftleClusters_, relativeConstraints::geom, geom_, edm::Event::getByToken(), edm::EventSetup::getTransientHandle(), eostools::move(), mtdgeoToken_, edm::Event::put(), and run().

◆ run()

void MTDTrackingRecHitProducer::run ( edm::Handle< edmNew::DetSetVector< FTLCluster > >  inputHandle,
MTDTrackingDetSetVector output 
)

Iterate over DetUnits, then over Clusters and invoke the CPE on each, and make a RecHit to store the result.

Definition at line 93 of file MTDTrackingRecHitProducer.cc.

93  {
94  const edmNew::DetSetVector<FTLCluster>& input = *inputHandle;
96 
97  DEBUG("inputCollection " << input.size());
98  for (; DSViter != input.end(); DSViter++) {
99  unsigned int detid = DSViter->detId();
100  DetId detIdObject(detid);
101  const auto genericDet = geom_->idToDetUnit(detIdObject);
102  if (genericDet == nullptr) {
103  throw cms::Exception("MTDTrackingRecHitProducer")
104  << "GeographicalID: " << std::hex << detid << " is invalid!" << std::dec << std::endl;
105  }
106 
107  MTDTrackingDetSetVector::FastFiller recHitsOnDet(output, detid);
108 
109  edmNew::DetSet<FTLCluster>::const_iterator clustIt = DSViter->begin(), clustEnd = DSViter->end();
110 
111  for (; clustIt != clustEnd; clustIt++) {
112  DEBUG("Cluster: size " << clustIt->size() << " " << clustIt->x() << "," << clustIt->y() << " "
113  << clustIt->energy() << " " << clustIt->time());
114  MTDClusterParameterEstimator::ReturnType tuple = cpe_->getParameters(*clustIt, *genericDet);
115  LocalPoint lp(std::get<0>(tuple));
116  LocalError le(std::get<1>(tuple));
117 
118  // Create a persistent edm::Ref to the cluster
120  // Make a RecHit and add it to the DetSet
121  MTDTrackingRecHit hit(lp, le, *genericDet, cluster);
122  DEBUG("MTD_TRH: " << hit.localPosition().x() << "," << hit.localPosition().y() << " : "
123  << hit.localPositionError().xx() << "," << hit.localPositionError().yy() << " : " << hit.time()
124  << " : " << hit.timeError());
125  // Now save it =================
126  recHitsOnDet.push_back(hit);
127  } // <-- End loop on Clusters
128  } // <-- End loop on DetUnits
129  DEBUG("outputCollection " << output.size());
130 }

References edmNew::DetSetVector< T >::begin(), cpe_, DEBUG, TauDecayModes::dec, edmNew::DetSetVector< T >::end(), Exception, geom_, MTDClusterParameterEstimator::getParameters(), MTDGeometry::idToDetUnit(), input, edmNew::makeRefTo(), convertSQLitetoXML_cfg::output, edmNew::DetSetVector< T >::FastFiller::push_back(), edmNew::DetSet< T >::size(), hit::x, and hit::y.

Referenced by produce().

Member Data Documentation

◆ cpe_

const MTDClusterParameterEstimator* MTDTrackingRecHitProducer::cpe_
private

Definition at line 46 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().

◆ cpeToken_

edm::ESGetToken<MTDClusterParameterEstimator, MTDCPERecord> MTDTrackingRecHitProducer::cpeToken_
private

Definition at line 48 of file MTDTrackingRecHitProducer.cc.

Referenced by MTDTrackingRecHitProducer(), and produce().

◆ ftlbClusters_

const edm::EDGetTokenT<FTLClusterCollection> MTDTrackingRecHitProducer::ftlbClusters_
private

Definition at line 42 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

◆ ftleClusters_

const edm::EDGetTokenT<FTLClusterCollection> MTDTrackingRecHitProducer::ftleClusters_
private

Definition at line 43 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

◆ geom_

const MTDGeometry* MTDTrackingRecHitProducer::geom_
private

Definition at line 45 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().

◆ mtdgeoToken_

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

Definition at line 47 of file MTDTrackingRecHitProducer.cc.

Referenced by MTDTrackingRecHitProducer(), and produce().

MTDTrackingRecHitProducer::cpeToken_
edm::ESGetToken< MTDClusterParameterEstimator, MTDCPERecord > cpeToken_
Definition: MTDTrackingRecHitProducer.cc:48
MTDTrackingRecHitProducer::geom_
const MTDGeometry * geom_
Definition: MTDTrackingRecHitProducer.cc:45
DEBUG
#define DEBUG(x)
Definition: MTDTrackingRecHitProducer.cc:29
edm::ESInputTag
Definition: ESInputTag.h:87
input
static const std::string input
Definition: EdmProvDump.cc:48
MTDClusterParameterEstimator::ReturnType
std::tuple< LocalPoint, LocalError, TimeValue, TimeValueError > ReturnType
Definition: MTDClusterParameterEstimator.h:25
hit::y
double y
Definition: SiStripHitEffFromCalibTree.cc:90
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
FTLCluster
Definition: FTLCluster.h:21
MTDTrackingRecHitProducer::ftleClusters_
const edm::EDGetTokenT< FTLClusterCollection > ftleClusters_
Definition: MTDTrackingRecHitProducer.cc:43
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edmNew::makeRefTo
edm::Ref< typename HandleT::element_type, typename HandleT::element_type::value_type::value_type > makeRefTo(const HandleT &iHandle, typename HandleT::element_type::value_type::const_iterator itIter)
Definition: DetSetVectorNew.h:689
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:530
edm::Handle
Definition: AssociativeIterator.h:50
MTDTrackingRecHitProducer::mtdgeoToken_
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
Definition: MTDTrackingRecHitProducer.cc:47
MTDGeometry::idToDetUnit
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:163
edm::Ref
Definition: AssociativeIterator.h:58
edmNew::DetSet::size
size_type size() const
Definition: DetSetNew.h:68
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
DetId
Definition: DetId.h:17
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
Point3DBase< float, LocalTag >
LocalError
Definition: LocalError.h:12
MTDTrackingRecHit
A 2D TrackerRecHit with time and time error information.
Definition: MTDTrackingRecHit.h:10
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
MTDTrackingRecHitProducer::ftlbClusters_
const edm::EDGetTokenT< FTLClusterCollection > ftlbClusters_
Definition: MTDTrackingRecHitProducer.cc:42
edm::EventSetup::getTransientHandle
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:166
edmNew::DetSetVector
Definition: DetSetNew.h:13
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
MTDTrackingRecHitProducer::cpe_
const MTDClusterParameterEstimator * cpe_
Definition: MTDTrackingRecHitProducer.cc:46
MTDClusterParameterEstimator::getParameters
virtual ReturnType getParameters(const FTLCluster &cl, const GeomDetUnit &det) const =0
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:535
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MTDTrackingRecHitProducer::run
void run(edm::Handle< edmNew::DetSetVector< FTLCluster > > inputHandle, MTDTrackingDetSetVector &output)
Definition: MTDTrackingRecHitProducer.cc:93
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:202
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31