X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FTRDVDRIFTda.cxx;h=516eaaae22a470af82b040d16b38ade1f0628f45;hb=64129b355d10efd75096de85219ac3997c7ca660;hp=b6c60d585fa0e38d9210aa4e01f09098862e9985;hpb=289cc63762b21bbf75987ea9f506511e2e428730;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/TRDVDRIFTda.cxx b/TRD/TRDVDRIFTda.cxx index b6c60d585fa..516eaaae22a 100644 --- a/TRD/TRDVDRIFTda.cxx +++ b/TRD/TRDVDRIFTda.cxx @@ -1,27 +1,19 @@ /* - -TRDda.cxx - calibration algorithm to be run on monitoring server -DAcase2.c - -AliTRDCalibraFillHisto - average pulse height/ vdrift calibration -AliTRDCalibPadStatus - pad status calibration - - -This program connects to the DAQ data source passed as argument -and populates local "./result.txt" file with the ids of events received -during the run. - -The program exits when being asked to shut down (daqDA_checkshutdown) -or End of Run event. - -Messages on stdout are exported to DAQ log system. - -contact: alice-datesupport@cern.ch +Contact: r.bailhache@gsi.de +Link: +Reference run: 25909 +Run Type: PHYSICS STANDALONE +DA Type: MON +Number of events needed: many +Input Files: TRD raw files +Output Files: trdCalibrationv.root +Trigger types used: PHYSICS_EVENT */ -#define RESULT_FILE "trdCalibrationv.root" +#define RESULT_FILE "trdVdrift.root" +#define FILE_ID "VDRIFT" extern "C" { @@ -40,24 +32,30 @@ extern "C" { #include #include #include -#include #include #include #include +#include "TROOT.h" +#include "TPluginManager.h" // //AliRoot includes // #include "AliRawReader.h" #include "AliRawReaderDate.h" -#include "AliTRDRawStreamV2.h" -#include "AliCDBManager.h" +#include "AliLog.h" + +// +//AMORE +// +#include // // TRD calibration algorithm includes // #include "AliTRDCalibraFillHisto.h" - +//functions, implementation below +//void SendToAmoreDB(TObject *o, unsigned long32 runNb); /* Main routine @@ -66,6 +64,12 @@ extern "C" { */ int main(int argc, char **argv) { + /* magic line from Rene */ + gROOT->GetPluginManager()->AddHandler("TVirtualStreamerInfo", + "*", + "TStreamerInfo", + "RIO", + "TStreamerInfo()"); int status; if (argc!=2) { @@ -102,18 +106,24 @@ int main(int argc, char **argv) { /* init some counters */ int nevents_physics=0; int nevents_total=0; + //unsigned long32 runNb=0; //run number - //Instance of AliCDBManager: needed by AliTRDRawStreamV2 - AliCDBManager *man = AliCDBManager::Instance(); - man->SetDefaultStorage("local://$ALICE_ROOT"); - man->SetRun(0); + //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 + //AliTRDrawFastStream::DisableSkipData(); + AliLog::SetGlobalLogLevel(AliLog::kFatal); + /* main loop (infinite) */ for(;;) { //for(Int_t k = 0; k < 20; k++) { @@ -140,7 +150,8 @@ int main(int argc, char **argv) { continue; } - if( ((Int_t)nevents_total)%100 == 0 ) printf(" event number %d (physic event number %d) will be processed\n",(Int_t) nevents_total,(Int_t) nevents_physics); + 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 */ @@ -152,15 +163,19 @@ int main(int argc, char **argv) { if ((eventT==PHYSICS_EVENT) && (passvdrift)) { //if (eventT==PHYSICS_EVENT) { AliRawReader *rawReader = new AliRawReaderDate((void*)event); - AliTRDRawStreamV2 *trdRawStream = new AliTRDRawStreamV2((AliRawReader *) rawReader); - Int_t result = calibra->ProcessEventDAQ(trdRawStream,(Bool_t)nevents_physics); + rawReader->Select("TRD"); + + Int_t result = calibra->ProcessEventDAQ((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){ @@ -168,6 +183,13 @@ int main(int argc, char **argv) { } + /* + if( ((Int_t)nevents_physics)%100 == 0 ) { + SendToAmoreDB(&calibra); + } + */ + + nevents_total++; @@ -200,9 +222,28 @@ int main(int argc, char **argv) { fileTRD->Close(); status=0; // Export the file in any case to see if problems - if(daqDA_FES_storeFile(RESULT_FILE,RESULT_FILE)) status = -2; + if(daqDA_FES_storeFile(RESULT_FILE,FILE_ID)) status = -2; delete fileTRD; 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); + } +*/ + +