1 #if !defined( __CINT__) || defined(__MAKECINT__)
4 #include <TProfile2D.h>
8 #include "AliReconstruction.h"
9 #include "../TRD/AliTRDCalibra.h"
10 #include "AliCDBManager.h"
11 #include "TStopwatch.h"
17 void AliTRDFindTheCoef()
20 // This macro takes a 2D histo or vector in the file TRD.calibration.root
21 // tries to find the coeffficients
22 // writes the result in the form of a tree in the file coeftest.root
29 ////Set the CDBManager(You have to use the same as during the reconstruction)*************************
30 AliCDBManager *man = AliCDBManager::Instance();
31 man->SetDefaultStorage("local://$ALICE_ROOT");
34 ////Set the parameters of AliTRDCalibra***************
35 AliTRDCalibra *calibra = AliTRDCalibra::Instance();
37 ////Take the Histo2d or tree in the TRD.calibration.root file
38 TFile *file = new TFile("TRD.calibration.root","READ");
39 //TProfile2D *h = (TProfile2D *) file->Get("PRF2d");
40 TTree *h = (TTree *) file->Get("treePRF2d");
44 //TProfile2D *h = (TProfile2D *) file->Get("PRF2d");
45 TTree *h1 = (TTree *) file->Get("treePH2d");
49 //TProfile2D *h = (TProfile2D *) file->Get("PRF2d");
50 TTree *h2 = (TTree *) file->Get("treeCH2d");
54 ////How many bins did you have?
55 //calibra->SetNumberBinCharge(100);
56 //calibra->SetNumberBinPRF(20);
59 ////Which method do you want to use (It is always the default method that will be put in the database)
60 //calibra->SetMeanChargeOn();
61 //calibra->SetFitChargeBisOn();
62 //calibra->SetFitPHOn();
63 //calibra->SetPeriodeFitPH(10);
66 //calibra->SetRangeFitPRF(0.5);//fit from -0.5 and 0.5 with a gaussian the PRF
67 //calibra->SetT0Shift(0.1433);//will always abstract 0.1433 mus to the result of the method for time 0
69 ////What do you want to see?
70 calibra->SetDebug(1);//0 (nothing to see), 1, 2, 3, or 4
71 //calibra->SetDet(0,1,14);//in case of fDebug = 3 and 4
72 //calibra->SetFitVoir(2);//in case of fDebug = 2
74 ////How many statistics do you want to accept?
75 calibra->SetMinEntries(10);// 1 entry at least to fit
77 ////Do you want to write the result
78 //calibra->SetWriteCoef(1);
80 ////Do you want to change the name of the file (TRD.coefficient.root)
81 //calibra->SetWriteNameCoef("coeftest.root");
83 //Set the mode on the z and rphi direction for each calibration paramaters
84 calibra->SetModeCalibrationFromTObject((TObject *)h2,0);
85 calibra->SetModeCalibrationFromTObject((TObject *)h1,1);
86 calibra->SetModeCalibrationFromTObject((TObject *)h,2);
88 //Fit the pad response function
89 calibra->FitPRFOnline(h);
91 //Fit the avreage pulse height
92 calibra->FitPHOnline(h1);
94 //Fit the deposited charge
95 calibra->FitCHOnline(h2);