Skip to content

Commit 864d008

Browse files
author
wpierozak
committed
FT0: Changed calibration object name, implemented missing OrbitReset fetching
1 parent 05cc06e commit 864d008

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

Detectors/FIT/FT0/calibration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Events per BC Calibration
44
### Description
5-
Generates histograms of **TVX per Bunch Crossing (BC)**. Events can be filtered by applying amplitude thresholds to the **A-side** and **C-side**.
5+
Generates histograms of **Events per Bunch Crossing (BC)**. Events can be filtered by applying amplitude thresholds to the **A-side** and **C-side**.
66

77
### Command-Line Options
88
| Option | Default | Description |

Detectors/FIT/FT0/calibration/src/EventsPerBcCalibrator.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ namespace o2::ft0
5252
{
5353
LOG(info) << "Finalizing slot from " << slot.getStartTimeMS() << " to " << slot.getEndTimeMS();
5454
o2::ft0::EventsPerBc* data = slot.getContainer();
55-
mTvxPerBcs.emplace_back(std::make_unique<TH1F>("TvxPerBc", "FT0 TVX per BC", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches - 1));
55+
mTvxPerBcs.emplace_back(std::make_unique<TH1F>("EventsPerBc", "FT0 Events per BC", o2::constants::lhc::LHCMaxBunches, 0, o2::constants::lhc::LHCMaxBunches - 1));
5656
for (int bin = 0; bin < o2::constants::lhc::LHCMaxBunches; bin++) {
5757
mTvxPerBcs.back()->Fill(bin, data->mTvx[bin]);
5858
}
5959
auto clName = o2::utils::MemFileHelper::getClassName(*mTvxPerBcs.back());
60-
auto flName = o2::ccdb::CcdbApi::generateFileName(clName);
60+
auto flName = o2::ccdb::CcdbApi::generateFileName(clName) + ".root";
6161
std::map<std::string, std::string> metaData;
62-
mTvxPerBcInfos.emplace_back(std::make_unique<o2::ccdb::CcdbObjectInfo>("FT0/Calib/TvxPerBc", clName, flName, metaData, slot.getStartTimeMS(), slot.getEndTimeMS()));
62+
mTvxPerBcInfos.emplace_back(std::make_unique<o2::ccdb::CcdbObjectInfo>("FT0/Calib/EventsPerBc", clName, flName, metaData, slot.getStartTimeMS(), slot.getEndTimeMS()));
6363
LOG(info) << "Created object valid from " << mTvxPerBcInfos.back()->getStartValidityTimestamp() << " to " << mTvxPerBcInfos.back()->getEndValidityTimestamp();
6464
}
6565

Detectors/FIT/FT0/calibration/workflow/FT0EventsPerBcProcessor-Workflow.cxx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co
55
using namespace o2::framework;
66
using o2::calibration::FT0EventsPerBcProcessor;
77
std::vector<InputSpec> inputs;
8+
auto ccdbRequest = std::make_shared<o2::base::GRPGeomRequest>(true, // orbitResetTime
9+
false, // GRPECS=true
10+
false, // GRPLHCIF
11+
false, // GRPMagField
12+
false, // askMatLUT
13+
o2::base::GRPGeomRequest::None, // geometry
14+
inputs);
815
inputs.emplace_back("digits", "FT0", "DIGITSBC");
916
std::vector<OutputSpec> outputs;
1017
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "EventsPerBc"}, Lifetime::Sporadic);
@@ -13,7 +20,7 @@ o2::framework::WorkflowSpec defineDataProcessing(o2::framework::ConfigContext co
1320
"FT0EventsPerBcProcessor",
1421
inputs,
1522
outputs,
16-
AlgorithmSpec(adaptFromTask<FT0EventsPerBcProcessor>()),
23+
AlgorithmSpec(adaptFromTask<FT0EventsPerBcProcessor>(ccdbRequest)),
1724
Options{
1825
{"slot-len-sec", VariantType::UInt32, 3600u, {"Duration of each slot in seconds"}},
1926
{"slot-len-tf", VariantType::UInt32, 0u, {"Slot length in Time Frames (TFs)"}},

Detectors/FIT/FT0/calibration/workflow/FT0EventsPerBcSpec.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "Framework/WorkflowSpec.h"
1111
#include "Framework/Task.h"
1212
#include "DetectorsCalibration/Utils.h"
13+
#include "DetectorsBase/GRPGeomHelper.h"
1314

1415
#include "DataFormatsFT0/Digit.h"
1516
#include "FT0Calibration/EventsPerBcCalibrator.h"
@@ -20,10 +21,11 @@ namespace o2::calibration
2021
class FT0EventsPerBcProcessor final : public o2::framework::Task
2122
{
2223
public:
23-
FT0EventsPerBcProcessor() = default;
24+
FT0EventsPerBcProcessor(std::shared_ptr<o2::base::GRPGeomRequest> request): mCCDBRequest(request) {}
2425

2526
void init(o2::framework::InitContext& ic) final
2627
{
28+
o2::base::GRPGeomHelper::instance().setRequest(mCCDBRequest);
2729
if (ic.options().hasOption("slot-len-sec")) {
2830
mSlotLenSec = ic.options().get<uint32_t>("slot-len-sec");
2931
}
@@ -59,8 +61,14 @@ namespace o2::calibration
5961
}
6062
}
6163

64+
void finaliseCCDB(o2::framework::ConcreteDataMatcher& matcher, void* obj)
65+
{
66+
o2::base::GRPGeomHelper::instance().finaliseCCDB(matcher, obj);
67+
}
68+
6269
void run(o2::framework::ProcessingContext& pc) final
6370
{
71+
o2::base::GRPGeomHelper::instance().checkUpdates(pc);
6472
auto digits = pc.inputs().get<gsl::span<o2::ft0::Digit>>("digits");
6573
o2::base::TFIDInfoHelper::fillTFIDInfo(pc, mCalibrator->getCurrentTFInfo());
6674
if(digits.size() == 0) {
@@ -102,6 +110,7 @@ namespace o2::calibration
102110
}
103111

104112
private:
113+
std::shared_ptr<o2::base::GRPGeomRequest> mCCDBRequest;
105114
std::unique_ptr<o2::ft0::EventsPerBcCalibrator> mCalibrator;
106115
bool mOneObjectPerRun;
107116
uint32_t mSlotLenSec;

0 commit comments

Comments
 (0)