]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/EMCAL/macros/hlt_rec.C
Merge remote-tracking branch 'origin/master' into flatdev
[u/mrichter/AliRoot.git] / HLT / EMCAL / macros / hlt_rec.C
1 void hlt_rec(const char* input="./") {
2
3   // For real data:
4  // AliCDBManager::Instance()->SetDefaultStorage("raw://");
5  
6   gStyle->SetPalette(1);
7
8   if(!gSystem->AccessPathName("galice.root")){
9     cerr << "please delete the galice.root or run at different place." << endl;
10     return;
11   }
12  
13   if (!input) {
14     cerr << "please specify input or run without arguments" << endl;
15     return;
16   }
17
18   //////////////////////////////////////////////////////////////////////////////////////////////////
19   //
20   // init the HLT system in order to define the analysis chain below
21   //
22   
23   AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
24
25   gHLT->LoadComponentLibraries("libAliHLTUtil.so");
26   gHLT->LoadComponentLibraries("libAliHLTRCU.so");
27   gHLT->LoadComponentLibraries("libAliHLTCalo.so");
28   gHLT->LoadComponentLibraries("libAliHLTEMCAL.so");
29   gHLT->LoadComponentLibraries("libAliHLTPHOS.so");
30   gHLT->LoadComponentLibraries("libAliHLTGlobal.so");
31
32   //////////////////////////////////////////////////////////////////////////////////////////////////
33   //
34   // define the analysis chain to be run
35   //
36
37   // Define which modules and RCUs to use
38   int moduleStart = 0;
39   int moduleEnd = 9;
40   int rcuStart = 0;
41   int rcuEnd = 1;
42   
43   // The number of RCUs per module in EMCAL (used for calculating data specification)
44
45   Int_t rcusPerModule = 2;
46   Int_t ddlOffset = 4608; // The DDL offset for EMCAL (for PHOS the number is 1792)
47   
48   TString arg, fwInput, ecInput, dm;
49
50   // Loop over the modules/RCUs
51   for (int module = moduleStart; module <= moduleEnd; module++) 
52     {
53       TString clInput;
54       
55       for(int rcu = rcuStart; rcu <= rcuEnd; rcu++) 
56         {
57           TString publisher, rawanalyzer, dm;
58
59           // Raw data publisher
60           publisher.Form("EMC-RP_%02d_%d", module, rcu);
61           
62          arg.Form("-verbose -minid %d -datatype 'DDL_RAW ' 'EMCA'  -dataspec 0x%x ", ddlOffset + module*(rcusPerModule) + rcu, 0x1 << (module*rcusPerModule + rcu));
63           AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
64           cout << arg.Data() << endl;
65
66           // Raw analyzer
67           arg = "";
68           rawanalyzer.Form("EMC-RA_%02d_%d", module, rcu);
69           AliHLTConfiguration rawConf(rawanalyzer.Data(), "EmcalRawCrude", publisher.Data(), arg.Data());
70            
71           // If you want to have a component subscribing to all the raw analyzers this will be it's input
72           if(fwInput.Length() > 0) fwInput += " ";
73           fwInput+=rawanalyzer;
74           cout << ">>>>>>>>>> fwInput:" << fwInput << endl;
75           
76           // digit maker components
77           dm.Form("EMC-DM_%02d_%d", module, rcu);
78           arg="";
79           // HI-GAIN ~ 15/256 ------ CHECK LOW GAIN FACTOR
80           arg.Form("-highgainfactor 0.0167 -lowgainfactor 0.08");
81           AliHLTConfiguration dmConf(dm.Data(), "EmcalDigitMaker", rawanalyzer.Data(), arg.Data());
82           if(clInput.Length() > 0) clInput += " ";
83           clInput+=dm;
84           cout << ">>>>>>>>>> clInput:" << clInput << endl;     
85         
86         } // end of RCU loop
87
88         TString cl, ca;
89
90         cl.Form("EMC-CL_%02d", module);
91         arg = "";
92         // digitthreshold was 0.005
93         arg.Form("-digitthreshold 0.0167 -recpointthreshold 0.1");
94         AliHLTConfiguration clConf(cl.Data(), "EmcalClusterizer", clInput.Data(), arg.Data());
95         if(ecInput.Length() > 0) ecInput += " ";
96         ecInput += cl;
97
98     } // end of module loop
99
100   TString ec, test;
101
102      // The call the histo maker 
103         arg.Form("");
104         arg.Form("-pushfraction 5 -beverbose 1");
105         test = ecInput + " " + fwInput + " ";
106         AliHLTConfiguration hfConf("emcalHisto","EmcalRawHistoMaker",test.Data(), arg.Data());
107         ecInput += " emcalHisto";
108         cout << ">>>>>>>>>> test:" << test << endl;     
109                 
110         ec.Form("ESD-CONVERTER");
111         arg = "";
112         AliHLTConfiguration esdcconf(ec.Data(), "GlobalEsdConverter"   , ecInput.Data(), "");
113
114
115   // The filewriter 
116 //  arg.Form("-datatype 'CHANNELT' 'EMCA' -datafile RAout.root -concatenate-blocks -concatenate-events");
117 //  AliHLTConfiguration fwConf("filewriter", "FileWriter", fwInput.Data(), arg.Data());
118   
119   // The call the histo maker 
120 //  arg.Form("");
121 //  arg.Form("-pushfraction 5 -beverbose 1");
122 //  AliHLTConfiguration hfConf("emcalHisto","EmcalRawHistoMaker",fwInput.Data(), arg.Data());
123   
124   // Write the root file 
125   //AliHLTConfiguration rwConf("rootFileHisto","ROOTFileWriter", "emcalHisto ESD-CONVERTER","-datafile roothisto.root -concatenate-events -overwrite");
126
127
128
129   
130   //////////////////////////////////////////////////////////////////////
131   //
132   // Init and run the reconstruction
133   // All but HLT reconstruction is switched off 
134   //
135   /////////////////////////////////////////////////////////////////////
136
137   TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTCalo.so libAliHLTEMCAL.so libAliHLTGlobal.so chains=";
138   option+="ESD-CONVERTER";
139   //option+="rootFileHisto loglevel=0x5f";
140
141   AliReconstruction rec;
142   
143
144   // uncomment for simulation
145   rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
146   rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));
147
148   rec.SetRunReconstruction(":");
149   rec.SetEventRange(0,10);
150   rec.SetInput(input);
151   
152   //rec.SetInput("raw.root");
153   rec.SetRunVertexFinder(kFALSE);
154
155   rec.SetRunReconstruction("HLT");
156   //rec.SetRunTracking(":");
157   rec.SetLoadAlignFromCDB(0);
158   rec.SetRunQA(":");
159
160   rec.SetOption("HLT", option);
161   
162   rec.Run();
163
164
165 }