/*
-TRDPEDESTALda.cxx - calibration algorithm for the pedestal to be run in parallel on the LDCs
-DAcase1.c
-
-
-AliTRDCalibPadStatus - pad status calibration
-
-This program reads the DAQ data files passed as argument using the monitoring library.
-
-It fills a TRD calib object AliTRDCalibPadStatus and write it in a local file trdPedestal.root before
-exporting it to the file exchange server.
-
-Messages on stdout are exported to DAQ log system.
-
-contact: alice-datesupport@cern.ch
+Contact: r.bailhache@gsi.de
+Link:
+Reference run: 12170
+Run Type: PEDESTAL
+DA Type: LDC
+Number of events needed: 100
+Input Files: TRD raw files
+Output Files: trdCalibration.root
+Trigger types used:
*/
-#define RESULT_FILE "trdCalibration.root"
+#define RESULT_FILE "trdPedestal.root"
+#define FILE_ID "PADSTATUS"
extern "C" {
#include <daqDA.h>
//
#include <TFile.h>
#include <TStopwatch.h>
-
+#include "TROOT.h"
+#include "TPluginManager.h"
//
// AliRoot includes
//
#include "AliRawReader.h"
#include "AliRawReaderDate.h"
-#include "AliTRDRawStreamV2.h"
+#include "AliTRDrawStreamTB.h"
+#include "AliTRDrawStreamBase.h"
#include "AliCDBManager.h"
//
// AliRoot TRD calib classes
*/
int main(int argc, char **argv) {
+ /* magic line from Rene */
+ gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo",
+ "*",
+ "TStreamerInfo",
+ "RIO",
+ "TStreamerInfo()");
+
int status;
int nevents =0;
//Instance of AliCDBManager: needed by AliTRDRawStream
- AliCDBManager *man = AliCDBManager::Instance();
- man->SetDefaultStorage("local://$ALICE_ROOT");
- man->SetRun(0);
+ //AliCDBManager *man = AliCDBManager::Instance();
+ //man->SetDefaultStorage("local://$ALICE_ROOT");
+ //man->SetRun(0);
// AliTRDCalibPadStatus object
AliTRDCalibPadStatus calipad = AliTRDCalibPadStatus();
Bool_t passpadstatus = kTRUE;
-
- /*see the time*/
- TStopwatch timer;
- timer.Start();
-
+ // 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);
/* read the data files */
int n;
if(passpadstatus){
AliRawReader *rawReader = new AliRawReaderDate((void*)event);
- AliTRDRawStreamV2 *trdRawStream = new AliTRDRawStreamV2((AliRawReader *)rawReader);
- if(!calipad.ProcessEvent(trdRawStream,(Bool_t)nevents_total)) passpadstatus = kFALSE;
+ rawReader->Select("TRD");
+ AliTRDrawStreamTB *trdRawStream = new AliTRDrawStreamTB((AliRawReader *)rawReader);
+ //trdRawStream->Init();
+ if(!calipad.ProcessEvent((AliTRDrawStreamBase *)trdRawStream,(Bool_t)nevents_total)) passpadstatus = kFALSE;
nevents++;
delete trdRawStream;
delete rawReader;
/* report progress */
printf("%d events processed and %d used\n",nevents_total,nevents);
- /*see the time*/
- timer.Stop();
- timer.Print();
-
/* write file in any case to see what happens in case of problems*/
- /*see the time*/
- TStopwatch timer1;
- timer1.Start();
TFile *fileTRD = new TFile(RESULT_FILE,"recreate");
calipad.AnalyseHisto();
calipad.Write("calibpadstatus");
fileTRD->Close();
- printf("Wrote local file %s\n",RESULT_FILE);
- /*see the time*/
- timer1.Stop();
- timer1.Print();
-
+
/* store the result file on FES */
- status=daqDA_FES_storeFile(RESULT_FILE,RESULT_FILE);
+ status=daqDA_FES_storeFile(RESULT_FILE,FILE_ID);
if (status) {
printf("Failed to export file : %d\n",status);
return -1;
}
-
-
- /* report progress */
- daqDA_progressReport(100);
return status;