]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TOF/CreateCalibPars_Miscalibrated.C
minor bugfix to make doxygen happy
[u/mrichter/AliRoot.git] / TOF / CreateCalibPars_Miscalibrated.C
CommitLineData
a7037d41 1void CreateCalibPars_Miscalibrated(){
2 // Create TOF Calibration Object for miscalibrated detector
3 // and write it on CDB
4 AliTOFGeometry *geom = new AliTOFGeometryV5();
5 AliTOFcalib *tofcalib = new AliTOFcalib(geom);
6 AliTOFCal *tofCal= new AliTOFCal(geom);
7 tofCal->CreateArray();
8
9 // Input data for decalibration
10
11 TFile f("$ALICE_ROOT/TOF/data/spectrum.root","READ");
12
bce42494 13 TH1F *hTimeToTFit= (TH1F*)f.Get("hTimeToTLim");
14 TF1 *fit=hTimeToTFit->GetFunction("pol5");
a7037d41 15
16 // Slewing parameters (same for all channels)
17
18 Float_t par[6] = {0.,0.,0.,0.,0.,0.};
19 for(Int_t i =0;i<6;i++){
20 par[i]=fit->GetParameter(i);
bce42494 21 cout << " Slewing parameters=" << par[i] << endl;
a7037d41 22 }
23
24 // Global time offset (randomly gen, gaussian with mean = 0.3, sig=0.08 ns)
25
26 Float_t delay=0.;
27 Float_t meanDelay=0.3;
28 Float_t sigmaDelay=0.08;
29
30 // ToT spectrum
31
bce42494 32 TH1F *hToT= (TH1F*)f.Get("hToTLim");
a7037d41 33
34 // Fill the Sim calibration object
35
36 TRandom *rnd = new TRandom(4357);
37 for (Int_t ipad = 0 ; ipad<tofCal->NPads(); ipad++){
38 AliTOFChannel *calChannel = tofCal->GetChannel(ipad);
39 calChannel->SetSlewPar(par);
40 delay=rnd->Gaus(meanDelay,sigmaDelay);
a7037d41 41 calChannel->SetDelay(delay);
42 }
43 tofcalib->WriteSimParOnCDB("TOF/Calib",0,0,tofCal,hToT);
44 f.Close();
45}
46
47