]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TPC/AliTPCdataQA.cxx
Adding possibility to use only local maximas
[u/mrichter/AliRoot.git] / TPC / AliTPCdataQA.cxx
index 45549361afff7140ad61d9f06454b0572f9e16a0..2e9ff87f41c007716ab36dc27c6047b08e21401b 100644 (file)
@@ -45,16 +45,18 @@ using namespace std;
 //date
 #include "event.h"
 #include "AliTPCCalPad.h"
+#include "AliTPCPreprocessorOnline.h"
 
 //header file
 #include "AliTPCdataQA.h"
 
 ClassImp(AliTPCdataQA)
 
-AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/
-  TObject(),
+AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/  
+  TH1F("TPCRAW","TPCRAW",100,0,100),
   fFirstTimeBin(60),
   fLastTimeBin(1000),
+  fMaxTime(1100),
   fAdcMin(1),
   fAdcMax(100),
   fOldRCUformat(kTRUE),
@@ -87,9 +89,10 @@ AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/
 
 //_____________________________________________________________________
 AliTPCdataQA::AliTPCdataQA(const AliTPCdataQA &ped) : /*FOLD00*/
-  TObject(ped),
+  TH1F(ped),
   fFirstTimeBin(ped.GetFirstTimeBin()),
   fLastTimeBin(ped.GetLastTimeBin()),
+  fMaxTime(ped.fMaxTime),
   fAdcMin(ped.GetAdcMin()),
   fAdcMax(ped.GetAdcMax()),
   fOldRCUformat(ped.fOldRCUformat),
@@ -415,7 +418,6 @@ void AliTPCdataQA::Analyse()
   }
 
   Int_t nTimeBins = fLastTimeBin - fFirstTimeBin +1;
-  
   cout << "EventCounter: " << fEventCounter << endl
        << "TimeBins: " << nTimeBins << endl;
 
@@ -429,3 +431,73 @@ void AliTPCdataQA::Analyse()
   if (fOverThreshold20) fOverThreshold20->Multiply(normalization);  
   if (fOverThreshold30) fOverThreshold30->Multiply(normalization);  
 }
+
+
+void AliTPCdataQA::MakeTree(const char *fname){
+  //
+  // Export result to the tree -located in the file
+  // This file can be analyzed using AliTPCCalibViewer
+  // 
+  AliTPCdataQA *ped = this;
+  AliTPCPreprocessorOnline preprocesor;
+  if (ped->GetMaxCharge()) preprocesor.AddComponent(ped->GetMaxCharge());  
+  if (ped->GetMeanCharge()) preprocesor.AddComponent(ped->GetMeanCharge());  
+  if (ped->GetOverThreshold0()) preprocesor.AddComponent(ped->GetOverThreshold0());
+  if (ped->GetOverThreshold5()) preprocesor.AddComponent(ped->GetOverThreshold5());
+  if (ped->GetOverThreshold10()) preprocesor.AddComponent(ped->GetOverThreshold10());
+  if (ped->GetOverThreshold20()) preprocesor.AddComponent(ped->GetOverThreshold20());
+  if (ped->GetOverThreshold30()) preprocesor.AddComponent(ped->GetOverThreshold30());
+  preprocesor.DumpToFile(fname);  
+}
+
+
+
+void AliTPCdataQA::MakeArrays(){
+  //
+  //
+  //
+  AliTPCROC * roc = AliTPCROC::Instance();
+  //
+  Int_t nRowsMax = roc->GetNRows(roc->GetNSector()-1);
+  Int_t nPadsMax = roc->GetNPads(roc->GetNSector()-1,nRowsMax-1);
+  fAllBins = new Float_t*[nRowsMax];
+  fAllSigBins = new Int_t*[nRowsMax];
+  fAllNSigBins = new Int_t[nRowsMax];
+  for (Int_t iRow = 0; iRow < nRowsMax; iRow++) {
+    //
+    Int_t maxBin = fMaxTime*(nPadsMax+6);  // add 3 virtual pads  before and 3 after
+    fAllBins[iRow] = new Float_t[maxBin];
+    memset(fAllBins[iRow],0,sizeof(Float_t)*maxBin);
+    fAllSigBins[iRow] = new Int_t[maxBin];
+    fAllNSigBins[iRow]=0;
+  }
+}
+
+
+void AliTPCdataQA::CleanArrays(){
+  //
+  //
+  //
+  AliTPCROC * roc = AliTPCROC::Instance();
+  //
+  Int_t nRowsMax = roc->GetNRows(roc->GetNSector()-1);
+  Int_t nPadsMax = roc->GetNPads(roc->GetNSector()-1,nRowsMax-1); 
+  for (Int_t iRow = 0; iRow < nRowsMax; iRow++) {
+    //
+    Int_t maxBin = fMaxTime*(nPadsMax+6);  // add 3 virtual pads  before and 3 after
+    memset(fAllBins[iRow],0,sizeof(Float_t)*maxBin);
+    fAllNSigBins[iRow]=0;
+  }
+}
+
+Float_t* AliTPCdataQA::GetExpandDigit(Int_t row, Int_t pad, Int_t time){
+  //
+  //
+  //
+  AliTPCROC * roc = AliTPCROC::Instance();
+  Int_t nRowsMax = roc->GetNRows(roc->GetNSector()-1);
+  if (row<0 || row>nRowsMax) return 0;
+  Int_t nPadsMax = roc->GetNPads(roc->GetNSector()-1,nRowsMax-1); 
+  
+}