AliRoot Core  3dc7879 (3dc7879)
testDataQA.C
Go to the documentation of this file.
1 
10 void testDataQA(Char_t *fileName, Int_t maxevent=10)
11 {
12  AliRawReaderRoot *rawReader = new AliRawReaderRoot(fileName);
13  if ( !rawReader ) return;
14  AliTPCdataQA *calib = new AliTPCdataQA;
15  AliTPCdataQA *calibFast = new AliTPCdataQA;
16  calib->SetRangeTime(1,1000);
17  calibFast->SetRangeTime(1,1000);
18  printf("Processing data\n");
19  Int_t event=0;
20  while (rawReader->NextEvent()){
21  calib->ProcessEvent(rawReader);
22  rawReader->Reset();
23  event++;
24  // if you wann to check the handling of Analyse updates uncomment this
25 // if(gRandom->Rndm()<0.3) {
26 // calib->Analyse();
27 // calibFast->Analyse();
28 // }
29  if (event>maxevent) break;
30  }
31  calib->Analyse();
32  calibFast->Analyse();
33 
34  TFile file1("dataQATestAnalyse.root","recreate");
35  calib->Write("AliTPCdataQA");
36  calibFast->Write("AliTPCdataQAFast");
37  delete rawReader;
38  // delete calib;
39  delete calibFast;
40 
41  file1.Close();
42  //
43  TFile file2("dataQATestAnalyse.root");
44  AliTPCdataQA* cal = (AliTPCdataQA*)file2.Get("AliTPCdataQA");
45  AliTPCdataQA* calFast = (AliTPCdataQA*)file2.Get("AliTPCdataQAFast");
46 
47  AliTPCPreprocessorOnline preprocesor;
48  preprocesor.AddComponent(cal->GetNoThreshold());
49  preprocesor.AddComponent(cal->GetOverThreshold10());
50  preprocesor.AddComponent(cal->GetOverThreshold20());
51  preprocesor.AddComponent(cal->GetOverThreshold30());
52  preprocesor.AddComponent(cal->GetNLocalMaxima());
53  preprocesor.AddComponent(cal->GetMeanCharge());
54  preprocesor.AddComponent(cal->GetMaxCharge());
55  preprocesor.AddComponent(cal->GetNTimeBins());
56  preprocesor.AddComponent(cal->GetNPads());
57  preprocesor.AddComponent(cal->GetTimePosition());
58 
59  AliTPCCalPad* calPadNoThr= new AliTPCCalPad(*calFast->GetNoThreshold());
60  AliTPCCalPad* calPadThr10= new AliTPCCalPad(*calFast->GetOverThreshold10());
61  AliTPCCalPad* calPadThr20= new AliTPCCalPad(*calFast->GetOverThreshold20());
62  AliTPCCalPad* calPadThr30= new AliTPCCalPad(*calFast->GetOverThreshold30());
63  AliTPCCalPad* calNLocal = new AliTPCCalPad(*calFast->GetNLocalMaxima());
64  AliTPCCalPad* calPadMean = new AliTPCCalPad(*calFast->GetMeanCharge());
65  AliTPCCalPad* calPadMax = new AliTPCCalPad(*calFast->GetMaxCharge());
66  AliTPCCalPad* calNTime = new AliTPCCalPad(*calFast->GetNTimeBins());
67  AliTPCCalPad* calNPad = new AliTPCCalPad(*calFast->GetNPads());
68  AliTPCCalPad* calTimePos = new AliTPCCalPad(*calFast->GetTimePosition());
69  //
70  calPadNoThr ->SetName(Form("%sFast", calPadNoThr->GetName()));
71  calPadThr10 ->SetName(Form("%sFast", calPadThr10->GetName()));
72  calPadThr20 ->SetName(Form("%sFast", calPadThr20->GetName()));
73  calPadThr30 ->SetName(Form("%sFast", calPadThr30->GetName()));
74  calNLocal ->SetName(Form("%sFast", calNLocal ->GetName()));
75  calPadMean ->SetName(Form("%sFast", calPadMean ->GetName()));
76  calPadMax ->SetName(Form("%sFast", calPadMax ->GetName()));
77  calNTime ->SetName(Form("%sFast", calNTime ->GetName()));
78  calNPad ->SetName(Form("%sFast", calNPad ->GetName()));
79  calTimePos ->SetName(Form("%sFast", calTimePos ->GetName()));
80 
81  preprocesor.AddComponent(calPadNoThr );
82  preprocesor.AddComponent(calPadThr10 );
83  preprocesor.AddComponent(calPadThr20 );
84  preprocesor.AddComponent(calPadThr30 );
85  preprocesor.AddComponent(calNLocal );
86  preprocesor.AddComponent(calPadMean );
87  preprocesor.AddComponent(calPadMax );
88  preprocesor.AddComponent(calNTime );
89  preprocesor.AddComponent(calNPad );
90  preprocesor.AddComponent(calTimePos );
91 
92  preprocesor.DumpToFile("CalibTreeTestAnalyse.root");
93  AliTPCCalibViewerGUI::ShowGUI("CalibTreeTestAnalyse.root");
94 }
95 
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
AliTPCCalPad * GetMaxCharge() const
Definition: AliTPCdataQA.h:60
AliTPCCalPad * GetNTimeBins() const
Definition: AliTPCdataQA.h:66
AliTPCCalPad * GetTimePosition() const
Definition: AliTPCdataQA.h:68
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
AliTPCCalPad * GetOverThreshold30() const
Definition: AliTPCdataQA.h:65
AliTPCCalPad * GetNPads() const
Definition: AliTPCdataQA.h:67
static TObjArray * ShowGUI(const char *fileName=0)
AliTPCCalPad * GetMeanCharge() const
Definition: AliTPCdataQA.h:61
void DumpToFile(const char *fileName)
void SetRangeTime(Int_t tMin, Int_t tMax)
Definition: AliTPCdataQA.h:106
Preprocessor class for HLT and DAQ.
AliTPCCalPad * GetNLocalMaxima() const
Definition: AliTPCdataQA.h:62
Bool_t ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3)
void testDataQA(Char_t *fileName, Int_t maxevent=10)
Definition: testDataQA.C:10
AliTPCCalPad * GetNoThreshold() const
Definition: AliTPCdataQA.h:59
AliTPCCalPad * GetOverThreshold20() const
Definition: AliTPCdataQA.h:64
AliTPCCalPad * GetOverThreshold10() const
Definition: AliTPCdataQA.h:63