test
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 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...
 
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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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_ = 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::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::produce ( edm::Event e,
const edm::EventSetup c 
)
overridevirtual

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

Implements edm::EDProducer.

Definition at line 60 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.

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  std::auto_ptr<SiPixelRecHitCollectionNew> output(new 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 
86  e.put(output);
87 
88  }
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 95 of file SiPixelRecHitConverter.cc.

References edmNew::DetSetVector< T >::begin(), cpe_, cond::rpcobgas::detid, edmNew::DetSetVector< T >::end(), PixelCPEBase::getParameters(), input, asciidump::le, 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
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.
PixelCPEBase const * cpe_
const PixelClusterParameterEstimator * cpe_; // what we got (for now, one ptr to base class) ...
const_iterator begin(bool update=false) const
ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const
Definition: PixelCPEBase.h:138
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().