Skip to content

Commit 40bfdc2

Browse files
authored
Merge branch 'dev' into its/trk/stag
2 parents 9995505 + 85fad07 commit 40bfdc2

File tree

60 files changed

+2270
-598
lines changed

Some content is hidden

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

60 files changed

+2270
-598
lines changed

Detectors/TOF/base/include/TOFBase/WindowFiller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class WindowFiller
9696
}
9797

9898
std::vector<uint8_t>& getPatterns() { return mPatterns; }
99-
void addPattern(const uint32_t val, int icrate, int orbit, int bc) { mCratePatterns.emplace_back(val, icrate, orbit * 3 + (bc + 100) / Geo::BC_IN_WINDOW); }
99+
void addPattern(const uint32_t val, int icrate, int orbit, int bc) { mCratePatterns.emplace_back(val, icrate, ((unsigned long)orbit) * 3 + (bc + 100) / Geo::BC_IN_WINDOW); }
100100
void addCrateHeaderData(unsigned long orbit, int crate, int32_t bc, uint32_t eventCounter);
101101
Diagnostic& getDiagnosticFrequency() { return mDiagnosticFrequency; }
102102

Detectors/TOF/base/src/WindowFiller.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ void WindowFiller::fillOutputContainer(std::vector<Digit>& digits)
194194
int npatterns = 0;
195195

196196
// check if patterns are in the current row
197-
unsigned int initrow = mFirstIR.orbit * Geo::NWINDOW_IN_ORBIT;
197+
unsigned long initrow = ((unsigned long)mFirstIR.orbit) * Geo::NWINDOW_IN_ORBIT;
198198
for (std::vector<PatternData>::reverse_iterator it = mCratePatterns.rbegin(); it != mCratePatterns.rend(); ++it) {
199-
unsigned int irow = it->row;
199+
unsigned long irow = it->row;
200200
// printf("pattern row=%ld (%u - %u) current=%ld\n",irow - initrow,irow,initrow,mReadoutWindowCurrent);
201201

202202
if (irow - initrow > mReadoutWindowCurrent) {

Detectors/TOF/calibration/include/TOFCalibration/TOFDiagnosticCalibrator.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ class TOFDiagnosticCalibrator final : public o2::calibration::TimeSlotCalibratio
3131
int mRunNumber = -1;
3232

3333
public:
34-
TOFDiagnosticCalibrator() = default;
34+
TOFDiagnosticCalibrator(int minROwin = 100) : mMinROwin(minROwin) {}
3535
~TOFDiagnosticCalibrator() final = default;
36-
bool hasEnoughData(const Slot& slot) const final { return true; }
36+
bool hasEnoughData(const Slot& slot) const final;
3737
void initOutput() final;
3838
void finalizeSlot(Slot& slot) final;
3939
Slot& emplaceNewSlot(bool front, TFType tstart, TFType tend) final;
@@ -43,12 +43,15 @@ class TOFDiagnosticCalibrator final : public o2::calibration::TimeSlotCalibratio
4343
const std::vector<Diagnostic>& getDiagnosticVector() const { return mDiagnosticVector; }
4444
const CcdbObjectInfoVector& getDiagnosticInfoVector() const { return mccdbInfoVector; }
4545
CcdbObjectInfoVector& getDiagnosticInfoVector() { return mccdbInfoVector; }
46+
int getMinROwin() const { return mMinROwin; }
47+
void setMinROwin(int rowin) { mMinROwin = rowin; }
4648

4749
private:
4850
CcdbObjectInfoVector mccdbInfoVector;
4951
std::vector<Diagnostic> mDiagnosticVector;
52+
int mMinROwin; // minimal number of readout windows needed to finalize the object
5053

51-
ClassDefOverride(TOFDiagnosticCalibrator, 1);
54+
ClassDefOverride(TOFDiagnosticCalibrator, 2);
5255
};
5356

5457
} // end namespace tof

Detectors/TOF/calibration/src/TOFDiagnosticCalibrator.cxx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ void TOFDiagnosticCalibrator::initOutput()
2828
mccdbInfoVector.clear();
2929
mDiagnosticVector.clear();
3030
}
31+
//----------------------------------------------------------
32+
bool TOFDiagnosticCalibrator::hasEnoughData(const Slot& slot) const
33+
{
34+
const Diagnostic* diag = slot.getContainer();
3135

36+
if (diag->getFrequencyROW() < mMinROwin) {
37+
return false;
38+
}
39+
40+
return true;
41+
}
3242
//----------------------------------------------------------
3343
void TOFDiagnosticCalibrator::finalizeSlot(Slot& slot)
3444
{

Detectors/TOF/calibration/testWorkflow/TOFDiagnosticCalibratorSpec.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace calibration
3737
class TOFDiagnosticCalibDevice : public o2::framework::Task
3838
{
3939
public:
40-
TOFDiagnosticCalibDevice(std::shared_ptr<o2::base::GRPGeomRequest> req, int runnumber = -1) : mCCDBRequest(req), mRunNumber(runnumber) {}
40+
TOFDiagnosticCalibDevice(std::shared_ptr<o2::base::GRPGeomRequest> req, int runnumber = -1, int rowinMin = 100000) : mCCDBRequest(req), mRunNumber(runnumber), mMinROwin(rowinMin) {}
4141
void init(o2::framework::InitContext& ic) final
4242
{
4343
o2::base::GRPGeomHelper::instance().setRequest(mCCDBRequest);
@@ -47,6 +47,7 @@ class TOFDiagnosticCalibDevice : public o2::framework::Task
4747
mCalibrator->setSlotLength(slotL);
4848
mCalibrator->setMaxSlotsDelay(delay);
4949
mCalibrator->setRunNumber(mRunNumber);
50+
mCalibrator->setMinROwin(mMinROwin);
5051
}
5152

5253
void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj) final
@@ -75,6 +76,7 @@ class TOFDiagnosticCalibDevice : public o2::framework::Task
7576
std::unique_ptr<o2::tof::TOFDiagnosticCalibrator> mCalibrator;
7677
std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
7778
int mRunNumber = -1;
79+
int mMinROwin = 100000;
7880

7981
//________________________________________________________________
8082
void sendOutput(DataAllocator& output)
@@ -104,7 +106,7 @@ class TOFDiagnosticCalibDevice : public o2::framework::Task
104106
namespace framework
105107
{
106108

107-
DataProcessorSpec getTOFDiagnosticCalibDeviceSpec(int runnumber)
109+
DataProcessorSpec getTOFDiagnosticCalibDeviceSpec(int runnumber, int rowinMin)
108110
{
109111
using device = o2::calibration::TOFDiagnosticCalibDevice;
110112
using clbUtils = o2::calibration::Utils;
@@ -125,7 +127,7 @@ DataProcessorSpec getTOFDiagnosticCalibDeviceSpec(int runnumber)
125127
"tof-diagnostic-calibration",
126128
inputs,
127129
outputs,
128-
AlgorithmSpec{adaptFromTask<device>(ccdbRequest, runnumber)},
130+
AlgorithmSpec{adaptFromTask<device>(ccdbRequest, runnumber, rowinMin)},
129131
Options{
130132
{"tf-per-slot", VariantType::UInt32, 5u, {"number of TFs per calibration time slot"}},
131133
{"max-delay", VariantType::UInt32, 3u, {"number of slots in past to consider"}}}};

Detectors/TOF/calibration/testWorkflow/tof-diagnostic-workflow.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
1919
{
2020
// option allowing to set parameters
2121
workflowOptions.push_back(ConfigParamSpec{"tof-dia-run-number", o2::framework::VariantType::Int, -1, {"run number"}});
22+
workflowOptions.push_back(ConfigParamSpec{"tof-dia-min-rowin", o2::framework::VariantType::Int, 100000, {"min number of TOF Readout Windows, def=100k (3 s)"}});
2223
}
2324

2425
// ------------------------------------------------------------------
@@ -29,6 +30,7 @@ WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
2930
{
3031
WorkflowSpec specs;
3132
auto runnumber = configcontext.options().get<int>("tof-dia-run-number");
32-
specs.emplace_back(getTOFDiagnosticCalibDeviceSpec(runnumber));
33+
auto rowinMin = configcontext.options().get<int>("tof-dia-min-rowin");
34+
specs.emplace_back(getTOFDiagnosticCalibDeviceSpec(runnumber, rowinMin));
3335
return specs;
3436
}

Detectors/Upgrades/ALICE3/TRK/base/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111

1212
o2_add_library(TRKBase
1313
SOURCES src/GeometryTGeo.cxx
14+
src/AlmiraParam.cxx
1415
src/TRKBaseParam.cxx
1516
src/SegmentationChip.cxx
1617
PUBLIC_LINK_LIBRARIES O2::DetectorsBase)
1718

1819
o2_target_root_dictionary(TRKBase
19-
HEADERS include/TRKBase/GeometryTGeo.h
20+
HEADERS include/TRKBase/AlmiraParam.h
21+
include/TRKBase/GeometryTGeo.h
2022
include/TRKBase/TRKBaseParam.h
21-
include/TRKBase/SegmentationChip.h)
23+
include/TRKBase/SegmentationChip.h)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#ifndef O2_TRK_ALMIRAPARAM_H
13+
#define O2_TRK_ALMIRAPARAM_H
14+
15+
#include "CommonConstants/LHCConstants.h"
16+
#include "CommonUtils/ConfigurableParam.h"
17+
#include "CommonUtils/ConfigurableParamHelper.h"
18+
19+
namespace o2
20+
{
21+
namespace trk
22+
{
23+
constexpr float DEFAlmiraStrobeDelay = 0.f; ///< default strobe delay in ns wrt ROF start, to be tuned with the real chip response
24+
25+
struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
26+
int roFrameLengthInBC = o2::constants::lhc::LHCMaxBunches / 198; ///< ROF length in BC for continuous mode
27+
float strobeDelay = DEFAlmiraStrobeDelay; ///< strobe start in ns wrt ROF start
28+
float strobeLengthCont = -1.; ///< if < 0, full ROF length minus delay
29+
int roFrameBiasInBC = 0; ///< ROF start bias in BC wrt orbit start
30+
31+
O2ParamDef(AlmiraParam, "TRKAlmiraParam");
32+
};
33+
34+
} // namespace trk
35+
36+
namespace framework
37+
{
38+
template <typename T>
39+
struct is_messageable;
40+
41+
template <>
42+
struct is_messageable<o2::trk::AlmiraParam> : std::true_type {
43+
};
44+
} // namespace framework
45+
46+
} // namespace o2
47+
48+
#endif
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
12+
#include "TRKBase/AlmiraParam.h"
13+
14+
O2ParamImpl(o2::trk::AlmiraParam);

Detectors/Upgrades/ALICE3/TRK/base/src/TRKBaseLinkDef.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
#pragma link off all classes;
1616
#pragma link off all functions;
1717

18+
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::trk::AlmiraParam> + ;
1819
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::trk::TRKBaseParam> + ;
1920

21+
#pragma link C++ class o2::trk::AlmiraParam + ;
2022
#pragma link C++ class o2::trk::GeometryTGeo +
2123
#pragma link C++ class o2::trk::TRKBaseParam + ;
2224
#pragma link C++ class o2::trk::SegmentationChip + ;
2325

24-
#endif
26+
#endif

0 commit comments

Comments
 (0)