1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 /* $Id: AliT0CalibSeasonTimeShift.cxx 42881 2010-08-16 10:59:14Z alla $ */
18 ///////////////////////////////////////////////////////////////////////////////
20 // class for T0 calibration TM-AC-AM_6-02-2006
21 // equalize time shift for each time CFD channel
23 ///////////////////////////////////////////////////////////////////////////////
25 #include "AliT0CalibSeasonTimeShift.h"
33 ClassImp(AliT0CalibSeasonTimeShift)
35 //________________________________________________________________
36 AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift():TNamed()
42 //________________________________________________________________
43 AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift(const char* name):TNamed()
47 TString namst = "Calib_";
49 SetName(namst.Data());
50 SetTitle(namst.Data());
53 //________________________________________________________________
54 AliT0CalibSeasonTimeShift::AliT0CalibSeasonTimeShift(const AliT0CalibSeasonTimeShift& calibda):TNamed(calibda)
58 SetName(calibda.GetName());
59 SetTitle(calibda.GetName());
64 //________________________________________________________________
65 AliT0CalibSeasonTimeShift &AliT0CalibSeasonTimeShift::operator =(const AliT0CalibSeasonTimeShift& calibda)
67 // assignment operator
68 SetName(calibda.GetName());
69 SetTitle(calibda.GetName());
74 //________________________________________________________________
75 AliT0CalibSeasonTimeShift::~AliT0CalibSeasonTimeShift()
82 //________________________________________________________________
83 void AliT0CalibSeasonTimeShift::Print(Option_t*) const
87 printf("\n ---- T0 results ----\n\n");
88 printf(" (T0A+T0C)/2 = %f; T0A = %f; T0C = %f; resolution = %f \n", fMeanPar[0], fMeanPar[1],fMeanPar[2],fMeanPar[3]);
89 printf(" sigma(T0A+T0C)/2 = %f; sigma(T0 = %f; sigma(T0C) = %f; sigma(resolution) = %f \n" , fSigmaPar[0], fSigmaPar[1], fSigmaPar[2],fSigmaPar[3]);
93 //________________________________________________________________
94 void AliT0CalibSeasonTimeShift::SetT0Par(Float_t par[4],Float_t spar[4])
96 for (Int_t i=0; i<4; i++)
99 fSigmaPar[i] = spar[i];
104 //________________________________________________________________
105 void AliT0CalibSeasonTimeShift::SetT0Par(const char* filePhys)
108 gFile = TFile::Open(filePhys);
110 AliError("No input PHYS data found ");
116 TString histname[4]={"meanAC", "meanA", "meanC", "resolution"};
117 for (Int_t i=0; i<4; i++)
119 TH1F *cfd = (TH1F*) gFile->Get(histname[i].Data());
120 if(!cfd) AliWarning(Form("no histograms collected for %s", histname[i].Data()));
122 TF1 *g = new TF1("g", "gaus",-2,2);
123 cfd->Fit("g"," ","Q",-2,2);
125 g->GetParameters(&par[0]);
126 fMeanPar[i] = par[1];