16#include "TStopwatch.h"
55namespace globaltracking
61 TOFMatcherSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
const o2::tpc::CorrectionMapsLoaderGloOpts& sclOpts,
bool useMC,
bool useFIT,
bool tpcRefit,
bool strict,
bool pushMatchable,
int lanes = 1) : mDataRequest(dr), mGGCCDBRequest(gr), mUseMC(useMC), mUseFIT(useFIT), mDoTPCRefit(tpcRefit), mStrict(strict), mPushMatchable(pushMatchable), mNlanes(lanes)
74 std::shared_ptr<DataRequest> mDataRequest;
75 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
80 bool mDoTPCRefit =
false;
82 bool mPushMatchable =
false;
83 float mExtraTolTRD = 0.;
97 mTPCCorrMapsLoader.
init(ic);
108 static bool initOnceDone =
false;
111 for (
auto bc : bcs) {
118 bool updateMaps =
false;
125 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
157 updateTimeDependentParams(pc);
172 mMatcher.
setTS(creationTime);
180 auto& tracksTPCTOF = pc.
outputs().
make<std::vector<o2::dataformats::TrackTPCTOF>>(
OutputRef{
"tpctofTracks", ss});
182 LOG(
debug) << (mDoTPCRefit ?
"Refitting " :
"Shifting Z for ") << nmatch <<
" matched TPC tracks with TOF time info";
200 if (isITSTPCTRDused) {
210 if (mPushMatchable) {
236 LOGF(
debug,
"TOF matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
237 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
244 auto dataRequest = std::make_shared<DataRequest>();
246 dataRequest->setMatchingInputStrict();
248 dataRequest->requestTracks(
src, useMC);
249 dataRequest->requestClusters(GID::getSourceMask(
GID::TOF), useMC);
251 dataRequest->requestClusters(GID::getSourceMask(
GID::TPC),
false);
254 dataRequest->requestFT0RecPoints(
false);
257 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
267 std::vector<OutputSpec> outputs;
320 AlgorithmSpec{adaptFromTask<TOFMatcherSpec>(dataRequest, ggRequest, sclOpts, useMC, useFIT, tpcRefit, strict, pushMatchable, nlanes)},
Helper class to access load maps from CCDB.
Definition of the GeometryManager class.
Helper for geometry and GRP related CCDB requests.
Accessor for TrackParCov derived objects from multiple containers.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
std::vector< o2::dataformats::MatchInfoHMP > MatchOutputType
Class to perform TOF matching to global tracks.
Definition of the Names Generator class.
Definition of the ITS track.
Result of refitting TPC-ITS matched track.
Result of refitting TPC with TOF match constraint.
Helper class to extract VDrift from different sources.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
void snapshot(const Output &spec, T const &object)
decltype(auto) make(const Output &spec, Args... args)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
ServiceRegistryRef services()
The services registry associated with this processing context.
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void setExtraTimeToleranceTRD(float val)
get extra tolerance on trackTRD-TOF times comparison
void makeConstrainedTPCTracks(MtcInfo &mtcCont, MCInfo &MCCont, CTrack &trcCont)
std::vector< o2::MCCompLabel > & getMatchedTOFLabelsVector(trkType index)
get vector of TOF labels of matched tracks
void setFIT(bool value=true)
std::vector< o2::dataformats::CalibInfoTOF > & getCalibVector()
void setTPCCorrMaps(o2::gpu::CorrectionMapsHelper *maph)
std::vector< o2::dataformats::MatchInfoTOFReco > & getMatchedTracksPair(int sec)
void setHighPurity(bool value=true)
print settings
std::vector< o2::dataformats::MatchInfoTOF > & getMatchedTrackVector(trkType index)
void setTS(unsigned long creationTime)
void storeMatchable(bool val=true)
void run(const o2::globaltracking::RecoContainer &inp, unsigned long firstTForbit=0)
< perform matching for provided input
void setNlanes(int lanes)
void run(ProcessingContext &pc) final
void init(InitContext &ic) final
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
~TOFMatcherSpec() override=default
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
TOFMatcherSpec(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, bool useMC, bool useFIT, bool tpcRefit, bool strict, bool pushMatchable, int lanes=1)
void setLumiScaleType(int32_t v)
void setLumiScaleMode(int32_t v)
static void addInteractionBC(int bc, bool fromCollisonCotext=false)
void extractCCDBInputs(o2::framework::ProcessingContext &pc)
void updateVDrift(float vdriftCorr, float vdrifRef, float driftTimeOffset=0)
bool accountCCDBInputs(const o2::framework::ConcreteDataMatcher &matcher, void *obj)
static void requestCCDBInputs(std::vector< o2::framework::InputSpec > &inputs, std::vector< o2::framework::ConfigParamSpec > &options, const CorrectionMapsLoaderGloOpts &gloOpts)
recalculate inverse correction
void init(o2::framework::InitContext &ic)
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 o2::header::DataOrigin gDataOriginTOF
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getTOFMatcherSpec(o2::dataformats::GlobalTrackID::mask_t src, bool useMC, bool useFIT, bool tpcRefit, bool strict, float extratolerancetrd, bool pushMatchable, const o2::tpc::CorrectionMapsLoaderGloOpts &sclOpts, int nlanes=1)
create a processor spec
std::vector< T, o2::pmr::polymorphic_allocator< T > > vector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool isTrackSourceLoaded(int src) const
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
int lumiType
what estimator to used for corrections scaling: 0: no scaling, 1: CTP, 2: IDC
int lumiMode
what corrections method to use: 0: classical scaling, 1: Using of the derivative map,...
float refTimeOffset
additive time offset reference (\mus)
float refVDrift
reference vdrift for which factor was extracted
float getTimeOffset() const
float timeOffsetCorr
additive time offset correction (\mus)
float corrFact
drift velocity correction factor (multiplicative)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"