Skip to content

Commit 19676ca

Browse files
committed
Base: allow to create alignment for individual detectors other than ITS
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 4d5a07f commit 19676ca

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Detectors/Base/include/DetectorsBase/GRPGeomHelper.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ struct GRPGeomRequest {
9898
bool askGRPLHCIF = false;
9999
bool askGRPMagField = false;
100100
bool askMatLUT = false;
101-
bool askTime = false; // need orbit reset time for precise timestamp calculation
102-
bool askGeomAlign = false; // load aligned geometry
103-
bool askGeomIdeal = false; // load ideal geometry
104-
bool askAlignments = false; // load detector alignments but don't apply them
105-
bool askOnceAllButField = false; // for all entries but field query only once
106-
bool needPropagatorD = false; // init also PropagatorD
101+
bool askTime = false; // need orbit reset time for precise timestamp calculation
102+
bool askGeomAlign = false; // load aligned geometry
103+
bool askGeomIdeal = false; // load ideal geometry
104+
bool askAlignments = false; // load detector alignments but don't apply them
105+
bool askOnceAllButField = false; // for all entries but field query only once
106+
bool needPropagatorD = false; // init also PropagatorD
107+
o2::detectors::DetID::mask_t algDetMask; // mask of requested alignment objects
107108

108109
GRPGeomRequest() = delete;
109110
GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF, bool GRPMagField, bool askMatLUT, GeomRequest geom, std::vector<o2::framework::InputSpec>& inputs, bool askOnce = false, bool needPropD = false, std::string detMaskString = "all");

Detectors/Base/src/GRPGeomHelper.cxx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using namespace o2::framework;
3737
namespace o2d = o2::dataformats;
3838

3939
GRPGeomRequest::GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF, bool GRPMagField, bool askMatLUT, GeomRequest geom, std::vector<o2::framework::InputSpec>& inputs, bool askOnce, bool needPropD, std::string detMaskString)
40-
: askGRPECS(GRPECS), askGRPLHCIF(GRPLHCIF), askGRPMagField(GRPMagField), askMatLUT(askMatLUT), askTime(orbitResetTime), askOnceAllButField(askOnce), needPropagatorD(needPropD)
40+
: askGRPECS(GRPECS), askGRPLHCIF(GRPLHCIF), askGRPMagField(GRPMagField), askMatLUT(askMatLUT), askTime(orbitResetTime), askOnceAllButField(askOnce), needPropagatorD(needPropD), algDetMask(DetID::getMask(detMaskString))
4141
{
4242
if (geom == Aligned) {
4343
askGeomAlign = true;
@@ -48,7 +48,6 @@ GRPGeomRequest::GRPGeomRequest(bool orbitResetTime, bool GRPECS, bool GRPLHCIF,
4848
}
4949
if (geom == Alignments) {
5050
askAlignments = true;
51-
o2::detectors::DetID::mask_t algDetMask = DetID::getMask(detMaskString);
5251
for (auto id = DetID::First; id <= DetID::Last; id++) {
5352
if (algDetMask[id]) {
5453
std::string binding = fmt::format("align{}", DetID::getName(id));
@@ -164,6 +163,9 @@ bool GRPGeomHelper::finaliseCCDB(ConcreteDataMatcher& matcher, void* obj)
164163
constexpr o2::header::DataDescription algDesc{"ALIGNMENT"};
165164
if (mRequest->askAlignments && matcher.description == algDesc) {
166165
for (auto id = DetID::First; id <= DetID::Last; id++) {
166+
if (!mRequest->algDetMask[id]) {
167+
continue;
168+
}
167169
if (matcher.origin == DetID::getDataOrigin(id)) {
168170
LOG(info) << DetID::getName(id) << " alignment updated";
169171
mAlignments[id] = (std::vector<o2::detectors::AlignParam>*)obj;
@@ -233,9 +235,12 @@ void GRPGeomHelper::checkUpdates(ProcessingContext& pc)
233235
}
234236
if (mRequest->askAlignments) {
235237
for (auto id = DetID::First; id <= DetID::Last; id++) {
238+
if (!mRequest->algDetMask[id]) {
239+
continue;
240+
}
236241
std::string binding = fmt::format("align{}", DetID::getName(id));
237242
if (pc.inputs().getPos(binding.c_str()) < 0) {
238-
return;
243+
LOGP(fatal, "Alignment for detector {} was requested but no binding was found!", id);
239244
} else {
240245
pc.inputs().get<std::vector<o2::detectors::AlignParam>*>(binding);
241246
}

0 commit comments

Comments
 (0)