16#include "TStopwatch.h"
56namespace globaltracking
62 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) {}
71 std::shared_ptr<DataRequest> mDataRequest;
72 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
77 bool mDoTPCRefit =
false;
79 bool mPushMatchable =
false;
80 float mExtraTolTRD = 0.;
82 bool mRequestCTPLumi =
false;
104 auto const&
raw = pc.
inputs().
get<
const char*>(
"corrMap");
105 mTPCCorrMaps = &o2::gpu::TPCFastTransformPOD::get(raw);
106 float lumiCTP = mRequestCTPLumi ? pc.
inputs().
get<
float>(
"lumiCTP") : 0;
107 static bool initOnceDone =
false;
110 for (
auto bc : bcs) {
118 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
143 updateTimeDependentParams(pc);
158 mMatcher.
setTS(creationTime);
166 auto& tracksTPCTOF = pc.
outputs().
make<std::vector<o2::dataformats::TrackTPCTOF>>(
OutputRef{
"tpctofTracks", ss});
168 LOG(
debug) << (mDoTPCRefit ?
"Refitting " :
"Shifting Z for ") << nmatch <<
" matched TPC tracks with TOF time info";
186 if (isITSTPCTRDused) {
196 if (mPushMatchable) {
217 static bool first =
true;
230 LOGF(
debug,
"TOF matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
231 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
238 auto dataRequest = std::make_shared<DataRequest>();
240 dataRequest->setMatchingInputStrict();
242 dataRequest->requestTracks(
src, useMC);
243 dataRequest->requestClusters(GID::getSourceMask(
GID::TOF), useMC);
245 dataRequest->requestClusters(GID::getSourceMask(
GID::TPC),
false);
248 dataRequest->requestFT0RecPoints(
false);
251 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
261 if (requestCTPLumi) {
264 std::vector<OutputSpec> outputs;
317 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 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.
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"