CMS 3D CMS Logo

PixelCPEClusterRepairESProducer.cc
Go to the documentation of this file.
12 
17 
18 #include <string>
19 #include <memory>
20 
22 public:
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26  std::unique_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord&);
27 
28 private:
35 
39 };
40 
41 using namespace edm;
42 
44  std::string myname = p.getParameter<std::string>("ComponentName");
45 
46  useLAFromDB_ = p.getParameter<bool>("useLAFromDB");
47  doLorentzFromAlignment_ = p.getParameter<bool>("doLorentzFromAlignment");
48 
49  pset_ = p;
50  auto c = setWhatProduced(this, myname);
51  magfieldToken_ = c.consumes();
52  pDDToken_ = c.consumes();
53  hTTToken_ = c.consumes();
54  templateDBobjectToken_ = c.consumes();
55  templateDBobject2DToken_ = c.consumes();
56  if (useLAFromDB_ || doLorentzFromAlignment_) {
57  char const* laLabel = doLorentzFromAlignment_ ? "fromAlignment" : "";
58  lorentzAngleToken_ = c.consumes(edm::ESInputTag("", laLabel));
59  }
60 }
61 
63 
65  // templates2
67  desc.add<std::string>("ComponentName", "PixelCPEClusterRepair");
68 
69  // from PixelCPEBase
71 
72  // from PixelCPEClusterRepair
74 
75  // specific to PixelCPEClusterRepairESProducer
76  descriptions.add("_templates2_default", desc);
77 }
78 
79 std::unique_ptr<PixelClusterParameterEstimator> PixelCPEClusterRepairESProducer::produce(
80  const TkPixelCPERecord& iRecord) {
81  // Normal, default LA is used in case of template failure, load it unless
82  // turned off
83  // if turned off, null is ok, becomes zero
84  const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
85  if (useLAFromDB_ || doLorentzFromAlignment_) {
86  lorentzAngleProduct = &iRecord.get(lorentzAngleToken_);
87  }
88 
89  return std::make_unique<PixelCPEClusterRepair>(pset_,
90  &iRecord.get(magfieldToken_),
91  iRecord.get(pDDToken_),
92  iRecord.get(hTTToken_),
93  lorentzAngleProduct,
94  &iRecord.get(templateDBobjectToken_),
95  &iRecord.get(templateDBobject2DToken_));
96 }
97 
PixelCPEClusterRepairESProducer::produce
std::unique_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
Definition: PixelCPEClusterRepairESProducer.cc:79
edm::ESInputTag
Definition: ESInputTag.h:87
TrackerGeometry.h
ESHandle.h
PixelCPEClusterRepairESProducer::templateDBobjectToken_
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > templateDBobjectToken_
Definition: PixelCPEClusterRepairESProducer.cc:33
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PixelClusterParameterEstimator.h
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
TkPixelCPERecord
Definition: TkPixelCPERecord.h:18
PixelCPEClusterRepairESProducer::PixelCPEClusterRepairESProducer
PixelCPEClusterRepairESProducer(const edm::ParameterSet &p)
Definition: PixelCPEClusterRepairESProducer.cc:43
PixelCPEClusterRepairESProducer::templateDBobject2DToken_
edm::ESGetToken< SiPixel2DTemplateDBObject, SiPixel2DTemplateDBObjectESProducerRcd > templateDBobject2DToken_
Definition: PixelCPEClusterRepairESProducer.cc:34
TrackerTopology.h
TrackerTopologyRcd.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
IdealMagneticFieldRecord.h
SiPixelTemplateDBObjectESProducerRcd.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
PixelCPEClusterRepairESProducer::pset_
edm::ParameterSet pset_
Definition: PixelCPEClusterRepairESProducer.cc:36
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PixelCPEClusterRepairESProducer
Definition: PixelCPEClusterRepairESProducer.cc:21
SiPixel2DTemplateDBObjectESProducerRcd.h
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
PixelCPEClusterRepairESProducer::useLAFromDB_
bool useLAFromDB_
Definition: PixelCPEClusterRepairESProducer.cc:38
PixelCPEClusterRepairESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelCPEClusterRepairESProducer.cc:64
PixelCPEClusterRepair.h
PixelCPEClusterRepairESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: PixelCPEClusterRepairESProducer.cc:30
MagneticField.h
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
PixelCPEClusterRepairESProducer::hTTToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > hTTToken_
Definition: PixelCPEClusterRepairESProducer.cc:31
PixelCPEClusterRepairESProducer::lorentzAngleToken_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcd > lorentzAngleToken_
Definition: PixelCPEClusterRepairESProducer.cc:32
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
PixelCPEClusterRepair::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEClusterRepair.cc:719
EventSetup.h
PixelCPEBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEBase.cc:467
TkPixelCPERecord.h
PixelCPEClusterRepairESProducer::doLorentzFromAlignment_
bool doLorentzFromAlignment_
Definition: PixelCPEClusterRepairESProducer.cc:37
edm::ESProducer
Definition: ESProducer.h:104
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
PixelCPEClusterRepairESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition: PixelCPEClusterRepairESProducer.cc:29
PixelCPEClusterRepairESProducer::~PixelCPEClusterRepairESProducer
~PixelCPEClusterRepairESProducer() override
Definition: PixelCPEClusterRepairESProducer.cc:62