16#include "TStopwatch.h"
35#include "TGeoGlobalMagField.h"
46namespace globaltracking
52 GlobalFwdMatchingDPL(std::shared_ptr<DataRequest> dr, std::shared_ptr<o2::base::GRPGeomRequest> gr,
bool useMC,
bool MatchRootOutput)
53 : mDataRequest(dr), mGGCCDBRequest(gr), mUseMC(useMC), mMatchRootOutput(MatchRootOutput) {}
62 std::shared_ptr<DataRequest> mDataRequest;
63 std::shared_ptr<o2::base::GRPGeomRequest> mGGCCDBRequest;
64 bool mMatchRootOutput =
false;
78 if (matchingParam.isMatchUpstream() && mMatchRootOutput) {
79 LOG(fatal) <<
"Invalid MFTMCH matching configuration: matchUpstream and enable-match-output";
88 updateTimeDependentParams(pc);
90 mMatching.
run(recoData);
105 if (mMatchRootOutput) {
113 LOGF(info,
"Forward matcher total timing: Cpu: %.3e Real: %.3e s in %d slots",
114 mTimer.CpuTime(), mTimer.RealTime(), mTimer.Counter() - 1);
126 LOG(info) <<
"cluster dictionary updated";
131 LOG(info) <<
"MFT Alpide param updated";
139 static bool initOnceDone =
false;
144 double centerMFT[3] = {0, 0, -61.4};
145 auto Bz = field->
getBz(centerMFT);
146 LOG(info) <<
"Setting Global forward matching Bz = " << Bz;
160 if (alpParams.roFrameBiasInBC != 0) {
162 LOG(info) <<
"Setting MFT ROF bias to " << alpParams.roFrameBiasInBC <<
" BCs";
175 std::vector<OutputSpec> outputs;
176 auto dataRequest = std::make_shared<DataRequest>();
180 dataRequest->requestMFTClusters(
false);
181 dataRequest->requestTracks(
src, useMC);
183 if (matchingParam.isMatchUpstream()) {
184 dataRequest->requestMFTMCHMatches(useMC);
187 if (matchingParam.useMIDMatch) {
188 dataRequest->requestMCHMIDMatches(
false);
190 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
200 outputs.emplace_back(
"GLO",
"GLFWDMFT", 0, Lifetime::Timeframe);
201 outputs.emplace_back(
"GLO",
"GLFWDMCH", 0, Lifetime::Timeframe);
202 outputs.emplace_back(
"GLO",
"GLFWDINF", 0, Lifetime::Timeframe);
204 outputs.emplace_back(
"GLO",
"GLFWD", 0, Lifetime::Timeframe);
208 outputs.emplace_back(
"GLO",
"GLFWD_MC", 0, Lifetime::Timeframe);
211 if (matchRootOutput) {
212 outputs.emplace_back(
"GLO",
"MTC_MFTMCH", 0, Lifetime::Timeframe);
216 "globalfwd-track-matcher",
219 AlgorithmSpec{adaptFromTask<GlobalFwdMatchingDPL>(dataRequest, ggRequest, useMC, matchRootOutput)},
Definition of the ITS/MFT clusterer settings.
gsl::span< const o2::MCCompLabel > MCLabelsTr
Definition of the Names Generator class.
Helper for geometry and GRP related CCDB requests.
Header of the General Run Parameters object.
Global Forward Muon tracks.
Definition of the MagF class.
Class to perform MFT MCH (and MID) matching.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
static const GlobalFwdMatchingParam & Instance()
Double_t getBz(const Double_t *xyz) const
Method to calculate the field at point xyz.
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
void init(InitContext &ic) final
void finaliseCCDB(ConcreteDataMatcher &matcher, void *obj) final
void endOfStream(EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(ProcessingContext &pc) final
~GlobalFwdMatchingDPL() override=default
GlobalFwdMatchingDPL(std::shared_ptr< DataRequest > dr, std::shared_ptr< o2::base::GRPGeomRequest > gr, bool useMC, bool MatchRootOutput)
void setMFTDictionary(const o2::itsmft::TopologyDictionary *d)
const std::vector< o2::dataformats::MatchInfoFwd > & getMFTMCHMatchInfo() const
void setMFTTriggered(bool v)
void setBunchFilling(const o2::BunchFilling &bf)
set Bunch filling and init helpers for validation by BCs
const std::vector< o2::mft::TrackMFT > & getMFTMatchingPlaneParams() const
const std::vector< o2::track::TrackParCovFwd > & getMCHMatchingPlaneParams() const
void setMCTruthOn(bool v)
set MFT ROFrame duration in microseconds
void setMFTROFrameLengthMUS(float fums)
set MFT ROFrame duration in BC (continuous mode only)
void setMFTROFrameLengthInBC(int nbc)
set MFT ROFrame bias in BC (continuous mode only) or time shift applied already as MFTAlpideParam....
void setMFTROFrameBiasInBC(int nbc)
const std::vector< o2::dataformats::GlobalFwdTrack > & getMatchedFwdTracks() const
void run(const o2::globaltracking::RecoContainer &inp)
const std::vector< o2::MCCompLabel > & getMatchLabels() const
bool isMFTTriggered() const
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > Options
framework::DataProcessorSpec getGlobalFwdMatchingSpec(bool useMC, bool matchRootOutput)
create a processor spec
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
void collectData(o2::framework::ProcessingContext &pc, const DataRequest &request)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"