@@ -95,16 +95,17 @@ bool DelphesO2LutWriter::fatSolve(lutEntry_t& lutEntry,
9595 o2::track::TrackParCov trkOut;
9696 const int status = fat.FastTrack (trkIn, trkOut, nch);
9797 if (status <= mAtLeastHits ) {
98- LOGF (info, " --- fatSolve: FastTrack failed --- \n " );
98+ LOGF (info, " --- fatSolve: FastTrack failed ---" );
9999 // tlv.Print();
100100 return false ;
101101 }
102- LOGF (info, " --- fatSolve: FastTrack succeeded %d --- \n " , status);
102+ LOGF (info, " --- fatSolve: FastTrack succeeded %d ---" , status);
103103 // trkOut.print();
104104 lutEntry.valid = true ;
105105 lutEntry.itof = fat.GetGoodHitProb (itof);
106106 lutEntry.otof = fat.GetGoodHitProb (otof);
107- for (int i = 0 ; i < 15 ; ++i)
107+ static constexpr int nCov = 15 ;
108+ for (int i = 0 ; i < nCov; ++i)
108109 lutEntry.covm [i] = trkOut.getCov ()[i];
109110
110111 // define the efficiency
@@ -151,20 +152,22 @@ bool DelphesO2LutWriter::fwdPara(lutEntry_t& lutEntry, float pt, float eta, floa
151152 lutEntry.valid = false ;
152153
153154 // parametrised forward response; interpolates between FAT at eta = 1.75 and a fixed parametrisation at eta = 4; only diagonal elements
154- if (std::fabs (eta) < etaMaxBarrel || std::fabs (eta) > 4 )
155+ static constexpr float etaLimit = 4 .0f ;
156+ if (std::fabs (eta) < etaMaxBarrel || std::fabs (eta) > etaLimit)
155157 return false ;
156158
157159 if (!fatSolve (lutEntry, pt, etaMaxBarrel, mass))
158160 return false ;
159- float covmbarrel[15 ] = {0 };
160- for (int i = 0 ; i < 15 ; ++i) {
161+ static constexpr int nCov = 15 ;
162+ float covmbarrel[nCov] = {0 };
163+ for (int i = 0 ; i < nCov; ++i) {
161164 covmbarrel[i] = lutEntry.covm [i];
162165 }
163166
164167 // parametrisation at eta = 4
165168 const double beta = 1 . / std::sqrt (1 + mass * mass / pt / pt / std::cosh (eta) / std::cosh (eta));
166169 const float dcaPos = 2.5e-4 / std::sqrt (3 ); // 2.5 micron/sqrt(3)
167- const float r0 = 0.5 ; // layer 0 radius [cm]
170+ const float r0 = 0.5 ; // layer 0 radius [cm]
168171 const float r1 = 1.3 ;
169172 const float r2 = 2.5 ;
170173 const float x0layer = 0.001 ; // material budget (rad length) per layer
@@ -198,8 +201,8 @@ bool DelphesO2LutWriter::fwdPara(lutEntry_t& lutEntry, float pt, float eta, floa
198201 lutEntry.covm [2 ] = covmbarrel[2 ];
199202 if (dcaz2 > lutEntry.covm [2 ])
200203 lutEntry.covm [2 ] = dcaz2;
201- lutEntry.covm [5 ] = covmbarrel[5 ]; // sigma^2 sin(phi)
202- lutEntry.covm [9 ] = covmbarrel[9 ]; // sigma^2 tanl
204+ lutEntry.covm [5 ] = covmbarrel[5 ]; // sigma^2 sin(phi)
205+ lutEntry.covm [9 ] = covmbarrel[9 ]; // sigma^2 tanl
203206 lutEntry.covm [14 ] = momresTot * momresTot / pt / pt / pt / pt; // sigma^2 1/pt
204207 // Check that all numbers are numbers
205208 for (int i = 0 ; i < 15 ; ++i) {
@@ -283,10 +286,10 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, si
283286 lutEntry.valid = true ;
284287 if (std::fabs (eta) <= etaMaxBarrel) { // full lever arm ends at etaMaxBarrel
285288 LOGF (info, " Solving in the barrel" );
286- // printf( " --- fatSolve: pt = %f, eta = %f, mass = %f, field=%f \n ", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field);
289+ // LOGF(info, " --- fatSolve: pt = %f, eta = %f, mass = %f, field=%f", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field);
287290 successfullCalls++;
288291 if (!fatSolve (lutEntry, lutEntry.pt , lutEntry.eta , lutHeader.mass , itof, otof, q)) {
289- // printf( " --- fatSolve: error \n ");
292+ // LOGF(info, " --- fatSolve: error");
290293 lutEntry.valid = false ;
291294 lutEntry.eff = 0 .;
292295 lutEntry.eff2 = 0 .;
@@ -298,7 +301,7 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, si
298301 }
299302 } else {
300303 LOGF (info, " Solving outside the barrel" );
301- // printf( " --- fwdSolve: pt = %f, eta = %f, mass = %f, field=%f \n ", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field);
304+ // LOGF(info, " --- fwdSolve: pt = %f, eta = %f, mass = %f, field=%f", lutEntry.pt, lutEntry.eta, lutHeader.mass, lutHeader.field);
302305 lutEntry.eff = 1 .;
303306 lutEntry.eff2 = 1 .;
304307 bool retval = true ;
@@ -319,7 +322,7 @@ void DelphesO2LutWriter::lutWrite(const char* filename, int pdg, float field, si
319322 lutEntry.eff2 = lutEntryBarrel.eff2 ;
320323 }
321324 if (!retval) {
322- printf ( " --- fwdSolve: error \n " );
325+ LOGF (info, " --- fwdSolve: error" );
323326 lutEntry.valid = false ;
324327 for (int i = 0 ; i < 15 ; ++i) {
325328 lutEntry.covm [i] = 0 .;
0 commit comments