test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
CreateIdealTkAlRecords Class Reference
Inheritance diagram for CreateIdealTkAlRecords:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 CreateIdealTkAlRecords (const edm::ParameterSet &)
 
 ~CreateIdealTkAlRecords ()
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector
< ProductResolverIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static std::string toString (const GeomDetEnumerators::SubDetector &)
 
static
GeomDetEnumerators::SubDetector 
toSubDetector (const std::string &sub)
 
static std::vector
< GeomDetEnumerators::SubDetector
toSubDetectors (const std::vector< std::string > &subs)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void addAlignmentInfo (const GeomDet &)
 
void alignToGT (const edm::EventSetup &)
 
virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
void clearAlignmentInfos ()
 
std::unique_ptr< TrackerGeometryretrieveGeometry (const edm::EventSetup &)
 
void writeToDB ()
 

Private Attributes

AlignmentErrorsExtended alignmentErrors_
 
Alignments alignments_
 
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
 
const bool alignToGlobalTag_
 
const bool createReferenceRcd_
 
bool firstEvent_
 
std::vector< uint32_t > rawIDs_
 
const std::vector
< GeomDetEnumerators::SubDetector
skipSubDetectors_
 
std::vector
< GeomDetEnumerators::SubDetector
subDets_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: Plugin to create ideal tracker alignment records.

Implementation: The plugin takes the geometry stored in the global tag and transfers this information to the format needed in the TrackerAlignmentRcd. The APEs are set to zero for all det IDs of the tracker geometry and put into an TrackerAlignmentErrorExtendedRcd. In addition an empty TrackerSurfaceDeformationRcd is created corresponding to ideal surfaces.

An option exists to align to the content of the used global tag. This is useful, if the geometry record and the tracker alignment records do not match.

Definition at line 70 of file CreateTrackerAlignmentRcds.cc.

Constructor & Destructor Documentation

CreateIdealTkAlRecords::CreateIdealTkAlRecords ( const edm::ParameterSet iConfig)
explicit

Definition at line 105 of file CreateTrackerAlignmentRcds.cc.

105  :
106  skipSubDetectors_(toSubDetectors(iConfig.getUntrackedParameter<std::vector<std::string> >("skipSubDetectors"))),
107  alignToGlobalTag_(iConfig.getUntrackedParameter<bool>("alignToGlobalTag")),
108  createReferenceRcd_(iConfig.getUntrackedParameter<bool>("createReferenceRcd")),
109  firstEvent_(true)
110 {
111 }
T getUntrackedParameter(std::string const &, T const &) const
static std::vector< GeomDetEnumerators::SubDetector > toSubDetectors(const std::vector< std::string > &subs)
const std::vector< GeomDetEnumerators::SubDetector > skipSubDetectors_
CreateIdealTkAlRecords::~CreateIdealTkAlRecords ( )

Definition at line 114 of file CreateTrackerAlignmentRcds.cc.

115 {
116 }

Member Function Documentation

void CreateIdealTkAlRecords::addAlignmentInfo ( const GeomDet det)
private

Definition at line 237 of file CreateTrackerAlignmentRcds.cc.

References alignmentErrors_, alignments_, createReferenceRcd_, GeomDet::geographicalId(), LogDebug, Alignments::m_align, AlignmentErrorsExtended::m_alignError, GeomDet::position(), DetId::rawId(), rawIDs_, makeMuonMisalignmentScenario::rot, idealTransformation::rotation, GeomDet::rotation(), GeomDet::subDetector(), subDets_, and toString().

Referenced by analyze().

238 {
239  const auto subDetector = toString(det.subDetector());
240  const auto& detId = det.geographicalId().rawId();
241  const auto& pos = det.position();
242  const auto& rot = det.rotation();
243  rawIDs_.push_back(detId);
244  subDets_.push_back(det.subDetector());
245 
246  // TrackerAlignmentRcd entry
247  if (createReferenceRcd_) {
250  detId));
251  } else {
252  const AlignTransform::Translation translation(pos.x(), pos.y(), pos.z());
254  CLHEP::HepRep3x3(rot.xx(),rot.xy(),rot.xz(),
255  rot.yx(),rot.yy(),rot.yz(),
256  rot.zx(),rot.zy(),rot.zz()));
257  const auto& eulerAngles = rotation.eulerAngles();
258  LogDebug("Alignment")
259  << "============================================================\n"
260  << "subdetector: " << subDetector << "\n"
261  << "detId: " << detId << "\n"
262  << "------------------------------------------------------------\n"
263  << " x: " << pos.x() << "\n"
264  << " y: " << pos.y() << "\n"
265  << " z: " << pos.z() << "\n"
266  << " phi: " << eulerAngles.phi() << "\n"
267  << " theta: " << eulerAngles.theta() << "\n"
268  << " psi: " << eulerAngles.psi() << "\n"
269  << "============================================================\n";
270  alignments_.m_align.emplace_back(AlignTransform(translation, rotation, detId));
271  }
272 
273  // TrackerAlignmentErrorExtendedRcd entry
274  const AlignTransformError::SymMatrix zeroAPEs(6, 0);
275  alignmentErrors_.m_alignError.emplace_back(AlignTransformErrorExtended(zeroAPEs, detId));
276 }
#define LogDebug(id)
std::vector< uint32_t > rawIDs_
static std::string toString(const GeomDetEnumerators::SubDetector &)
AlignmentErrorsExtended alignmentErrors_
std::vector< GeomDetEnumerators::SubDetector > subDets_
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
Definition: GeomDet.h:51
CLHEP::HepSymMatrix SymMatrix
CLHEP::Hep3Vector Translation
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
std::vector< AlignTransformErrorExtended > m_alignError
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:44
CLHEP::HepRotation Rotation
void CreateIdealTkAlRecords::alignToGT ( const edm::EventSetup iSetup)
private

Definition at line 280 of file CreateTrackerAlignmentRcds.cc.

References AlignmentSurfaceDeformations::add(), alignmentErrors_, alignments_, alignmentSurfaceDeformations_, HLT_25ns10e33_v2_cff::distance, spr::find(), newFWLiteAna::found, edm::EventSetup::get(), i, cmsHarvester::index, LogDebug, Alignments::m_align, AlignmentErrorsExtended::m_alignError, rawIDs_, skipSubDetectors_, subDets_, and toString().

Referenced by analyze().

281 {
282  LogDebug("Alignment") << "Aligning to global tag\n";
283 
284  edm::ESHandle<Alignments> alignments;
285  iSetup.get<TrackerAlignmentRcd>().get(alignments);
287  iSetup.get<TrackerAlignmentErrorExtendedRcd>().get(alignmentErrors);
289  iSetup.get<TrackerSurfaceDeformationRcd>().get(surfaceDeformations);
290 
291  if (alignments->m_align.size() != alignmentErrors->m_alignError.size())
292  throw cms::Exception("GeometryMismatch")
293  << "Size mismatch between alignments (size=" << alignments->m_align.size()
294  << ") and alignment errors (size=" << alignmentErrors->m_alignError.size()
295  << ")";
296 
297  std::vector<uint32_t> commonIDs;
298  auto itAlignErr = alignmentErrors->m_alignError.cbegin();
299  for (auto itAlign = alignments->m_align.cbegin();
300  itAlign != alignments->m_align.cend();
301  ++itAlign, ++itAlignErr) {
302  const auto id = itAlign->rawId();
303  auto found = std::find(rawIDs_.cbegin(), rawIDs_.cend(), id);
304  if (found != rawIDs_.cend()) {
305  if (id != itAlignErr->rawId())
306  throw cms::Exception("GeometryMismatch")
307  << "DetId mismatch between alignments (rawId=" << id
308  << ") and alignment errors (rawId=" << itAlignErr->rawId() << ")";
309 
310  const auto index = std::distance(rawIDs_.cbegin(), found);
311  if (std::find(skipSubDetectors_.begin(),
312  skipSubDetectors_.end(),
313  subDets_[index]) != skipSubDetectors_.end()) continue;
314 
315  if (alignments_.m_align[index].rawId()
316  != alignmentErrors_.m_alignError[index].rawId())
317  throw cms::Exception("GeometryMismatch")
318  << "DetId mismatch between alignments (rawId="
319  << alignments_.m_align[index].rawId()
320  << ") and alignment errors (rawId="
321  << alignmentErrors_.m_alignError[index].rawId() << ")";
322 
323  LogDebug("Alignment")
324  << "============================================================\n"
325  << "\nGeometry content (" << toString(subDets_[index]) << ", "
326  << alignments_.m_align[index].rawId() << "):\n"
327  << "\tx: " << alignments_.m_align[index].translation().x()
328  << "\ty: " << alignments_.m_align[index].translation().y()
329  << "\tz: " << alignments_.m_align[index].translation().z()
330  << "\tphi: " << alignments_.m_align[index].rotation().phi()
331  << "\ttheta: " << alignments_.m_align[index].rotation().theta()
332  << "\tpsi: " << alignments_.m_align[index].rotation().psi()
333  << "============================================================\n";
334  alignments_.m_align[index] = *itAlign;
335  alignmentErrors_.m_alignError[index] = *itAlignErr;
336  commonIDs.push_back(id);
337  LogDebug("Alignment")
338  << "============================================================\n"
339  << "Global tag content (" << toString(subDets_[index]) << ", "
340  << alignments_.m_align[index].rawId() << "):\n"
341  << "\tx: " << alignments_.m_align[index].translation().x()
342  << "\ty: " << alignments_.m_align[index].translation().y()
343  << "\tz: " << alignments_.m_align[index].translation().z()
344  << "\tphi: " << alignments_.m_align[index].rotation().phi()
345  << "\ttheta: " << alignments_.m_align[index].rotation().theta()
346  << "\tpsi: " << alignments_.m_align[index].rotation().psi()
347  << "============================================================\n";
348  }
349  }
350 
351  // - surface deformations are stored differently
352  // -> different treatment
353  // - the above payloads contain also entries for ideal modules
354  // - no entry is created for ideal surfaces
355  // -> size of surface deformation payload does not necessarily match the
356  // size of the other tracker alignment payload
357  for (const auto& id: commonIDs) {
358  // search for common raw ID in surface deformation items
359  auto item = std::find_if(surfaceDeformations->items().cbegin(),
360  surfaceDeformations->items().cend(),
361  [&id](const auto& i) { return i.m_rawId == id; });
362  if (item == surfaceDeformations->items().cend()) continue; // not found
363 
364  // copy surface deformation item
365  const auto index = std::distance(surfaceDeformations->items().cbegin(), item);
366  const auto beginEndPair = surfaceDeformations->parameters(index);
367  std::vector<align::Scalar> params(beginEndPair.first, beginEndPair.second);
368  alignmentSurfaceDeformations_.add(item->m_rawId,
369  item->m_parametrizationType,
370  params);
371  }
372 }
#define LogDebug(id)
std::vector< uint32_t > rawIDs_
int i
Definition: DBlmapReader.cc:9
static std::string toString(const GeomDetEnumerators::SubDetector &)
AlignmentErrorsExtended alignmentErrors_
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
std::vector< GeomDetEnumerators::SubDetector > subDets_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const std::vector< GeomDetEnumerators::SubDetector > skipSubDetectors_
bool add(align::ID rawId, int type, const std::vector< align::Scalar > &parameters)
Add a new item.
std::vector< AlignTransformErrorExtended > m_alignError
const T & get() const
Definition: EventSetup.h:56
void CreateIdealTkAlRecords::analyze ( const edm::Event ,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 125 of file CreateTrackerAlignmentRcds.cc.

References a, addAlignmentInfo(), alignToGlobalTag_, alignToGT(), b, clearAlignmentInfos(), createReferenceRcd_, firstEvent_, retrieveGeometry(), patCandidatesForDimuonsSequences_cff::tracker, and writeToDB().

126 {
127  if (firstEvent_) {
129  const auto tracker = retrieveGeometry(iSetup);
130 
131  auto dets = tracker->dets();
132  std::sort(dets.begin(), dets.end(),
133  [](const auto& a, const auto& b) {
134  return a->geographicalId().rawId() < b->geographicalId().rawId();});
135 
136  for (const auto& det: dets) addAlignmentInfo(*det);
138  writeToDB();
139  firstEvent_ = false;
140  }
141 }
std::unique_ptr< TrackerGeometry > retrieveGeometry(const edm::EventSetup &)
void addAlignmentInfo(const GeomDet &)
void alignToGT(const edm::EventSetup &)
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void CreateIdealTkAlRecords::clearAlignmentInfos ( )
private

Definition at line 207 of file CreateTrackerAlignmentRcds.cc.

References alignmentErrors_, alignments_, alignmentSurfaceDeformations_, AlignmentErrorsExtended::clear(), Alignments::clear(), and rawIDs_.

Referenced by analyze().

208 {
209  alignments_.clear();
212  rawIDs_.clear();
213 }
std::vector< uint32_t > rawIDs_
AlignmentErrorsExtended alignmentErrors_
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
void clear()
Clear vector without having to look into internals:
Definition: Alignments.h:17
void clear()
Clear vector without having to look into internals:
void CreateIdealTkAlRecords::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 395 of file CreateTrackerAlignmentRcds.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::addUntracked(), and edm::ParameterSetDescription::setComment().

396 {
398  desc.setComment("Creates ideal TrackerAlignmentRcd and TrackerAlignmentErrorExtendedRcd "
399  "from the loaded tracker geometry. "
400  "PoolDBOutputService must be set up for these records.");
401  desc.addUntracked<bool>("alignToGlobalTag", false);
402  desc.addUntracked<std::vector<std::string> >("skipSubDetectors",
403  std::vector<std::string>{});
404  desc.addUntracked<bool>("createReferenceRcd", false);
405  descriptions.add("createIdealTkAlRecords", desc);
406 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< TrackerGeometry > CreateIdealTkAlRecords::retrieveGeometry ( const edm::EventSetup iSetup)
private

Definition at line 217 of file CreateTrackerAlignmentRcds.cc.

References TrackerGeomBuilderFromGeometricDet::build(), edm::EventSetup::get(), and edm::ESHandle< class >::product().

Referenced by analyze().

218 {
219  edm::ESHandle<GeometricDet> geometricDet;
220  iSetup.get<IdealGeometryRecord>().get(geometricDet);
221 
223  iSetup.get<PTrackerParametersRcd>().get(ptp);
224 
225  edm::ESHandle<TrackerTopology> tTopoHandle;
226  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
227  const auto* const tTopo = tTopoHandle.product();
228 
229  TrackerGeomBuilderFromGeometricDet trackerBuilder;
230 
231  return std::unique_ptr<TrackerGeometry> {
232  trackerBuilder.build(&(*geometricDet), *ptp, tTopo )};
233 }
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
std::string CreateIdealTkAlRecords::toString ( const GeomDetEnumerators::SubDetector sub)
static

Definition at line 145 of file CreateTrackerAlignmentRcds.cc.

References GeomDetEnumerators::CSC, GeomDetEnumerators::DT, Exception, GeomDetEnumerators::GEM, GeomDetEnumerators::invalidDet, GeomDetEnumerators::ME0, GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2OTB, GeomDetEnumerators::P2OTEC, GeomDetEnumerators::P2PXEC, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.

Referenced by addAlignmentInfo(), and alignToGT().

146 {
147  switch (sub) {
148  case GeomDetEnumerators::PixelBarrel: return "PixelBarrel";
149  case GeomDetEnumerators::PixelEndcap: return "PixelEndcap";
150  case GeomDetEnumerators::TIB: return "TIB";
151  case GeomDetEnumerators::TOB: return "TOB";
152  case GeomDetEnumerators::TID: return "TID";
153  case GeomDetEnumerators::TEC: return "TEC";
154  case GeomDetEnumerators::CSC: return "CSC";
155  case GeomDetEnumerators::DT: return "DT";
156  case GeomDetEnumerators::RPCBarrel: return "RPCBarrel";
157  case GeomDetEnumerators::RPCEndcap: return "RPCEndcap";
158  case GeomDetEnumerators::GEM: return "GEM";
159  case GeomDetEnumerators::ME0: return "ME0";
160  case GeomDetEnumerators::P2OTB: return "P2OTB";
161  case GeomDetEnumerators::P2OTEC: return "P2OTEC";
162  case GeomDetEnumerators::P1PXB: return "P1PXB";
163  case GeomDetEnumerators::P1PXEC: return "P1PXEC";
164  case GeomDetEnumerators::P2PXEC: return "P2PXEC";
165  case GeomDetEnumerators::invalidDet: return "invalidDet";
166  default:
167  throw cms::Exception("UnknownSubdetector");
168  }
169 }
GeomDetEnumerators::SubDetector CreateIdealTkAlRecords::toSubDetector ( const std::string &  sub)
static

Definition at line 173 of file CreateTrackerAlignmentRcds.cc.

References GeomDetEnumerators::CSC, GeomDetEnumerators::DT, Exception, GeomDetEnumerators::GEM, GeomDetEnumerators::invalidDet, GeomDetEnumerators::ME0, GeomDetEnumerators::P1PXB, GeomDetEnumerators::P1PXEC, GeomDetEnumerators::P2OTB, GeomDetEnumerators::P2OTEC, GeomDetEnumerators::P2PXEC, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.

Referenced by toSubDetectors().

174 {
175  if (sub == "PixelBarrel") return GeomDetEnumerators::PixelBarrel;
176  else if (sub == "PixelEndcap") return GeomDetEnumerators::PixelEndcap;
177  else if (sub == "TIB") return GeomDetEnumerators::TIB;
178  else if (sub == "TOB") return GeomDetEnumerators::TOB;
179  else if (sub == "TID") return GeomDetEnumerators::TID;
180  else if (sub == "TEC") return GeomDetEnumerators::TEC;
181  else if (sub == "CSC") return GeomDetEnumerators::CSC;
182  else if (sub == "DT") return GeomDetEnumerators::DT;
183  else if (sub == "RPCBarrel") return GeomDetEnumerators::RPCBarrel;
184  else if (sub == "RPCEndcap") return GeomDetEnumerators::RPCEndcap;
185  else if (sub == "GEM") return GeomDetEnumerators::GEM;
186  else if (sub == "ME0") return GeomDetEnumerators::ME0;
187  else if (sub == "P2OTB") return GeomDetEnumerators::P2OTB;
188  else if (sub == "P2OTEC") return GeomDetEnumerators::P2OTEC;
189  else if (sub == "P1PXB") return GeomDetEnumerators::P1PXB;
190  else if (sub == "P1PXEC") return GeomDetEnumerators::P1PXEC;
191  else if (sub == "P2PXEC") return GeomDetEnumerators::P2PXEC;
192  else if (sub == "invalidDet") return GeomDetEnumerators::invalidDet;
193  else throw cms::Exception("UnknownSubdetector") << sub;
194 }
std::vector< GeomDetEnumerators::SubDetector > CreateIdealTkAlRecords::toSubDetectors ( const std::vector< std::string > &  subs)
static

Definition at line 198 of file CreateTrackerAlignmentRcds.cc.

References mps_fire::result, and toSubDetector().

199 {
200  std::vector<GeomDetEnumerators::SubDetector> result;
201  for (const auto& sub: subs) result.emplace_back(toSubDetector(sub));
202  return result;
203 }
tuple result
Definition: mps_fire.py:84
static GeomDetEnumerators::SubDetector toSubDetector(const std::string &sub)
void CreateIdealTkAlRecords::writeToDB ( )
private

Definition at line 376 of file CreateTrackerAlignmentRcds.cc.

References alignmentErrors_, alignments_, alignmentSurfaceDeformations_, cond::TimeTypeSpecs::beginValue, Exception, edm::Service< T >::isAvailable(), cond::runnumber, cond::timeTypeSpecs, and cond::service::PoolDBOutputService::writeOne().

Referenced by analyze().

377 {
378  const auto& since = cond::timeTypeSpecs[cond::runnumber].beginValue;
379 
381  if (!poolDb.isAvailable()) {
382  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
383  }
384 
385  edm::LogInfo("Alignment")
386  << "Writing ideal tracker-alignment records.";
387  poolDb->writeOne(&alignments_, since, "TrackerAlignmentRcd");
388  poolDb->writeOne(&alignmentErrors_, since, "TrackerAlignmentErrorExtendedRcd");
389  poolDb->writeOne(&alignmentSurfaceDeformations_, since, "TrackerSurfaceDeformationRcd");
390 }
const TimeTypeSpecs timeTypeSpecs[]
Definition: Time.cc:22
AlignmentErrorsExtended alignmentErrors_
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
Time_t beginValue
Definition: Time.h:45
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)

Member Data Documentation

AlignmentErrorsExtended CreateIdealTkAlRecords::alignmentErrors_
private
Alignments CreateIdealTkAlRecords::alignments_
private
AlignmentSurfaceDeformations CreateIdealTkAlRecords::alignmentSurfaceDeformations_
private

Definition at line 96 of file CreateTrackerAlignmentRcds.cc.

Referenced by alignToGT(), clearAlignmentInfos(), and writeToDB().

const bool CreateIdealTkAlRecords::alignToGlobalTag_
private

Definition at line 91 of file CreateTrackerAlignmentRcds.cc.

Referenced by analyze().

const bool CreateIdealTkAlRecords::createReferenceRcd_
private

Definition at line 92 of file CreateTrackerAlignmentRcds.cc.

Referenced by addAlignmentInfo(), and analyze().

bool CreateIdealTkAlRecords::firstEvent_
private

Definition at line 93 of file CreateTrackerAlignmentRcds.cc.

Referenced by analyze().

std::vector<uint32_t> CreateIdealTkAlRecords::rawIDs_
private

Definition at line 97 of file CreateTrackerAlignmentRcds.cc.

Referenced by addAlignmentInfo(), alignToGT(), and clearAlignmentInfos().

const std::vector<GeomDetEnumerators::SubDetector> CreateIdealTkAlRecords::skipSubDetectors_
private

Definition at line 90 of file CreateTrackerAlignmentRcds.cc.

Referenced by alignToGT().

std::vector<GeomDetEnumerators::SubDetector> CreateIdealTkAlRecords::subDets_
private

Definition at line 98 of file CreateTrackerAlignmentRcds.cc.

Referenced by addAlignmentInfo(), and alignToGT().