15#include <unordered_map>
52 mSlotLength = ic.
options().
get<uint32_t>(
"sec-per-slot");
53 mProcessSeeds = ic.
options().
get<
bool>(
"process-seeds");
54 mMatCorr = ic.
options().
get<
int>(
"matCorrType");
55 if (mProcessSeeds && mSources != mSourcesMap) {
56 LOG(fatal) <<
"process-seeds option is not compatible with using different track sources for vDrift and map extraction";
64 static bool initOnceDone =
false;
69 mInterpolation.
init(mSources, mSourcesMap);
70 if (mProcessITSTPConly) {
75 bool limitTracks = (
param.maxTracksPerCalibSlot < 0) ?
false : true;
76 int nTracksPerTfMax = (nTfs > 0 && limitTracks) ?
param.maxTracksPerCalibSlot / nTfs : -1;
77 if (nTracksPerTfMax > 0) {
78 LOGP(info,
"We will stop processing tracks after validating {} tracks per TF, since we want to accumulate {} tracks for a slot with {} TFs",
79 nTracksPerTfMax,
param.maxTracksPerCalibSlot, nTfs);
80 if (
param.additionalTracksMap > 0) {
81 int nTracksAdditional =
param.additionalTracksMap / nTfs;
82 LOGP(info,
"In addition up to {} additional tracks are processed per TF", nTracksAdditional);
85 }
else if (nTracksPerTfMax < 0) {
86 LOG(info) <<
"The number of processed tracks per TF is not limited";
88 LOG(error) <<
"No tracks will be processed. maxTracksPerCalibSlot must be greater than slot length in TFs";
99 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
121 LOG(info) <<
"cluster dictionary updated";
132 updateTimeDependentParams(pc);
136 LOGF(info,
"TPC interpolation timing: Cpu: %.3e Real: %.3e s", mTimer.CpuTime(), mTimer.RealTime());
140 if (mSendTrackData) {
146 if (mSendTrackData) {
152 mInterpolation.
reset();
157 LOGF(info,
"TPC residuals extraction total timing: Cpu: %.3e Real: %.3e s in %d slots",
158 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
163 auto dataRequest = std::make_shared<DataRequest>();
164 std::vector<OutputSpec> outputs;
167 LOG(fatal) <<
"MC usage must be disabled for this workflow, since it is not yet implemented";
170 dataRequest->requestTracks(srcVtx, useMC);
171 dataRequest->requestClusters(srcCls, useMC);
172 dataRequest->requestPrimaryVertices(useMC);
174 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
184 outputs.emplace_back(
"GLO",
"TPCINT_TRK", 0, Lifetime::Timeframe);
186 outputs.emplace_back(
"GLO",
"TPCINT_RES", 0, Lifetime::Timeframe);
189 outputs.emplace_back(
"GLO",
"UNBINNEDRES", 0, Lifetime::Timeframe);
190 outputs.emplace_back(
"GLO",
"TRKREFS", 0, Lifetime::Timeframe);
192 outputs.emplace_back(
"GLO",
"TRKDATA", 0, Lifetime::Timeframe);
195 outputs.emplace_back(
"GLO",
"TRKDATAEXT", 0, Lifetime::Timeframe);
199 "tpc-track-interpolation",
202 AlgorithmSpec{adaptFromTask<TPCInterpolationDPL>(dataRequest, srcTrk, srcTrkMap, ggRequest, useMC, processITSTPConly, sendTrackData, debugOutput)},
204 {
"matCorrType", VariantType::Int, 2, {
"material correction type (definition in Propagator.h)"}},
205 {
"sec-per-slot", VariantType::UInt32, 600u, {
"number of seconds per calibration time slot (put 0 for infinite slot length)"}},
206 {
"process-seeds", VariantType::Bool,
false, {
"do not remove duplicates, e.g. for ITS-TPC-TRD track also process its seeding ITS-TPC part"}}}};
Class of a TPC cluster in TPC-native coordinates (row, time)
Definition of the GeometryManager class.
Definition of the GeometryTGeo class.
Wrapper container for different reconstructed object types.
Parameters used for TPC space point calibration.
Definition of the ITS track.
Result of refitting TPC-ITS matched track.
Helper class to obtain TPC clusters / digits / labels from DPL.
void checkUpdates(o2::framework::ProcessingContext &pc)
static int getNHBFPerTF()
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static const SpacePointsCalibConfParam & Instance()
Static class with identifiers, bitmasks and names for ALICE detectors.
T get(const char *key) const
void snapshot(const Output &spec, T const &object)
ConfigParamRegistry const & options()
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
void endOfStream(EndOfStreamContext &ec) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void init(InitContext &ic) final
void run(ProcessingContext &pc) final
void prepareInputTrackSample(const o2::globaltracking::RecoContainer &inp)
Prepare input track sample (not relying on CreateTracksVariadic functionality)
std::vector< TrackData > & getReferenceTracks()
std::vector< TrackData > & getReferenceTracksUnfiltered()
std::vector< TrackDataExtended > & getTrackDataExtended()
void setMatCorr(MatCorrType matCorr)
Sets the flag if material correction should be applied when extrapolating the tracks.
void setProcessSeeds()
Enable processing of seeds.
void setMaxTracksPerTF(int n)
Sets the maximum number of tracks to be processed (successfully) per TF.
std::vector< TrackDataCompact > & getTrackDataCompact()
void setAddTracksForMapPerTF(int n)
In addition to mMaxTracksPerTF up to the set number of additional tracks can be processed.
std::vector< TPCClusterResiduals > & getClusterResidualsUnfiltered()
void process()
Main processing function.
void setITSClusterDictionary(const o2::itsmft::TopologyDictionary *dict)
Allow setting the ITS cluster dictionary from outside.
std::vector< UnbinnedResid > & getClusterResiduals()
void setDumpTrackPoints()
Enable full output.
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void setProcessITSTPConly()
Enable ITS-TPC only processing.
void setSqrtS(float s)
Set the centre of mass energy required for pT downsampling Tsalis function.
void reset()
Reset cache and output vectors.
void init(o2::dataformats::GlobalTrackID::mask_t src, o2::dataformats::GlobalTrackID::mask_t srcMap)
Initialize everything, set the requested track sources.
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, bool laser=true, bool itstpcTgl=true)
void extractCCDBInputs(o2::framework::ProcessingContext &pc, bool laser=true, bool itstpcTgl=true)
const VDriftCorrFact & getVDriftObject() const
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
static std::string_view getSourceName(Source s)
constexpr double LHCOrbitMUS
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getTPCInterpolationSpec(o2::dataformats::GlobalTrackID::mask_t srcCls, o2::dataformats::GlobalTrackID::mask_t srcVtx, o2::dataformats::GlobalTrackID::mask_t srcTrk, o2::dataformats::GlobalTrackID::mask_t srcTrkMap, bool useMC, bool processITSTPConly, bool sendTrackData, bool debugOutput)
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)
float refTimeOffset
additive time offset reference (\mus)
float refVDrift
reference vdrift for which factor was extracted
float timeOffsetCorr
additive time offset correction (\mus)
float corrFact
drift velocity correction factor (multiplicative)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"