19#include "MFTBase/GeometryTGeo.h"
22#include "TGeoGlobalMagField.h"
37 mMFTAssessment = std::make_unique<o2::mft::MFTAssessment>(mUseMC);
38 for (
int sw = 0;
sw < NStopWatches;
sw++) {
42 mTimer[SWTot].Start(
false);
48 updateTimeDependentParams(pc);
49 mTimer[SWQCAsync].Start(
false);
50 mMFTAssessment->runASyncQC(pc);
51 mTimer[SWQCAsync].Stop();
55 mTimer[SWTrackables].Start(
false);
56 mMFTAssessment->processTrackables();
57 mTimer[SWTrackables].Stop();
60 mTimer[SWGenerated].Start(
false);
61 mMFTAssessment->processGeneratedTracks();
62 mTimer[SWGenerated].Stop();
64 mTimer[SWRecoAndTrue].Start(
false);
65 mMFTAssessment->processRecoTracks();
66 mMFTAssessment->processTrueAndFakeTracks();
67 mTimer[SWRecoAndTrue].Stop();
74 if (mFinalizeAnalysis) {
75 mTimer[SWAnalysis].Start(
false);
76 mMFTAssessment->finalizeAnalysis();
77 mTimer[SWAnalysis].Stop();
83 for (
int i = 0;
i < NStopWatches;
i++) {
84 LOGF(info,
"Timing %18s: Cpu: %.3e s; Real: %.3e s in %d slots", TimerName[
i], mTimer[
i].CpuTime(), mTimer[
i].RealTime(), mTimer[
i].Counter() - 1);
92 mMFTAssessment->getHistos(objar);
94 output.snapshot(
Output{
"MFT",
"MFTASSESSMENT", 0}, objar);
96 TFile*
f =
new TFile(Form(
"MFTAssessment.root"),
"RECREATE");
104 static bool initOnceDone =
false;
112 double centerMFT[3] = {0, 0, -61.4};
113 auto Bz = field->
getBz(centerMFT);
114 LOG(info) <<
"Setting MFT Assessment Bz = " << Bz;
115 mMFTAssessment->setBz(Bz);
116 mMFTAssessment->init(mFinalizeAnalysis);
128 LOG(info) <<
"cluster dictionary updated";
133 LOG(info) <<
"MFT GeomtetryTGeo loaded from ccdb";
142 std::vector<InputSpec> inputs;
143 std::vector<OutputSpec> outputs;
145 inputs.emplace_back(
"compClusters",
"MFT",
"COMPCLUSTERS", 0, Lifetime::Timeframe);
146 inputs.emplace_back(
"patterns",
"MFT",
"PATTERNS", 0, Lifetime::Timeframe);
147 inputs.emplace_back(
"clustersrofs",
"MFT",
"CLUSTERSROF", 0, Lifetime::Timeframe);
148 inputs.emplace_back(
"tracksrofs",
"MFT",
"MFTTrackROF", 0, Lifetime::Timeframe);
149 inputs.emplace_back(
"tracks",
"MFT",
"TRACKS", 0, Lifetime::Timeframe);
150 inputs.emplace_back(
"trackClIdx",
"MFT",
"TRACKCLSID", 0, Lifetime::Timeframe);
151 inputs.emplace_back(
"cldict",
"MFT",
"CLUSDICT", 0, Lifetime::Condition,
ccdbParamSpec(
"MFT/Calib/ClusterDictionary"));
152 auto ggRequest = std::make_shared<o2::base::GRPGeomRequest>(
false,
161 ggRequest->addInput({
"mftTGeo",
"MFT",
"GEOMTGEO", 0, Lifetime::Condition,
framework::ccdbParamSpec(
"MFT/Config/Geometry")}, inputs);
164 inputs.emplace_back(
"clslabels",
"MFT",
"CLUSTERSMCTR", 0, Lifetime::Timeframe);
165 inputs.emplace_back(
"trklabels",
"MFT",
"TRACKSMCTR", 0, Lifetime::Timeframe);
168 outputs.emplace_back(
"MFT",
"MFTASSESSMENT", 0, Lifetime::Sporadic);
174 AlgorithmSpec{adaptFromTask<o2::mft::MFTAssessmentSpec>(ggRequest, useMC, processGen, finalizeAnalysis)},
Definition of the MagF class.
Definition of the Names Generator class.
void checkUpdates(o2::framework::ProcessingContext &pc)
static GRPGeomHelper & instance()
void setRequest(std::shared_ptr< GRPGeomRequest > req)
Double_t getBz(const Double_t *xyz) const
Method to calculate the field at point xyz.
DataAllocator & outputs()
InputRecord & inputs()
The inputs associated with this processing context.
ServiceRegistryRef services()
The services registry associated with this processing context.
static void adopt(GeometryTGeo *raw, bool canDelete=false)
void endOfStream(o2::framework::EndOfStreamContext &ec) final
This is invoked whenever we have an EndOfStream event.
void run(o2::framework::ProcessingContext &pc) final
void init(o2::framework::InitContext &ic) final
void finaliseCCDB(o2::framework::ConcreteDataMatcher &matcher, void *obj) final
Defining PrimaryVertex explicitly as messageable.
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
std::vector< ConfigParamSpec > Options
DataProcessorSpec getMFTAssessmentSpec(bool useMC, bool useGeom, bool processGen, bool finalizeAnalysis=false)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"