Skip to content

Commit 21545f8

Browse files
authored
Merge branch 'AliceO2Group:dev' into new-detector4
2 parents b84fdbd + e04d84f commit 21545f8

File tree

44 files changed

+574
-357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+574
-357
lines changed

Common/ML/src/OrtInterface.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void OrtModel::initOptions(std::unordered_map<std::string, std::string> optionsM
5454

5555
// Load from options map
5656
if (!optionsMap.contains("model-path")) {
57-
LOG(fatal) << "(ORT) Model path cannot be empty!";
57+
LOG(fatal) << "(ORT) Model path must be contained in options map!";
5858
}
5959

6060
if (!optionsMap["model-path"].empty()) {

Common/SimConfig/include/SimConfig/SimParams.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ struct SimCutParams : public o2::conf::ConfigurableParamHelper<SimCutParams> {
4444
struct SimMaterialParams : public o2::conf::ConfigurableParamHelper<SimMaterialParams> {
4545
// Local density value takes precedence over global density value, i.e. local values overwrite the global value.
4646
float globalDensityFactor = 1.f; // global factor that scales all material densities for systematic studies
47-
std::string localDensityFactor; // Expected format: "SimMaterialParams.localDensityFactor=<mod1>:<value1>,<mod2>:<value2>,..."
47+
// String to set densities on module or material level. Expected format:
48+
// "SimMaterialParams.localDensityFactor=<mod1/matname>:<value1>,<mod2>:<value2>,..."
49+
// Example: "SimMaterialParams.localDensityFactor=TPC/Air:1.2,ITS:5." will scale the density of the Air in TPC
50+
// with 1.2 and to 5.0 for all materials in ITS".
51+
std::string localDensityFactor;
4852

4953
O2ParamDef(SimMaterialParams, "SimMaterialParams");
5054
};

DataFormats/Reconstruction/include/ReconstructionDataFormats/TrackParametrization.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ GPUdi() TrackParametrization<value_T>::TrackParametrization(value_t x, value_t a
277277
: mX{x}, mAlpha{alpha}, mAbsCharge{char(gpu::CAMath::Abs(charge))}, mPID{pid}
278278
{
279279
// explicit constructor
280+
math_utils::detail::bringToPMPi<value_t>(mAlpha);
280281
for (int i = 0; i < kNParams; i++) {
281282
mP[i] = par[i];
282283
}
@@ -295,6 +296,7 @@ GPUdi() void TrackParametrization<value_T>::set(value_t x, value_t alpha, const
295296
{
296297
mX = x;
297298
mAlpha = alpha;
299+
math_utils::detail::bringToPMPi<value_t>(mAlpha);
298300
mAbsCharge = char(gpu::CAMath::Abs(charge));
299301
for (int i = 0; i < kNParams; i++) {
300302
mP[i] = par[i];
@@ -430,6 +432,7 @@ template <typename value_T>
430432
GPUdi() void TrackParametrization<value_T>::setAlpha(value_t v)
431433
{
432434
mAlpha = v;
435+
math_utils::detail::bringToPMPi<value_t>(mAlpha);
433436
}
434437

435438
//____________________________________________________________

DataFormats/Reconstruction/src/TrackParametrization.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ template <typename value_T>
575575
std::string TrackParametrization<value_T>::asString() const
576576
{
577577
// print parameters as string
578-
return fmt::format("X:{:+.4e} Alp:{:+.3e} Par: {:+.4e} {:+.4e} {:+.4e} {:+.4e} {:+.4e} |Q|:{:d} {:s}\n",
578+
return fmt::format("X:{:+.4e} Alp:{:+.3e} Par: {:+.4e} {:+.4e} {:+.4e} {:+.4e} {:+.4e} |Q|:{:d} {:s}",
579579
getX(), getAlpha(), getY(), getZ(), getSnp(), getTgl(), getQ2Pt(), getAbsCharge(), getPID().getName());
580580
}
581581

Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class BarrelAlignmentSpec : public Task
9292
{
9393
mTPCCorrMapsLoader.setLumiScaleType(tpcOpt.lumiType);
9494
mTPCCorrMapsLoader.setLumiScaleMode(tpcOpt.lumiMode);
95+
mTPCCorrMapsLoader.setCheckCTPIDCConsistency(tpcOpt.checkCTPIDCconsistency);
9596
}
9697
~BarrelAlignmentSpec() override = default;
9798
void init(InitContext& ic) final;

Detectors/Base/include/DetectorsBase/MaterialManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class MaterialManager
218218
std::unordered_map<std::string, float> mDensityMap;
219219

220220
void initDensityMap();
221-
float getDensity(std::string const& modname);
221+
float getDensity(std::string const& modname, std::string const& matname);
222222

223223
// Hide details by providing these private methods so it cannot happen that special settings
224224
// are applied as default settings by accident using a boolean flag

Detectors/Base/src/MaterialManager.cxx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,51 @@ void MaterialManager::initDensityMap()
123123
mDensityMapInitialized = true;
124124
}
125125

126-
float MaterialManager::getDensity(std::string const& modname)
126+
float MaterialManager::getDensity(std::string const& modname, std::string const& matname)
127127
{
128+
// This function returns the final density for a material of name matname inside module modname.
129+
// The priority is
130+
// - return density for a specific module + material if it exists in the lookup
131+
// - return density for the module if it exists in the the lookup
132+
// - return global density factor
133+
134+
auto debug = getenv("O2SIM_MATMGR_LOCALDENSITY_DEBUG");
135+
128136
if (!mDensityMapInitialized) {
129137
initDensityMap();
130138
}
131-
if (mDensityMap.find(modname) != mDensityMap.end()) {
132-
return mDensityMap[modname];
139+
// density on final material level
140+
// (this works by a name lookup of pair "modname/matname")
141+
std::string lookupstring = modname + "/" + matname;
142+
auto iter = mDensityMap.find(lookupstring);
143+
if (iter != mDensityMap.end()) {
144+
if (debug) {
145+
LOG(info) << "MatManager - " << modname << "/" << matname << " : applying density " << iter->second << " from material match";
146+
}
147+
return iter->second;
133148
}
134-
return o2::conf::SimMaterialParams::Instance().globalDensityFactor;
149+
// density on module level
150+
iter = mDensityMap.find(modname);
151+
if (iter != mDensityMap.end()) {
152+
if (debug) {
153+
LOG(info) << "MatManager - " << modname << "/" << matname << " : applying density " << iter->second << " from module match";
154+
}
155+
return iter->second;
156+
}
157+
// global factor
158+
const auto global = o2::conf::SimMaterialParams::Instance().globalDensityFactor;
159+
if (debug && global != 1.0) {
160+
LOG(info) << "MatManager - " << modname << "/" << matname << " : applying global density " << iter->second;
161+
}
162+
return global;
135163
}
136164

137165
void MaterialManager::Material(const char* modname, Int_t imat, const char* name, Float_t a, Float_t z, Float_t dens,
138166
Float_t radl, Float_t absl, Float_t* buf, Int_t nwbuf)
139167
{
140168
TString uniquename = modname;
141-
auto densityFactor = getDensity(modname);
169+
auto densityFactor = getDensity(modname, name);
170+
142171
uniquename.Append("_");
143172
uniquename.Append(name);
144173
if (TVirtualMC::GetMC()) {
@@ -173,7 +202,7 @@ void MaterialManager::Mixture(const char* modname, Int_t imat, const char* name,
173202
Int_t nlmat, Float_t* wmat)
174203
{
175204
TString uniquename = modname;
176-
auto densityFactor = getDensity(modname);
205+
auto densityFactor = getDensity(modname, name);
177206
uniquename.Append("_");
178207
uniquename.Append(name);
179208

Detectors/GlobalTrackingWorkflow/src/CosmicsMatchingSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class CosmicsMatchingSpec : public Task
6666
{
6767
mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType);
6868
mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode);
69+
mTPCCorrMapsLoader.setCheckCTPIDCConsistency(sclOpts.checkCTPIDCconsistency);
6970
}
7071
~CosmicsMatchingSpec() override = default;
7172
void init(InitContext& ic) final;

Detectors/GlobalTrackingWorkflow/src/SecondaryVertexingSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class SecondaryVertexingSpec : public Task
6262
{
6363
mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType);
6464
mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode);
65+
mTPCCorrMapsLoader.setCheckCTPIDCConsistency(sclOpts.checkCTPIDCconsistency);
6566
}
6667
~SecondaryVertexingSpec() override = default;
6768
void init(InitContext& ic) final;

Detectors/GlobalTrackingWorkflow/src/TOFMatcherSpec.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class TOFMatcherSpec : public Task
6262
{
6363
mTPCCorrMapsLoader.setLumiScaleType(sclOpts.lumiType);
6464
mTPCCorrMapsLoader.setLumiScaleMode(sclOpts.lumiMode);
65+
mTPCCorrMapsLoader.setCheckCTPIDCConsistency(sclOpts.checkCTPIDCconsistency);
6566
}
6667
~TOFMatcherSpec() override = default;
6768
void init(InitContext& ic) final;

0 commit comments

Comments
 (0)