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 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 25 of file PixelCPEGenericESProducer.cc.

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

26 {
27  std::string myname = p.getParameter<std::string>("ComponentName");
28  // Use LA-width from DB. If both (upper and this) are false LA-width is calcuated from LA-offset
29  useLAWidthFromDB_ = p.existsAs<bool>("useLAWidthFromDB")?
30  p.getParameter<bool>("useLAWidthFromDB"):false;
31  // Use Alignment LA-offset
32  useLAAlignmentOffsets_ = p.existsAs<bool>("useLAAlignmentOffsets")?
33  p.getParameter<bool>("useLAAlignmentOffsets"):false;
34  magname_ = p.existsAs<edm::ESInputTag>("MagneticFieldRecord")?
35  p.getParameter<edm::ESInputTag>("MagneticFieldRecord"):edm::ESInputTag("");
36 
37  pset_ = p;
38  setWhatProduced(this,myname);
39 
40  //std::cout<<" ESProducer "<<myname<<" "<<useLAWidthFromDB_<<" "<<useLAAlignmentOffsets_<<std::endl; //dk
41 
42 }
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 ( )
virtual

Definition at line 44 of file PixelCPEGenericESProducer.cc.

44 {}

Member Function Documentation

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

Definition at line 47 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().

47  {
48 
50  iRecord.getRecord<IdealMagneticFieldRecord>().get( magname_, magfield );
51 
53  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
54 
56  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<IdealGeometryRecord>().get(hTT);
57 
58  // Lorant angle for offsets
59  ESHandle<SiPixelLorentzAngle> lorentzAngle;
60  if(useLAAlignmentOffsets_) // LA offsets from alignment
61  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle );
62  else // standard LA, from calibration, label=""
63  iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle );
64 
65  // add the new la width object
66  ESHandle<SiPixelLorentzAngle> lorentzAngleWidth;
67  const SiPixelLorentzAngle * lorentzAngleWidthProduct = 0;
68  if(useLAWidthFromDB_) { // use the width LA
69  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("forWidth",lorentzAngleWidth );
70  lorentzAngleWidthProduct = lorentzAngleWidth.product();
71  } else { lorentzAngleWidthProduct = NULL;} // do not use it
72  //std::cout<<" la width "<<lorentzAngleWidthProduct<<std::endl; //dk
73 
74  const SiPixelGenErrorDBObject * genErrorDBObjectProduct = 0;
75 
76 #ifdef NEW_CPEERROR
77  // Errors take only from new GenError
78  ESHandle<SiPixelGenErrorDBObject> genErrorDBObject;
79  iRecord.getRecord<SiPixelGenErrorDBObjectRcd>().get(genErrorDBObject); //needs new TKPixelCPERecord.h
80  genErrorDBObjectProduct = genErrorDBObject.product();
81 
82  cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPEGeneric(
83  pset_,magfield.product(),*pDD.product(),*hTT.product(),lorentzAngle.product(),genErrorDBObjectProduct,
84  lorentzAngleWidthProduct) );
85 
86 #else
87  // Errors can be used from tempaltes or from GenError, for testing only
88  const bool useNewSimplerErrors = false;
89  if(useNewSimplerErrors) { // new genError object
90  ESHandle<SiPixelGenErrorDBObject> genErrorDBObject;
91  iRecord.getRecord<SiPixelGenErrorDBObjectRcd>().get(genErrorDBObject); //needs new TKPixelCPERecord.h
92  genErrorDBObjectProduct = genErrorDBObject.product();
93  }
94 
95  // errors come from templates
96  ESHandle<SiPixelTemplateDBObject> templateDBobject;
97  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
98 
99  cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPEGeneric(
100  pset_,magfield.product(),*pDD.product(),*hTT.product(),lorentzAngle.product(),genErrorDBObjectProduct,
101  templateDBobject.product(),lorentzAngleWidthProduct) );
102 #endif
103 
104  return cpe_;
105 }
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::useLAAlignmentOffsets_
private

Definition at line 20 of file PixelCPEGenericESProducer.h.

bool PixelCPEGenericESProducer::useLAWidthFromDB_
private

Definition at line 19 of file PixelCPEGenericESProducer.h.