]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/TRDPEDESTALda.cxx
Fix for memory leaks in digits TClonesArrays (Matevz)
[u/mrichter/AliRoot.git] / TRD / TRDPEDESTALda.cxx
index 30aab9a01821a6ee8a62481c081aa508b5c5bc4d..195a7047c081ff71aef8e95c51aebbdba2b5a375 100644 (file)
@@ -8,7 +8,7 @@ DA Type: LDC
 Number of events needed: 100
 Input Files: TRD raw files
 Output Files: trdCalibration.root
-Trigger types used:
+Trigger types used: PHYSICS_EVENT
 
 */
 
@@ -36,7 +36,7 @@ extern "C" {
 //
 #include "AliRawReader.h"
 #include "AliRawReaderDate.h"
-#include "AliTRDrawStreamTB.h"
+#include "AliTRDrawStream.h"
 #include "AliTRDrawStreamBase.h"
 #include "AliCDBManager.h"
 //
@@ -81,29 +81,31 @@ int main(int argc, char **argv) {
   
 
   /* init some counters */
-  int nevents_total=0;
+  int neventstotal=0;
   int nevents      =0;
  
   //Instance of AliCDBManager: needed by AliTRDRawStream
   //AliCDBManager *man = AliCDBManager::Instance();
-  //man->SetDefaultStorage("local://$ALICE_ROOT");
+  //man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   //man->SetRun(0);
   // AliTRDCalibPadStatus object
   AliTRDCalibPadStatus calipad = AliTRDCalibPadStatus();
   Bool_t passpadstatus = kTRUE;
 
   // setting
-  // AliTRDrawStreamTB::SetNoDebug();
-  AliTRDrawStreamTB::SetNoErrorWarning();
-  //AliTRDrawStreamTB::SetForceCleanDataOnly();
-  AliTRDrawStreamTB::AllowCorruptedData();
-  AliTRDrawStreamTB::DisableStackNumberChecker();
-  AliTRDrawStreamTB::DisableStackLinkNumberChecker();
-  //AliTRDrawStreamTB::SetSkipCDH();
-  //AliTRDrawStreamTB::SetExtraWordsFix();
-  //AliTRDrawStreamTB::EnableDebugStream();
-  //AliTRDrawStreamTB::SetDumpHead(320);
-  //AliTRDrawStreamTB::SetDumpHead(80);
+  // 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);
 
   /* read the data files */
   int n;
@@ -120,6 +122,7 @@ int main(int argc, char **argv) {
     /* read the file  until EOF */
     for(;;) {
       struct eventHeaderStruct *event;
+      eventTypeType eventT;
       
       /* get next event */
       status=monitorGetEventDynamic((void **)&event);
@@ -137,11 +140,14 @@ int main(int argc, char **argv) {
         break;
       }
 
-      if(passpadstatus){
+      /* use event - here, just write event id to result file */
+      eventT=event->eventType;
+
+      if((eventT==PHYSICS_EVENT) && (passpadstatus)){
 
        AliRawReader *rawReader = new AliRawReaderDate((void*)event);
        rawReader->Select("TRD");
-       AliTRDrawStreamTB *trdRawStream = new AliTRDrawStreamTB((AliRawReader *)rawReader);
+       AliTRDrawStream *trdRawStream = new AliTRDrawStream((AliRawReader *)rawReader);
        Int_t result = calipad.ProcessEvent((AliTRDrawStreamBase *)trdRawStream,0);
        // 0 error, 1 no input, 2 output
        if(result == 2) nevents++;
@@ -151,7 +157,7 @@ int main(int argc, char **argv) {
       
       }
 
-      nevents_total++;
+      neventstotal++;
 
       /* free resources */
       free(event);
@@ -160,7 +166,7 @@ int main(int argc, char **argv) {
 
 
   /* report progress */
-  printf("%d events processed and %d used\n",nevents_total,nevents);
+  printf("%d events processed and %d used\n",neventstotal,nevents);
 
   /* write file in any case to see what happens in case of problems*/
   TFile *fileTRD = new TFile(RESULT_FILE,"recreate");
@@ -179,3 +185,4 @@ int main(int argc, char **argv) {
   
   return status;
 }
+