#include "AliRawReader.h"
#include "AliRawReaderDate.h"
#include "AliTPCmapper.h"
-#include "AliTPCRawStream.h"
#include "AliTPCROC.h"
#include "AliTPCCalROC.h"
#include "AliTPCCalPad.h"
//functios, implementation below
-void SendToAmoreDB(AliTPCCalibCE &calibCE, unsigned long32 runNb);
+void SendToAmoreDB(AliTPCCalibCE *calibCE, unsigned long32 runNb);
//for threaded processing
return -1;
}
- AliLog::SetClassDebugLevel("AliTPCRawStream",-5);
AliLog::SetClassDebugLevel("AliRawReaderDate",-5);
AliLog::SetClassDebugLevel("AliTPCAltroMapping",-5);
AliLog::SetModuleDebugLevel("RAW",-5);
TString laserTriggerName("C0LSR-ABCE-NOPF-CENT");
TString monitoringType("YES");
Int_t forceTriggerId=-1;
+ Int_t saveOption=2; // how to store the object. See AliTPCCalibCE::DumpToFile
+ Bool_t skipAmore=kFALSE;
if ( config.GetConfigurationMap()->GetValue("LaserTriggerName") ) {
laserTriggerName=config.GetConfigurationMap()->GetValue("LaserTriggerName")->GetName();
printf("TPCCEda: Only processing triggers with Id: %d.\n",forceTriggerId);
}
+ if ( config.GetConfigurationMap()->GetValue("SaveOption") ) {
+ saveOption=TMath::Nint(config.GetValue("SaveOption"));
+ printf("TPCCEda: Saving option set to: %d.\n",saveOption);
+ }
+
+ if ( config.GetConfigurationMap()->GetValue("SkipAmore") ) {
+ skipAmore=((TObjString*)config.GetConfigurationMap()->GetValue("SkipAmore"))->GetString().Atoi();
+ printf("TPCCEda: Skip Amore set in config\n");
+ }
//subsribe to laser triggers only in physics partition
//if the trigger class is not available the return value is -1
//create calibration object
- AliTPCCalibCE calibCE(config.GetConfigurationMap()); // central electrode calibration
- calibCE.SetAltroMapping(mapping->GetAltroMapping()); // Use altro mapping we got from daqDetDb
+ AliTPCCalibCE *calibCE=new AliTPCCalibCE(config.GetConfigurationMap()); // central electrode calibration
+ calibCE->SetAltroMapping(mapping->GetAltroMapping()); // Use altro mapping we got from daqDetDb
//amore update interval
Double_t updateInterval=300; //seconds
return -1;
}
-
+ Bool_t hasNewData=kFALSE;
/* read until EOF */
while (true) {
struct eventHeaderStruct *event;
if (event==NULL){
//use time in between bursts to
// send the data to AMOREdb
- if (stopWatch.RealTime()>updateInterval){
- calibCE.Analyse();
- SendToAmoreDB(calibCE,runNb);
+ if (stopWatch.RealTime()>updateInterval && hasNewData){
+ calibCE->Analyse();
+ if (!skipAmore) SendToAmoreDB(calibCE,runNb);
stopWatch.Start();
} else {
stopWatch.Continue();
}
//debug output
if (nevents>neventsOld){
- printf ("TPCCEda: %d events processed, %d used\n",nevents,calibCE.GetNeventsProcessed());
+ printf ("TPCCEda: %d events processed, %d used\n",nevents,calibCE->GetNeventsProcessed());
neventsOld=nevents;
}
-
+ hasNewData=kFALSE;
continue;
}
runNb = event->eventRunNb;
// CE calibration
- calibCE.ProcessEvent(event);
+ calibCE->ProcessEvent(event);
+ hasNewData=kTRUE;
/* free resources */
free(event);
//
// Analyse CE data and write them to rootfile
//
- calibCE.Analyse();
- printf ("TPCCEda: %d events processed, %d used\n",nevents,calibCE.GetNeventsProcessed());
-
- TFile * fileTPC = new TFile (RESULT_FILE,"recreate");
- calibCE.Write("tpcCalibCE");
- delete fileTPC;
+ printf ("TPCCEda: %d events processed, %d used\n",nevents,calibCE->GetNeventsProcessed());
+
+ //save data to file
+ calibCE->DumpToFile(RESULT_FILE,Form("name=tpcCalibCE,type=%d",saveOption));
printf("TPCCEda: Wrote %s\n",RESULT_FILE);
/* store the result file on FES */
-
status=daqDA_FES_storeFile(RESULT_FILE,FILE_ID);
if (status) {
status = -2;
}
+
+ if (!skipAmore){
+ printf("TPCCEda: Amore part\n");
+ calibCE->Analyse();
+ SendToAmoreDB(calibCE,runNb);
+ }
- SendToAmoreDB(calibCE,runNb);
-
+ delete calibCE;
return status;
}
-void SendToAmoreDB(AliTPCCalibCE &calibCE, unsigned long32 runNb)
+void SendToAmoreDB(AliTPCCalibCE *calibCE, unsigned long32 runNb)
{
//AMORE
// printf ("AMORE part\n");
gSystem->Setenv("AMORE_DA_NAME",Form("TPC-%s",FILE_ID));
//
// end cheet
- TGraph *grA=calibCE.MakeGraphTimeCE(-1,0,2);
- TGraph *grC=calibCE.MakeGraphTimeCE(-2,0,2);
+ TGraph *grA=calibCE->MakeGraphTimeCE(-1,0,2);
+ TGraph *grC=calibCE->MakeGraphTimeCE(-2,0,2);
TDatime time;
TObjString info(Form("Run: %u; Date: %s",runNb,time.AsSQLString()));
amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
Int_t statusDA=0;
- statusDA+=amoreDA.Send("CET0",calibCE.GetCalPadT0());
- statusDA+=amoreDA.Send("CEQ",calibCE.GetCalPadQ());
- statusDA+=amoreDA.Send("CERMS",calibCE.GetCalPadRMS());
+ statusDA+=amoreDA.Send("CET0",calibCE->GetCalPadT0());
+ statusDA+=amoreDA.Send("CEQ",calibCE->GetCalPadQ());
+ statusDA+=amoreDA.Send("CERMS",calibCE->GetCalPadRMS());
statusDA+=amoreDA.Send("DriftA",grA);
statusDA+=amoreDA.Send("DriftC",grC);
statusDA+=amoreDA.Send("Info",&info);