X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FEMCALLEDda.cxx;h=65bfca6c1cbc97a0a9b5df29c12be94d0d64a714;hb=27d01a0d1e8e549f88357eff419756b310312be3;hp=d2baa2e7b82aae75c15bc12c3071940f459671b7;hpb=4d4676b30f69ca168f4d568f5b4ff58c8f2d2b9c;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/EMCALLEDda.cxx b/EMCAL/EMCALLEDda.cxx index d2baa2e7b82..65bfca6c1cb 100644 --- a/EMCAL/EMCALLEDda.cxx +++ b/EMCAL/EMCALLEDda.cxx @@ -8,8 +8,7 @@ Input Files: argument list Output Files: RESULT_FILE=EMCALLED.root, to be exported to the DAQ FXS fileId: FILE_ID=EMCALLED - Trigger types used: CALIBRATION_EVENT (temporarily also PHYSICS_EVENT to start with) - [When we have real data files later, we should only use CALIBRATION_EVENT] + Trigger types used: CALIBRATION_EVENT */ /* This process reads RAW data from the files provided as command line arguments @@ -18,9 +17,8 @@ */ #define RESULT_FILE "EMCALLED.root" -#define FILE_ID "EMCALLED" +#define FILE_ID "signal" #define AliDebugLevel() -1 -#define FILE_PEDClassName "emcCalibPedestal" #define FILE_SIGClassName "emcCalibSignal" const int kNRCU = 4; /* LOCAL_DEBUG is used to bypass daq* calls that do not work locally */ @@ -46,14 +44,14 @@ extern "C" { #include "AliRawReader.h" #include "AliRawReaderDate.h" #include "AliRawEventHeaderBase.h" -#include "AliCaloRawStream.h" +#include "AliCaloRawStreamV3.h" #include "AliCaloAltroMapping.h" #include "AliLog.h" +#include "AliDAQ.h" // // EMC calibration-helper algorithm includes // -#include "AliCaloCalibPedestal.h" #include "AliCaloCalibSignal.h" /* @@ -61,9 +59,9 @@ extern "C" { Arguments: list of DATE raw data files */ -int main(int argc, char **argv) { +int main(int argc, char **argv) { // Main routine, EMC signal detector algorithm - AliLog::SetClassDebugLevel("AliCaloRawStream",-5); + AliLog::SetClassDebugLevel("AliCaloRawStreamV3",-5); AliLog::SetClassDebugLevel("AliRawReaderDate",-5); AliLog::SetModuleDebugLevel("RAW",-5); @@ -78,11 +76,13 @@ int main(int argc, char **argv) { "TStreamerInfo", "RIO", "TStreamerInfo()"); - + int i, status; - + /* log start of process */ printf("EMCAL DA started - %s\n",__FILE__); + + Int_t emcID = AliDAQ::DetectorID("EMCAL"); // bit 18.. /* declare monitoring program */ status=monitorDeclareMp( __FILE__ ); @@ -93,10 +93,10 @@ int main(int argc, char **argv) { /* define wait event timeout - 1s max */ monitorSetNowait(); monitorSetNoWaitNetworkTimeout(1000); - + /* Retrieve mapping files from DAQ DB */ - const char* mapFiles[kNRCU] = {"RCU0A.data","RCU1A.data","RCU0C.data","RCU1C.data"}; - + const char* mapFiles[kNRCU] = {"RCU0A.data","RCU1A.data","RCU0C.data","RCU1C.data"}; + for(Int_t iFile=0; iFileSetAltroMapping( mapping ); AliCaloCalibSignal * calibSignal = new AliCaloCalibSignal(AliCaloCalibSignal::kEmCal); calibSignal->SetAltroMapping( mapping ); - + calibSignal->SetParametersFromFile( parameterFile ); + AliRawReader *rawReader = NULL; int nevents=0; - + /* loop over RAW data files */ for ( i=1; ieventType; /* just convenient shorthand */ - - /* skip start/end of run events */ - if ( (eventT != physicsEvent) && (eventT != calibrationEvent) ) { + /* only look at calibration events */ + if ( eventT != calibrationEvent ) { + free(event); + continue; + } + + /* only look at events where EMCAL was included */ + if (! TEST_DETECTOR_IN_PATTERN(event->eventDetectorPattern, emcID) ) { + free(event); continue; } nevents++; // count how many acceptable events we have - + // Signal calibration rawReader = new AliRawReaderDate((void*)event); + calibSignal->SetRunNumber(event->eventRunNb); calibSignal->ProcessEvent(rawReader); - rawReader->Reset(); - calibPedestal->ProcessEvent(rawReader); delete rawReader; - + /* free resources */ free(event); - + } //until EOF } // loop over files - + + // calculate average values also, for the LED info + calibSignal->SetUseAverage(kTRUE); + calibSignal->Analyze(); + + // by default, we only save the full info in debug mode +#ifdef LOCAL_DEBUG +#else + // reset the full trees, when we are not in debug mode + calibSignal->GetTreeAmpVsTime()->Reset(); + calibSignal->GetTreeLEDAmpVsTime()->Reset(); +#endif + // // write class to rootfile // - - printf ("%d physics/calibration events processed.\n",nevents); - + + printf ("%d calibration events processed.\n",nevents); + TFile f(RESULT_FILE, "recreate"); if (!f.IsZombie()) { f.cd(); - calibPedestal->Write(FILE_PEDClassName); calibSignal->Write(FILE_SIGClassName); f.Close(); - printf("Objects saved to file \"%s\" as \"%s\" and \"%s\".\n", - RESULT_FILE, FILE_PEDClassName, FILE_SIGClassName); + printf("Objects saved to file \"%s\" as \"%s\".\n", + RESULT_FILE, FILE_SIGClassName); } else { printf("Could not save the object to file \"%s\".\n", RESULT_FILE); } - + // // closing down; see if we can delete our analysis helper(s) also // - delete calibPedestal; delete calibSignal; for(Int_t iFile=0; iFile