CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelCPEGenericESProducer Class Reference

#include <PixelCPEGenericESProducer.h>

Inheritance diagram for PixelCPEGenericESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 PixelCPEGenericESProducer (const edm::ParameterSet &p)
 
std::unique_ptr< PixelClusterParameterEstimatorproduce (const TkPixelCPERecord &)
 
 ~PixelCPEGenericESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Private Attributes

edm::ESInputTag magname_
 
edm::ParameterSet pset_
 
bool UseErrorsFromTemplates_
 
bool useLAAlignmentOffsets_
 
bool useLAWidthFromDB_
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 10 of file PixelCPEGenericESProducer.h.

Constructor & Destructor Documentation

PixelCPEGenericESProducer::PixelCPEGenericESProducer ( const edm::ParameterSet p)

Definition at line 24 of file PixelCPEGenericESProducer.cc.

References edm::ParameterSet::existsAs(), edm::ParameterSet::getParameter(), AlCaHLTBitMon_ParallelJobs::p, and AlCaHLTBitMon_QueryRunRegistry::string.

25 {
26  std::string myname = p.getParameter<std::string>("ComponentName");
27  // Use LA-width from DB. If both (upper and this) are false LA-width is calcuated from LA-offset
28  useLAWidthFromDB_ = p.existsAs<bool>("useLAWidthFromDB")?
29  p.getParameter<bool>("useLAWidthFromDB"):false;
30  // Use Alignment LA-offset
31  useLAAlignmentOffsets_ = p.existsAs<bool>("useLAAlignmentOffsets")?
32  p.getParameter<bool>("useLAAlignmentOffsets"):false;
33  magname_ = p.existsAs<edm::ESInputTag>("MagneticFieldRecord")?
34  p.getParameter<edm::ESInputTag>("MagneticFieldRecord"):edm::ESInputTag("");
35  UseErrorsFromTemplates_ = p.getParameter<bool>("UseErrorsFromTemplates");
36 
37 
38  pset_ = p;
39  setWhatProduced(this,myname);
40 
41  //std::cout<<" ESProducer "<<myname<<" "<<useLAWidthFromDB_<<" "<<useLAAlignmentOffsets_<<" "
42  // <<UseErrorsFromTemplates_<<std::endl; //dk
43 
44 }
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
PixelCPEGenericESProducer::~PixelCPEGenericESProducer ( )
override

Definition at line 46 of file PixelCPEGenericESProducer.cc.

46 {}

Member Function Documentation

std::unique_ptr< PixelClusterParameterEstimator > PixelCPEGenericESProducer::produce ( const TkPixelCPERecord iRecord)

Definition at line 49 of file PixelCPEGenericESProducer.cc.

References edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), and edm::ESHandle< T >::product().

49  {
50 
51  ESHandle<MagneticField> magfield;
52  iRecord.getRecord<IdealMagneticFieldRecord>().get( magname_, magfield );
53 
55  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
56 
58  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<TrackerTopologyRcd>().get(hTT);
59 
60  // Lorant angle for offsets
61  ESHandle<SiPixelLorentzAngle> lorentzAngle;
62  if(useLAAlignmentOffsets_) // LA offsets from alignment
63  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle );
64  else // standard LA, from calibration, label=""
65  iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle );
66 
67  // add the new la width object
68  ESHandle<SiPixelLorentzAngle> lorentzAngleWidth;
69  const SiPixelLorentzAngle * lorentzAngleWidthProduct = nullptr;
70  if(useLAWidthFromDB_) { // use the width LA
71  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("forWidth",lorentzAngleWidth );
72  lorentzAngleWidthProduct = lorentzAngleWidth.product();
73  } else { lorentzAngleWidthProduct = nullptr;} // do not use it
74  //std::cout<<" la width "<<lorentzAngleWidthProduct<<std::endl; //dk
75 
76  const SiPixelGenErrorDBObject * genErrorDBObjectProduct = nullptr;
77 
78  // Errors take only from new GenError
79  ESHandle<SiPixelGenErrorDBObject> genErrorDBObject;
80  if(UseErrorsFromTemplates_) { // do only when generrors are needed
81  iRecord.getRecord<SiPixelGenErrorDBObjectRcd>().get(genErrorDBObject);
82  genErrorDBObjectProduct = genErrorDBObject.product();
83  //} else {
84  //std::cout<<" pass an empty GenError pointer"<<std::endl;
85  }
86  return std::make_unique<PixelCPEGeneric>(
87  pset_,magfield.product(),*pDD.product(),
88  *hTT.product(),lorentzAngle.product(),
89  genErrorDBObjectProduct,lorentzAngleWidthProduct);
90 }
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

edm::ESInputTag PixelCPEGenericESProducer::magname_
private

Definition at line 17 of file PixelCPEGenericESProducer.h.

edm::ParameterSet PixelCPEGenericESProducer::pset_
private

Definition at line 16 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::UseErrorsFromTemplates_
private

Definition at line 20 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::useLAAlignmentOffsets_
private

Definition at line 19 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::useLAWidthFromDB_
private

Definition at line 18 of file PixelCPEGenericESProducer.h.