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
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 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 
36  pset_ = p;
37  setWhatProduced(this,myname);
38 
39  //std::cout<<" ESProducer "<<myname<<" "<<useLAWidthFromDB_<<" "<<useLAAlignmentOffsets_<<std::endl; //dk
40 
41 }
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:184
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
PixelCPEGenericESProducer::~PixelCPEGenericESProducer ( )
virtual

Definition at line 43 of file PixelCPEGenericESProducer.cc.

43 {}

Member Function Documentation

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

Definition at line 46 of file PixelCPEGenericESProducer.cc.

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

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