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 49 of file SiPhase2OuterTrackerFakeLorentzAngleESSource.cc.

49  {
50  using namespace edm::es;
51  T* obj = new T();
52  for (const auto detId : TrackerGeometryUtils::getOuterTrackerDetIds(geomDet)) {
53  const DetId detectorId = DetId(detId);
54  const int subDet = detectorId.subdetId();
55  if (detectorId.det() == DetId::Detector::Tracker) {
56  if (subDet == StripSubdetector::TOB || subDet == StripSubdetector::TID) {
57  if (!obj->putLorentzAngle(detId, value))
58  edm::LogError("SiPhase2OuterTrackerFakeLorentzAngleESSource")
59  << "[SiPhase2OuterTrackerFakeLorentzAngleESSource::produce] detid already exists" << std::endl;
60  } // if it's a OT DetId
61  } // check if Tracker
62  } // loop on DetIds
63  return std::unique_ptr<T>(obj);
64  }

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

DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
align::Tracker
Definition: StructureType.h:70
DetId
Definition: DetId.h:17
TrackerGeometryUtils::getOuterTrackerDetIds
std::vector< uint32_t > getOuterTrackerDetIds(const GeometricDet &geomDet)
Definition: utils.cc:20
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
value
Definition: value.py:1
T
long double T
Definition: Basic3DVectorLD.h:48
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
edm::es
Definition: es_Label.h:33
edm::Log
Definition: MessageLogger.h:70
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17