CMS 3D CMS Logo

TkTransientTrackingRecHitBuilderESProducer.cc
Go to the documentation of this file.
5 
7 
12 
13 #include <string>
14 #include <memory>
15 
17 
18 using namespace edm;
19 
21 {
22  std::string myname = p.getParameter<std::string>("ComponentName");
23  pset_ = p;
24  setWhatProduced(this,myname);
25 }
26 
28 
29 std::unique_ptr<TransientTrackingRecHitBuilder>
31 // if (_propagator){
32 // delete _propagator;
33 // _propagator = 0;
34 // }
35 
36  std::string sname = pset_.getParameter<std::string>("StripCPE");
37  std::string pname = pset_.getParameter<std::string>("PixelCPE");
38  std::string mname = pset_.getParameter<std::string>("Matcher");
39 
40 
46  const SiStripRecHitMatcher * mp ;
47 
48  if (sname == "Fake") {
49  sp = nullptr;
50  }else{
51  iRecord.getRecord<TkStripCPERecord>().get( sname, se );
52  sp = se.product();
53  }
54 
55  if (pname == "Fake") {
56  pp = nullptr;
57  }else{
58  iRecord.getRecord<TkPixelCPERecord>().get( pname, pe );
59  pp = pe.product();
60  }
61 
62  if (mname == "Fake") {
63  mp = nullptr;
64  }else{
65  iRecord.getRecord<TkStripCPERecord>().get( mname, me );
66  mp = me.product();
67  }
68 
69  bool computeCoarseLocalPositionFromDisk = pset_.getParameter<bool>("ComputeCoarseLocalPositionFromDisk");
70  if (computeCoarseLocalPositionFromDisk)
71  edm::LogWarning("TkTransientTrackingRecHitBuilderESProducer")<<" The tracking rec hit positions and errors are not a persistent in data formats.\n"
72  <<" They are not available from disk.\n"
73  <<" However, TkTransientTrackingRecHitBuilderESProducer::ComputeCoarseLocalPositionFromDisk=True \n"
74  <<" will make the coarse estimation of this position/error available without track refit.\n"
75  <<" Position/error obtained from rechit with already defined position/error are not recomputed.\n"
76  <<" Position/error obtained from track refit are precise.";
77 
79  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
80 
81  //For Phase2 upgrade
82  std::string p2OTname = "";
83  if(pset_.existsAs<std::string>("Phase2StripCPE")){
84  p2OTname = pset_.getParameter<std::string>("Phase2StripCPE");
85  }
88 
89  if (p2OTname != "") {
90  iRecord.getRecord<TkStripCPERecord>().get( p2OTname, p2OTe );
91  p2OTp = p2OTe.product();
92  return std::make_unique<TkTransientTrackingRecHitBuilder>(pDD.product(), pp, p2OTp);
93  }
94  return std::make_unique<TkTransientTrackingRecHitBuilder>(pDD.product(), pp, sp, mp, computeCoarseLocalPositionFromDisk);
95 
96 }
97 
98 
T getParameter(std::string const &) const
std::unique_ptr< TransientTrackingRecHitBuilder > produce(const TransientRecHitRecord &)
HLT enums.
T const * product() const
Definition: ESHandle.h:86