]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/TRDVDRIFTda.cxx
Removal of old raw reader calls (Raphaelle)
[u/mrichter/AliRoot.git] / TRD / TRDVDRIFTda.cxx
index 03f77de7b7049b1a67c7b4128997c7e6f6ee8322..97748453aaac6ef867a66910f31f239dd4325b69 100644 (file)
@@ -42,16 +42,22 @@ extern "C" {
 //
 #include "AliRawReader.h"
 #include "AliRawReaderDate.h"
-#include "AliTRDrawStream.h"
-#include "AliTRDrawStreamBase.h"
+//#include "AliTRDrawFastStream.h"
+//#include "AliTRDrawStreamBase.h"
+#include "AliLog.h"
 
+//
+//AMORE
+//
+#include <AmoreDA.h>
 
 //
 // TRD calibration algorithm includes
 //
 #include "AliTRDCalibraFillHisto.h"
 
-
+//functions, implementation below
+//void SendToAmoreDB(TObject *o, unsigned long32 runNb);
 
 
 /* Main routine
@@ -100,36 +106,26 @@ int main(int argc, char **argv) {
 
 
   /* init some counters */
-  int neventsphysics=0;
-  int neventstotal=0;
+  int nevents_physics=0;
+  int nevents_total=0;
+  //unsigned long32 runNb=0;      //run number
 
-  //Instance of AliCDBManager: needed by AliTRDrawStream
+  //Instance of AliCDBManager: needed by AliTRDrawFastStream
   //AliCDBManager *man = AliCDBManager::Instance();
   //man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   //man->SetRun(0);
   //Instance of AliTRDCalibraFillHisto
   AliTRDCalibraFillHisto *calibra      = AliTRDCalibraFillHisto::Instance();
   calibra->SetNumberClustersProcent(0.9);
+
   // everythings are okey for vdrift
   Bool_t passvdrift  = kTRUE;    // if timebin okey
   Int_t  nbvdrift    = 0;     // number of events with entries for vdrift
 
    // setting
-  // AliTRDrawStream::SetNoDebug();
-  AliTRDrawStream::DisableSkipData();
-  AliTRDrawStream::SetNoErrorWarning();
-  //AliTRDrawStream::SetSubtractBaseline(0); 
-  //AliTRDrawStream::SetForceCleanDataOnly();
-  //AliTRDrawStream::AllowCorruptedData();
-  //AliTRDrawStream::DisableStackNumberChecker();
-  //AliTRDrawStream::DisableStackLinkNumberChecker();
-  //AliTRDrawStream::SetSkipCDH();
-  //AliTRDrawStream::SetExtraWordsFix();
-  //AliTRDrawStream::EnableDebugStream();
-  //AliTRDrawStream::SetDumpHead(320);
-  //AliTRDrawStream::SetDumpHead(80);
-
-  
+  //AliTRDrawFastStream::DisableSkipData();
+  AliLog::SetGlobalLogLevel(AliLog::kFatal); 
+    
   /* main loop (infinite) */
   for(;;) {
   //for(Int_t k = 0; k < 20; k++) {
@@ -156,7 +152,9 @@ int main(int argc, char **argv) {
       continue;
     }
 
-    if( ((Int_t)neventstotal)%1000 == 0 ) printf(" event number %d (physic event number %d) will be processed\n",(Int_t) neventstotal,(Int_t) neventsphysics);  
+    if( ((Int_t)nevents_total)%1000 == 0 ) printf(" event number %d (physic event number %d) will be processed\n",(Int_t) nevents_total,(Int_t) nevents_physics);  
+
+
 
     /* use event - here, just write event id to result file */
     eventT=event->eventType;
@@ -168,23 +166,33 @@ int main(int argc, char **argv) {
       //if (eventT==PHYSICS_EVENT) {
       AliRawReader *rawReader = new AliRawReaderDate((void*)event);
       rawReader->Select("TRD");
-      AliTRDrawStream *trdRawStream = new AliTRDrawStream((AliRawReader *) rawReader);
-      Int_t result = calibra->ProcessEventDAQ((AliTRDrawStreamBase *) trdRawStream,(Bool_t)nbvdrift);
+
+      Int_t result = calibra->ProcessEventDAQ2((AliRawReader *)rawReader);
       if(!result) passvdrift = kFALSE;
       else nbvdrift += (Int_t) result/2;
              
-      delete trdRawStream;
+
       delete rawReader;
     
     } 
+
+    // get the run number
+    //runNb = event->eventRunNb;
    
     if(eventT==PHYSICS_EVENT){
  
-      neventsphysics++;
+      nevents_physics++;
      
     }
     
-    neventstotal++;
+    /*
+      if( ((Int_t)nevents_physics)%100 == 0 ) {
+      SendToAmoreDB(&calibra);
+      }
+    */
+
+    
+    nevents_total++;
 
 
     /* free resources */
@@ -199,7 +207,7 @@ int main(int argc, char **argv) {
 
 
   /* report progress */
-  printf("%d events processed and %d used\n",neventstotal,nbvdrift);
+  printf("%d events processed and %d used\n",nevents_total,nbvdrift);
   
   //
   // Write a local file and put it on the FX 
@@ -223,3 +231,21 @@ int main(int argc, char **argv) {
   return status;
 }
 
+/*
+  void SendToAmoreDB(TObject *o)
+  {
+  //AMORE
+  const char *amoreDANameorig=gSystem->Getenv("AMORE_DA_NAME");
+  gSystem->Setenv("AMORE_DA_NAME","TRD-dataQA");
+  
+  amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
+  Int_t statusDA=0;
+  statusDA+=amoreDA.Send("DataQA-VDRIFT",o);
+  if ( statusDA!=0 )
+  printf("Waring: Failed to write one of the calib objects to the AMORE database\n");
+  // reset env var
+  if (amoreDANameorig) gSystem->Setenv("AMORE_DA_NAME",amoreDANameorig);
+  } 
+*/
+
+