CMS 3D CMS Logo

PixelCPEClusterRepairESProducer.cc
Go to the documentation of this file.
11 
16 
17 
18 
19 #include <string>
20 #include <memory>
21 
22 using namespace edm;
23 
25 {
26  std::string myname = p.getParameter<std::string>("ComponentName");
27 
28  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
29  DoLorentz_ = p.existsAs<bool>("DoLorentz")?p.getParameter<bool>("DoLorentz"):false;
30 
31  pset_ = p;
32  setWhatProduced(this,myname);
33 
34  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
35 
36 }
37 
39 
40 std::unique_ptr<PixelClusterParameterEstimator>
42 
43  ESHandle<MagneticField> magfield;
44  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
45 
47  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
48 
50  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<TrackerTopologyRcd>().get(hTT);
51 
53  const SiPixelLorentzAngle * lorentzAngleProduct = nullptr;
54  if(DoLorentz_) { // LA correction from alignment
55  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle);
56  lorentzAngleProduct = lorentzAngle.product();
57  } else { // Normal, deafult LA actually is NOT needed
58  //iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle);
59  lorentzAngleProduct=nullptr; // null is ok becuse LA is not use by templates in this mode
60  }
61 
62  ESHandle<SiPixelTemplateDBObject> templateDBobject;
63  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
64 
65  ESHandle<SiPixel2DTemplateDBObject> templateDBobject2D;
66  iRecord.getRecord<SiPixel2DTemplateDBObjectESProducerRcd>().get(templateDBobject2D);
67 
68  return
69  std::make_unique<PixelCPEClusterRepair>(pset_,
70  magfield.product(),
71  *pDD.product(),
72  *hTT.product(),
73  lorentzAngleProduct,
74  templateDBobject.product(),
75  templateDBobject2D.product() );
76 }
77 
78 
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
PixelCPEClusterRepairESProducer(const edm::ParameterSet &p)
void get(HolderT &iHolder) const
std::unique_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
HLT enums.
T const * product() const
Definition: ESHandle.h:86