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  c.setConsumes(magfieldToken_).setConsumes(pDDToken_).setConsumes(hTTToken_).setConsumes(templateDBobjectToken_);
47  if (DoLorentz_) {
48  c.setConsumes(lorentzAngleToken_, edm::ESInputTag("", "fromAlignment"));
49  }
50  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
51 }
52 
53 std::unique_ptr<PixelClusterParameterEstimator> PixelCPETemplateRecoESProducer::produce(
54  const TkPixelCPERecord& iRecord) {
55  // Normal, deafult LA actually is NOT needed
56  // null is ok becuse LA is not use by templates in this mode
57  const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
58  if (DoLorentz_) { // LA correction from alignment
59  lorentzAngleProduct = &iRecord.get(lorentzAngleToken_);
60  }
61 
62  return std::make_unique<PixelCPETemplateReco>(pset_,
63  &iRecord.get(magfieldToken_),
64  iRecord.get(pDDToken_),
65  iRecord.get(hTTToken_),
66  lorentzAngleProduct,
67  &iRecord.get(templateDBobjectToken_));
68 }
69 
72 
73  // from PixelCPEBase
75 
76  // from PixelCPETemplateReco
78 
79  // specific to PixelCPETemplateRecoESProducer
80  desc.add<std::string>("ComponentName", "PixelCPETemplateReco");
81  desc.add<bool>("DoLorentz", true);
82  descriptions.add("_templates_default", desc);
83 }
84 
PixelCPETemplateRecoESProducer::pset_
edm::ParameterSet pset_
Definition: PixelCPETemplateRecoESProducer.cc:32
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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:53
TrackerTopology.h
PixelCPETemplateRecoESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: PixelCPETemplateRecoESProducer.cc:27
PixelCPETemplateRecoESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelCPETemplateRecoESProducer.cc:70
TrackerTopologyRcd.h
PixelCPETemplateReco::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPETemplateReco.cc:547
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:112
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerDigiGeometryRecord.h
PixelCPETemplateReco.h
edm::ParameterSet
Definition: ParameterSet.h:36
MagneticField.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
ModuleFactory.h
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:101
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