15#include <TObjString.h>
18#include "TStopwatch.h"
63namespace globaltracking
69 CosmicsMatchingSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool usePV,
bool useMC) : mDataRequest(dr), mGGCCDBRequest(gr), mUsePVInfo(usePV), mUseMC(useMC) {}
79 std::shared_ptr<DataRequest> mDataRequest;
80 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
85 bool mUsePVInfo =
false;
105 updateTimeDependentParams(pc);
117 static bool first =
true;
124 md.SetOwnerKeyValue();
135 auto const&
raw = pc.
inputs().
get<
const char*>(
"corrMap");
136 mCorrMap = &gpu::TPCFastTransformPOD::get(raw);
137 static bool initOnceDone =
false;
146 if (!grp->isDetContinuousReadOut(
DetID::ITS)) {
155 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
173 LOG(info) <<
"cluster dictionary updated";
182 LOGF(info,
"Cosmics matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
183 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
188 std::vector<OutputSpec> outputs;
190 {
"material-lut-path", VariantType::String,
"", {
"Path of the material LUT file"}},
191 {
"debug-tree-flags", VariantType::Int, 0, {
"DebugFlagTypes bit-pattern for debug tree"}}};
193 auto dataRequest = std::make_shared<DataRequest>();
195 dataRequest->requestTracks(
src, useMC);
196 dataRequest->requestClusters(
src,
false);
198 dataRequest->requestPrimaryVertices(useMC);
201 outputs.emplace_back(
"GLO",
"COSMICTRC", 0, Lifetime::Timeframe);
203 outputs.emplace_back(
"GLO",
"COSMICTRC_MC", 0, Lifetime::Timeframe);
206 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
217 outputs.emplace_back(
"META",
"COSMICMATCHER", 0, Lifetime::Sporadic);
223 AlgorithmSpec{adaptFromTask<CosmicsMatchingSpec>(dataRequest, ggRequest, usePV, useMC)},
Class of a TPC cluster in TPC-native coordinates (row, time)
Definition of the ITS/MFT clusterer settings.
Definition of the ITSMFT compact cluster.
gsl::span< const o2::MCCompLabel > MCLabelsTr
Definition of the Names Generator class.
Definition of the GeometryManager class.
o2::raw::RawFileWriter * raw
Helper for geometry and GRP related CCDB requests.
Header of the General Run Parameters object.
Accessor for TrackParCov derived objects from multiple containers.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of the GeometryTGeo class.
Definition of a container to keep Monte Carlo truth external to simulation objects.
Configurable params for cosmics matching.
Class to perform matching/refit of cosmic tracks legs.
Class to store the output of the matching to TOF.
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.
Helper class to obtain TPC clusters / digits / labels from DPL.
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 MatchCosmicsParams & Instance()
static std::string asJSON(std::string const &keyOnly="")
static void write(std::string const &filename, std::string const &keyOnly="")
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.
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
void endOfStream(framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void finaliseCCDB(framework::ConcreteDataMatcher &matcher, void *obj) final
void init(InitContext &ic) final
void run(ProcessingContext &pc) final
~CosmicsMatchingSpec() override=default
CosmicsMatchingSpec(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, bool usePV, bool useMC)
void setITSROFrameLengthMUS(float fums)
void setUsePVInfo(bool v)
auto getCosmicTracksLbl() const
void setITSDict(const o2::itsmft::TopologyDictionary *dict)
void setDebugFlag(UInt_t flag, bool on=true)
set the name of output debug file
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph)
auto getCosmicTracks() const
void process(const o2::globaltracking::RecoContainer &data)
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
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 gDataOriginTPC
constexpr double LHCBunchSpacingNS
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getCosmicsMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool usePV, bool useMC)
create a processor spec
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.
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"