// ask child to create the tree.
int iResult = 0;
+ // component configuration
+ //Stage 1: default initialization.
+ //"Default" (for derived component) histograms.
+ FillHistogramDefinitions();
+ //Default values.
+ fMaxEntries = kMaxEntries;
+ fPublishInterval = kInterval;
+ fLastTime = 0;
+ //Stage 2: OCDB.
+ TString cdbPath("HLT/ConfigHLT/");
+ cdbPath += GetComponentID();
+ //
+ iResult = ConfigureFromCDBTObjString(cdbPath);
+ //
+ if (iResult < 0)
+ return iResult;
+ //Stage 3: command line arguments.
+ if (argc && (iResult = ConfigureFromArgumentString(argc, argv)) < 0)
+ return iResult;
+
// calculating a unique id from the hostname and process id
// used for identifying output of multiple components
TUUID guid = GenerateGUID();
guid.GetUUID(buf);
fUniqueId = bufAsInt[0];
-
if (!fTree) {
- std::auto_ptr<TTree> ptr(CreateTree(argc, argv));
+ // originally foreseen to pass the arguments to the function, however
+ // this is not appropriate. Argument scan via overloaded function
+ // ScanConfigurationArgument
+ std::auto_ptr<TTree> ptr(CreateTree(0, NULL));
if (ptr.get()) {
- //Stage 1: default initialization.
ptr->SetDirectory(0);
- //"Default" (for derived component) histograms.
- FillHistogramDefinitions();
- //Default values.
- fMaxEntries = kMaxEntries;
- fPublishInterval = kInterval;
- fLastTime = 0;
- //Stage 2: OCDB.
- TString cdbPath("HLT/ConfigHLT/");
- cdbPath += GetComponentID();
- //
- iResult = ConfigureFromCDBTObjString(cdbPath);
- //
- if (iResult < 0)
- return iResult;
- //Stage 3: command line arguments.
- if (argc && (iResult = ConfigureFromArgumentString(argc, argv)) < 0)
- return iResult;
-
ptr->SetCircular(fMaxEntries);
fTree = ptr.release();
} else //No way to process error correctly - error is unknown here.
bool bDoPublishing=false;
const int cycleResetInterval=1000;
if (fpEventTimer && fpCycleTimer) {
- averageEventTime=(fpEventTimer->RealTime()*fgkTimeScale)/(GetEventCount()+1);
- fillingtime=fpEventTimer->RealTime()*fgkTimeScale;
+ averageEventTime=AliHLTUInt32_t(fpEventTimer->RealTime()*fgkTimeScale)/(GetEventCount()+1);
+ fillingtime=int(fpEventTimer->RealTime()*fgkTimeScale);
publishtime=fillingtime;
fpEventTimer->Start(kFALSE);
fpCycleTimer->Stop();
- averageCycleTime=(fpCycleTimer->RealTime()*fgkTimeScale)/((GetEventCount()%cycleResetInterval)+1);
+ averageCycleTime=AliHLTUInt32_t(fpCycleTimer->RealTime()*fgkTimeScale)/((GetEventCount()%cycleResetInterval)+1);
// adapt processing to 3/4 of the max time
bDoFilling=4*averageEventTime<3*fMaxEventTime ||
(averageEventTime<fCycleTimeFactor*averageCycleTime && fpCycleTimer->RealTime()>fIgnoreCycleTime);
}
if (fpEventTimer) {
fpEventTimer->Stop();
- fillingtime=fpEventTimer->RealTime()*fgkTimeScale-fillingtime;
+ fillingtime=int(fpEventTimer->RealTime()*fgkTimeScale)-fillingtime;
if (fillingtime<0) fillingtime=0;
fpEventTimer->Start(kFALSE);
}
if (fpEventTimer) {
fpEventTimer->Stop();
- publishtime=fpEventTimer->RealTime()*fgkTimeScale-publishtime;
+ publishtime=int(fpEventTimer->RealTime()*fgkTimeScale)-publishtime;
if (publishtime>fillingtime) publishtime-=fillingtime;
else publishtime=0;
- averageEventTime=(fpEventTimer->RealTime()*fgkTimeScale)/(GetEventCount()+1);
+ averageEventTime=AliHLTUInt32_t(fpEventTimer->RealTime()*fgkTimeScale)/(GetEventCount()+1);
// info output once every 5 seconds
static UInt_t lastTime=0;
// possible arguments:
// -maxentries number
// -interval number
- // -histogram name -size number -expression expression [-cut expression ][-opt option]
+ // -histogram name -size number -expression expression [-title expression ] -cut expression ][-opt option]
// As soon as "-histogram" found, -size and -expression and -outtype are required,
// cut and option can be omitted.
if (argc <= 0)
AliHLTHistogramDefinition def;
int i = 0;
- int maxEntries = 0;
+ int maxEntries = fMaxEntries;
while (i < argc) {
const TString argument(argv[i]);
hist->SetOption(d.GetDrawOption().Data());
}
+ //Reformatting the histogram name
+ TString str2=d.GetCut().Data();
+ str2.ReplaceAll("Track_", "");
+ str2.ReplaceAll("&&", " ");
+ str2 = histName+" "+str2;
+ hist->SetTitle(str2);
+
+ if(d.GetTitle().Length()){
+
+ //removing underscore
+ size_t found;
+ string str=d.GetTitle().Data();
+ found=str.find_first_of("_");
+ if(!(d.GetExpression().CompareTo("Track_pt"))){
+ found=str.find_first_of("_",found+1);
+ }
+ str[found]=' ';
+ char axis[100];
+ sprintf(axis,"%s",str.c_str());
+
+ hist->SetXTitle(axis);
+ hist->GetXaxis()->CenterTitle();
+ }
return hist;
}
int AliHLTTTreeProcessor::ParseHistogramDefinition(int argc, const char** argv, int pos, AliHLTHistogramDefinition& dst)const
{
//Histogram-definition:
- // -histogram name -size number -expression expression [-cut expression][-opt option]
+ // -histogram name -size number -expression expression [-title expression][-cut expression][-opt option]
//at pos we have '-histogram', at pos + 1 must be the name.
if (pos + 1 == argc) {
pos += 2;
int processed = 6;
+ dst.SetTitle("");
dst.SetCut("");
dst.SetDrawOption("");
- //remaining options can be the cut and Draw option.
- //cut must be first.
+ //remaining options can be the title, cut and Draw option.
+ //title must be first
+ if (pos + 1 >= argc){
+ return processed;
+ }
+ if (TString(argv[pos]).CompareTo("-title") == 0) {
+ dst.SetTitle(argv[pos + 1]);
+ pos += 2;
+ processed += 2;
+ }
+
+ //cut must be second.
if (pos + 1 >= argc)
return processed;