CMS 3D CMS Logo

PixelCPEFastESProducer.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
3 
18 
20 public:
22  std::unique_ptr<PixelClusterParameterEstimator> produce(const TkPixelCPERecord&);
23  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
24 
25 private:
32 
35 };
36 
37 using namespace edm;
38 
40  auto const& myname = p.getParameter<std::string>("ComponentName");
41  auto const& magname = p.getParameter<edm::ESInputTag>("MagneticFieldRecord");
42  useErrorsFromTemplates_ = p.getParameter<bool>("UseErrorsFromTemplates");
43 
44  auto cc = setWhatProduced(this, myname);
45  magfieldToken_ = cc.consumes(magname);
46  pDDToken_ = cc.consumes();
47  hTTToken_ = cc.consumes();
48  lorentzAngleToken_ = cc.consumes(edm::ESInputTag(""));
49  lorentzAngleWidthToken_ = cc.consumes(edm::ESInputTag("", "forWidth"));
51  genErrorDBObjectToken_ = cc.consumes();
52  }
53 }
54 
55 std::unique_ptr<PixelClusterParameterEstimator> PixelCPEFastESProducer::produce(const TkPixelCPERecord& iRecord) {
56  // add the new la width object
57  const SiPixelLorentzAngle* lorentzAngleWidthProduct = nullptr;
58  lorentzAngleWidthProduct = &iRecord.get(lorentzAngleWidthToken_);
59 
60  const SiPixelGenErrorDBObject* genErrorDBObjectProduct = nullptr;
61 
62  // Errors take only from new GenError
63  if (useErrorsFromTemplates_) { // do only when generrors are needed
64  genErrorDBObjectProduct = &iRecord.get(genErrorDBObjectToken_);
65  //} else {
66  //std::cout<<" pass an empty GenError pointer"<<std::endl;
67  }
68  return std::make_unique<PixelCPEFast>(pset_,
69  &iRecord.get(magfieldToken_),
70  iRecord.get(pDDToken_),
71  iRecord.get(hTTToken_),
72  &iRecord.get(lorentzAngleToken_),
73  genErrorDBObjectProduct,
74  lorentzAngleWidthProduct);
75 }
76 
79 
80  // from PixelCPEBase
82 
83  // from PixelCPEFast
85 
86  // used by PixelCPEFast
87  desc.add<double>("EdgeClusterErrorX", 50.0);
88  desc.add<double>("EdgeClusterErrorY", 85.0);
89  desc.add<bool>("UseErrorsFromTemplates", true);
90  desc.add<bool>("TruncatePixelCharge", true);
91 
92  // specific to PixelCPEFastESProducer
93  desc.add<std::string>("ComponentName", "PixelCPEFast");
94  desc.add<edm::ESInputTag>("MagneticFieldRecord", edm::ESInputTag());
95 
96  descriptions.add("PixelCPEFastESProducer", desc);
97 }
98 
edm::ESInputTag
Definition: ESInputTag.h:87
TrackerGeometry.h
ESHandle.h
PixelCPEFastESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition: PixelCPEFastESProducer.cc:26
PixelCPEFastESProducer::pset_
edm::ParameterSet pset_
Definition: PixelCPEFastESProducer.cc:33
edm
HLT enums.
Definition: AlignableModifier.h:19
PixelClusterParameterEstimator.h
PixelCPEFast::fillPSetDescription
static void fillPSetDescription(edm::ParameterSetDescription &desc)
Definition: PixelCPEFast.cc:483
PixelCPEFastESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PixelCPEFastESProducer.cc:77
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ESProducer.h
TkPixelCPERecord
Definition: TkPixelCPERecord.h:18
PixelCPEFast.h
PixelCPEFastESProducer::lorentzAngleToken_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcd > lorentzAngleToken_
Definition: PixelCPEFastESProducer.cc:29
cc
PixelCPEFastESProducer::PixelCPEFastESProducer
PixelCPEFastESProducer(const edm::ParameterSet &p)
Definition: PixelCPEFastESProducer.cc:39
TrackerTopology.h
TrackerTopologyRcd.h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
PixelCPEFastESProducer::produce
std::unique_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
Definition: PixelCPEFastESProducer.cc:55
PixelCPEFastESProducer::hTTToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > hTTToken_
Definition: PixelCPEFastESProducer.cc:28
SiPixelLorentzAngle
Definition: SiPixelLorentzAngle.h:11
IdealMagneticFieldRecord.h
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
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MagneticField.h
PixelCPEFastESProducer::useErrorsFromTemplates_
bool useErrorsFromTemplates_
Definition: PixelCPEFastESProducer.cc:34
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
SiPixelGenErrorDBObjectRcd.h
PixelCPEFastESProducer::lorentzAngleWidthToken_
edm::ESGetToken< SiPixelLorentzAngle, SiPixelLorentzAngleRcd > lorentzAngleWidthToken_
Definition: PixelCPEFastESProducer.cc:30
PixelCPEFastESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: PixelCPEFastESProducer.cc:27
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
PixelCPEFastESProducer
Definition: PixelCPEFastESProducer.cc:19
TkPixelCPERecord.h
SiPixelGenErrorDBObject
Definition: SiPixelGenErrorDBObject.h:16
edm::ESProducer
Definition: ESProducer.h:104
PixelCPEFastESProducer::genErrorDBObjectToken_
edm::ESGetToken< SiPixelGenErrorDBObject, SiPixelGenErrorDBObjectRcd > genErrorDBObjectToken_
Definition: PixelCPEFastESProducer.cc:31