CMS 3D CMS Logo

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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 & itemsToGetFrom (BranchType iType) 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::SubDetectortoSubDetectors (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::SubDetectorskipSubDetectors_
 
std::vector< GeomDetEnumerators::SubDetectorsubDets_
 

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 239 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().

240 {
241  const auto subDetector = toString(det.subDetector());
242  const auto& detId = det.geographicalId().rawId();
243  const auto& pos = det.position();
244  const auto& rot = det.rotation();
245  rawIDs_.push_back(detId);
246  subDets_.push_back(det.subDetector());
247 
248  // TrackerAlignmentRcd entry
249  if (createReferenceRcd_) {
252  detId));
253  } else {
254  const AlignTransform::Translation translation(pos.x(), pos.y(), pos.z());
256  CLHEP::HepRep3x3(rot.xx(),rot.xy(),rot.xz(),
257  rot.yx(),rot.yy(),rot.yz(),
258  rot.zx(),rot.zy(),rot.zz()));
259  const auto& eulerAngles = rotation.eulerAngles();
260  LogDebug("Alignment")
261  << "============================================================\n"
262  << "subdetector: " << subDetector << "\n"
263  << "detId: " << detId << "\n"
264  << "------------------------------------------------------------\n"
265  << " x: " << pos.x() << "\n"
266  << " y: " << pos.y() << "\n"
267  << " z: " << pos.z() << "\n"
268  << " phi: " << eulerAngles.phi() << "\n"
269  << " theta: " << eulerAngles.theta() << "\n"
270  << " psi: " << eulerAngles.psi() << "\n"
271  << "============================================================\n";
272  alignments_.m_align.emplace_back(AlignTransform(translation, rotation, detId));
273  }
274 
275  // TrackerAlignmentErrorExtendedRcd entry
276  const AlignTransformError::SymMatrix zeroAPEs(6, 0);
277  alignmentErrors_.m_alignError.emplace_back(AlignTransformErrorExtended(zeroAPEs, detId));
278 }
#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 282 of file CreateTrackerAlignmentRcds.cc.

References AlignmentSurfaceDeformations::add(), alignmentErrors_, alignments_, alignmentSurfaceDeformations_, SoftLeptonByDistance_cfi::distance, spr::find(), runEdmFileComparison::found, edm::EventSetup::get(), mps_fire::i, hcalTTPDigis_cfi::id, diffTreeTool::index, AlignmentSurfaceDeformations::items(), LogDebug, Alignments::m_align, AlignmentErrorsExtended::m_alignError, AlignmentSurfaceDeformations::parameters(), rawIDs_, skipSubDetectors_, subDets_, and toString().

Referenced by analyze().

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

Definition at line 125 of file CreateTrackerAlignmentRcds.cc.

References a, addAlignmentInfo(), alignToGlobalTag_, alignToGT(), b, clearAlignmentInfos(), createReferenceRcd_, firstEvent_, retrieveGeometry(), AlCaHLTBitMon_QueryRunRegistry::string, mixOne_simraw_on_sim_cfi::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 209 of file CreateTrackerAlignmentRcds.cc.

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

Referenced by analyze().

210 {
211  alignments_.clear();
214  rawIDs_.clear();
215 }
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 397 of file CreateTrackerAlignmentRcds.cc.

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

398 {
400  desc.setComment("Creates ideal TrackerAlignmentRcd and TrackerAlignmentErrorExtendedRcd "
401  "from the loaded tracker geometry. "
402  "PoolDBOutputService must be set up for these records.");
403  desc.addUntracked<bool>("alignToGlobalTag", false);
404  desc.addUntracked<std::vector<std::string> >("skipSubDetectors",
405  std::vector<std::string>{});
406  desc.addUntracked<bool>("createReferenceRcd", false);
407  descriptions.add("createIdealTkAlRecords", desc);
408 }
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 219 of file CreateTrackerAlignmentRcds.cc.

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

Referenced by analyze().

220 {
221  edm::ESHandle<GeometricDet> geometricDet;
222  iSetup.get<IdealGeometryRecord>().get(geometricDet);
223 
225  iSetup.get<PTrackerParametersRcd>().get(ptp);
226 
227  edm::ESHandle<TrackerTopology> tTopoHandle;
228  iSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
229  const auto* const tTopo = tTopoHandle.product();
230 
231  TrackerGeomBuilderFromGeometricDet trackerBuilder;
232 
233  return std::unique_ptr<TrackerGeometry> {
234  trackerBuilder.build(&(*geometricDet), *ptp, tTopo )};
235 }
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
const T & get() const
Definition: EventSetup.h:55
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::P2PXB, 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::P2PXB: return "P2PXB";
165  case GeomDetEnumerators::P2PXEC: return "P2PXEC";
166  case GeomDetEnumerators::invalidDet: return "invalidDet";
167  default:
168  throw cms::Exception("UnknownSubdetector");
169  }
170 }
GeomDetEnumerators::SubDetector CreateIdealTkAlRecords::toSubDetector ( const std::string &  sub)
static

Definition at line 174 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::P2PXB, GeomDetEnumerators::P2PXEC, GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GeomDetEnumerators::RPCBarrel, GeomDetEnumerators::RPCEndcap, GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.

Referenced by toSubDetectors().

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

Definition at line 200 of file CreateTrackerAlignmentRcds.cc.

References mps_fire::result, and toSubDetector().

201 {
202  std::vector<GeomDetEnumerators::SubDetector> result;
203  for (const auto& sub: subs) result.emplace_back(toSubDetector(sub));
204  return result;
205 }
static GeomDetEnumerators::SubDetector toSubDetector(const std::string &sub)
void CreateIdealTkAlRecords::writeToDB ( )
private

Definition at line 378 of file CreateTrackerAlignmentRcds.cc.

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

Referenced by analyze().

379 {
381 
383  if (!poolDb.isAvailable()) {
384  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
385  }
386 
387  edm::LogInfo("Alignment")
388  << "Writing ideal tracker-alignment records.";
389  poolDb->writeOne(&alignments_, since, "TrackerAlignmentRcd");
390  poolDb->writeOne(&alignmentErrors_, since, "TrackerAlignmentErrorExtendedRcd");
391  poolDb->writeOne(&alignmentSurfaceDeformations_, since, "TrackerSurfaceDeformationRcd");
392 }
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().