################################################################
#ze detector loop
for detectorScript in $ALICE_ROOT/PWGPP/QA/detectorQAscripts/*; do
+ echo
+ echo "##############################################"
unset planB
[[ ! ${detectorScript} =~ .*\.sh$ ]] && continue
detector=${detectorScript%.sh}
cd ${tmpDetectorRunDir}
tmpPrefix=${tmpDetectorRunDir}/${outputDir}
- echo
- echo "##############################################"
echo "running QA for ${detector}"
echo " outputDir=$outputDir"
echo " tmpPrefix=$tmpPrefix"
declare -A arrOfTouchedProductions
while read qaFile; do
echo
+
+ #first check if input file exists
+ [[ ! -f ${qaFile%\#*} ]] && echo "file ${qaFile%\#*} not accessible" && continue
if ! guessRunData ${qaFile}; then
echo "could not guess run data from ${qaFile}"
highPtTree=${qaFile}
#maybe the input is not an archive, but a file
- [[ "${qaFile}" =~ "QAresults.root" ]] && highPtTree=""
- [[ "${qaFile}" =~ "FilterEvents_Trees.root" ]] && qaFile=""
+ [[ "${qaFile}" =~ QAresults.root$ ]] && highPtTree=""
+ [[ "${qaFile}" =~ FilterEvents_Trees.root$ ]] && qaFile=""
#it is possible we get the highPt trees from somewhere else
#search the list of high pt trees for the proper run number
#perform some default actions:
#if trending.root not created, create a default one
if [[ ! -f trending.root ]]; then
- aliroot -b -q -l "$ALICE_ROOT/PWGPP/macros/simpleTrending.C(\"${qaFile}\",${runNumber},\"${detector}\",\"trending.root\",\"trending\",\"recreate\")" &>> runLevelQA.log
+ aliroot -b -q -l "$ALICE_ROOT/PWGPP/macros/simpleTrending.C(\"${qaFile}\",${runNumber},\"${detector}\",\"trending.root\",\"trending\",\"recreate\")" 2>&1 | tee -a runLevelQA.log
+ fi
+ if [[ -f trending.root ]]; then
+ arrOfTouchedProductions[${tmpProductionDir}]=1
+ else
+ echo "trending.root not created"
fi
- arrOfTouchedProductions[${tmpProductionDir}]=1
fi
#expert QA based on high pt trees
if [[ -n ${highPtTree} && $(type -t runLevelHighPtTreeQA) =~ "function" ]]; then
mv -f ${dir} ${productionDir}
done
- #go to a temp dir to do the period level stuff
+ #go to a temp dir to do the period level stuff in a completely clean dir
tmpPeriodLevelQAdir="${tmpProductionDir}/periodLevelQA"
echo
echo tmpPeriodLevelQAdir="${tmpProductionDir}/periodLevelQA"
else
executePlanB
fi
- done
+ done #end of detector loop
#remove lock
rm -f ${lockFile}
-void processContainer(TObject* object, TTreeSRedirector* debugStreamer, TString name, TRegexp filterRegexp=".*");
+void processContainer(TObject* object, TTreeSRedirector* debugStreamer, TString name);
void loadLibraries();
-void simpleTrending(TString inputFileName, Int_t run, TRegexp filterRegexp=".*", TString trendingFileName="trending.root", TString treeName="trending", TString fileOpenMode="update" );
+void simpleTrending(TString inputFileName, Int_t run, TString filterExpr=".*", TString trendingFileName="trending.root", TString treeName="trending", TString fileOpenMode="update" );
TString treeName;
-void simpleTrending(TString inputFileName, Int_t run, TRegexp filterRegexp, TString trendingFileName, TString debugTreeName, TString fileOpenMode )
+void simpleTrending(TString inputFileName, Int_t run, TString filterExpr, TString trendingFileName, TString debugTreeName, TString fileOpenMode )
{
// Dump the statistical information about all histograms in the file
TList * keyList = inputFile->GetListOfKeys();
Int_t nkeys=keyList->GetEntries();
- keyList->Print();
-
- TTreeSRedirector *pcstream = new TTreeSRedirector(trendingFileName,fileOpenMode);
- (*pcstream)<<treeName.Data()<<"run="<<run;
+
+ TRegexp filterRegexp=filterExpr.Data();
- //main loop over the top level objects, filtering is done here
+ //check if we have a matching container, only then create the output file
TList* keyList=inputFile->GetListOfKeys();
Int_t nkeys=keyList->GetEntries();
+ Bool_t containerExists=kFALSE;
+ for (Int_t i=0; i<nkeys; i++)
+ {
+ TObject* object=keyList->At(i);
+ if (!object) continue;
+ TString name=object->GetName();
+ if (name.Contains(filterRegexp))
+ {
+ containerExists=kTRUE;
+ break;
+ }
+ }
+ if (!containerExists)
+ {
+ printf("container %s does not exist in %s\n",filterExpr.Data(),inputFileName.Data());
+ return;
+ }
+
+ TTreeSRedirector *pcstream = new TTreeSRedirector(trendingFileName,fileOpenMode);
+ (*pcstream)<<treeName.Data()<<"run="<<run;
+
+ //main loop over the top level objects, filtering is done here
for (Int_t i=0; i<nkeys; i++)
{
TObject * object = inputFile->Get(keyList->At(i)->GetName());
if (!object) continue;
TString name=object->GetName();
- processContainer(object,pcstream,name,filterRegexp);
+ if (!name.Contains(filterRegexp)) continue;
+ processContainer(object,pcstream,name);
}
//
}
-void processContainer(TObject* inputObject, TTreeSRedirector* pcstream, TString parentname, TRegexp filterRegexp)
+void processContainer(TObject* inputObject, TTreeSRedirector* pcstream, TString parentname)
{
//recursively process the contents of an object:
//might be a TDirectory
TH1* inputHistogram=NULL;
TString inputObjectName=inputObject->GetName();
- if (!inputObjectName.Contains(filterRegexp)) return;
//TDirectory* inputDir=dynamic_cast<TDirectory*>(inputObject);
//TSeqCollection* inputCollection=dynamic_cast<TSeqCollection*>(inputObject);