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