Skip to content

Commit 66122b1

Browse files
authored
Fix timing info in ITS cluster and track tasks (#1605)
* ranges updated to be compatible with back-bias calibration * from current timestamp to TF timestamp
1 parent 8b44655 commit 66122b1

4 files changed

Lines changed: 25 additions & 21 deletions

File tree

Modules/ITS/include/ITS/ITSClusterTask.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <DataFormatsITSMFT/TopologyDictionary.h>
2828
#include <ITSBase/GeometryTGeo.h>
29+
#include <Framework/TimingInfo.h>
2930

3031
class TH1D;
3132
class TH2D;
@@ -96,7 +97,7 @@ class ITSClusterTask : public TaskInterface
9697
int mNRofs = 0;
9798
int mNRofsMonitor = 0;
9899
int nBCbins = 103;
99-
long int mTimestamp;
100+
long int mTimestamp = -1;
100101
std::string mGeomPath = "./";
101102
TString xLabel;
102103
std::string mGeoTimestamp = "1640991600000";

Modules/ITS/include/ITS/ITSTrackTask.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <TH2D.h>
2323
#include <DataFormatsITSMFT/TopologyDictionary.h>
2424
#include <ITSBase/GeometryTGeo.h>
25+
#include <Framework/TimingInfo.h>
2526
#include <TTree.h>
2627
#include <TLine.h>
2728

@@ -83,7 +84,7 @@ class ITSTrackTask : public TaskInterface
8384
Int_t mNTracks = 0;
8485
Int_t mNRofs = 0;
8586
int nBCbins = 103;
86-
long int mTimestamp;
87+
long int mTimestamp = -1;
8788
int nVertices = 0;
8889
double mChipBins[2125]; // x bins for cos(lambda) plot
8990
double mCoslBins[25]; // y bins for cos(lambda) plot

Modules/ITS/src/ITSClusterTask.cxx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,6 @@ void ITSClusterTask::initialize(o2::framework::InitContext& /*ctx*/)
126126
mGeneralOccupancy->GetXaxis()->SetLabelSize(0);
127127
mGeneralOccupancy->GetZaxis()->SetTitle("Max Avg Cluster occ (clusters/event/chip)");
128128
publishHistos();
129-
130-
// get dict from ccdb
131-
mTimestamp = std::stol(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "dicttimestamp", "0"));
132-
long int ts = mTimestamp ? mTimestamp : o2::ccdb::getCurrentTimestamp();
133-
ILOG(Info, Support) << "Getting dictionary from ccdb - timestamp: " << ts << ENDM;
134-
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
135-
mgr.setTimestamp(ts);
136-
mDict = mgr.get<o2::itsmft::TopologyDictionary>("ITS/Calib/ClusterDictionary");
137-
ILOG(Info, Support) << "Dictionary size: " << mDict->getSize() << ENDM;
138129
}
139130

140131
void ITSClusterTask::startOfActivity(Activity& /*activity*/)
@@ -151,6 +142,16 @@ void ITSClusterTask::startOfCycle()
151142
void ITSClusterTask::monitorData(o2::framework::ProcessingContext& ctx)
152143
{
153144

145+
if (mTimestamp == -1) { // get dict from ccdb
146+
mTimestamp = std::stol(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "dicttimestamp", "0"));
147+
long int ts = mTimestamp ? mTimestamp : ctx.services().get<o2::framework::TimingInfo>().creation;
148+
ILOG(Info, Support) << "Getting dictionary from ccdb - timestamp: " << ts << ENDM;
149+
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
150+
mgr.setTimestamp(ts);
151+
mDict = mgr.get<o2::itsmft::TopologyDictionary>("ITS/Calib/ClusterDictionary");
152+
ILOG(Info, Support) << "Dictionary size: " << mDict->getSize() << ENDM;
153+
}
154+
154155
std::chrono::time_point<std::chrono::high_resolution_clock> start;
155156
std::chrono::time_point<std::chrono::high_resolution_clock> end;
156157
int difference;

Modules/ITS/src/ITSTrackTask.cxx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ void ITSTrackTask::initialize(o2::framework::InitContext& /*ctx*/)
7878
auto line = new TLine(ChipBoundary[l], 0, ChipBoundary[l], 10);
7979
hNClusterVsChipITS->GetListOfFunctions()->Add(line);
8080
}
81-
82-
// get dict from ccdb
83-
// mTimestamp = std::stol(mCustomParameters["dicttimestamp"]);
84-
mTimestamp = std::stol(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "dicttimestamp", "0"));
85-
long int ts = mTimestamp ? mTimestamp : o2::ccdb::getCurrentTimestamp();
86-
ILOG(Info, Support) << "Getting dictionary from ccdb - timestamp: " << ts << ENDM;
87-
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
88-
mgr.setTimestamp(ts);
89-
mDict = mgr.get<o2::itsmft::TopologyDictionary>("ITS/Calib/ClusterDictionary");
90-
ILOG(Info, Support) << "Dictionary size: " << mDict->getSize() << ENDM;
9181
}
9282

9383
void ITSTrackTask::startOfActivity(Activity& /*activity*/)
@@ -104,6 +94,17 @@ void ITSTrackTask::monitorData(o2::framework::ProcessingContext& ctx)
10494
{
10595

10696
ILOG(Info, Support) << "START DOING QC General" << ENDM;
97+
98+
if (mTimestamp == -1) { // get dict from ccdb
99+
mTimestamp = std::stol(o2::quality_control_modules::common::getFromConfig<string>(mCustomParameters, "dicttimestamp", "0"));
100+
long int ts = mTimestamp ? mTimestamp : ctx.services().get<o2::framework::TimingInfo>().creation;
101+
ILOG(Info, Support) << "Getting dictionary from ccdb - timestamp: " << ts << ENDM;
102+
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
103+
mgr.setTimestamp(ts);
104+
mDict = mgr.get<o2::itsmft::TopologyDictionary>("ITS/Calib/ClusterDictionary");
105+
ILOG(Info, Support) << "Dictionary size: " << mDict->getSize() << ENDM;
106+
}
107+
107108
auto trackArr = ctx.inputs().get<gsl::span<o2::its::TrackITS>>("tracks");
108109
auto trackRofArr = ctx.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("rofs");
109110
auto clusRofArr = ctx.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("clustersrof");

0 commit comments

Comments
 (0)