CMS 3D CMS Logo

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

#include <PixelCPEClusterRepairESProducer.h>

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

Public Member Functions

 PixelCPEClusterRepairESProducer (const edm::ParameterSet &p)
 
std::unique_ptr< PixelClusterParameterEstimatorproduce (const TkPixelCPERecord &)
 
 ~PixelCPEClusterRepairESProducer () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 

Private Attributes

bool DoLorentz_
 
edm::ParameterSet pset_
 

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
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- 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 12 of file PixelCPEClusterRepairESProducer.h.

Constructor & Destructor Documentation

PixelCPEClusterRepairESProducer::PixelCPEClusterRepairESProducer ( const edm::ParameterSet p)

Definition at line 24 of file PixelCPEClusterRepairESProducer.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 
28  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
29  DoLorentz_ = p.existsAs<bool>("DoLorentz")?p.getParameter<bool>("DoLorentz"):false;
30 
31  pset_ = p;
32  setWhatProduced(this,myname);
33 
34  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
35 
36 }
T getParameter(std::string const &) const
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
PixelCPEClusterRepairESProducer::~PixelCPEClusterRepairESProducer ( )
override

Definition at line 38 of file PixelCPEClusterRepairESProducer.cc.

38 {}

Member Function Documentation

void PixelCPEClusterRepairESProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 40 of file PixelCPEClusterRepairESProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and AlCaHLTBitMon_QueryRunRegistry::string.

40  {
41  // templates2
43  desc.add<bool>("DoLorentz", true);
44  desc.add<bool>("DoCosmics", false);
45  desc.add<bool>("LoadTemplatesFromDB", true);
46  desc.add<bool>("RunDamagedClusters", false);
47  desc.add<std::string>("ComponentName", "PixelCPEClusterRepair");
48  desc.add<double>("MinChargeRatio", 0.8);
49  desc.add<double>("MaxSizeMismatchInY", 0.3);
50  desc.add<bool>("Alpha2Order", true);
51  desc.add<std::vector<std::string>>("Recommend2D", {
52  "PXB 2",
53  "PXB 3",
54  "PXB 4",
55  });
56  desc.add<int>("ClusterProbComputationFlag", 0);
57  desc.add<int>("speed", -2);
58  desc.add<bool>("UseClusterSplitter", false);
59  descriptions.add("templates2", desc);
60 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< PixelClusterParameterEstimator > PixelCPEClusterRepairESProducer::produce ( const TkPixelCPERecord iRecord)

Definition at line 63 of file PixelCPEClusterRepairESProducer.cc.

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

63  {
64 
65  ESHandle<MagneticField> magfield;
66  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
67 
69  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
70 
72  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<TrackerTopologyRcd>().get(hTT);
73 
75  const SiPixelLorentzAngle * lorentzAngleProduct = nullptr;
76  if(DoLorentz_) { // LA correction from alignment
77  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle);
78  lorentzAngleProduct = lorentzAngle.product();
79  } else { // Normal, deafult LA actually is NOT needed
80  //iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle);
81  lorentzAngleProduct=nullptr; // null is ok becuse LA is not use by templates in this mode
82  }
83 
84  ESHandle<SiPixelTemplateDBObject> templateDBobject;
85  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
86 
87  ESHandle<SiPixel2DTemplateDBObject> templateDBobject2D;
88  iRecord.getRecord<SiPixel2DTemplateDBObjectESProducerRcd>().get(templateDBobject2D);
89 
90  return
91  std::make_unique<PixelCPEClusterRepair>(pset_,
92  magfield.product(),
93  *pDD.product(),
94  *hTT.product(),
95  lorentzAngleProduct,
96  templateDBobject.product(),
97  templateDBobject2D.product() );
98 }
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
T const * product() const
Definition: ESHandle.h:86

Member Data Documentation

bool PixelCPEClusterRepairESProducer::DoLorentz_
private

Definition at line 20 of file PixelCPEClusterRepairESProducer.h.

edm::ParameterSet PixelCPEClusterRepairESProducer::pset_
private

Definition at line 19 of file PixelCPEClusterRepairESProducer.h.