CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PixelCPETemplateRecoESProducer.cc
Go to the documentation of this file.
7 
12 
13 
14 
15 #include <string>
16 #include <memory>
17 
18 using namespace edm;
19 
21 {
22  std::string myname = p.getParameter<std::string>("ComponentName");
23 
24  //DoLorentz_ = p.getParameter<bool>("DoLorentz"); // True when LA from alignment is used
25  DoLorentz_ = p.existsAs<bool>("DoLorentz")?p.getParameter<bool>("DoLorentz"):false;
26 
27  pset_ = p;
28  setWhatProduced(this,myname);
29 
30  //std::cout<<" from ES Producer Templates "<<myname<<" "<<DoLorentz_<<std::endl; //dk
31 
32 }
33 
35 
36 boost::shared_ptr<PixelClusterParameterEstimator>
38 
40  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
41 
43  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
44 
46  const SiPixelLorentzAngle * lorentzAngleProduct = 0;
47  if(DoLorentz_) { // LA correction from alignment
48  iRecord.getRecord<SiPixelLorentzAngleRcd>().get("fromAlignment",lorentzAngle);
49  lorentzAngleProduct = lorentzAngle.product();
50  } else { // Normal, deafult LA actually is NOT needed
51  //iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle);
52  lorentzAngleProduct=NULL; // null is ok becuse LA is not use by templates in this mode
53  }
54 
55  ESHandle<SiPixelTemplateDBObject> templateDBobject;
56  iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
57 
58  // cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPETemplateReco(pset_,magfield.product(),lorentzAngle.product(),templateDBobject.product() ));
59  cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPETemplateReco(pset_,magfield.product(),*pDD.product(),lorentzAngleProduct,templateDBobject.product() ));
60  return cpe_;
61 }
62 
63 
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:184
tuple magfield
Definition: HLT_ES_cff.py:2311
#define NULL
Definition: scimark2.h:8
boost::shared_ptr< PixelClusterParameterEstimator > produce(const TkPixelCPERecord &)
T const * product() const
Definition: ESHandle.h:62
PixelCPETemplateRecoESProducer(const edm::ParameterSet &p)