From f9ce172e63018e29c4d178788941195daa68027f Mon Sep 17 00:00:00 2001 From: sgweber Date: Thu, 5 Jun 2014 17:19:45 +0200 Subject: [PATCH] added conversion shell scripts --- HLT/BASE/AliHLTComponentBenchmark.cxx | 7 +- .../AliHLTGlobalEsdConverterComponent.cxx | 73 ++++++++++++++++ .../AliHLTGlobalEsdConverterComponent.h | 3 + .../AliHLTGlobalFlatEsdConverterComponent.cxx | 87 +++++++++++-------- .../AliHLTGlobalFlatEsdConverterComponent.h | 2 + HLT/global/fladevMacros/compare/command.sh | 3 + HLT/global/fladevMacros/esdToFlat/command.sh | 3 + .../fladevMacros/esdToFlat/command_list.sh | 19 ++++ HLT/global/fladevMacros/esdToFlat/read.sh | 8 ++ HLT/global/fladevMacros/plot/showHistos.C | 52 +++++++++++ .../fladevMacros/rawToFlat/command_list.sh | 63 ++++++++++++++ .../fladevMacros/rawToFlat/command_single.sh | 44 ++++++++++ .../fladevMacros/rawToFlat/config_Flat.C | 34 ++++++++ .../fladevMacros/rawToFlat/createHistos.C | 50 +++++++++++ .../fladevMacros/rawToHltEsd/command.sh | 4 + .../fladevMacros/rawToHltEsd/command_list.sh | 63 ++++++++++++++ .../fladevMacros/rawToHltEsd/createHistos.C | 50 +++++++++++ 17 files changed, 525 insertions(+), 40 deletions(-) create mode 100755 HLT/global/fladevMacros/compare/command.sh create mode 100755 HLT/global/fladevMacros/esdToFlat/command.sh create mode 100755 HLT/global/fladevMacros/esdToFlat/command_list.sh create mode 100755 HLT/global/fladevMacros/esdToFlat/read.sh create mode 100644 HLT/global/fladevMacros/plot/showHistos.C create mode 100755 HLT/global/fladevMacros/rawToFlat/command_list.sh create mode 100755 HLT/global/fladevMacros/rawToFlat/command_single.sh create mode 100644 HLT/global/fladevMacros/rawToFlat/config_Flat.C create mode 100644 HLT/global/fladevMacros/rawToFlat/createHistos.C create mode 100755 HLT/global/fladevMacros/rawToHltEsd/command.sh create mode 100755 HLT/global/fladevMacros/rawToHltEsd/command_list.sh create mode 100644 HLT/global/fladevMacros/rawToHltEsd/createHistos.C diff --git a/HLT/BASE/AliHLTComponentBenchmark.cxx b/HLT/BASE/AliHLTComponentBenchmark.cxx index 881bd5c3a65..311e5c3cff3 100644 --- a/HLT/BASE/AliHLTComponentBenchmark.cxx +++ b/HLT/BASE/AliHLTComponentBenchmark.cxx @@ -126,20 +126,17 @@ void AliHLTComponentBenchmark::GetStatisticsData( Double_t* statistics, TString* { // ! if( fNEvents<=0 ) return ; - float ratio = 1; - if( fTotalInput >0 ) ratio = fTotalOutput / fTotalInput; statistics[0] = fNEvents; statistics[1] = fTotalInput/fNEvents/1024; statistics[2] = fTotalOutput/fNEvents/1024; - statistics[3] = ratio; if( fNTimers<=0 ) return ; for( int i=0; iGet("time"); + if(t!=0x0){ + fInitialTime = atoi(t->GetTitle()); + } + } + } AliHLTGlobalEsdConverterComponent::~AliHLTGlobalEsdConverterComponent() @@ -296,6 +309,7 @@ int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& / { // see header file for class documentation int iResult=0; + bool benchmark = true; if (!fESD) return -ENODEV; if (!IsDataEvent()) return iResult; @@ -357,6 +371,36 @@ int AliHLTGlobalEsdConverterComponent::DoEvent(const AliHLTComponentEventData& / fBenchmark.Stop(0); HLTWarning( fBenchmark.GetStatistics() ); + + + + + + + if(benchmark){ + + TTimeStamp ts; + Double_t time = (Double_t) ts.GetSec() - fInitialTime; + Int_t nV0s = pESD->GetNumberOfV0s(); + Int_t nTracks = pESD->GetNumberOfTracks(); + + + Double_t statistics[10]; + TString names[10]; + fBenchmark.GetStatisticsData(statistics, names); + statistics[5] = nTracks; + statistics[6] = time; + statistics[7] = nV0s; + + FillBenchmarkHistos( statistics, names); + printf("\nTIME: %.9f \n\n",time); + fBenchmark.Reset(); + + } + + + + return iResult; } @@ -632,6 +676,7 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* // update with vertices and vertex-fitted tracks // output of PrimaryVertexer and V0Finder components + TObject* pBase = (TObject*)GetFirstInputObject(kAliHLTDataTypeKFVertex | kAliHLTDataOriginOut); if (pBase) { AliKFVertex* kfVertex = dynamic_cast(pBase); @@ -861,7 +906,35 @@ int AliHLTGlobalEsdConverterComponent::ProcessBlocks(TTree* pTree, AliESDEvent* if (iAddedDataBlocks>0 && pTree) { pTree->Fill(); } + + + if (iResult>=0) iResult=iAddedDataBlocks; return iResult; } + + + + +void AliHLTGlobalEsdConverterComponent::FillBenchmarkHistos(Double_t *statistics, TString */*names*/){ + + +// cout<<"Now writing benchmarks to " << fBenchmarkHistosFilename <Get("benchmarkInformation"); + TNamed *t = (TNamed*)f->Get("time"); + + if(!s){ + HLTWarning( "Benchmark Histograms not available!" ); + return; + } + s->Fill(statistics); + + TList histosList; + histosList.Add(s); + histosList.Add(t); + histosList.SaveAs(fBenchmarkHistosFilename); + +} diff --git a/HLT/global/AliHLTGlobalEsdConverterComponent.h b/HLT/global/AliHLTGlobalEsdConverterComponent.h index f70000084d0..379fb979962 100644 --- a/HLT/global/AliHLTGlobalEsdConverterComponent.h +++ b/HLT/global/AliHLTGlobalEsdConverterComponent.h @@ -73,6 +73,7 @@ class AliHLTGlobalEsdConverterComponent : public AliHLTProcessor */ int ProcessBlocks(TTree* pTree, AliESDEvent* pESD); + void FillBenchmarkHistos(Double_t *statistics, TString *names); private: /** copy constructor prohibited */ AliHLTGlobalEsdConverterComponent(const AliHLTGlobalEsdConverterComponent&); @@ -107,6 +108,8 @@ protected: /// solenoid b field Double_t fSolenoidBz; //! transient AliHLTComponentBenchmark fBenchmark; // benchmark + TString fBenchmarkHistosFilename; + Int_t fInitialTime; ClassDef(AliHLTGlobalEsdConverterComponent, 0) }; diff --git a/HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx b/HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx index e64f133d8a4..92867fc8b9e 100644 --- a/HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx +++ b/HLT/global/AliHLTGlobalFlatEsdConverterComponent.cxx @@ -50,6 +50,8 @@ #include "TTree.h" #include "TList.h" #include "TClonesArray.h" +#include "TTimeStamp.h" +#include "THnSparse.h" //#include "AliHLTESDCaloClusterMaker.h" //#include "AliHLTCaloClusterDataStruct.h" //#include "AliHLTCaloClusterReader.h" @@ -72,13 +74,25 @@ AliHLTGlobalFlatEsdConverterComponent::AliHLTGlobalFlatEsdConverterComponent() , fVerbosity(0) , fSolenoidBz(-5.00668) , fBenchmark("FlatEsdConverter") - , fBenchmarkHistosFilename("$HERAFOLDER/flatDev/rawToFlat/histosBenchmark.root") + , fBenchmarkHistosFilename("$PWD/histosBenchmark.root") + , fInitialTime(0) { // see header file for class documentation // or // refer to README to build package // or // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt + + + + + TFile *f = TFile::Open(fBenchmarkHistosFilename,"READ"); + if(f!=0x0){ + TNamed *t = (TNamed*)f->Get("time"); + if(t!=0x0){ + fInitialTime = atoi(t->GetTitle()); + } + } } AliHLTGlobalFlatEsdConverterComponent::~AliHLTGlobalFlatEsdConverterComponent() @@ -269,10 +283,14 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa if (!IsDataEvent()) return iResult; - - fBenchmark.Reset(); fBenchmark.StartNewEvent(); fBenchmark.Start(0); + + TStopwatch timer; + timer.Start(); + + + size_t maxOutputSize = size; size = 0; @@ -461,7 +479,7 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa const AliESDVertex *primaryVertexSPD = dynamic_cast( GetFirstInputObject( kAliHLTDataTypeESDVertex|kAliHLTDataOriginITS ) ); const AliESDVertex *primaryVertexTracks = dynamic_cast( GetFirstInputObject( kAliHLTDataTypeESDVertex|kAliHLTDataOriginOut ) ); - cout<FillPrimaryVertices( primaryVertexSPD, primaryVertexTracks ); @@ -611,8 +629,8 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa // Fill v0's - { int nV0s =0; + { const AliHLTComponentBlockData* pP = GetFirstInputBlock(kAliHLTDataTypeGlobalVertexer|kAliHLTDataOriginOut); if (pP && pP->fSize && pP->fPtr) { const AliHLTGlobalVertexerComponent::AliHLTGlobalVertexerData *data = reinterpret_cast(pP->fPtr); @@ -625,9 +643,8 @@ int AliHLTGlobalFlatEsdConverterComponent::DoEvent( const AliHLTComponentEventDa flatEsd->StoreLastV0(); } } else { - HLTWarning("xxx No V0 data block"); + HLTWarning(" No V0 data block"); } - cout<<"\nxxxx Found "<Get("cpuTimeVsSize"); - hRealTimeVsSize = (TH2F*)outFile->Get("realTimeVsSize"); + +// cout<<"Now writing benchmarks to " << fBenchmarkHistosFilename <Get("benchmarkInformation"); + TNamed *t = (TNamed*)f->Get("time"); - if(!hCpuTimeVsSize || !hRealTimeVsSize){ + if(!s){ HLTWarning( "Benchmark Histograms not available!" ); return; } - - - Double_t realTimePerEvent = statistics[5]; - Double_t cpuTimePerEvent = statistics[5]; - Double_t sizePerEvent = statistics[1]; - - hCpuTimeVsSize->Fill(sizePerEvent, cpuTimePerEvent); - hRealTimeVsSize->Fill(sizePerEvent, realTimePerEvent); + s->Fill(statistics); - TList histosList; - histosList.Add(hCpuTimeVsSize); - histosList.Add(hRealTimeVsSize); - - histosList.SaveAs(outputFilename); + TList histosList; + histosList.Add(s); + histosList.Add(t); + histosList.SaveAs(fBenchmarkHistosFilename); } \ No newline at end of file diff --git a/HLT/global/AliHLTGlobalFlatEsdConverterComponent.h b/HLT/global/AliHLTGlobalFlatEsdConverterComponent.h index 68ceecfa4c5..0933c23645b 100644 --- a/HLT/global/AliHLTGlobalFlatEsdConverterComponent.h +++ b/HLT/global/AliHLTGlobalFlatEsdConverterComponent.h @@ -99,6 +99,8 @@ protected: Double_t fSolenoidBz; //! transient AliHLTComponentBenchmark fBenchmark; // benchmark TString fBenchmarkHistosFilename; + Int_t fInitialTime; + ClassDef(AliHLTGlobalFlatEsdConverterComponent, 0) }; diff --git a/HLT/global/fladevMacros/compare/command.sh b/HLT/global/fladevMacros/compare/command.sh new file mode 100755 index 00000000000..dfb6a601890 --- /dev/null +++ b/HLT/global/fladevMacros/compare/command.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +aliroot -b -l -q $ALICE_ROOT/HLT/global/LoadLibs.C $ALICE_ROOT/HLT/global/CompareFlatESDs.C++'("flat.dat","normal.dat")' | tee compare.out diff --git a/HLT/global/fladevMacros/esdToFlat/command.sh b/HLT/global/fladevMacros/esdToFlat/command.sh new file mode 100755 index 00000000000..29c478b6018 --- /dev/null +++ b/HLT/global/fladevMacros/esdToFlat/command.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +aliroot -b - l -q $ALICE_ROOT/HLT/global/LoadLibs.C $ALICE_ROOT/HLT/global/FlatESDConverter.C++'("AliESDs.root",kTRUE,kTRUE)' diff --git a/HLT/global/fladevMacros/esdToFlat/command_list.sh b/HLT/global/fladevMacros/esdToFlat/command_list.sh new file mode 100755 index 00000000000..5e22ac08006 --- /dev/null +++ b/HLT/global/fladevMacros/esdToFlat/command_list.sh @@ -0,0 +1,19 @@ +#! /bin/bash +if [ $# -lt 1 ] + then + echo "please specify directory with input ESD data" + exit + else + fileList=$1 + fi + + iFile=1 +for file in ${fileList}*/AliESDs.root +do + replace="AliESDfriends" + fileFriends="${file/AliESDs/$replace}" + aliroot -b -l -q $ALICE_ROOT/HLT/global/LoadLibs.C $ALICE_ROOT/HLT/global/FlatESDConverter.C++'("'${file}'", "'${fileFriends}'", "'${iFile}'.dat",kFALSE, kTRUE)' 2>&1| tee convert.log + cat ${iFile}.dat >> outFlatESD.dat + + iFile=$((iFile+1)) +done diff --git a/HLT/global/fladevMacros/esdToFlat/read.sh b/HLT/global/fladevMacros/esdToFlat/read.sh new file mode 100755 index 00000000000..a0ff5b375df --- /dev/null +++ b/HLT/global/fladevMacros/esdToFlat/read.sh @@ -0,0 +1,8 @@ +#! /bin/bash +if [ $# -lt 1 ] + then + filename="outFlatESD.dat" + else + filename=$1 + fi +aliroot -b -l -q $ALICE_ROOT/HLT/global/LoadLibs.C $ALICE_ROOT/HLT/global/ReadFlatESD.C++'("'${filename}'")' | tee readFlat.out diff --git a/HLT/global/fladevMacros/plot/showHistos.C b/HLT/global/fladevMacros/plot/showHistos.C new file mode 100644 index 00000000000..335412f94ac --- /dev/null +++ b/HLT/global/fladevMacros/plot/showHistos.C @@ -0,0 +1,52 @@ +THnSparseD *s; + + +void showHistos(const char * fn="histosBenchmark.root" ){ + + + TFile * file = TFile::Open(fn); + s = (THnSparseD*)file->Get("benchmarkInformation"); + + + if(!s){ + cout<<"Cannot open THnSparse!"<GetAxis(1)->SetRange(1,160); + s->GetAxis(2)->SetRange(1,600); + s->GetAxis(3)->SetRange(1,350); + s->GetAxis(5)->SetRange(1,400); + + createHisto(3,6,"realTimeVsTime"); + createHisto(3,1,"realTimeVsSize","col"); + createHisto(3,5,"realTimeVsnTracks","col"); + createHisto(3,2,"realTimeVsOutsize","col"); + createHisto(3,7,"realTimeVsV0s","col"); + createHisto(2,1,"outVsIn","col"); + createHisto(1,5,"sizeVsnTracks","col"); + + + s->GetAxis(7)->SetRange(2,10); + + TH2D * realTimeVsSizeV0s = s->Projection(3,1); + TCanvas *c = new TCanvas("benchmarks","benchmarks",500,400); + realTimeVsSizeV0s->SetStats(0); + realTimeVsSizeV0s->Draw("col"); + c->SaveAs("realTimeVsSizeV0s.pdf"); + c->SaveAs("realTimeVsSizeV0s.root"); + + +} + +void createHisto( Int_t a1, Int_t a2, const char* name,const char* opt=""){ + + TH2D*h=s->Projection(a1,a2); + + TCanvas *c = new TCanvas("benchmarks","benchmarks",500,400); + h->SetStats(0); + h->Draw(opt); + c->SaveAs( Form("%s.pdf", name ) ); + c->SaveAs( Form("%s.root", name )); + delete c; +} \ No newline at end of file diff --git a/HLT/global/fladevMacros/rawToFlat/command_list.sh b/HLT/global/fladevMacros/rawToFlat/command_list.sh new file mode 100755 index 00000000000..b8e30f9a892 --- /dev/null +++ b/HLT/global/fladevMacros/rawToFlat/command_list.sh @@ -0,0 +1,63 @@ +#! /bin/bash +if [ $# -lt 1 ] + then + echo "please specify directory with input raw data" + exit + else + fileList=$1 + fi +if [ $# -lt 2 ] + then + config="normal" + else + config=$2 + fi +if [ $# -lt 3 ] + then + ouputfileName="outFlatHLT.dat" + else + ouputfileName=$3 + fi +if [ $# -lt 4 ] + then + ocdb="local://$OCDB10" + else + ocdb=$4 + fi +if [ $# -lt 5 ] + then + start=-1 + else + start=$5 + fi +if [ $# -lt 6 ] + then + end=-1 + else + end=$6 + fi + +aliroot ../createHistos.C -q +iFile=1 + +for file in ${fileList}*/raw.root +do + # dir=${dir%*/} + # echo ${dir##*/} + echo "Now processing ${file}" + rm galice.root + mkdir ${iFile} + + if [ $config = "flat" ] + then + echo "using flat ESD converter" + aliroot -q -b ../config_Flat.C'("'${iFile}'","'${ouputfileName}'")' $ALICE_ROOT/HLT/exa/recraw-local.C'("'${file}'","'${ocdb}'", '${start}', '${end}', "HLT", "chains=RootWriter ignore-hltout")' 2>&1|tee recraw-local.log -a + cat ${iFile}/* >> outFlatESD.dat + else + echo "using normal ESD converter" + aliroot -b -q -l $ALICE_ROOT/HLT/exa/recraw-local.C'("'${file}'","'${ocdb}'", '${start}', '${end}', "HLT","chains=GLOBAL-esd-converter ignore-hltout")' 2>&1|tee recraw-local.log -a + mv AliESD* ${iFile}/ + fi + + iFile=$((iFile+1)) +done diff --git a/HLT/global/fladevMacros/rawToFlat/command_single.sh b/HLT/global/fladevMacros/rawToFlat/command_single.sh new file mode 100755 index 00000000000..8aed890e62f --- /dev/null +++ b/HLT/global/fladevMacros/rawToFlat/command_single.sh @@ -0,0 +1,44 @@ +#! /bin/bash +if [ $# -lt 1 ] + then + inputFileName="raw.root" + else + inputFileName=$1 + fi +if [ $# -lt 2 ] + then + outputDirectory="outFlat" + else + outputDirectory=$2 + fi +if [ $# -lt 3 ] + then + ouputfileName="outFlatHLT.dat" + else + ouputfileName=$3 + fi +if [ $# -lt 4 ] + then + ocdb="local://$OCDB10" + else + ocdb=$4 + fi +if [ $# -lt 5 ] + then + start=-1 + else + start=$5 + fi +if [ $# -lt 6 ] + then + end=-1 + else + end=$6 + fi + +aliroot ../createHistos.C -q + +aliroot -q -b ../config_Flat.C'("'${outputDirectory}'", "'${outputFileName}'" )' $ALICE_ROOT/HLT/exa/recraw-local.C'("'${inputFileName}'","'${ocdb}'", '${start}', '${end}', "HLT", "chains=RootWriter ignore-hltout")' |tee output.out -a + +printf "now merging files" +cat ${outputDirectory}/* > outFlatESD.dat diff --git a/HLT/global/fladevMacros/rawToFlat/config_Flat.C b/HLT/global/fladevMacros/rawToFlat/config_Flat.C new file mode 100644 index 00000000000..5eeb8a86dcc --- /dev/null +++ b/HLT/global/fladevMacros/rawToFlat/config_Flat.C @@ -0,0 +1,34 @@ +void config_Flat( TString directory="outFlat", TString fileName="outFlatHLT.dat") +{ + // set up HLT system to enable configuration registration + AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance(); + + /* + pHLT->LoadComponentLibraries("libESD.so"); + pHLT->LoadComponentLibraries("libSTEER.so"); + pHLT->LoadComponentLibraries("libSTEERBase.so"); + pHLT->LoadComponentLibraries("libAOD.so"); + pHLT->LoadComponentLibraries("libANALYSIS.so"); + pHLT->LoadComponentLibraries("libANALYSISalice.so"); + + pHLT->LoadComponentLibraries("libHLTbase.so"); + pHLT->LoadComponentLibraries("libAliHLTUtil.so"); + pHLT->LoadComponentLibraries("libAliHLTGlobal.so"); + */ + + /* + pHLT->LoadComponentLibraries("libAliHLTMUON.so"); + pHLT->LoadComponentLibraries("libAliHLTTPC.so"); + pHLT->LoadComponentLibraries("libAliHLTTRD.so"); + */ + + + // writer configuration + + + // -- The RootFileWriter + AliHLTConfiguration RootWriter("RootWriter", "FileWriter", "GLOBAL-flat-esd-converter", "-directory " + directory + " -datafile " + fileName ); + + //pHLT->BuildTaskList("RootWriter"); + //pHLT->PrintTaskList(); +} diff --git a/HLT/global/fladevMacros/rawToFlat/createHistos.C b/HLT/global/fladevMacros/rawToFlat/createHistos.C new file mode 100644 index 00000000000..865ed36c336 --- /dev/null +++ b/HLT/global/fladevMacros/rawToFlat/createHistos.C @@ -0,0 +1,50 @@ +void createHistos(){ + + TString outputFilename = "$PWD/histosBenchmark.root"; + + static const Int_t n=8; + + TString axes[n] = {"nEvents", "inputSize(kB)", "outputSize(kB)", "realTime(ms)", "cpuTime(ms)", "nTracks", "timestamp (s)", "nV0s" }; + Int_t bins[n] = {100, 200, 1000, 600, 1000, 200, 1000, 10}; + Double_t mins[n]= {0., 0., 0., 0., 0., 0., 0., 0.}; + Double_t maxs[n]= {100., 200., 1000., 6., 10., 200., 10000, 10.}; + + THnSparseD * s = new THnSparseD("benchmarkInformation", "Benchmark information", n, bins, mins, maxs); + + for(int i=0; iGetAxis(i)->SetName(axes[i]); + s->GetAxis(i)->SetTitle(axes[i]); + } + + + TTimeStamp ts; + Int_t t = (Int_t) ts.GetSec() ; + TNamed *time = new TNamed("time",Form("%d",t)); + + + TList histosList; + histosList.Add(s); + histosList.Add(time); + + // TH2F* hCpuTimeVsSize; + // TH2F* hRealTimeVsSize; + // TH2F* hCpuTimeVsTracks; + // TH2F* hRealTimeVsTracks; + + +// hCpuTimeVsSize = new TH2F("cpuTimeVsSize","cpu time vs. size", 1000,0,200, 1100,0,11); +// hRealTimeVsSize = new TH2F("realTimeVsSize","real time vs. size", 1000,0,200, 1000,0,10); +// hCpuTimeVsTracks = new TH2F("cpuTimeVsTracks","cpu time vs. number of tracks", 200,0,200, 1100,0,11); +// hRealTimeVsTracks = new TH2F("realTimeVsTracks","real time vs. number of tracks", 200,0,200, 1000,0,10); + +// histosList.Add(hCpuTimeVsSize); +// histosList.Add(hRealTimeVsSize); +// histosList.Add(hCpuTimeVsTracks); +// histosList.Add(hRealTimeVsTracks); + histosList.SaveAs(outputFilename); + + + + + +} diff --git a/HLT/global/fladevMacros/rawToHltEsd/command.sh b/HLT/global/fladevMacros/rawToHltEsd/command.sh new file mode 100755 index 00000000000..4dc8bf1ffd8 --- /dev/null +++ b/HLT/global/fladevMacros/rawToHltEsd/command.sh @@ -0,0 +1,4 @@ +#! /bin/bash + +aliroot -b -q -l $ALICE_ROOT/HLT/exa/recraw-local.C'("raw.root","local://$OCDB10",-1,-1,"HLT","chains=GLOBAL-esd-converter ignore-hltout")' 2>&1|tee recraw-local.log + diff --git a/HLT/global/fladevMacros/rawToHltEsd/command_list.sh b/HLT/global/fladevMacros/rawToHltEsd/command_list.sh new file mode 100755 index 00000000000..b8e30f9a892 --- /dev/null +++ b/HLT/global/fladevMacros/rawToHltEsd/command_list.sh @@ -0,0 +1,63 @@ +#! /bin/bash +if [ $# -lt 1 ] + then + echo "please specify directory with input raw data" + exit + else + fileList=$1 + fi +if [ $# -lt 2 ] + then + config="normal" + else + config=$2 + fi +if [ $# -lt 3 ] + then + ouputfileName="outFlatHLT.dat" + else + ouputfileName=$3 + fi +if [ $# -lt 4 ] + then + ocdb="local://$OCDB10" + else + ocdb=$4 + fi +if [ $# -lt 5 ] + then + start=-1 + else + start=$5 + fi +if [ $# -lt 6 ] + then + end=-1 + else + end=$6 + fi + +aliroot ../createHistos.C -q +iFile=1 + +for file in ${fileList}*/raw.root +do + # dir=${dir%*/} + # echo ${dir##*/} + echo "Now processing ${file}" + rm galice.root + mkdir ${iFile} + + if [ $config = "flat" ] + then + echo "using flat ESD converter" + aliroot -q -b ../config_Flat.C'("'${iFile}'","'${ouputfileName}'")' $ALICE_ROOT/HLT/exa/recraw-local.C'("'${file}'","'${ocdb}'", '${start}', '${end}', "HLT", "chains=RootWriter ignore-hltout")' 2>&1|tee recraw-local.log -a + cat ${iFile}/* >> outFlatESD.dat + else + echo "using normal ESD converter" + aliroot -b -q -l $ALICE_ROOT/HLT/exa/recraw-local.C'("'${file}'","'${ocdb}'", '${start}', '${end}', "HLT","chains=GLOBAL-esd-converter ignore-hltout")' 2>&1|tee recraw-local.log -a + mv AliESD* ${iFile}/ + fi + + iFile=$((iFile+1)) +done diff --git a/HLT/global/fladevMacros/rawToHltEsd/createHistos.C b/HLT/global/fladevMacros/rawToHltEsd/createHistos.C new file mode 100644 index 00000000000..d3495a53e84 --- /dev/null +++ b/HLT/global/fladevMacros/rawToHltEsd/createHistos.C @@ -0,0 +1,50 @@ +void createHistos(){ + + TString outputFilename = "$PWD/histosBenchmark.root"; + + static const Int_t n=8; + + TString axes[n] = {"nEvents", "inputSize(kB)", "outputSize(kB)", "realTime(ms)", "cpuTime(ms)", "nTracks", "timestamp (s)", "nV0s" }; + Int_t bins[n] = {100, 200, 200, 2000, 1000, 200, 1600, 10}; + Double_t mins[n]= {0., 0., 0., 0., 0., 0., 0., 0.}; + Double_t maxs[n]= {100., 200., 200., 20., 10., 200., 16000, 10.}; + + THnSparseD * s = new THnSparseD("benchmarkInformation", "Benchmark information", n, bins, mins, maxs); + + for(int i=0; iGetAxis(i)->SetName(axes[i]); + s->GetAxis(i)->SetTitle(axes[i]); + } + + + TTimeStamp ts; + Int_t t = (Int_t) ts.GetSec() ; + TNamed *time = new TNamed("time",Form("%d",t)); + + + TList histosList; + histosList.Add(s); + histosList.Add(time); + + // TH2F* hCpuTimeVsSize; + // TH2F* hRealTimeVsSize; + // TH2F* hCpuTimeVsTracks; + // TH2F* hRealTimeVsTracks; + + +// hCpuTimeVsSize = new TH2F("cpuTimeVsSize","cpu time vs. size", 1000,0,200, 1100,0,11); +// hRealTimeVsSize = new TH2F("realTimeVsSize","real time vs. size", 1000,0,200, 1000,0,10); +// hCpuTimeVsTracks = new TH2F("cpuTimeVsTracks","cpu time vs. number of tracks", 200,0,200, 1100,0,11); +// hRealTimeVsTracks = new TH2F("realTimeVsTracks","real time vs. number of tracks", 200,0,200, 1000,0,10); + +// histosList.Add(hCpuTimeVsSize); +// histosList.Add(hRealTimeVsSize); +// histosList.Add(hCpuTimeVsTracks); +// histosList.Add(hRealTimeVsTracks); + histosList.SaveAs(outputFilename); + + + + + +} -- 2.43.0