CMS 3D CMS Logo

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