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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const MTDClusterParameterEstimatorcpe_
 
const edm::EDGetTokenT< FTLClusterCollectionftlbClusters_
 
const edm::EDGetTokenT< FTLClusterCollectionftleClusters_
 
const MTDGeometrygeom_
 

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 33 of file MTDTrackingRecHitProducer.cc.

Constructor & Destructor Documentation

◆ MTDTrackingRecHitProducer()

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

Definition at line 50 of file MTDTrackingRecHitProducer.cc.

51  : ftlbClusters_(consumes<FTLClusterCollection>(ps.getParameter<edm::InputTag>("barrelClusters"))),
52  ftleClusters_(consumes<FTLClusterCollection>(ps.getParameter<edm::InputTag>("endcapClusters"))) {
53  produces<MTDTrackingDetSetVector>();
54 }

◆ ~MTDTrackingRecHitProducer()

MTDTrackingRecHitProducer::~MTDTrackingRecHitProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 57 of file MTDTrackingRecHitProducer.cc.

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

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 64 of file MTDTrackingRecHitProducer.cc.

64  {
67  geom_ = geom.product();
68 
70  es.get<MTDCPERecord>().get("MTDCPEBase", cpe);
71  cpe_ = cpe.product();
72 
74  evt.getByToken(ftlbClusters_, inputBarrel);
75 
77  evt.getByToken(ftleClusters_, inputEndcap);
78 
79  auto outputhits = std::make_unique<MTDTrackingDetSetVector>();
80  auto& theoutputhits = *outputhits;
81 
82  run(inputBarrel, theoutputhits);
83  run(inputEndcap, theoutputhits);
84 
85  evt.put(std::move(outputhits));
86 }

References cpe_, ftlbClusters_, ftleClusters_, relativeConstraints::geom, geom_, edm::EventSetup::get(), get, edm::Event::getByToken(), eostools::move(), edm::ESHandle< T >::product(), 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 92 of file MTDTrackingRecHitProducer.cc.

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

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 47 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().

◆ ftlbClusters_

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

Definition at line 43 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

◆ ftleClusters_

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

Definition at line 44 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

◆ geom_

const MTDGeometry* MTDTrackingRecHitProducer::geom_
private

Definition at line 46 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().

MTDDigiGeometryRecord
Definition: MTDDigiGeometryRecord.h:15
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
MTDTrackingRecHitProducer::geom_
const MTDGeometry * geom_
Definition: MTDTrackingRecHitProducer.cc:46
DEBUG
#define DEBUG(x)
Definition: MTDTrackingRecHitProducer.cc:30
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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
MTDCPERecord
Definition: MTDCPERecord.h:10
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
FTLCluster
Definition: FTLCluster.h:21
MTDTrackingRecHitProducer::ftleClusters_
const edm::EDGetTokenT< FTLClusterCollection > ftleClusters_
Definition: MTDTrackingRecHitProducer.cc:44
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:735
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:231
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:572
edm::Handle
Definition: AssociativeIterator.h:50
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::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle
Definition: DTSurvey.h:22
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:528
Point3DBase< float, LocalTag >
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
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:132
MTDTrackingRecHitProducer::ftlbClusters_
const edm::EDGetTokenT< FTLClusterCollection > ftlbClusters_
Definition: MTDTrackingRecHitProducer.cc:43
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edmNew::DetSetVector
Definition: DetSetNew.h:13
eostools.move
def move(src, dest)
Definition: eostools.py:511
MTDTrackingRecHitProducer::cpe_
const MTDClusterParameterEstimator * cpe_
Definition: MTDTrackingRecHitProducer.cc:47
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:577
Exception
Definition: hltDiff.cc:246
MTDTrackingRecHitProducer::run
void run(edm::Handle< edmNew::DetSetVector< FTLCluster > > inputHandle, MTDTrackingDetSetVector &output)
Definition: MTDTrackingRecHitProducer.cc:92
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:236
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