41 const char* fileName =
"fastTransformQA.root";
43 AliTPCcalibDB* pCalib = AliTPCcalibDB::Instance();
45 return storeError(-1,
"TPCFastTransformQA: No TPC calibration instance found");
48 AliTPCParam* tpcParam = pCalib->GetParameters();
50 return storeError(-2,
"TPCFastTransformQA: No TPCParam object found");
53 AliTPCTransform* origTransform = pCalib->GetTransform();
55 return storeError(-3,
"TPCFastTransformQA: No TPC transformation found");
58 const AliTPCRecoParam*
rec = origTransform->GetCurrentRecoParam();
60 return storeError(-5,
"TPCFastTransformQA: No TPC Reco Param set in transformation");
64 int32_t lastTimeBin =
rec->GetLastBin();
71 for (Int_t iSec = 0; iSec < 1; iSec++) {
72 LOG(info) <<
"Measure original transformation time for TPC sector " << iSec <<
" ..";
73 int32_t nRows = tpcParam->GetNRow(iSec);
74 for (int32_t iRow = 0; iRow < nRows; iRow++) {
75 Int_t nPads = tpcParam->GetNPads(iSec, iRow);
76 for (
float pad = 0.5; pad < nPads; pad += 1.) {
79 double orig[3] = {
static_cast<Double_t
>(iRow), pad,
time};
80 origTransform->Transform(orig, is, 0, 1);
82 sum1 += orig[0] + orig[1] + orig[2];
92 for (Int_t iSec = 0; iSec < 1; iSec++) {
93 LOG(info) <<
"Measure fast transformation time for TPC sector " << iSec <<
" ..";
94 int32_t nRows = tpcParam->GetNRow(iSec);
95 for (int32_t iRow = 0; iRow < nRows; iRow++) {
96 Int_t nPads = tpcParam->GetNPads(iSec, iRow);
97 int32_t slice = 0, slicerow = 0;
98 AliHLTTPCGeometry::Sector2Slice(slice, slicerow, iSec, iRow);
99 for (
float pad = 0.5; pad < nPads; pad += 1.) {
102 fastTransform.Transform(slice, slicerow, pad,
time, fast[0], fast[1], fast[2]);
104 sum2 += fast[0] + fast[1] + fast[2];
110 LOG(info) <<
"nCalls1 = " << nCalls1;
111 LOG(info) <<
"nCalls2 = " << nCalls2;
112 LOG(info) <<
"Orig transformation : " << timer1.RealTime() * 1.e9 / nCalls1 <<
" ns / call";
113 LOG(info) <<
"Fast transformation : " << timer2.RealTime() * 1.e9 / nCalls2 <<
" ns / call";
115 LOG(info) <<
"Fast Transformation speedup: " << 1. * timer1.RealTime() / timer2.RealTime() * nCalls2 / nCalls1;
118 LOG(info) <<
"Fast Transformation memory usage: " <<
size / 1000. / 1000. <<
" MB";
119 LOG(info) <<
"ignore this " << sum1 <<
" " << sum2;
123 TFile*
file =
new TFile(fileName,
"RECREATE");
125 return storeError(-1,
"Can't recreate QA file !");
128 TNtuple* nt =
new TNtuple(
"fastTransformQA",
"fastTransformQA",
"sec:row:pad:time:x:y:z:fx:fy:fz");
130 for (Int_t iSec = 0; iSec < 1; iSec++) {
131 int32_t nRows = tpcParam->GetNRow(iSec);
132 for (int32_t iRow = 0; iRow < nRows; iRow++) {
133 LOG(info) <<
"Write fastTransform QA for TPC sector " << iSec <<
", row " << iRow <<
" ..";
134 Int_t nPads = tpcParam->GetNPads(iSec, iRow);
135 int32_t slice = 0, slicerow = 0;
136 AliHLTTPCGeometry::Sector2Slice(slice, slicerow, iSec, iRow);
137 for (
float pad = 0.5; pad < nPads; pad += 1.) {
140 double orig[3] = {
static_cast<Double_t
>(iRow), pad,
time};
142 origTransform->Transform(orig, is, 0, 1);
143 fastTransform.Transform(slice, slicerow, pad,
time, fast[0], fast[1], fast[2]);
144 float entry[] = {(float)iSec, (
float)iRow, pad,
time, (float)orig[0], (
float)orig[1], (float)orig[2], fast[0], fast[1], fast[2]};