@@ -237,58 +237,10 @@ class TOFResoParamsV3 : public o2::tof::Parameters<13>
237237 }
238238
239239 // Time shift for post calibration to realign as a function of eta
240- void setTimeShiftParameters (std::unordered_map<std::string, float > const & pars, bool positive)
241- {
242- std::string baseOpt = positive ? " TimeShift.Pos." : " TimeShift.Neg." ;
243-
244- if (pars.count (baseOpt + " GetN" ) == 0 ) { // If the map does not contain the number of eta bins, we assume that no correction has to be applied
245- return ;
246- }
247- const int nPoints = static_cast <int >(pars.at (baseOpt + " GetN" ));
248- if (nPoints <= 0 ) {
249- LOG (fatal) << " TOFResoParamsV3 shift: time must be positive" ;
250- }
251- TGraph graph;
252- for (int i = 0 ; i < nPoints; ++i) {
253- graph.AddPoint (pars.at (Form (" TimeShift.eta%i" , i)), pars.at (Form (" TimeShift.cor%i" , i)));
254- }
255- setTimeShiftParameters (&graph, positive);
256- }
257- void setTimeShiftParameters (std::string const & filename, std::string const & objname, bool positive)
258- {
259- TFile f (filename.c_str (), " READ" );
260- if (f.IsOpen ()) {
261- if (positive) {
262- f.GetObject (objname.c_str (), gPosEtaTimeCorr );
263- } else {
264- f.GetObject (objname.c_str (), gNegEtaTimeCorr );
265- }
266- f.Close ();
267- }
268- LOG (info) << " Set the Time Shift parameters from file " << filename << " and object " << objname << " for " << (positive ? " positive" : " negative" );
269- }
270- void setTimeShiftParameters (TGraph* g, bool positive)
271- {
272- if (positive) {
273- gPosEtaTimeCorr = g;
274- } else {
275- gNegEtaTimeCorr = g;
276- }
277- LOG (info) << " Set the Time Shift parameters from object " << g->GetName () << " " << g->GetTitle () << " for " << (positive ? " positive" : " negative" );
278- }
279- float getTimeShift (float eta, int16_t sign) const
280- {
281- if (sign > 0 ) {
282- if (!gPosEtaTimeCorr ) {
283- return 0 .f ;
284- }
285- return gPosEtaTimeCorr ->Eval (eta);
286- }
287- if (!gNegEtaTimeCorr ) {
288- return 0 .f ;
289- }
290- return gNegEtaTimeCorr ->Eval (eta);
291- }
240+ void setTimeShiftParameters (std::unordered_map<std::string, float > const & pars, const bool positive);
241+ void setTimeShiftParameters (std::string const & filename, std::string const & objname, const bool positive);
242+ void setTimeShiftParameters (TGraph* g, const bool positive);
243+ float getTimeShift (float eta, int16_t sign) const ;
292244
293245 void printTimeShiftParameters () const
294246 {
0 commit comments