Skip to content
53 changes: 53 additions & 0 deletions devices/aliceHLTwrapper/macros/hltConfigurations.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,57 @@ void hltConfigurations()
}
}
AliHLTConfiguration clustercollection("cluster-collection", "BlockFilter", collectionInput.Data(), "");

TString arg;
TString publisher;

arg.Form("-publish-raw filtered");
AliHLTConfiguration tpcdatapublisherconf("TPC-DP", "TPCDataPublisher", NULL , arg.Data());

publisher.Form("TPC-DP-raw", slice, part);
arg.Form("-datatype 'DDL_RAW ' 'TPC '");
AliHLTConfiguration tpcdatarawfilterconf(publisher.Data(), "BlockFilter", "TPC-DP" , arg.Data());

// Hardware CF emulator
TString hwcfemu;
hwcfemu.Form("TPC-HWCFEmu");
arg="";
AliHLTConfiguration tpchwcfemuconf(hwcfemu.Data(), "TPCHWClusterFinderEmulator", publisher.Data(), arg.Data());

TString hwcf;
hwcf.Form("TPC-HWCF");
AliHLTConfiguration hwcfemuconf(hwcf.Data(), "TPCHWClusterTransform", hwcfemu.Data(), "-publish-raw");

TString hwcfDecoder = "TPC-HWCFDecoder";
AliHLTConfiguration hwcfdecoderconf(hwcfDecoder.Data(), "TPCHWClusterDecoder",hwcfemu.Data(), "");

TString clusterTransformation = "TPC-ClusterTransformation";
AliHLTConfiguration clustertransformationconf(clusterTransformation.Data(), "TPCClusterTransformation",hwcfDecoder.Data(), "");

AliHLTConfiguration clusterpubconf("cluster-publisher", "FilePublisher", "", "-datafilelist cluster-input.txt");

TString trackerID;
trackerID.Form("TPC-TR");
TString trackerInput;
//trackerInput=clusterTransformation;
trackerInput="cluster-publisher";
AliHLTConfiguration trackerconf(trackerID.Data(), "TPCCATracker", trackerInput.Data(), "-GlobalTracking -allowGPU -GPUHelperThreads 4");

AliHLTConfiguration globalmergerconf("TPC-globalmerger","TPCCAGlobalMerger",trackerID.Data(),"");

TString input;
input+=" "; input+=clusterTransformation;
input+=" "; input+=hwcfDecoder;
//input+=" TPC-globalmerger";
arg="-directory clusters-from-raw -subdir -specfmt=_0x%08x -blocknofmt= -write-all-blocks -write-all-events";
arg+=Form(" -publisher-conf emulated-tpc-clusters.txt");
AliHLTConfiguration clustertransformwriterconf("TPC-ClusterWriter", "FileWriter", input.Data(), arg.Data());

arg="-directory output-tracks -subdir -specfmt=_0x%08x -blocknofmt= -write-all-blocks -write-all-events";
arg+=Form(" -publisher-conf output-tracks.txt");
AliHLTConfiguration trackwriterconf("TPC-TrackWriter", "FileWriter", "TPC-globalmerger", arg.Data());

arg.Form("-disable-component-stat -publish 0 -file ClusterRawStatistics.root");
AliHLTConfiguration collector("collector", "StatisticsCollector", "TPC-ClusterWriter", arg.Data());

}
93 changes: 93 additions & 0 deletions devices/aliceHLTwrapper/macros/overlayClusters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
#! /bin/bash

printHelp=0
merge_nEvents=0
targetdir=
nOutput=0
outputBaseName=event

scriptname=`basename $0`
scriptdir=`dirname $0`
macroname=overlayClusters.C
macropath=$scriptdir/$macroname

if ! test -e "$macropath" ; then
cat<<EOF

Error can not find macro '$macropath'; has to be in the same folder as script

EOF
printHelp=1

else
[ "$#" -ge 1 ] && merge_nEvents=$1
shift
[ "$#" -ge 1 ] && targetdir=$1
shift
[ "$#" -ge 1 ] && outputBaseName=$1
shift
[ "$merge_nEvents" -eq 0 ] && printHelp=1
fi


if [ "$printHelp" -gt 0 ]; then
cat<<EOF
$scriptname: merge TPC cluster data files with help of root macro $macroname
Usage:
ls path_to_event_folder | $scriptname count targetdir basename

count number of files to merge
targetdir target directory [optional]
basename basename of folders for merged data samples [optional]

The input event folders are read from standard input.

A working aliroot setup is required in order to start root and load the required
AliRoot libraries.

Current script/macro path:
$scriptdir
EOF
exit
fi

c=0
unset inputeventlist
while read inputevent; do
inputeventlist=(${inputeventlist[@]} $inputevent)
if [ "$c" -ge $(( merge_nEvents - 1 )) ]; then
outputevent=`echo $targetdir | sed -e 's|\([^/]\)$|\1/|'`$outputBaseName`printf %03d $nOutput`
echo merging ...
for f in ${inputeventlist[@]}; do echo " $f"; done
echo " -> $outputevent"

mkdir -p $outputevent || break
# for each event to be generated loop over all slices and partitions
# and merge the files with corresponding specification
for ((slice=0; slice<36; slice++)); do
for ((part=0; part<6; part++)); do
# the data specification of HLT TPC data blocks describes ranges of
# from-to slices/partitions in the corresponding bitfields of the 32bit specification
spec=`printf 0x%02x%02x%02x%02x $slice $slice $part $part`
echo "$outputevent: processing slice $slice partition $part (data specification $spec)"
for inputpath in `ls ${inputeventlist[0]}/*$spec* | sed -e '/CLUSTERS/!d'`; do
filename=`basename $inputpath`
outputfile=$outputevent/$filename
if test -e $outputfile ; then
echo "file $outputfile existing, skipping ..."
continue
fi
echo ${inputeventlist[@]} > $outputevent/filelist.txt
(echo "-o $outputevent/$filename"; for ev in ${inputeventlist[@]}; do echo "$ev/$filename"; done) \
| root -b -q -l $macropath
done
done
done

let nOutput++
c=0
unset inputeventlist
else
let c++
fi
done
29 changes: 29 additions & 0 deletions devices/aliceHLTwrapper/macros/runHLT.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const char* defaultCDBUri="local://./OCDB";
void runHLT(const char* chain, int events=1, int runno=-1, const char* cdbURI=defaultCDBUri)
{
// setup the OCDB access
// required to load the GRP entry in order to initialize the magnetic field
if (runno>=0) {
AliCDBManager::Instance()->SetDefaultStorage(cdbURI);
AliCDBManager::Instance()->SetRun(runno);
AliGRPManager grpman;
grpman.ReadGRPEntry();
grpman.SetMagField();
}

// init the HLT system
AliHLTSystem* pHLT=AliHLTPluginBase::GetInstance();

///////////////////////////////////////////////////////////////////////////////////////////
//
// list of configurations
//
///////////////////////////////////////////////////////////////////////////////////////////

if (chain) {
pHLT->ScanOptions("loglevel=0x7c");
//pHLT->ScanOptions("loglevel=0x7f frameworklog=0x7f");
pHLT->BuildTaskList(chain);
pHLT->Run(events);
}
}