]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to write output to ASCII file (Christian Lippman)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Oct 2007 11:56:03 +0000 (11:56 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 19 Oct 2007 11:56:03 +0000 (11:56 +0000)
TPC/TPCPEDESTALda.cxx

index 34d742e50895cdd6de22a6f7cbc35eb79e8ab8d3..68c64a2099f857697d451ed559c257431ed8d8fb 100644 (file)
@@ -22,6 +22,7 @@ extern "C" {
 #include "monitor.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include <fstream.h>
 
 //
 //Root includes
@@ -33,6 +34,7 @@ extern "C" {
 //
 #include "AliRawReader.h"
 #include "AliRawReaderDate.h"
+#include "AliTPCmapper.h"
 #include "AliTPCRawStream.h"
 #include "AliTPCROC.h"
 #include "AliTPCCalROC.h"
@@ -129,5 +131,34 @@ int main(int argc, char **argv) {
   delete fileTPC;
   printf("Wrote %s\n",RESULT_FILE);
 
+  // Prepare files for local ALTRO configuration through DDL
+  AliTPCmapper mapping;
+
+  ofstream out;
+  char filename[255];
+  sprintf(filename,"Pedestals.data");
+  out.open(filename);
+
+  Int_t ctr = 0;
+
+  out << 10 << endl;  // PEDESTALS
+  for ( int roc = 0; roc <= 71; roc++ ) {
+    if ( !calibPedestal.GetCalRocPedestal(roc) ) continue;
+    Int_t side = mapping.GetSideFromRoc(roc);
+    Int_t sec  = mapping.GetSectorFromRoc(roc);
+    printf("**Analysing ROC %d (side %d, sector %d) ...\n", roc, side, sec);
+    for ( int row = 0; row < mapping.GetNpadrows(roc); row++ ) {
+      for ( int pad = 0; pad < mapping.GetNpads(roc, row); pad++ ) {
+       Int_t rcu   = mapping.GetRcu(roc, row, pad);
+       Int_t hwadd = mapping.GetHWAddress(roc, row, pad);
+       Float_t ped   = calibPedestal.GetCalRocPedestal(roc)->GetValue(row,pad);
+       out << ctr << "\t" << side << "\t" << sec << "\t" << rcu << "\t" << hwadd << "\t" << ped << std::endl;
+       ctr++;
+      }
+    }
+  }
+
+  out.close();
+
   return status;
 }