CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
cms::SiPixelRecHitConverter Class Reference
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, TrackerGeometry const &geom)
 
void run (edm::Handle< edmNew::DetSetVector< SiPixelCluster >> inputhandle, SiPixelRecHitCollectionNew &output, TrackerGeometry const &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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

PixelCPEBase const * cpe_ = nullptr
 const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) More...
 
bool m_newCont
 
const edm::InputTag src_
 
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecordtCPE_
 
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster_
 
const edm::EDPutTokenT< SiPixelRecHitCollectiontPut_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtTrackerGeom_
 

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 89 of file SiPixelRecHitConverter.cc.

Constructor & Destructor Documentation

◆ SiPixelRecHitConverter()

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

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

Definition at line 131 of file SiPixelRecHitConverter.cc.

132  : src_(conf.getParameter<edm::InputTag>("src")),
134  tPut_(produces<SiPixelRecHitCollection>()),
135  tTrackerGeom_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()),
136  tCPE_(esConsumes<PixelClusterParameterEstimator, TkPixelCPERecord>(
137  edm::ESInputTag("", conf.getParameter<std::string>("CPE")))) {}

◆ ~SiPixelRecHitConverter()

SiPixelRecHitConverter::~SiPixelRecHitConverter ( )
override

Definition at line 140 of file SiPixelRecHitConverter.cc.

140 {}

Member Function Documentation

◆ produce()

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

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

Definition at line 145 of file SiPixelRecHitConverter.cc.

145  {
146  // Step A.1: get input data
148  e.getByToken(tPixelCluster_, input);
149 
150  // Step A.2: get event setup
151  auto const& geom = es.getData(tTrackerGeom_);
152 
153  // Step B: create empty output collection
155 
156  // Step B*: create CPE
157  cpe_ = dynamic_cast<const PixelCPEBase*>(&es.getData(tCPE_));
158 
159  // Step C: Iterate over DetIds and invoke the strip CPE algorithm
160  // on each DetUnit
161 
162  run(input, output, geom);
163 
164  output.shrink_to_fit();
165  e.emplace(tPut_, std::move(output));
166  }

References cpe_, MillePedeFileConverter_cfg::e, relativeConstraints::geom, edm::EventSetup::getData(), input, eostools::move(), convertSQLitetoXML_cfg::output, run(), tCPE_, tPixelCluster_, tPut_, and tTrackerGeom_.

◆ run() [1/2]

void cms::SiPixelRecHitConverter::run ( const edmNew::DetSetVector< SiPixelCluster > &  input,
SiPixelRecHitCollectionNew output,
TrackerGeometry const &  geom 
)

Referenced by produce().

◆ run() [2/2]

void SiPixelRecHitConverter::run ( edm::Handle< edmNew::DetSetVector< SiPixelCluster >>  inputhandle,
SiPixelRecHitCollectionNew output,
TrackerGeometry const &  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 173 of file SiPixelRecHitConverter.cc.

175  {
176  if (!cpe_) {
177  edm::LogError("SiPixelRecHitConverter") << " at least one CPE is not ready -- can't run!";
178  // TO DO: throw an exception here? The user may want to know...
179  assert(0);
180  return; // clusterizer is invalid, bail out
181  }
182 
183  int numberOfDetUnits = 0;
184  int numberOfClusters = 0;
185 
186  const edmNew::DetSetVector<SiPixelCluster>& input = *inputhandle;
187 
189 
190  for (; DSViter != input.end(); DSViter++) {
191  numberOfDetUnits++;
192  unsigned int detid = DSViter->detId();
193  DetId detIdObject(detid);
194  const GeomDetUnit* genericDet = geom.idToDetUnit(detIdObject);
195  const PixelGeomDetUnit* pixDet = dynamic_cast<const PixelGeomDetUnit*>(genericDet);
196  assert(pixDet);
197  SiPixelRecHitCollectionNew::FastFiller recHitsOnDetUnit(output, detid);
198 
199  edmNew::DetSet<SiPixelCluster>::const_iterator clustIt = DSViter->begin(), clustEnd = DSViter->end();
200 
201  for (; clustIt != clustEnd; clustIt++) {
202  numberOfClusters++;
203  std::tuple<LocalPoint, LocalError, SiPixelRecHitQuality::QualWordType> tuple =
204  cpe_->getParameters(*clustIt, *genericDet);
205  LocalPoint lp(std::get<0>(tuple));
206  LocalError le(std::get<1>(tuple));
207  SiPixelRecHitQuality::QualWordType rqw(std::get<2>(tuple));
208  // Create a persistent edm::Ref to the cluster
210  edmNew::makeRefTo(inputhandle, clustIt);
211  // Make a RecHit and add it to the DetSet
212  // old : recHitsOnDetUnit.push_back( new SiPixelRecHit( lp, le, detIdObject, &*clustIt) );
213  SiPixelRecHit hit(lp, le, rqw, *genericDet, cluster);
214  //
215  // Now save it =================
216  recHitsOnDetUnit.push_back(hit);
217  // =============================
218 
219  // std::cout << "SiPixelRecHitConverterVI " << numberOfClusters << ' '<< lp << " " << le << std::endl;
220  } // <-- End loop on Clusters
221 
222  // LogDebug("SiPixelRecHitConverter")
223  //std::cout << "SiPixelRecHitConverterVI "
224  // << " Found " << recHitsOnDetUnit.size() << " RecHits on " << detid //;
225  // << std::endl;
226 
227  } // <-- End loop on DetUnits
228 
229  // LogDebug ("SiPixelRecHitConverter")
230  // std::cout << "SiPixelRecHitConverterVI "
231  // << cpeName_ << " converted " << numberOfClusters
232  // << " SiPixelClusters into SiPixelRecHits, in "
233  // << numberOfDetUnits << " DetUnits." //;
234  // << std::endl;
235  }

References cms::cuda::assert(), edmNew::DetSetVector< T >::begin(), cpe_, edmNew::DetSetVector< T >::end(), relativeConstraints::geom, PixelCPEBase::getParameters(), input, edmNew::makeRefTo(), convertSQLitetoXML_cfg::output, and edmNew::DetSetVector< T >::FastFiller::push_back().

Member Data Documentation

◆ cpe_

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

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

Definition at line 119 of file SiPixelRecHitConverter.cc.

Referenced by produce(), and run().

◆ m_newCont

bool cms::SiPixelRecHitConverter::m_newCont
private

Definition at line 125 of file SiPixelRecHitConverter.cc.

◆ src_

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

Definition at line 120 of file SiPixelRecHitConverter.cc.

◆ tCPE_

const edm::ESGetToken<PixelClusterParameterEstimator, TkPixelCPERecord> cms::SiPixelRecHitConverter::tCPE_
private

Definition at line 124 of file SiPixelRecHitConverter.cc.

Referenced by produce().

◆ tPixelCluster_

const edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > cms::SiPixelRecHitConverter::tPixelCluster_
private

Definition at line 121 of file SiPixelRecHitConverter.cc.

Referenced by produce().

◆ tPut_

const edm::EDPutTokenT<SiPixelRecHitCollection> cms::SiPixelRecHitConverter::tPut_
private

Definition at line 122 of file SiPixelRecHitConverter.cc.

Referenced by produce().

◆ tTrackerGeom_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> cms::SiPixelRecHitConverter::tTrackerGeom_
private

Definition at line 123 of file SiPixelRecHitConverter.cc.

Referenced by produce().

PixelCPEBase::getParameters
ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const override
Definition: PixelCPEBase.h:143
edm::ESInputTag
Definition: ESInputTag.h:87
input
static const std::string input
Definition: EdmProvDump.cc:48
cms::SiPixelRecHitConverter::src_
const edm::InputTag src_
Definition: SiPixelRecHitConverter.cc:120
cms::SiPixelRecHitConverter::cpe_
PixelCPEBase const * cpe_
const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class)
Definition: SiPixelRecHitConverter.cc:119
GeomDet
Definition: GeomDet.h:27
cms::SiPixelRecHitConverter::tPut_
const edm::EDPutTokenT< SiPixelRecHitCollection > tPut_
Definition: SiPixelRecHitConverter.cc:122
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
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
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:231
cms::cuda::assert
assert(be >=bs)
edmNew::DetSetVector::begin
const_iterator begin(bool update=false) const
Definition: DetSetVectorNew.h:572
SiPixelCluster
Pixel cluster – collection of neighboring pixels above threshold.
Definition: SiPixelCluster.h:27
edm::Handle
Definition: AssociativeIterator.h:50
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
edm::Ref
Definition: AssociativeIterator.h:58
DetId
Definition: DetId.h:17
cms::SiPixelRecHitConverter::tCPE_
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > tCPE_
Definition: SiPixelRecHitConverter.cc:124
SiPixelRecHitQuality::QualWordType
unsigned int QualWordType
Definition: SiPixelRecHitQuality.h:10
cms::SiPixelRecHitConverter::run
void run(const edmNew::DetSetVector< SiPixelCluster > &input, SiPixelRecHitCollectionNew &output, TrackerGeometry const &geom)
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
Point3DBase< float, LocalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
LocalError
Definition: LocalError.h:12
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
cms::SiPixelRecHitConverter::tPixelCluster_
const edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster_
Definition: SiPixelRecHitConverter.cc:121
edmNew::DetSetVector::end
const_iterator end(bool update=false) const
Definition: DetSetVectorNew.h:577
edmNew::DetSetVector::FastFiller
Definition: DetSetVectorNew.h:236
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
cms::SiPixelRecHitConverter::tTrackerGeom_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tTrackerGeom_
Definition: SiPixelRecHitConverter.cc:123
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
edmNew::DetSet::const_iterator
const data_type * const_iterator
Definition: DetSetNew.h:31