CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
fakeOTLA Namespace Reference

Functions

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

Function Documentation

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 int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
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
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46