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
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)
 
boost::shared_ptr
< PixelClusterParameterEstimator
produce (const TkPixelCPERecord &)
 
virtual ~PixelCPEGenericESProducer ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Private Attributes

boost::shared_ptr
< PixelClusterParameterEstimator
cpe_
 
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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 26 of file PixelCPEGenericESProducer.cc.

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

27 {
28  std::string myname = p.getParameter<std::string>("ComponentName");
29  // Use LA-width from DB. If both (upper and this) are false LA-width is calcuated from LA-offset
30  useLAWidthFromDB_ = p.existsAs<bool>("useLAWidthFromDB")?
31  p.getParameter<bool>("useLAWidthFromDB"):false;
32  // Use Alignment LA-offset
33  useLAAlignmentOffsets_ = p.existsAs<bool>("useLAAlignmentOffsets")?
34  p.getParameter<bool>("useLAAlignmentOffsets"):false;
35  magname_ = p.existsAs<edm::ESInputTag>("MagneticFieldRecord")?
36  p.getParameter<edm::ESInputTag>("MagneticFieldRecord"):edm::ESInputTag("");
37  UseErrorsFromTemplates_ = p.getParameter<bool>("UseErrorsFromTemplates");
38 
39 
40  pset_ = p;
41  setWhatProduced(this,myname);
42 
43  //std::cout<<" ESProducer "<<myname<<" "<<useLAWidthFromDB_<<" "<<useLAAlignmentOffsets_<<" "
44  // <<UseErrorsFromTemplates_<<std::endl; //dk
45 
46 }
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:186
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
PixelCPEGenericESProducer::~PixelCPEGenericESProducer ( )
virtual

Definition at line 48 of file PixelCPEGenericESProducer.cc.

48 {}

Member Function Documentation

boost::shared_ptr< PixelClusterParameterEstimator > PixelCPEGenericESProducer::produce ( const TkPixelCPERecord iRecord)

Definition at line 51 of file PixelCPEGenericESProducer.cc.

References edm::eventsetup::EventSetupRecord::get(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), HLT_ES_cff::magfield, NULL, and edm::ESHandle< class >::product().

51  {
52 
54  iRecord.getRecord<IdealMagneticFieldRecord>().get( magname_, magfield );
55 
57  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
58 
60  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<TrackerTopologyRcd>().get(hTT);
61 
62  // Lorant angle for offsets
63  ESHandle<SiPixelLorentzAngle> lorentzAngle;
64  if(useLAAlignmentOffsets_) // LA offsets from alignment
65  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle );
66  else // standard LA, from calibration, label=""
67  iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle );
68 
69  // add the new la width object
70  ESHandle<SiPixelLorentzAngle> lorentzAngleWidth;
71  const SiPixelLorentzAngle * lorentzAngleWidthProduct = 0;
72  if(useLAWidthFromDB_) { // use the width LA
73  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("forWidth",lorentzAngleWidth );
74  lorentzAngleWidthProduct = lorentzAngleWidth.product();
75  } else { lorentzAngleWidthProduct = NULL;} // do not use it
76  //std::cout<<" la width "<<lorentzAngleWidthProduct<<std::endl; //dk
77 
78  const SiPixelGenErrorDBObject * genErrorDBObjectProduct = 0;
79 
80 #ifdef NEW_CPEERROR
81  // Errors take only from new GenError
82  ESHandle<SiPixelGenErrorDBObject> genErrorDBObject;
83  if(UseErrorsFromTemplates_) { // do only when generrors are needed
84  iRecord.getRecord<SiPixelGenErrorDBObjectRcd>().get(genErrorDBObject);
85  genErrorDBObjectProduct = genErrorDBObject.product();
86  //} else {
87  //std::cout<<" pass an empty GenError pointer"<<std::endl;
88  }
89  cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>
90  (new PixelCPEGeneric(pset_,magfield.product(),*pDD.product(),
91  *hTT.product(),lorentzAngle.product(),
92  genErrorDBObjectProduct,lorentzAngleWidthProduct) );
93 
94 #else // old full templates, not used anymore
95  // Errors can be used from tempaltes or from GenError, for testing only
96  const bool useNewSimplerErrors = false;
97  if(useNewSimplerErrors) { // new genError object
98  ESHandle<SiPixelGenErrorDBObject> genErrorDBObject;
99  iRecord.getRecord<SiPixelGenErrorDBObjectRcd>().get(genErrorDBObject); //needs new TKPixelCPERecord.h
100  genErrorDBObjectProduct = genErrorDBObject.product();
101  }
102 
103  // errors come from templates
104  ESHandle<SiPixelTemplateDBObject> templateDBobject;
105  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
106 
107  cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPEGeneric(
108  pset_,magfield.product(),*pDD.product(),*hTT.product(),lorentzAngle.product(),genErrorDBObjectProduct,
109  templateDBobject.product(),lorentzAngleWidthProduct) );
110 #endif
111 
112  return cpe_;
113 }
tuple magfield
Definition: HLT_ES_cff.py:2311
#define NULL
Definition: scimark2.h:8
void get(HolderT &iHolder) const
T const * product() const
Definition: ESHandle.h:86
boost::shared_ptr< PixelClusterParameterEstimator > cpe_

Member Data Documentation

boost::shared_ptr<PixelClusterParameterEstimator> PixelCPEGenericESProducer::cpe_
private

Definition at line 16 of file PixelCPEGenericESProducer.h.

edm::ESInputTag PixelCPEGenericESProducer::magname_
private

Definition at line 18 of file PixelCPEGenericESProducer.h.

edm::ParameterSet PixelCPEGenericESProducer::pset_
private

Definition at line 17 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::UseErrorsFromTemplates_
private

Definition at line 21 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::useLAAlignmentOffsets_
private

Definition at line 20 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::useLAWidthFromDB_
private

Definition at line 19 of file PixelCPEGenericESProducer.h.