17#include <TObjString.h>
18#include "TStopwatch.h"
58namespace globaltracking
64 TOFMatcherSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool useMC,
bool useFIT,
bool tpcRefit,
bool strict,
bool pushMatchable,
int lanes = 1,
bool requestCTPLumi =
false) : mDataRequest(dr), mGGCCDBRequest(gr), mUseMC(useMC), mUseFIT(useFIT), mDoTPCRefit(tpcRefit), mStrict(strict), mPushMatchable(pushMatchable), mNlanes(lanes), mRequestCTPLumi(requestCTPLumi) {}
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.;
85 bool mRequestCTPLumi =
false;
107 auto const&
raw = pc.
inputs().
get<
const char*>(
"corrMap");
108 mTPCCorrMaps = &o2::gpu::TPCFastTransformPOD::get(raw);
109 float lumiCTP = mRequestCTPLumi ? pc.
inputs().
get<
float>(
"lumiCTP") : 0;
110 static bool initOnceDone =
false;
113 for (
auto bc : bcs) {
121 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
146 updateTimeDependentParams(pc);
162 mMatcher.
setTS(creationTime);
170 auto& tracksTPCTOF = pc.
outputs().
make<std::vector<o2::dataformats::TrackTPCTOF>>(
OutputRef{
"tpctofTracks", ss});
172 LOG(
debug) << (mDoTPCRefit ?
"Refitting " :
"Shifting Z for ") << nmatch <<
" matched TPC tracks with TOF time info";
190 if (isITSTPCTRDused) {
200 if (mPushMatchable) {
226 static bool first =
true;
233 md.SetOwnerKeyValue();
242 LOGF(
debug,
"TOF matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
243 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
250 auto dataRequest = std::make_shared<DataRequest>();
252 dataRequest->setMatchingInputStrict();
254 dataRequest->requestTracks(
src, useMC);
255 dataRequest->requestClusters(GID::getSourceMask(
GID::TOF), useMC);
257 dataRequest->requestClusters(GID::getSourceMask(
GID::TPC),
false);
260 dataRequest->requestFT0RecPoints(
false);
263 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
273 if (requestCTPLumi) {
276 std::vector<OutputSpec> outputs;
324 outputs.emplace_back(
"META",
"TOFMATCHER", 0, Lifetime::Sporadic);
330 AlgorithmSpec{adaptFromTask<TOFMatcherSpec>(dataRequest, ggRequest, useMC, useFIT, tpcRefit, strict, pushMatchable, nlanes, requestCTPLumi)},
Definition of the GeometryManager class.
o2::raw::RawFileWriter * raw
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)
static std::string getConfigOutputFileName(const std::string &procName, const std::string &confName="", bool json=true)
static const MatchTOFParams & Instance()
static std::string asJSON(std::string const &keyOnly="")
static void write(std::string const &filename, std::string const &keyOnly="")
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.
InputRecord & inputs()
The inputs associated with this processing context.
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()
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 setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph, float lumi)
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, bool useMC, bool useFIT, bool tpcRefit, bool strict, bool pushMatchable, int lanes=1, bool requestCTPLumi=false)
static void addInteractionBC(int bc, bool fromCollisonCotext=false)
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 gDataOriginCTP
constexpr o2::header::DataOrigin gDataOriginTPC
constexpr o2::header::DataOrigin gDataOriginTOF
Defining ITS Vertex 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, bool requestCTPLumi, int nlanes=1)
create a processor spec
std::vector< T, fair::mq::pmr::polymorphic_allocator< T > > vector
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string name
The name of the associated DataProcessorSpec.
size_t inputTimesliceId
The time pipelining id of this particular device.
bool isTrackSourceLoaded(int src) const
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"