1 #if !defined( __CINT__) || defined(__MAKECINT__)
4 #include <TProfile2D.h>
8 #include "AliReconstruction.h"
9 #include "AliTRDCalibra.h"
10 #include "AliCDBManager.h"
16 void AliTRDFindTheCoef()
19 // This macro takes a 2D histo or vector in the file TRD.calibration.root
20 // tries to find the coeffficients
21 // writes the result in the form of a tree in the file coeftest.root
27 ////Set the CDBManager(You have to use the same as during the reconstruction)*************************
28 AliCDBManager *man = AliCDBManager::Instance();
29 man->GetStorage("local://$ALICE_ROOT");
32 ////Set the parameters of AliTRDCalibra***************
33 AliTRDCalibra *calibra = AliTRDCalibra::Instance();
35 ////Wich mode did you use in the reconstruction?
36 calibra->SetNz(0,2);//here for the gain
37 calibra->SetNrphi(0,2);//here for the gain
39 ////How many bins did you have?
40 //calibra->SetNumberBinCharge(100);
41 //calibra->SetNumberBinPRF(20);
44 ////Which method do you want to use (It is always the default method that will be put in the database)
45 //calibra->SetMeanChargeOn();
46 calibra->SetFitChargeBisOn();
47 //calibra->SetFitPHOn();
48 //calibra->SetPeriodeFitPH(10);
51 //calibra->SetRangeFitPRF(0.5);//fit from -0.5 and 0.5 with a gaussian the PRF
52 //calibra->SetT0Shift(0.1433);//will always abstract 0.1433 mus to the result of the method for time 0
54 ////What do you want to see?
55 calibra->SetDebug(1);//0 (nothing to see), 1, 2, 3, or 4
56 //calibra->SetDet(0,1,14);//in case of fDebug = 3 and 4
57 //calibra->SetFitVoir(2);//in case of fDebug = 2
59 ////How many statistics do you want to accept?
60 calibra->SetMinEntries(1);// 1 entry at least to fit
62 ////Do you want to write the result?
63 calibra->SetWriteCoef(1);
65 ////Do you want to change the name of the file (TRD.coefficient.root)?
66 calibra->SetWriteNameCoef("coeftest.root");
68 ////Take the Histo2d or tree in the TRD.calibration.root file
69 TFile *file = TFile::Open("TRD.calibration.root","READ");
70 //TH2I *h = (TH2I *) file->Get("CH2d");
71 TTree *h = (TTree *) file->Get("treeCH2d");
75 calibra->FitCHOnline(h);