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 
33  bool DoLorentz_;
34 };
35 
36 using namespace edm;
37 
39  std::string myname = p.getParameter<std::string>("ComponentName");
40 
41  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
42  DoLorentz_ = p.getParameter<bool>("DoLorentz");
43 
44  pset_ = p;
45  auto c = setWhatProduced(this, myname);
46  magfieldToken_ = c.consumes();
47  pDDToken_ = c.consumes();
48  hTTToken_ = c.consumes();
49  templateDBobjectToken_ = c.consumes();
50  if (DoLorentz_) {
51  lorentzAngleToken_ = c.consumes(edm::ESInputTag("", "fromAlignment"));
52  }
53  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
54 }
55 
56 std::unique_ptr<PixelClusterParameterEstimator> PixelCPETemplateRecoESProducer::produce(
57  const TkPixelCPERecord& iRecord) {
58  // Normal, deafult LA actually is NOT needed
59  // null is ok becuse LA is not use by templates in this mode
60  const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
61  if (DoLorentz_) { // LA correction from alignment
62  lorentzAngleProduct = &iRecord.get(lorentzAngleToken_);
63  }
64 
65  return std::make_unique<PixelCPETemplateReco>(pset_,
66  &iRecord.get(magfieldToken_),
67  iRecord.get(pDDToken_),
68  iRecord.get(hTTToken_),
69  lorentzAngleProduct,
70  &iRecord.get(templateDBobjectToken_));
71 }
72 
75 
76  // from PixelCPEBase
78 
79  // from PixelCPETemplateReco
81 
82  // specific to PixelCPETemplateRecoESProducer
83  desc.add<std::string>("ComponentName", "PixelCPETemplateReco");
84  desc.add<bool>("DoLorentz", true);
85  descriptions.add("_templates_default", desc);
86 }
87 
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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
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:38
PixelCPETemplateRecoESProducer::produce
std::unique_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
Definition: PixelCPETemplateRecoESProducer.cc:56
TrackerTopology.h
PixelCPETemplateRecoESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: PixelCPETemplateRecoESProducer.cc:27
PixelCPETemplateRecoESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelCPETemplateRecoESProducer.cc:73
TrackerTopologyRcd.h
PixelCPETemplateReco::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPETemplateReco.cc:545
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:103
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerDigiGeometryRecord.h
PixelCPETemplateReco.h
edm::ParameterSet
Definition: ParameterSet.h:47
MagneticField.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
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:465
TkPixelCPERecord.h
edm::ESProducer
Definition: ESProducer.h:104
PixelCPETemplateRecoESProducer::DoLorentz_
bool DoLorentz_
Definition: PixelCPETemplateRecoESProducer.cc:33
PixelCPETemplateRecoESProducer::templateDBobjectToken_
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > templateDBobjectToken_
Definition: PixelCPETemplateRecoESProducer.cc:30
PixelCPETemplateRecoESProducer::hTTToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > hTTToken_
Definition: PixelCPETemplateRecoESProducer.cc:28