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 
37  bool DoLorentz_;
38 };
39 
40 using namespace edm;
41 
43  std::string myname = p.getParameter<std::string>("ComponentName");
44 
45  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
46  DoLorentz_ = p.getParameter<bool>("DoLorentz");
47 
48  pset_ = p;
49  auto c = setWhatProduced(this, myname);
50  c.setConsumes(magfieldToken_)
51  .setConsumes(pDDToken_)
52  .setConsumes(hTTToken_)
53  .setConsumes(templateDBobjectToken_)
54  .setConsumes(templateDBobject2DToken_);
55  if (DoLorentz_) {
56  c.setConsumes(lorentzAngleToken_, edm::ESInputTag("", "fromAlignment"));
57  }
58 
59  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
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  desc.add<bool>("DoLorentz", true);
77  descriptions.add("_templates2_default", desc);
78 }
79 
80 std::unique_ptr<PixelClusterParameterEstimator> PixelCPEClusterRepairESProducer::produce(
81  const TkPixelCPERecord& iRecord) {
82  // Normal, default LA actually is NOT needed
83  // null is ok becuse LA is not use by templates in this mode
84  const SiPixelLorentzAngle* lorentzAngleProduct = nullptr;
85  if (DoLorentz_) { // LA correction from alignment
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:80
PixelCPEClusterRepairESProducer::DoLorentz_
bool DoLorentz_
Definition: PixelCPEClusterRepairESProducer.cc:37
edm::ESInputTag
Definition: ESInputTag.h:87
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
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:42
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:112
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:36
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
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
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
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:722
EventSetup.h
PixelCPEBase::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEBase.cc:465
TkPixelCPERecord.h
edm::ESProducer
Definition: ESProducer.h:101
PixelCPEClusterRepairESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition: PixelCPEClusterRepairESProducer.cc:29
PixelCPEClusterRepairESProducer::~PixelCPEClusterRepairESProducer
~PixelCPEClusterRepairESProducer() override
Definition: PixelCPEClusterRepairESProducer.cc:62