CMS 3D CMS Logo

PixelCPETemplateRecoESProducer.cc
Go to the documentation of this file.
9 
14 
15 
16 
17 #include <string>
18 #include <memory>
19 
20 using namespace edm;
21 
23 {
24  std::string myname = p.getParameter<std::string>("ComponentName");
25 
26  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
27  DoLorentz_ = p.existsAs<bool>("DoLorentz")?p.getParameter<bool>("DoLorentz"):false;
28 
29  pset_ = p;
30  setWhatProduced(this,myname);
31 
32  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
33 
34 }
35 
37 
38 std::shared_ptr<PixelClusterParameterEstimator>
40 
41  ESHandle<MagneticField> magfield;
42  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
43 
45  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
46 
48  iRecord.getRecord<TrackerDigiGeometryRecord>().getRecord<TrackerTopologyRcd>().get(hTT);
49 
51  const SiPixelLorentzAngle * lorentzAngleProduct = 0;
52  if(DoLorentz_) { // LA correction from alignment
53  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle);
54  lorentzAngleProduct = lorentzAngle.product();
55  } else { // Normal, deafult LA actually is NOT needed
56  //iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle);
57  lorentzAngleProduct=NULL; // null is ok becuse LA is not use by templates in this mode
58  }
59 
60  ESHandle<SiPixelTemplateDBObject> templateDBobject;
61  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
62 
63  // cpe_ = std::make_shared<PixelCPETemplateReco>(pset_,magfield.product(),lorentzAngle.product(),templateDBobject.product() );
64  cpe_ = std::make_shared<PixelCPETemplateReco>(pset_,magfield.product(),*pDD.product(),*hTT.product(),lorentzAngleProduct,templateDBobject.product() );
65  return cpe_;
66 }
67 
68 
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
#define NULL
Definition: scimark2.h:8
void get(HolderT &iHolder) const
std::shared_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
PixelCPETemplateRecoESProducer(const edm::ParameterSet &p)
HLT enums.
T const * product() const
Definition: ESHandle.h:86