CMS 3D CMS Logo

Functions
fakeOTLA Namespace Reference

Functions

template<class T >
std::unique_ptr< TproduceRecord (const float value, const GeometricDet &geomDet)
 

Function Documentation

◆ produceRecord()

template<class T >
std::unique_ptr<T> fakeOTLA::produceRecord ( const float  value,
const GeometricDet geomDet 
)

Definition at line 52 of file SiPhase2OuterTrackerFakeLorentzAngleESSource.cc.

References DetId::det(), TrackerGeometryUtils::getOuterTrackerDetIds(), getGTfromDQMFile::obj, DetId::subdetId(), StripSubdetector::TID, StripSubdetector::TOB, and align::Tracker.

52  {
53  using namespace edm::es;
54  T* obj = new T();
55  for (const auto detId : TrackerGeometryUtils::getOuterTrackerDetIds(geomDet)) {
56  const DetId detectorId = DetId(detId);
57  const int subDet = detectorId.subdetId();
58  if (detectorId.det() == DetId::Detector::Tracker) {
59  if (subDet == StripSubdetector::TOB || subDet == StripSubdetector::TID) {
60  if (!obj->putLorentzAngle(detId, value))
61  edm::LogError("SiPhase2OuterTrackerFakeLorentzAngleESSource")
62  << "[SiPhase2OuterTrackerFakeLorentzAngleESSource::produce] detid already exists" << std::endl;
63  } // if it's a OT DetId
64  } // check if Tracker
65  } // loop on DetIds
66  return std::unique_ptr<T>(obj);
67  }
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Definition: value.py:1
static constexpr auto TOB
Definition: DetId.h:17
std::vector< uint32_t > getOuterTrackerDetIds(const GeometricDet &geomDet)
Definition: utils.cc:20
long double T
static constexpr auto TID