]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/TOFda.cxx
reducing macro to minimum AliReconstruction functionality, disable QA and TriggerESD...
[u/mrichter/AliRoot.git] / TOF / TOFda.cxx
index b0a2a6dfdad97c87f14f17077f9357151d98e8b5..df296c60529f7393f0933cb72029c51972d6b481 100644 (file)
@@ -2,6 +2,15 @@
 
 TOF DA for online calibration
 
+Contact: Chiara.Zampolli@bo.infn.it
+Link: www.bo.infn.it/~zampolli
+Run Type: PHYSICS
+DA Type: MON
+Number of events needed: depending on the run, being run-level
+Input Files: TOFdaTotal.root, to be updated if existing
+Output Files: TOFdaRun.root, TOFdaTotal.root, both to be exported to the DAQ FXS
+Trigger types used: PHYSICS_EVENT
+
 */
 
 #define FILE_TOTAL "TOFdaTotal.root"
@@ -17,7 +26,6 @@ TOF DA for online calibration
 #include <AliRawReaderDate.h>
 #include <AliRawReader.h>
 #include <AliTOFGeometry.h>
-#include <AliTOFGeometryV5.h>
 #include <AliT0RawReader.h>
 #include <AliDAQ.h>
 #include <AliTOFHitData.h>
@@ -30,6 +38,8 @@ TOF DA for online calibration
 #include <TObject.h>
 #include <TMath.h>
 #include <TSystem.h>
+#include "TROOT.h"
+#include "TPluginManager.h"
 
 
 /* Main routine
@@ -39,10 +49,16 @@ TOF DA for online calibration
 
 int main(int argc, char **argv) {
   
-  AliTOFGeometry * geomV5 = new AliTOFGeometryV5();
+  /* magic line from Rene */
+  gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
+                    "*",
+                    "TStreamerInfo",
+                    "RIO",
+                    "TStreamerInfo()");
+
   AliTOFGeometry * geom = new AliTOFGeometry();
 
-  static const Int_t size = geomV5->NPadXSector()*geomV5->NSectors();
+  static const Int_t size = AliTOFGeometry::NPadXSector()*AliTOFGeometry::NSectors();
   static const Int_t nbins = 500;
   static const Int_t binmin = -20;
   const Float_t c = 2.99792458E10; //speed of light
@@ -135,19 +151,23 @@ int main(int argc, char **argv) {
       AliT0RawReader *rawReaderT0 = new AliT0RawReader(rawReader,kTRUE);
       if (!rawReaderT0->Next()) {
         printf("T0: no raw data found!\n");
-      } else {
-        Int_t allData[110][5];
-        for (Int_t i=0; i<110; i++) {
+      } 
+      else {
+       /*
+        Int_t allData[105][5];
+        for (Int_t i=0; i<105; i++) {
          allData[i][0]=rawReaderT0->GetData(i,0);
-        }
+       }
         meantime = allData[49][0];
-        //printf("time zero (ns) = %i (%f) \n", meantime, meantime*25*1E-3-200);
+       */
+        meantime = rawReaderT0->GetData(49,0);
+       //        printf("time zero (ns) = %i (%f) \n", meantime, (meantime*24.4-200)*1E-3);   // debugging purpose
       }
       
       delete rawReaderT0;
       rawReaderT0 = 0x0;
       rawReader->Reset();
-
+      
       //TOF event
       Int_t dummy = -1;
       Int_t Volume[5];
@@ -196,9 +216,9 @@ int main(int argc, char **argv) {
            Volume[3] = Volume[4];
            Volume[4] = dummy;
            Int_t tof = (Int_t)((Double_t)HitData->GetTime()*1E3/AliTOFGeometry::TdcBinWidth());
-           Int_t index = rawStreamTOF->GetIndex(Volume);
+           Int_t index = geom->GetIndex(Volume);
            Float_t pos[3];
-           geomV5->GetPosPar(Volume,pos);
+           geom->GetPosPar(Volume,pos);
            Float_t texp=TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2])/c*1E9; //expected time in ns
            Float_t texpBin=(texp*1E3-32)/AliTOFGeometry::TdcBinWidth(); //expected time in number of TDC bin
            Int_t deltabin = tof-TMath::Nint(texpBin);   //to be used with real data; rounding expected time to Int_t
@@ -236,8 +256,6 @@ int main(int argc, char **argv) {
     }
   }
   
-  delete geomV5;
-  geomV5 = 0x0;
   delete geom;
   geom = 0x0;
 
@@ -308,10 +326,10 @@ int main(int argc, char **argv) {
   status=0;
 
   /* export file to FXS */
-  if (daqDA_FES_storeFile(FILE_RUN, FILE_RUN)) {
+  if (daqDA_FES_storeFile(FILE_RUN, "RUNLevel")) {
     status=-2;
   }
-  if (daqDA_FES_storeFile(FILE_TOTAL, FILE_TOTAL)) {
+  if (daqDA_FES_storeFile(FILE_TOTAL, "DELAYS")) {
     status=-2;
   }