Skip to content

Commit 53574c1

Browse files
authored
Merge branch 'AliceO2Group:dev' into fd3_digits
2 parents bbf4116 + c590fd7 commit 53574c1

File tree

184 files changed

+2862
-3587
lines changed

Some content is hidden

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

184 files changed

+2862
-3587
lines changed

CCDB/include/CCDB/BasicCCDBManager.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "CommonUtils/NameConf.h"
2121
#include "Framework/DataTakingContext.h"
2222
#include "Framework/DefaultsHelpers.h"
23+
#include "Framework/ServiceRegistryRef.h"
24+
#include "Framework/DataProcessingStats.h"
2325
#include <string>
2426
#include <chrono>
2527
#include <map>
@@ -340,6 +342,13 @@ T* CCDBManagerInstance::getForTimeStamp(std::string const& path, long timestamp,
340342
}
341343
auto end = std::chrono::system_clock::now();
342344
mTimerMS += std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
345+
auto *ref = o2::framework::ServiceRegistryRef::globalDeviceRef();
346+
if (ref && ref->active<framework::DataProcessingStats>()) {
347+
auto& stats = ref->get<o2::framework::DataProcessingStats>();
348+
stats.updateStats({(int)o2::framework::ProcessingStatsId::CCDB_CACHE_HIT, o2::framework::DataProcessingStats::Op::Set, (int64_t)mQueries - mFailures - mFetches});
349+
stats.updateStats({(int)o2::framework::ProcessingStatsId::CCDB_CACHE_MISS, o2::framework::DataProcessingStats::Op::Set, (int64_t)mFetches});
350+
stats.updateStats({(int)o2::framework::ProcessingStatsId::CCDB_CACHE_FAILURE, o2::framework::DataProcessingStats::Op::Set, (int64_t)mFailures});
351+
}
343352
return ptr;
344353
}
345354

@@ -391,4 +400,4 @@ class BasicCCDBManager : public CCDBManagerInstance
391400

392401
} // namespace o2::ccdb
393402

394-
#endif //O2_BASICCCDBMANAGER_H
403+
#endif // O2_BASICCCDBMANAGER_H

CCDB/src/BasicCCDBManager.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// Created by Sandro Wenzel on 2019-08-14.
1414
//
1515
#include "CCDB/BasicCCDBManager.h"
16+
#include "Framework/ServiceRegistryRef.h"
17+
#include "Framework/DataProcessingStats.h"
1618
#include <boost/lexical_cast.hpp>
1719
#include <fairlogger/Logger.h>
1820
#include <string>

Common/DCAFitter/include/DCAFitter/DCAFitterN.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ GPUd() o2::math_utils::SMatrix<double, 3, 3, o2::math_utils::MatRepSym<double, 3
818818
MatSym3D covmSum;
819819
for (int i = N; i--;) {
820820
MatSym3D covTr = o2::math_utils::Similarity(getTrackRotMatrix(i), getTrackCovMatrix(i, cand));
821+
covmSum += covTr;
821822
}
822823
return covmSum;
823824
}

Common/SimConfig/include/SimConfig/G4Params.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,22 @@ enum class EG4Physics {
3333
kUSER = 8 /* allows to give own string combination */
3434
};
3535

36+
// enumerating possible geometry navigation modes
37+
// (understanding that geometry description is always done with TGeo)
38+
enum class EG4Nav {
39+
kTGeo = 0, /* navigate with TGeo */
40+
kG4 = 1 /* navigate with G4 native geometry */
41+
};
42+
3643
// parameters to influence the G4 engine
3744
struct G4Params : public o2::conf::ConfigurableParamHelper<G4Params> {
3845
EG4Physics physicsmode = EG4Physics::kFTFP_BERT_EMV_optical; // default physics mode with which to configure G4
3946

4047
std::string configMacroFile = ""; // a user provided g4Config.in file (otherwise standard one fill be taken)
4148
std::string userPhysicsList = ""; // possibility to directly give physics list as string
4249

50+
EG4Nav navmode = EG4Nav::kTGeo; // geometry navigation mode (default TGeo)
51+
4352
std::string const& getPhysicsConfigString() const;
4453

4554
O2ParamDef(G4Params, "G4");

Common/SimConfig/src/SimConfigLinkDef.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::conf::DigiParams> + ;
3030

3131
#pragma link C++ enum o2::conf::EG4Physics;
32+
#pragma link C++ enum o2::conf::EG4Nav;
3233
#pragma link C++ enum o2::conf::SimFieldMode;
3334
#pragma link C++ struct o2::conf::G4Params + ;
3435
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::conf::G4Params> + ;

DataFormats/Detectors/CTP/include/DataFormatsCTP/Configuration.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ struct CtpCfg {
214214
uint32_t orbitShift = 0;
215215
uint32_t irInputs_1_24 = 0;
216216
uint32_t irInputs_25_48 = 0;
217-
ClassDefNV(CtpCfg, 1)
217+
std::vector<int> listOfUsedInputs();
218+
ClassDefNV(CtpCfg, 2)
218219
};
219220
} // namespace ctp
220221
} // namespace o2

DataFormats/Detectors/CTP/src/Configuration.cxx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,9 +1227,24 @@ int CtpCfg::readAndSave(std::string& path)
12271227
}
12281228
return 0;
12291229
}
1230-
1230+
std::vector<int> CtpCfg::listOfUsedInputs()
1231+
{
1232+
std::cout << std::hex << "0x" << irInputs_1_24 << " " << irInputs_25_48 << std::dec << std::endl;
1233+
std::vector<int> inputList;
1234+
for (int i = 0; i < 24; i++) {
1235+
if ((1ul << i) & irInputs_1_24) {
1236+
inputList.push_back(i);
1237+
}
1238+
}
1239+
for (int i = 0; i < 24; i++) {
1240+
if ((1ul << i) & irInputs_25_48) {
1241+
inputList.push_back(i + 24);
1242+
}
1243+
}
1244+
return inputList;
1245+
}
12311246
std::ostream& o2::ctp::operator<<(std::ostream& in, const o2::ctp::CTPConfiguration& conf)
12321247
{
12331248
conf.printStream(in);
12341249
return in;
1235-
}
1250+
}

DataFormats/Detectors/EMCAL/include/DataFormatsEMCAL/EMCALChannelData.h

Lines changed: 0 additions & 55 deletions
This file was deleted.

DataFormats/Detectors/EMCAL/src/EMCALChannelData.cxx

Lines changed: 0 additions & 19 deletions
This file was deleted.

DataFormats/Detectors/TRD/include/DataFormatsTRD/CalGain.h

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,52 @@ class CalGain
3333

3434
void setMPVdEdx(int iDet, float mpv) { mMPVdEdx[iDet] = mpv; }
3535

36-
float getMPVdEdx(int iDet) const { return mMPVdEdx[iDet]; }
36+
float getMPVdEdx(int iDet, bool defaultAvg = true) const
37+
{
38+
// if defaultAvg = false, we take the value stored whatever it is
39+
// if defaultAvg = true and we have default value or bad value stored, we take the average on all chambers instead
40+
if (!defaultAvg || isGoodGain(iDet))
41+
return mMPVdEdx[iDet];
42+
else {
43+
if (TMath::Abs(mMeanGain + 999.) < 1e-6)
44+
mMeanGain = getAverageGain();
45+
return mMeanGain;
46+
}
47+
}
48+
49+
float getAverageGain() const
50+
{
51+
float averageGain = 0.;
52+
int ngood = 0;
53+
54+
for (int iDet = 0; iDet < constants::MAXCHAMBER; iDet++) {
55+
if (isGoodGain(iDet)) {
56+
// The chamber has correct calibration
57+
ngood++;
58+
averageGain += mMPVdEdx[iDet];
59+
}
60+
}
61+
if (ngood == 0) {
62+
// we should make sure it never happens
63+
return constants::MPVDEDXDEFAULT;
64+
}
65+
averageGain /= ngood;
66+
return averageGain;
67+
}
68+
69+
bool isGoodGain(int iDet) const
70+
{
71+
if (TMath::Abs(mMPVdEdx[iDet] - constants::MPVDEDXDEFAULT) > 1e-6)
72+
return true;
73+
else
74+
return false;
75+
}
3776

3877
private:
3978
std::array<float, constants::MAXCHAMBER> mMPVdEdx{}; ///< Most probable value of dEdx distribution per TRD chamber
79+
mutable float mMeanGain{-999.}; ///! average gain, calculated only once
4080

41-
ClassDefNV(CalGain, 1);
81+
ClassDefNV(CalGain, 2);
4282
};
4383

4484
} // namespace trd

0 commit comments

Comments
 (0)