27#include "TStopwatch.h"
43 TRDTrackBasedCalibDevice(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool vdexb,
bool gain) : mDataRequest(dr), mGGCCDBRequest(gr), mDoVdExBCalib(vdexb), mDoGainCalib(gain) {}
53 bool mDoGainCalib{
false};
54 bool mDoVdExBCalib{
false};
56 std::shared_ptr<DataRequest> mDataRequest;
57 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
58 TrackBasedCalib mCalibrator;
65 if (getenv(
"ALIEN_JDL_LPMPRODUCTIONTYPE") && std::strcmp(getenv(
"ALIEN_JDL_LPMPRODUCTIONTYPE"),
"MC") == 0) {
78 updateTimeDependentParams(pc);
102 static bool initOnceDone =
false;
116 LOG(info) <<
"NoiseStatusMCM object has been updated";
121 LOG(info) <<
"Local gain factors object has been updated";
129 LOGF(info,
"TRD track-based calibration total timing: Cpu: %.3e Real: %.3e s in %d slots",
130 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
135 std::vector<OutputSpec> outputs;
136 auto dataRequest = std::make_shared<DataRequest>();
140 LOGF(info,
"Found ITS-TPC tracks as input, loading ITS-TPC-TRD");
147 LOGF(info,
"Found TPC tracks as input, loading TPC-TRD");
154 dataRequest->requestTracks(srcTrk,
false);
155 dataRequest->requestClusters(srcClu,
false);
157 auto& inputs = dataRequest->inputs;
158 inputs.emplace_back(
"mcmnoisemap",
"TRD",
"MCMNOISEMAP", 0, Lifetime::Condition,
ccdbParamSpec(
"TRD/Calib/NoiseMapMCM"));
160 inputs.emplace_back(
"localgainfactors",
"TRD",
"LOCALGAINFACTORS", 0, Lifetime::Condition,
ccdbParamSpec(
"TRD/Calib/LocalGainFactor"));
162 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
176 if (!gain && !vdexb) {
177 LOG(
error) <<
"TRD track based calibration requested, but neither gain nor vD and ExB calibration enabled";
181 "trd-trackbased-calib",
184 AlgorithmSpec{adaptFromTask<TRDTrackBasedCalibDevice>(dataRequest, ggRequest, vdexb, gain)},
Definition of the GeometryManager class.
Helper for geometry and GRP related CCDB requests.
Header of the General Run Parameters object.
char error[CURL_ERROR_SIZE]
Definition of the Names Generator class.
Steers the creation of calibration input based on tracks.
Provides information required for TRD calibration which is based on the global tracking.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
InputRecord & inputs()
The inputs associated with this processing context.
Simple noise status bit for each MCM of the TRD.
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void run(ProcessingContext &pc) final
TRDTrackBasedCalibDevice(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, bool vdexb, bool gain)
~TRDTrackBasedCalibDevice() override=default
void init(InitContext &ic) final
void setInput(const o2::globaltracking::RecoContainer &input)
Initialize the input arrays.
void setApplyShift(bool f)
void setNoiseMapMCM(const NoiseStatusMCM *map)
Set the MCM noise map.
void reset()
Reset the output.
void calculateGainCalibObjs()
void init()
Load geometry and apply magnetic field setting.
const auto & getGainCalibHistos() const
void calculateAngResHistos()
Main processing function for creating angular residual histograms for vDrift and ExB calibration.
void setLocalGainFactors(const LocalGainFactor *localGain)
const AngularResidHistos & getAngResHistos() const
constexpr o2::header::DataOrigin gDataOriginTRD
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
framework::DataProcessorSpec getTRDTrackBasedCalibSpec(o2::dataformats::GlobalTrackID::mask_t src, bool vdexb, bool gain)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"