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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 30 of file MTDTrackingRecHitProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 49 of file MTDTrackingRecHitProducer.cc.

49  :
50  ftlbClusters_( consumes<FTLClusterCollection>( ps.getParameter<edm::InputTag>("barrelClusters") ) ),
51  ftleClusters_( consumes<FTLClusterCollection>( ps.getParameter<edm::InputTag>("endcapClusters") ) )
52 {
53  produces< MTDTrackingDetSetVector >();
54 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< FTLClusterCollection > ftlbClusters_
const edm::EDGetTokenT< FTLClusterCollection > ftleClusters_
MTDTrackingRecHitProducer::~MTDTrackingRecHitProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 58 of file MTDTrackingRecHitProducer.cc.

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

58  {
60  desc.add<edm::InputTag>("barrelClusters", edm::InputTag("mtdClusters:FTLBarrel"));
61  desc.add<edm::InputTag>("endcapClusters", edm::InputTag("mtdClusters:FTLEndcap"));
62  descriptions.add("mtdTrackingRecHitProducer", desc);
63 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void MTDTrackingRecHitProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
override

Definition at line 66 of file MTDTrackingRecHitProducer.cc.

References cpe_, ftlbClusters_, ftleClusters_, relativeConstraints::geom, geom_, edm::EventSetup::get(), edm::Event::getByToken(), eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), and run().

66  {
67 
69  es.get<MTDDigiGeometryRecord>().get(geom);
70  geom_ = geom.product();
71 
73  es.get<MTDCPERecord>().get("MTDCPEBase",cpe);
74  cpe_ = cpe.product();
75 
77  evt.getByToken( ftlbClusters_, inputBarrel);
78 
80  evt.getByToken( ftleClusters_, inputEndcap);
81 
82  auto outputhits = std::make_unique<MTDTrackingDetSetVector>();
83  auto& theoutputhits = *outputhits;
84 
85  run(inputBarrel,theoutputhits);
86  run(inputEndcap,theoutputhits);
87 
88  evt.put(std::move(outputhits));
89 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
const edm::EDGetTokenT< FTLClusterCollection > ftlbClusters_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const edm::EDGetTokenT< FTLClusterCollection > ftleClusters_
const MTDClusterParameterEstimator * cpe_
void run(edm::Handle< edmNew::DetSetVector< FTLCluster > > inputHandle, MTDTrackingDetSetVector &output)
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
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 95 of file MTDTrackingRecHitProducer.cc.

References edmNew::DetSetVector< T >::begin(), cpe_, DEBUG, TauDecayModes::dec, DEFINE_FWK_MODULE, edmNew::DetSetVector< T >::end(), Exception, geom_, MTDClusterParameterEstimator::getParameters(), MTDGeometry::idToDetUnit(), input, BaseTrackerRecHit::localPosition(), BaseTrackerRecHit::localPositionError(), edmNew::makeRefTo(), edmNew::DetSetVector< T >::FastFiller::push_back(), edmNew::DetSet< T >::size(), edmNew::DetSetVector< T >::size(), MTDTrackingRecHit::time(), MTDTrackingRecHit::timeError(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

Referenced by produce().

97 {
98  const edmNew::DetSetVector<FTLCluster>& input = *inputHandle;
100 
101  DEBUG("inputCollection " << input.size());
102  for ( ; DSViter != input.end() ; DSViter++) {
103  unsigned int detid = DSViter->detId();
104  DetId detIdObject( detid );
105  const auto& genericDet = geom_->idToDetUnit(detIdObject);
106  if( genericDet == nullptr ) {
107  throw cms::Exception("MTDTrackingRecHitProducer") << "GeographicalID: " << std::hex
108  << detid
109  << " is invalid!" << std::dec
110  << std::endl;
111  }
112 
113  MTDTrackingDetSetVector::FastFiller recHitsOnDet(output,detid);
114 
115  edmNew::DetSet<FTLCluster>::const_iterator clustIt = DSViter->begin(), clustEnd = DSViter->end();
116 
117  for ( ; clustIt != clustEnd; clustIt++) {
118  DEBUG("Cluster: size " << clustIt->size() << " " << clustIt->x() << "," << clustIt->y() << " " << clustIt->energy() << " " << clustIt->time());
119  MTDClusterParameterEstimator::ReturnType tuple = cpe_->getParameters( *clustIt, *genericDet );
120  LocalPoint lp( std::get<0>(tuple) );
121  LocalError le( std::get<1>(tuple) );
122 
123 
124  // Create a persistent edm::Ref to the cluster
125  edm::Ref< edmNew::DetSetVector<FTLCluster>, FTLCluster > cluster = edmNew::makeRefTo( inputHandle, clustIt);
126  // Make a RecHit and add it to the DetSet
127  MTDTrackingRecHit hit( lp, le, *genericDet, cluster);
128  DEBUG("MTD_TRH: " << hit.localPosition().x() << "," << hit.localPosition().y()
129  << " : " << hit.localPositionError().xx() << "," << hit.localPositionError().yy()
130  << " : " << hit.time() << " : " << hit.timeError());
131  // Now save it =================
132  recHitsOnDet.push_back(hit);
133  } // <-- End loop on Clusters
134  } // <-- End loop on DetUnits
135  DEBUG("outputCollection " << output.size());
136 }
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)
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
#define DEBUG(x)
data_type const * const_iterator
Definition: DetSetNew.h:30
static std::string const input
Definition: EdmProvDump.cc:48
const MTDClusterParameterEstimator * cpe_
std::tuple< LocalPoint, LocalError, TimeValue, TimeValueError > ReturnType
Definition: DetId.h:18
virtual ReturnType getParameters(const FTLCluster &cl, const GeomDetUnit &det) const =0
A 2D TrackerRecHit with time and time error information.
size_type size() const
size_type size() const
Definition: DetSetNew.h:87
const_iterator begin(bool update=false) const
const MTDGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: MTDGeometry.cc:174

Member Data Documentation

const MTDClusterParameterEstimator* MTDTrackingRecHitProducer::cpe_
private

Definition at line 46 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().

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

Definition at line 42 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

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

Definition at line 43 of file MTDTrackingRecHitProducer.cc.

Referenced by produce().

const MTDGeometry* MTDTrackingRecHitProducer::geom_
private

Definition at line 45 of file MTDTrackingRecHitProducer.cc.

Referenced by produce(), and run().