64 #include "CLHEP/Vector/RotationInterfaces.h" 78 static std::vector<GeomDetEnumerators::SubDetector>
98 std::vector<GeomDetEnumerators::SubDetector>
subDets_;
133 [](
const auto&
a,
const auto&
b) {
134 return a->geographicalId().rawId() <
b->geographicalId().rawId();});
199 std::vector<GeomDetEnumerators::SubDetector>
202 std::vector<GeomDetEnumerators::SubDetector>
result;
203 for (
const auto& sub: subs) result.emplace_back(
toSubDetector(sub));
218 std::unique_ptr<TrackerGeometry>
229 const auto*
const tTopo = tTopoHandle.
product();
233 return std::unique_ptr<TrackerGeometry> {
234 trackerBuilder.
build(&(*geometricDet), *ptp, tTopo )};
256 CLHEP::HepRep3x3(
rot.xx(),
rot.xy(),
rot.xz(),
259 const auto& eulerAngles = rotation.eulerAngles();
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";
284 LogDebug(
"Alignment") <<
"Aligning to global tag\n";
295 <<
"Size mismatch between alignments (size=" << alignments->
m_align.size()
296 <<
") and alignment errors (size=" << alignmentErrors->
m_alignError.size()
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();
307 if (
id != itAlignErr->rawId())
309 <<
"DetId mismatch between alignments (rawId=" <<
id 310 <<
") and alignment errors (rawId=" << itAlignErr->rawId() <<
")";
320 <<
"DetId mismatch between alignments (rawId=" 322 <<
") and alignment errors (rawId=" 326 <<
"============================================================\n" 335 <<
"============================================================\n";
338 commonIDs.push_back(
id);
340 <<
"============================================================\n" 349 <<
"============================================================\n";
359 for (
const auto&
id: commonIDs) {
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;
369 std::vector<align::Scalar> params(beginEndPair.first, beginEndPair.second);
371 item->m_parametrizationType,
384 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
388 <<
"Writing ideal tracker-alignment records.";
400 desc.
setComment(
"Creates ideal TrackerAlignmentRcd and TrackerAlignmentErrorExtendedRcd " 401 "from the loaded tracker geometry. " 402 "PoolDBOutputService must be set up for these records.");
404 desc.
addUntracked<std::vector<std::string> >(
"skipSubDetectors",
405 std::vector<std::string>{});
407 descriptions.
add(
"createIdealTkAlRecords", desc);
std::unique_ptr< TrackerGeometry > retrieveGeometry(const edm::EventSetup &)
const TimeTypeSpecs timeTypeSpecs[]
std::vector< uint32_t > rawIDs_
void addAlignmentInfo(const GeomDet &)
static std::string toString(const GeomDetEnumerators::SubDetector &)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
AlignmentErrorsExtended alignmentErrors_
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
std::vector< GeomDetEnumerators::SubDetector > subDets_
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
constexpr uint32_t rawId() const
get the raw id
void analyze(const edm::Event &, const edm::EventSetup &) override
void clear()
Clear vector without having to look into internals:
const bool createReferenceRcd_
CreateIdealTkAlRecords(const edm::ParameterSet &)
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
static std::vector< GeomDetEnumerators::SubDetector > toSubDetectors(const std::vector< std::string > &subs)
void alignToGT(const edm::EventSetup &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< AlignTransform > m_align
const std::vector< GeomDetEnumerators::SubDetector > skipSubDetectors_
void setComment(std::string const &value)
#define DEFINE_FWK_MODULE(type)
const Surface::PositionType & position() const
The position (origin of the R.F.)
DetId geographicalId() const
The label of this GeomDet.
~CreateIdealTkAlRecords() override
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
void clearAlignmentInfos()
static GeomDetEnumerators::SubDetector toSubDetector(const std::string &sub)
std::vector< AlignTransformErrorExtended > m_alignError
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const bool alignToGlobalTag_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual SubDetector subDetector() const
Which subdetector.
T const * product() const
void clear()
Clear vector without having to look into internals: