32#include "TStopwatch.h"
60 SecondaryVertexingSpec(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
GTrackID::mask_t src,
bool enabCasc,
bool enable3body,
bool enableStrangenessTracking,
bool enableCCDBParams,
bool useMC) : mDataRequest(dr), mGGCCDBRequest(gr), mSrc(
src), mEnableCascades(enabCasc), mEnable3BodyVertices(enable3body), mEnableStrangenessTracking(enableStrangenessTracking), mEnableCCDBParams(enableCCDBParams), mUseMC(useMC) {}
69 std::shared_ptr<DataRequest> mDataRequest;
70 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
74 bool mEnableCCDBParams =
false;
75 bool mEnableCascades =
false;
76 bool mEnable3BodyVertices =
false;
77 bool mEnableStrangenessTracking =
false;
94 if (mEnableStrangenessTracking) {
106 double timeCPU0 = mTimer.CpuTime(), timeReal0 = mTimer.RealTime();
108 static std::array<size_t, 3> fitCalls{};
112 updateTimeDependentParams(pc);
114 mVertexer.
process(recoData, pc);
118 LOGP(info,
"Found {} V0s ({} fits), {} cascades ({} fits), {} 3-body decays ({} fits), {} strange tracks. Timing: CPU: {:.2f} Real: {:.2f} s",
120 mTimer.CpuTime() - timeCPU0, mTimer.RealTime() - timeReal0);
123 static bool first =
true;
128 if (mEnableStrangenessTracking) {
137 LOGF(info,
"Secondary vertexing total timing: Cpu: %.3e Real: %.3e s in %d slots, nThreads = %d",
138 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1, mVertexer.
getNThreads());
150 LOG(info) <<
"cluster dictionary updated";
160 LOG(info) <<
"SVertexer Params updated from ccdb";
164 LOG(info) <<
"ITS GeomtetryTGeo loaded from ccdb";
168#ifdef ENABLE_UPGRADES
170 LOG(info) <<
"cluster dictionary updated";
182 auto const&
raw = pc.
inputs().
get<
const char*>(
"corrMap");
183 mTPCCorrMaps = &gpu::TPCFastTransformPOD::get(raw);
185 static bool initOnceDone =
false;
189 if (mEnableCCDBParams) {
200 if (mEnableStrangenessTracking) {
205#ifdef ENABLE_UPGRADES
216 LOGP(info,
"Updating TPC fast transform map with new VDrift factor of {} wrt reference {} and DriftTimeOffset correction {} wrt {} from source {}",
224 if (mEnableStrangenessTracking) {
235 bool useMC,
bool useGeom)
237 std::vector<OutputSpec> outputs;
239 {
"material-lut-path", VariantType::String,
"", {
"Path of the material LUT file"}},
240 {
"threads", VariantType::Int, 1, {
"Number of threads"}}};
241 auto dataRequest = std::make_shared<DataRequest>();
242 if (enableCCDBParams) {
243 dataRequest->inputs.emplace_back(
"SVParam",
"GLO",
"SVPARAM", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Config/SVertexerParam"));
246 if (enableStrangenesTracking) {
250 LOGP(warn,
"Tracks involving TPC were requested w/o requesting TPC-only tracks, simplified selection will be applied");
256 dataRequest->requestClusters(srcClus, useMC);
258#ifdef ENABLE_UPGRADES
260 dataRequest->inputs.emplace_back(
"cldict",
"IT3",
"CLUSDICT", Lifetime::Condition,
ccdbParamSpec(
"IT3/Calib/ClusterDictionary"));
263 dataRequest->requestTracks(
src, useMC);
264 dataRequest->requestPrimaryVertices(useMC);
265 dataRequest->inputs.emplace_back(
"meanvtx",
"GLO",
"MEANVERTEX", 0, Lifetime::Condition,
ccdbParamSpec(
"GLO/Calib/MeanVertex", {}, 1));
266 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
274 if (!useGeom && enableStrangenesTracking) {
275 ggRequest->addInput({
"itsTGeo",
"ITS",
"GEOMTGEO", 0, Lifetime::Condition,
framework::ccdbParamSpec(
"ITS/Config/Geometry")}, dataRequest->inputs);
281 outputs.emplace_back(
"GLO",
"V0S_IDX", 0, Lifetime::Timeframe);
282 outputs.emplace_back(
"GLO",
"V0S", 0, Lifetime::Timeframe);
283 outputs.emplace_back(
"GLO",
"PVTX_V0REFS", 0, Lifetime::Timeframe);
285 outputs.emplace_back(
"GLO",
"CASCS_IDX", 0, Lifetime::Timeframe);
286 outputs.emplace_back(
"GLO",
"CASCS", 0, Lifetime::Timeframe);
287 outputs.emplace_back(
"GLO",
"PVTX_CASCREFS", 0, Lifetime::Timeframe);
289 outputs.emplace_back(
"GLO",
"DECAYS3BODY_IDX", 0, Lifetime::Timeframe);
290 outputs.emplace_back(
"GLO",
"DECAYS3BODY", 0, Lifetime::Timeframe);
291 outputs.emplace_back(
"GLO",
"PVTX_3BODYREFS", 0, Lifetime::Timeframe);
293 if (enableStrangenesTracking) {
294 outputs.emplace_back(
"GLO",
"STRANGETRACKS", 0, Lifetime::Timeframe);
295 outputs.emplace_back(
"GLO",
"CLUSUPDATES", 0, Lifetime::Timeframe);
297 outputs.emplace_back(
"GLO",
"STRANGETRACKS_MC", 0, Lifetime::Timeframe);
298 LOG(info) <<
"Strangeness tracker will use MC";
303 "secondary-vertexing",
306 AlgorithmSpec{adaptFromTask<SecondaryVertexingSpec>(dataRequest, ggRequest,
src, enableCasc, enable3body, enableStrangenesTracking, enableCCDBParams, useMC)},
Definition of the GeometryManager class.
o2::raw::RawFileWriter * raw
Helper for geometry and GRP related CCDB requests.
Global index for barrel track: provides provenance (detectors combination), index in respective array...
Definition of the Names Generator class.
Definition of the ITS track.
Result of refitting TPC-ITS matched track.
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)
GPUd() value_type estimateLTFast(o2 static GPUd() float estimateLTIncrement(const o2 PropagatorImpl * Instance(bool uninitialized=false)
void printKeyValues(bool showProv=true, bool useLogger=false, bool withPadding=true, bool showHash=true) const final
static const StrangenessTrackingParamConfig & Instance()
static void write(std::string const &filename, std::string const &keyOnly="")
TO BE DONE: extend to generic N body vertex.
T get(const char *key) const
ConfigParamRegistry const & options()
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
static GeometryTGeo * Instance()
void fillMatrixCache(int mask) override
static void adopt(GeometryTGeo *raw, bool canDelete=false)
void setConfigParams(const StrangenessTrackingParamConfig *params)
void setupThreads(int nThreads=1)
void setCorrType(const o2::base::PropagatorImpl< float >::MatCorrType &type)
void setClusterDictionaryITS(const o2::itsmft::TopologyDictionary *d)
void setMCTruthOn(bool v)
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)
void setEnableCascades(bool v)
std::array< size_t, 3 > getNFitterCalls() const
void setEnable3BodyDecays(bool v)
void setTPCCorrMaps(const o2::gpu::TPCFastTransformPOD *maph)
void process(const o2::globaltracking::RecoContainer &recoTracks, o2::framework::ProcessingContext &pc)
void setTPCVDrift(const o2::tpc::VDriftCorrFact &v)
void setMeanVertex(const o2::dataformats::MeanVertexObject *v)
void setStrangenessTracker(o2::strangeness_tracking::StrangenessTracker *tracker)
int getNStrangeTracks() const
~SecondaryVertexingSpec() override=default
SecondaryVertexingSpec(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, GTrackID::mask_t src, bool enabCasc, bool enable3body, bool enableStrangenessTracking, bool enableCCDBParams, bool useMC)
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void init(InitContext &ic) final
void run(ProcessingContext &pc) final
constexpr o2::header::DataOrigin gDataOriginTPC
Defining ITS Vertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
o2::framework::DataProcessorSpec getSecondaryVertexingSpec(o2::dataformats::GlobalTrackID::mask_t src, bool enableCasc, bool enable3body, bool enableStrangenesTracking, bool enableCCDBParams, bool useMC, bool useGeom)
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"