|
|
Go to the documentation of this file.
65 #include "CLHEP/Vector/RotationInterfaces.h"
79 static std::vector<GeomDetEnumerators::SubDetector>
toSubDetectors(
const std::vector<std::string>& subs);
106 std::vector<GeomDetEnumerators::SubDetector>
subDets_;
120 skipSubDetectors_(toSubDetectors(iConfig.getUntrackedParameter<
std::
vector<
std::
string> >(
"skipSubDetectors"))),
121 alignToGlobalTag_(iConfig.getUntrackedParameter<
bool>(
"alignToGlobalTag")),
122 createReferenceRcd_(iConfig.getUntrackedParameter<
bool>(
"createReferenceRcd")),
138 std::sort(dets.begin(), dets.end(), [](
const auto&
a,
const auto&
b) {
139 return a->geographicalId().rawId() <
b->geographicalId().rawId();
142 for (
const auto& det : dets)
154 return "PixelBarrel";
156 return "PixelEndcap";
197 if (sub ==
"PixelBarrel")
199 else if (sub ==
"PixelEndcap")
201 else if (sub ==
"TIB")
203 else if (sub ==
"TOB")
205 else if (sub ==
"TID")
207 else if (sub ==
"TEC")
209 else if (sub ==
"CSC")
211 else if (sub ==
"DT")
213 else if (sub ==
"RPCBarrel")
215 else if (sub ==
"RPCEndcap")
217 else if (sub ==
"GEM")
219 else if (sub ==
"ME0")
221 else if (sub ==
"P2OTB")
223 else if (sub ==
"P2OTEC")
225 else if (sub ==
"P1PXB")
227 else if (sub ==
"P1PXEC")
229 else if (sub ==
"P2PXB")
231 else if (sub ==
"P2PXEC")
233 else if (sub ==
"invalidDet")
240 const std::vector<std::string>& subs) {
241 std::vector<GeomDetEnumerators::SubDetector>
result;
242 result.reserve(subs.size());
243 for (
const auto& sub : subs)
263 return std::unique_ptr<TrackerGeometry>{trackerBuilder.
build(geometricDet, ptitp, ptp, tTopo)};
281 const auto& eulerAngles =
rotation.eulerAngles();
282 LogDebug(
"Alignment") <<
"============================================================\n"
283 <<
"subdetector: " << subDetector <<
"\n"
284 <<
"detId: " << detId <<
"\n"
285 <<
"------------------------------------------------------------\n"
286 <<
" x: " <<
pos.x() <<
"\n"
287 <<
" y: " <<
pos.y() <<
"\n"
288 <<
" z: " <<
pos.z() <<
"\n"
289 <<
" phi: " << eulerAngles.phi() <<
"\n"
290 <<
" theta: " << eulerAngles.theta() <<
"\n"
291 <<
" psi: " << eulerAngles.psi() <<
"\n"
292 <<
"============================================================\n";
302 LogDebug(
"Alignment") <<
"Aligning to global tag\n";
310 <<
"Size mismatch between alignments (size=" << alignments->
m_align.size()
311 <<
") and alignment errors (size=" << alignmentErrors->
m_alignError.size() <<
")";
313 std::vector<uint32_t> commonIDs;
314 auto itAlignErr = alignmentErrors->
m_alignError.cbegin();
315 for (
auto itAlign = alignments->
m_align.cbegin(); itAlign != alignments->
m_align.cend(); ++itAlign, ++itAlignErr) {
316 const auto id = itAlign->rawId();
319 if (
id != itAlignErr->rawId())
320 throw cms::Exception(
"GeometryMismatch") <<
"DetId mismatch between alignments (rawId=" <<
id
321 <<
") and alignment errors (rawId=" << itAlignErr->rawId() <<
")";
332 LogDebug(
"Alignment") <<
"============================================================\n"
341 <<
"============================================================\n";
344 commonIDs.push_back(
id);
345 LogDebug(
"Alignment") <<
"============================================================\n"
354 <<
"============================================================\n";
364 for (
const auto&
id : commonIDs) {
366 auto item = std::find_if(surfaceDeformations->
items().cbegin(),
367 surfaceDeformations->
items().cend(),
368 [&
id](
const auto&
i) {
return i.m_rawId ==
id; });
369 if (
item == surfaceDeformations->
items().cend())
375 std::vector<align::Scalar>
params(beginEndPair.first, beginEndPair.second);
385 throw cms::Exception(
"NotAvailable") <<
"PoolDBOutputService not available";
388 edm::LogInfo(
"Alignment") <<
"Writing ideal tracker-alignment records.";
398 "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", std::vector<std::string>{});
403 desc.addUntracked<
bool>(
"createReferenceRcd",
false);
404 descriptions.
add(
"createIdealTkAlRecords",
desc);
const Surface::PositionType & position() const
The position (origin of the R.F.)
void clear()
Clear vector without having to look into internals:
~CreateIdealTkAlRecords() override
const edm::ESGetToken< PTrackerAdditionalParametersPerDet, PTrackerAdditionalParametersPerDetRcd > ptitpToken_
static GeomDetEnumerators::SubDetector toSubDetector(const std::string &sub)
TrackerGeometry * build(const GeometricDet *gd, const PTrackerAdditionalParametersPerDet *ptitp, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
const edm::ESGetToken< AlignmentErrorsExtended, TrackerAlignmentErrorExtendedRcd > aliErrorToken_
void clearAlignmentInfos()
Log< level::Info, false > LogInfo
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< AlignmentSurfaceDeformations, TrackerSurfaceDeformationRcd > aliSurfaceToken_
const bool alignToGlobalTag_
const TimeTypeSpecs timeTypeSpecs[]
#define DEFINE_FWK_MODULE(type)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< uint32_t > rawIDs_
const edm::ESGetToken< PTrackerParameters, PTrackerParametersRcd > ptpToken_
static std::string toString(const GeomDetEnumerators::SubDetector &)
DetId geographicalId() const
The label of this GeomDet.
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
std::unique_ptr< TrackerGeometry > retrieveGeometry(const edm::EventSetup &)
AlignmentErrorsExtended alignmentErrors_
std::vector< GeomDetEnumerators::SubDetector > subDets_
AlignmentSurfaceDeformations alignmentSurfaceDeformations_
void addAlignmentInfo(const GeomDet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
const bool createReferenceRcd_
bool getData(T &iHolder) const
constexpr uint32_t rawId() const
get the raw id
void clear()
Clear vector without having to look into internals:
CreateIdealTkAlRecords(const edm::ParameterSet &)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
static std::vector< GeomDetEnumerators::SubDetector > toSubDetectors(const std::vector< std::string > &subs)
void alignToGT(const edm::EventSetup &)
std::vector< AlignTransform > m_align
std::vector< AlignTransformErrorExtended > m_alignError
const std::vector< GeomDetEnumerators::SubDetector > skipSubDetectors_
const edm::ESGetToken< Alignments, TrackerAlignmentRcd > aliToken_
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
virtual SubDetector subDetector() const
Which subdetector.