CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::SiPixelRecHitConverter Class Reference

#include <SiPixelRecHitConverter.h>

Inheritance diagram for cms::SiPixelRecHitConverter:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &e, const edm::EventSetup &c) override
 The "Event" entrypoint: gets called by framework for every event. More...
 
void run (const edmNew::DetSetVector< SiPixelCluster > &input, SiPixelRecHitCollectionNew &output, edm::ESHandle< TrackerGeometry > &geom)
 
void run (edm::Handle< edmNew::DetSetVector< SiPixelCluster > > inputhandle, SiPixelRecHitCollectionNew &output, edm::ESHandle< TrackerGeometry > &geom)
 
 SiPixelRecHitConverter (const edm::ParameterSet &conf)
 Constructor: set the ParameterSet and defer all thinking to setupCPE(). More...
 
 ~SiPixelRecHitConverter () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Private Attributes

edm::ParameterSet conf_
 
PixelCPEBase const * cpe_ = 0
 const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) More...
 
std::string cpeName_ ="None"
 
bool m_newCont
 
edm::InputTag src_
 
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster
 

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 62 of file SiPixelRecHitConverter.h.

Constructor & Destructor Documentation

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

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

Definition at line 42 of file SiPixelRecHitConverter.cc.

43  :
44  conf_(conf),
45  src_( conf.getParameter<edm::InputTag>( "src" ) ),
47  //--- Declare to the EDM what kind of collections we will be making.
48  produces<SiPixelRecHitCollection>();
49 
50  }
T getParameter(std::string const &) const
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster
SiPixelRecHitConverter::~SiPixelRecHitConverter ( )
override

Definition at line 53 of file SiPixelRecHitConverter.cc.

54  {
55  }

Member Function Documentation

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

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

Definition at line 60 of file SiPixelRecHitConverter.cc.

References conf_, cpe_, cpeName_, relativeConstraints::geom, edm::EventSetup::get(), edm::Event::getByToken(), edm::ParameterSet::getParameter(), input, eostools::move(), convertSQLitetoXML_cfg::output, edm::Event::put(), run(), AlCaHLTBitMon_QueryRunRegistry::string, and tPixelCluster.

61  {
62 
63  // Step A.1: get input data
65  e.getByToken( tPixelCluster, input);
66 
67  // Step A.2: get event setup
69  es.get<TrackerDigiGeometryRecord>().get( geom );
70 
71  // Step B: create empty output collection
72  auto output = std::make_unique<SiPixelRecHitCollectionNew>();
73 
74  // Step B*: create CPE
77  es.get<TkPixelCPERecord>().get(cpeName_,hCPE);
78  cpe_ = dynamic_cast< const PixelCPEBase* >(&(*hCPE));
79 
80  // Step C: Iterate over DetIds and invoke the strip CPE algorithm
81  // on each DetUnit
82 
83  run( input, *output, geom );
84 
85  output->shrink_to_fit();
86  e.put(std::move(output));
87 
88  }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
void run(const edmNew::DetSetVector< SiPixelCluster > &input, SiPixelRecHitCollectionNew &output, edm::ESHandle< TrackerGeometry > &geom)
static std::string const input
Definition: EdmProvDump.cc:48
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster
PixelCPEBase const * cpe_
const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) ...
def move(src, dest)
Definition: eostools.py:511
void cms::SiPixelRecHitConverter::run ( const edmNew::DetSetVector< SiPixelCluster > &  input,
SiPixelRecHitCollectionNew output,
edm::ESHandle< TrackerGeometry > &  geom 
)

Referenced by produce().

void SiPixelRecHitConverter::run ( edm::Handle< edmNew::DetSetVector< SiPixelCluster > >  inputhandle,
SiPixelRecHitCollectionNew output,
edm::ESHandle< TrackerGeometry > &  geom 
)

Iterate over DetUnits, then over Clusters and invoke the CPE on each, and make a RecHit to store the result. New interface reading DetSetVector by V.Chiochia (May 30th, 2006)

Definition at line 95 of file SiPixelRecHitConverter.cc.

References edmNew::DetSetVector< T >::begin(), cpe_, edmNew::DetSetVector< T >::end(), PixelCPEBase::getParameters(), TrackerGeometry::idToDetUnit(), input, edmNew::makeRefTo(), and edmNew::DetSetVector< T >::FastFiller::push_back().

97  {
98  if ( ! cpe_ )
99  {
100  edm::LogError("SiPixelRecHitConverter") << " at least one CPE is not ready -- can't run!";
101  // TO DO: throw an exception here? The user may want to know...
102  assert(0);
103  return; // clusterizer is invalid, bail out
104  }
105 
106  int numberOfDetUnits = 0;
107  int numberOfClusters = 0;
108 
109  const edmNew::DetSetVector<SiPixelCluster>& input = *inputhandle;
110 
112 
113  for ( ; DSViter != input.end() ; DSViter++) {
114  numberOfDetUnits++;
115  unsigned int detid = DSViter->detId();
116  DetId detIdObject( detid );
117  const GeomDetUnit * genericDet = geom->idToDetUnit( detIdObject );
118  const PixelGeomDetUnit * pixDet = dynamic_cast<const PixelGeomDetUnit*>(genericDet);
119  assert(pixDet);
120  SiPixelRecHitCollectionNew::FastFiller recHitsOnDetUnit(output,detid);
121 
122  edmNew::DetSet<SiPixelCluster>::const_iterator clustIt = DSViter->begin(), clustEnd = DSViter->end();
123 
124  for ( ; clustIt != clustEnd; clustIt++) {
125  numberOfClusters++;
126  std::tuple<LocalPoint, LocalError,SiPixelRecHitQuality::QualWordType> tuple = cpe_->getParameters( *clustIt, *genericDet );
127  LocalPoint lp( std::get<0>(tuple) );
128  LocalError le( std::get<1>(tuple) );
129  SiPixelRecHitQuality::QualWordType rqw( std::get<2>(tuple) );
130  // Create a persistent edm::Ref to the cluster
132  // Make a RecHit and add it to the DetSet
133  // old : recHitsOnDetUnit.push_back( new SiPixelRecHit( lp, le, detIdObject, &*clustIt) );
134  SiPixelRecHit hit( lp, le, rqw, *genericDet, cluster);
135  //
136  // Now save it =================
137  recHitsOnDetUnit.push_back(hit);
138  // =============================
139 
140  // std::cout << "SiPixelRecHitConverterVI " << numberOfClusters << ' '<< lp << " " << le << std::endl;
141  } // <-- End loop on Clusters
142 
143 
144  // LogDebug("SiPixelRecHitConverter")
145  //std::cout << "SiPixelRecHitConverterVI "
146  // << " Found " << recHitsOnDetUnit.size() << " RecHits on " << detid //;
147  // << std::endl;
148 
149 
150  } // <-- End loop on DetUnits
151 
152  // LogDebug ("SiPixelRecHitConverter")
153  // std::cout << "SiPixelRecHitConverterVI "
154  // << cpeName_ << " converted " << numberOfClusters
155  // << " SiPixelClusters into SiPixelRecHits, in "
156  // << numberOfDetUnits << " DetUnits." //;
157  // << std::endl;
158 
159  }
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
ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const override
Definition: PixelCPEBase.h:142
data_type const * const_iterator
Definition: DetSetNew.h:30
static std::string const input
Definition: EdmProvDump.cc:48
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: DetId.h:18
Pixel cluster – collection of neighboring pixels above threshold.
PixelCPEBase const * cpe_
const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) ...
const_iterator begin(bool update=false) const
Our base class.
Definition: SiPixelRecHit.h:23

Member Data Documentation

edm::ParameterSet cms::SiPixelRecHitConverter::conf_
private

Definition at line 91 of file SiPixelRecHitConverter.h.

Referenced by produce().

PixelCPEBase const* cms::SiPixelRecHitConverter::cpe_ = 0
private

const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class)

Definition at line 95 of file SiPixelRecHitConverter.h.

Referenced by produce(), and run().

std::string cms::SiPixelRecHitConverter::cpeName_ ="None"
private

Definition at line 93 of file SiPixelRecHitConverter.h.

Referenced by produce().

bool cms::SiPixelRecHitConverter::m_newCont
private

Definition at line 98 of file SiPixelRecHitConverter.h.

edm::InputTag cms::SiPixelRecHitConverter::src_
private

Definition at line 96 of file SiPixelRecHitConverter.h.

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > cms::SiPixelRecHitConverter::tPixelCluster
private

Definition at line 97 of file SiPixelRecHitConverter.h.

Referenced by produce().