15#include <TObjString.h>
18#include "TStopwatch.h"
63namespace globaltracking
69 CosmicsMatchingSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
GTrackID::mask_t src,
GTrackID::mask_t srcPVVeto,
bool usePV,
bool useMC) : mDataRequest(dr), mGGCCDBRequest(gr), mSeedSources(
src), mPVVetoSources(srcPVVeto), mUsePVInfo(usePV), mUseMC(useMC) {}
79 std::shared_ptr<DataRequest> mDataRequest;
80 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
87 bool mUsePVInfo =
false;
109 updateTimeDependentParams(pc);
121 static bool first =
true;
128 md.SetOwnerKeyValue();
139 auto const&
raw = pc.
inputs().
get<
const char*>(
"corrMap");
140 mCorrMap = &gpu::TPCFastTransformPOD::get(raw);
141 static bool initOnceDone =
false;
150 if (!grp->isDetContinuousReadOut(DetID::ITS)) {
153 mMatching.
setITSROFrameLengthMUS(alpParams.roFrameLengthInBC * o2::constants::lhc::LHCBunchSpacingNS * 1e-3);
159 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
177 LOG(info) <<
"cluster dictionary updated";
186 LOGF(info,
"Cosmics matching total timing: Cpu: %.3e Real: %.3e s in %d slots",
187 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
197 auto src = srcPVContributors;
212 std::vector<OutputSpec> outputs;
214 {
"material-lut-path", VariantType::String,
"", {
"Path of the material LUT file"}},
215 {
"debug-tree-flags", VariantType::Int, 0, {
"DebugFlagTypes bit-pattern for debug tree"}}};
217 auto dataRequest = std::make_shared<DataRequest>();
218 dataRequest->setITSPerLayer(itsStag);
220 dataRequest->requestTracks(
src, useMC);
222 dataRequest->requestClusters(
src,
false);
223 if (useTOFClusters) {
224 dataRequest->requestTOFClusters(
false);
227 dataRequest->requestPrimaryVertices(useMC);
232 outputs.emplace_back(
"GLO",
"COSMICTRC", 0, Lifetime::Timeframe);
234 outputs.emplace_back(
"GLO",
"COSMICTRC_MC", 0, Lifetime::Timeframe);
237 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
248 outputs.emplace_back(
"META",
"COSMICMATCHER", 0, Lifetime::Sporadic);
Class of a TPC cluster in TPC-native coordinates (row, time)
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 the ITS/MFT clusterer settings.
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
CosmicsMatchingSpec(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, GTrackID::mask_t src, GTrackID::mask_t srcPVVeto, bool usePV, bool useMC)
void run(ProcessingContext &pc) final
~CosmicsMatchingSpec() override=default
void setITSROFrameLengthMUS(float fums)
void setUsePVInfo(bool v)
auto getCosmicTracksLbl() const
void setPVVetoSources(GTrackID::mask_t src)
sources whose PV contributors veto the legs they contain
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 setSeedSources(GTrackID::mask_t src)
track sources used as legs (other loaded ones resolve PV contributors)
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
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
o2::dataformats::GlobalTrackID::mask_t getLegITSSources(o2::dataformats::GlobalTrackID::mask_t src)
o2::dataformats::GlobalTrackID::mask_t addPVContributorParents(o2::dataformats::GlobalTrackID::mask_t srcPVContributors)
srcPVContributors plus the parent matches needed to resolve their single-detector parts (RecoContaine...
framework::DataProcessorSpec getCosmicsMatchingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool usePV, bool useMC, bool itsStag, bool useTOFClusters=false, o2::dataformats::GlobalTrackID::mask_t srcPVContributors={})
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"