AliRoot Core  edcc906 (edcc906)
testPed.C
Go to the documentation of this file.
1 
6 void testPed(Char_t *fileName)
7 {
8  AliRawReaderRoot *rawReader = new AliRawReaderRoot(fileName);
9  if ( !rawReader ) return;
11  printf("Processing data\n");
12  Int_t event=0;
13  while (rawReader->NextEvent()){
14  calib->ProcessEvent(rawReader);
15  printf("Processing event\t%d\n",event);
16  event++;
17  }
18  calib->Analyse();
19  calib->DumpToFile("PedestalData.root");
20  delete rawReader;
21  delete calib;
22 
23  //
24  TFile f("PedestalData.root");
25  AliTPCCalibPedestal* ped = (AliTPCCalibPedestal*)f.Get("AliTPCCalibPedestal");
26  AliTPCCalPad * pad0 = new AliTPCCalPad(ped->GetCalPadRMS());
27  AliTPCCalPad * pad1 = new AliTPCCalPad(ped->GetCalPadPedestal());
28  pad0->SetName("Noise");
29  pad1->SetName("Pedestal");
30 
31  AliTPCPreprocessorOnline preprocesor;
32  preprocesor.AddComponent(pad0);
33  preprocesor.AddComponent(pad1);
34  preprocesor.DumpToFile("CalibTree.root");
35  AliTPCCalibViewerGUI::ShowGUI("CalibTree.root");
36 }
37 
38 
39 void testPed0(Char_t *fileName)
40 {
42 
43  AliRawReaderRoot *rawReader = new AliRawReaderRoot(fileName);
44  if ( !rawReader ) return;
46  printf("Processing data\n");
47  Int_t event=0;
48  while (rawReader->NextEvent()){
49  calib->ProcessEvent(rawReader);
50  printf("Processing event\t%d\n",event);
51  event++;
52  }
53  calib->Analyse();
54  //
55  AliTPCCalPad * pad0 = new AliTPCCalPad(calib->GetCalPadRMS());
56  AliTPCCalPad * pad1 = new AliTPCCalPad(calib->GetCalPadPedestal());
57  pad0->SetName("Noise");
58  pad1->SetName("Pedestal");
59  //
60  AliTPCPreprocessorOnline preprocesor;
61  preprocesor.AddComponent(pad0);
62  preprocesor.AddComponent(pad1);
63  preprocesor.DumpToFile("CalibTree.root");
64  AliTPCCalibViewerGUI::ShowGUI("CalibTree.root");
65 }
66 
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
const TObjArray * GetCalPadRMS() const
Implementation of the TPC pedestal calibration.
virtual void DumpToFile(const Char_t *filename, const Char_t *dir="", Bool_t append=kFALSE)
Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3)
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
void testPed(Char_t *fileName)
Definition: testPed.C:6
const TObjArray * GetCalPadPedestal() const
static TObjArray * ShowGUI(const char *fileName=0)
TF1 * f
Definition: interpolTest.C:21
void DumpToFile(const char *fileName)
void testPed0(Char_t *fileName)
Definition: testPed.C:39
Preprocessor class for HLT and DAQ.