CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
cms::SiPixelRecHitConverter Class Reference

#include <SiPixelRecHitConverter.h>

Inheritance diagram for cms::SiPixelRecHitConverter:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 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...
 
virtual ~SiPixelRecHitConverter ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

edm::ParameterSet conf_
 
PixelCPEBase const * cpe_ =nullptr
 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::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster
SiPixelRecHitConverter::~SiPixelRecHitConverter ( )
virtual

Definition at line 53 of file SiPixelRecHitConverter.cc.

54  {
55  }

Member Function Documentation

void SiPixelRecHitConverter::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 61 of file SiPixelRecHitConverter.cc.

62  {
63  }
void SiPixelRecHitConverter::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

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

Implements edm::EDProducer.

Definition at line 68 of file SiPixelRecHitConverter.cc.

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

69  {
70 
71  // Step A.1: get input data
73  e.getByToken( tPixelCluster, input);
74 
75  // Step A.2: get event setup
77  es.get<TrackerDigiGeometryRecord>().get( geom );
78 
79  // Step B: create empty output collection
80  std::auto_ptr<SiPixelRecHitCollectionNew> output(new SiPixelRecHitCollectionNew);
81 
82  // Step B*: create CPE
85  es.get<TkPixelCPERecord>().get(cpeName_,hCPE);
86  cpe_ = dynamic_cast< const PixelCPEBase* >(&(*hCPE));
87 
88  // Step C: Iterate over DetIds and invoke the strip CPE algorithm
89  // on each DetUnit
90 
91  run( input, *output, geom );
92 
93 
94  e.put(output);
95 
96  }
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void run(const edmNew::DetSetVector< SiPixelCluster > &input, SiPixelRecHitCollectionNew &output, edm::ESHandle< TrackerGeometry > &geom)
static std::string const input
Definition: EdmProvDump.cc:44
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > tPixelCluster
PixelCPEBase const * cpe_
const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) ...
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 103 of file SiPixelRecHitConverter.cc.

References edmNew::DetSetVector< T >::begin(), cpe_, cond::rpcobgas::detid, edmNew::DetSetVector< T >::end(), input, asciidump::le, PixelCPEBase::localParameters(), edmNew::makeRefTo(), edmNew::DetSetVector< T >::FastFiller::push_back(), and PixelCPEBase::rawQualityWord().

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

Member Data Documentation

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

Definition at line 95 of file SiPixelRecHitConverter.h.

Referenced by produce().

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

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

Definition at line 99 of file SiPixelRecHitConverter.h.

Referenced by produce(), and run().

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

Definition at line 97 of file SiPixelRecHitConverter.h.

Referenced by produce().

bool cms::SiPixelRecHitConverter::m_newCont
private

Definition at line 102 of file SiPixelRecHitConverter.h.

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

Definition at line 100 of file SiPixelRecHitConverter.h.

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

Definition at line 101 of file SiPixelRecHitConverter.h.

Referenced by produce().