]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TRD/macros/aliHLTTRDrun.cxx
update of macros: better default values for the macros and add <algorithm> library...
[u/mrichter/AliRoot.git] / HLT / TRD / macros / aliHLTTRDrun.cxx
CommitLineData
9d0c6289 1// This macro is used to profile the HLT::TRD code
2// usage: aliroot aliHLTTRDrun.cxx("/data/sim/") reconstruct raw ddls, /data/run/ must contain subfolders rawX
3
4#if !defined (__CINT__) || defined (__MAKECINT__)
5
6#include <iostream>
7#include <stdlib.h>
8#include <fstream>
9
10#include "TString.h"
11#include "TMath.h"
12
13#include "AliHLTSystem.h"
14#include "AliLog.h"
15#include "AliHLTDataTypes.h"
16#include "AliHLTConfiguration.h"
17
18#include <valgrind/callgrind.h>
19#include <sys/time.h>
20#endif
21
c93b2136 22#include <algorithm>
9d0c6289 23#include "initGRP.h"
24
25void aliHLTTRDrun(const TString inDir = gSystem->pwd());
26int main(int argc, char** argv)
27{
28 if(argc==2) aliHLTTRDrun(argv[1]);
29 else aliHLTTRDrun();
30}
31
32void aliHLTTRDrun(const TString inDir)
33{
34
35 // Is the TRD full?
36 Bool_t fullTRD=kFALSE;
37
38 // If not use these SMs:
39 Int_t TRDmodules[18] = {0,1,7,8,9,10,17,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1};
40
41 // Use custom arguments for components? i.e.: not reading OCDB arguments
42 Bool_t customArgs=kTRUE;
43
44 // Disable HLT flag?
45 Bool_t disableHLTflag=kTRUE;
46
47
48
49 /////////////////////////////////////
50
51 Int_t usedModules=0;
52 if(fullTRD){
53 usedModules = 18;
54 for(int i=0; i<18; i++)
55 TRDmodules[i]=i;
56 }else{
57 std::sort((UInt_t*)TRDmodules, ((UInt_t*)TRDmodules) + 18);
58 for(int i=0; i<18; i++)
59 if(TRDmodules[i]>-1)usedModules++;
60 }
61
62 AliHLTSystem gHLT;
63 AliLog::SetGlobalDebugLevel(1);
64 //AliLog::SetClassDebugLevel("AliTRDrawStream", 11);
65 /* enum ETpye {kFatal=0, kError, kWarning, kInfo, kDebug, kMaxType}; */
66 gHLT.SetGlobalLoggingLevel((AliHLTComponentLogSeverity)0x7f);
67 /* enum AliHLTComponentLogSeverity {
68 kHLTLogNone = 0,
69 kHLTLogBenchmark = 0x1,
70 kHLTLogDebug = 0x2,
71 kHLTLogInfo = 0x4,
72 kHLTLogWarning = 0x8,
73 kHLTLogError = 0x10,
74 kHLTLogFatal = 0x20,
75 few important messages not to be filtered out.
76 redirected to kHLTLogInfo in AliRoot
77 kHLTLogImportant = 0x40,
78 special value to enable all messages
79 kHLTLogAll = 0x7f,
80 the default logging filter
81 kHLTLogDefault = 0x79
82 useful = 0x45
83 */
84
85 gHLT.LoadComponentLibraries("libAliHLTUtil.so libAliHLTTRD.so libAliHLTMUON.so libAliHLTGlobal.so libAliHLTTrigger.so");
86
c93b2136 87 InitGRP("local://$ALICE_ROOT/OCDB",inDir.Data());
9d0c6289 88 TString inFolder = inDir+"/raw", inFile = "/TRD_", inExt = ".ddl";
89 TString sinput = " -datatype 'DDL_RAW ' 'TRD '";
90 TString temp1, temp2;
91 Int_t spec, startEvent=10, nEvents=30, ddl; //KR: start=10, nEvents=20;
92 for(Int_t Event=startEvent; Event<(nEvents+startEvent); Event++){
93 temp1=inFolder;
94 temp1+=Event;
95 temp1+=inFile;
96 for(int module=0; module<usedModules; module++){
97 spec=TMath::Power(2,TRDmodules[module]);
98 ddl=TRDmodules[module]+1024;
99 temp2=temp1;
100 temp2+=ddl;
101 temp2+=inExt;
102 sinput+=" -dataspec ";
103 sinput+=spec;
104 sinput+=" -datafile ";
105 sinput+=temp2;
106 }
107 sinput+=" -nextevent";
108 }
109 printf("%s\n",sinput.Data());
110 TString sCFArgs = "";//"output_percentage 700 -lowflux -simulation -tailcancellation -yPosMethod LUT"; //-processTracklets
111 TString sTrackerArgs = "";//"output_percentage 100 -lowflux -NTimeBins 24";
112
113 if(customArgs || disableHLTflag){
114 sCFArgs = "output_percentage 700 -lowflux -experiment -tailcancellation -faststreamer -yPosMethod LUT";
115 sTrackerArgs = "output_percentage 100 -lowflux -PIDmethod NN"; // -highLevelOutput yes -emulateHLTTracks yes
116 if(disableHLTflag){
117 sCFArgs +=" -HLTflag no";
118 sTrackerArgs +=" -HLTflag no";
119 }
120 }
121
122 // ======== Configuring chain
123 // Chain 1
124 AliHLTConfiguration Hsource("Hsource", "FilePublisher", 0, sinput);
125 AliHLTConfiguration HClusterizer("HClusterizer", "TRDClusterizer", "Hsource", sCFArgs);
126 AliHLTConfiguration HWriterCF("HWriterCF", "FileWriter", "HClusterizer", "-directory output/ -datafile cf.out");
127 AliHLTConfiguration HClustMultTrig("HClustMultTrig", "TrdClusterMultiplicityTrigger", "HClusterizer", "-MultiplicityThresh 400");
128
129 AliHLTConfiguration HTracker("HTracker", "TRDTrackerV1", "HClusterizer", sTrackerArgs);
130 AliHLTConfiguration HCalib("HCalib", "TRDCalibration", "HTracker", "-TrgStr hi -rejectTrgStr");
131 AliHLTConfiguration HWriterCalib("HWriterCalib", "ROOTFileWriter", "HCalib", "-directory output/ -datafile calib.root -concatenate-events -concatenate-blocks -write-all-events");
132
133 AliHLTConfiguration HESDMaker("HESDMaker", "GlobalEsdConverter", "HTracker", "-notree");
134 AliHLTConfiguration HTrackMerger("HTrackMerger", "GlobalTrackMerger", "HTracker", "");
135
136 AliHLTConfiguration HClHisto("HClHisto", "TRDClusterHisto", "HClusterizer", "-pushback-period=10");
137 AliHLTConfiguration HWriterHisto("HWriterHisto", "ROOTFileWriter", "HClHisto", "-directory output/ -datafile histo.root -concatenate-events -concatenate-blocks");
138
139 AliHLTConfiguration writerOffConf("esdWriter", "TRDEsdWriter", "HTracker", "-datafile AliHLTTRDESDs.root -concatenate-events -concatenate-blocks");
140
141 gHLT.BuildTaskList(&HTracker);
142 //gHLT.BuildTaskList(&HClHisto);
143 //gHLT.BuildTaskList(&writerOffConf);
144 //gHLT.BuildTaskList(&HCalib);
145
146 gHLT.Run(nEvents);
147}
148