CMS 3D CMS Logo

TkTransientTrackingRecHitBuilderESProducer.cc
Go to the documentation of this file.
13 
16 
18 
23 
24 #include <string>
25 #include <memory>
26 #include <optional>
27 
29 
31 public:
33 
34  std::unique_ptr<TransientTrackingRecHitBuilder> produce(const TransientRecHitRecord&);
35 
36  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
37 
38 private:
39  std::optional<edm::ESGetToken<StripClusterParameterEstimator, TkStripCPERecord>> spToken_;
40  std::optional<edm::ESGetToken<PixelClusterParameterEstimator, TkPixelCPERecord>> ppToken_;
41  std::optional<edm::ESGetToken<SiStripRecHitMatcher, TkStripCPERecord>> mpToken_;
43  std::optional<edm::ESGetToken<ClusterParameterEstimator<Phase2TrackerCluster1D>, TkPhase2OTCPERecord>> p2OTToken_;
45 };
46 
47 using namespace edm;
48 
50  : computeCoarseLocalPositionFromDisk_(p.getParameter<bool>("ComputeCoarseLocalPositionFromDisk")) {
51  std::string const myname = p.getParameter<std::string>("ComponentName");
52  auto c = setWhatProduced(this, myname);
53  geomToken_ = c.consumes();
54 
55  std::string const sname = p.getParameter<std::string>("StripCPE");
56  if (sname != "Fake") {
57  spToken_ = c.consumes(edm::ESInputTag("", sname));
58  }
59 
60  std::string const pname = p.getParameter<std::string>("PixelCPE");
61  if (pname != "Fake") {
62  ppToken_ = c.consumes(edm::ESInputTag("", pname));
63  }
64 
65  auto const mname = p.getParameter<std::string>("Matcher");
66  if (mname != "Fake") {
67  mpToken_ = c.consumes(edm::ESInputTag("", mname));
68  }
69 
70  auto const P2otname = p.getParameter<std::string>("Phase2StripCPE");
71  if (!P2otname.empty()) {
72  p2OTToken_ = c.consumes(edm::ESInputTag("", P2otname));
73  }
74 }
75 
76 std::unique_ptr<TransientTrackingRecHitBuilder> TkTransientTrackingRecHitBuilderESProducer::produce(
77  const TransientRecHitRecord& iRecord) {
78  const StripClusterParameterEstimator* sp = nullptr;
79  if (spToken_) {
80  sp = &iRecord.get(*spToken_);
81  }
82 
83  const PixelClusterParameterEstimator* pp = nullptr;
84  if (ppToken_) {
85  pp = &iRecord.get(*ppToken_);
86  }
87 
88  const SiStripRecHitMatcher* mp = nullptr;
89  if (mpToken_) {
90  mp = &iRecord.get(*mpToken_);
91  }
92 
94  edm::LogWarning("TkTransientTrackingRecHitBuilderESProducer")
95  << " The tracking rec hit positions and errors are not a persistent in data formats.\n"
96  << " They are not available from disk.\n"
97  << " However, TkTransientTrackingRecHitBuilderESProducer::ComputeCoarseLocalPositionFromDisk=True \n"
98  << " will make the coarse estimation of this position/error available without track refit.\n"
99  << " Position/error obtained from rechit with already defined position/error are not recomputed.\n"
100  << " Position/error obtained from track refit are precise.";
101 
102  auto const& dd = iRecord.get(geomToken_);
103 
104  //For Phase2 upgrade
105  if (p2OTToken_) {
106  return std::make_unique<TkTransientTrackingRecHitBuilder>(&dd, pp, &iRecord.get(*p2OTToken_));
107  }
108  return std::make_unique<TkTransientTrackingRecHitBuilder>(&dd, pp, sp, mp, computeCoarseLocalPositionFromDisk_);
109 }
110 
113 
114  desc.add<std::string>("ComponentName");
115  desc.add<bool>("ComputeCoarseLocalPositionFromDisk");
116  desc.add<std::string>("StripCPE")->setComment("Using \"Fake\" disables use of StripCPE");
117  desc.add<std::string>("PixelCPE")->setComment("Using \"Fake\" disables use of PixelCPE");
118  desc.add<std::string>("Matcher")->setComment("Using \"Fake\" disables use of SiStripRecHitMatcher");
119  desc.add<std::string>("Phase2StripCPE", "")->setComment("Using empty string disables use of Phase2StripCPE");
120 
121  descriptions.addDefault(desc);
122 }
123 
TkTransientTrackingRecHitBuilderESProducer::ppToken_
std::optional< edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > > ppToken_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:40
PixelClusterParameterEstimator
Definition: PixelClusterParameterEstimator.h:15
electrons_cff.bool
bool
Definition: electrons_cff.py:393
edm::ESInputTag
Definition: ESInputTag.h:87
MessageLogger.h
TkTransientTrackingRecHitBuilderESProducer::spToken_
std::optional< edm::ESGetToken< StripClusterParameterEstimator, TkStripCPERecord > > spToken_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:39
ESHandle.h
TkTransientTrackingRecHitBuilderESProducer::geomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:42
TkTransientTrackingRecHitBuilderESProducer::computeCoarseLocalPositionFromDisk_
const bool computeCoarseLocalPositionFromDisk_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:44
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TransientRecHitRecord.h
PixelClusterParameterEstimator.h
TkTransientTrackingRecHitBuilderESProducer::TkTransientTrackingRecHitBuilderESProducer
TkTransientTrackingRecHitBuilderESProducer(const edm::ParameterSet &p)
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:49
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TransientRecHitRecord
Definition: TransientRecHitRecord.h:14
ESProducer.h
TrackingGeometry.h
ESGetToken.h
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
TkTransientTrackingRecHitBuilder.h
StripClusterParameterEstimator
Definition: StripClusterParameterEstimator.h:25
Phase2StripCPE.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:103
TkPhase2OTCPERecord
Definition: TkPhase2OTCPERecord.h:12
unpackData-CaloStage2.pname
pname
Definition: unpackData-CaloStage2.py:76
createTree.dd
string dd
Definition: createTree.py:154
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
TrackerCPERecord.h
TkTransientTrackingRecHitBuilderESProducer
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:30
TkTransientTrackingRecHitBuilderESProducer::mpToken_
std::optional< edm::ESGetToken< SiStripRecHitMatcher, TkStripCPERecord > > mpToken_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:41
MagneticField.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
TkTransientTrackingRecHitBuilderESProducer::produce
std::unique_ptr< TransientTrackingRecHitBuilder > produce(const TransientRecHitRecord &)
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:76
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
SiStripRecHitMatcher.h
ModuleFactory.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
TkTransientTrackingRecHitBuilderESProducer::p2OTToken_
std::optional< edm::ESGetToken< ClusterParameterEstimator< Phase2TrackerCluster1D >, TkPhase2OTCPERecord > > p2OTToken_
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:43
EventSetup.h
StripClusterParameterEstimator.h
edm::ESProducer
Definition: ESProducer.h:104
TkTransientTrackingRecHitBuilderESProducer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TkTransientTrackingRecHitBuilderESProducer.cc:111
TransientTrackingRecHitBuilder.h
ClusterParameterEstimator.h
ParameterSet.h
createTree.pp
pp
Definition: createTree.py:17
SiStripRecHitMatcher
Definition: SiStripRecHitMatcher.h:24
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99