]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/macros/rec-hlt-phos.C
Temporary protection if one runs raw->sdigits for the real data.
[u/mrichter/AliRoot.git] / HLT / PHOS / macros / rec-hlt-phos.C
1
2
3 #include "AliHLTPHOSConstants.h"
4
5 //void rec_hlt_phos(const char* input="./")//, char* opt="decoder ESD")
6 void rec_hlt_phos()//, char* opt="decoder ESD")
7 {
8   AliCDBManager::Instance()->SetDefaultStorage("raw://");
9   if(!gSystem->AccessPathName("galice.root")){
10     cerr << "please delete the galice.root or run at different place." << endl;
11     return;
12   }
13  
14 //   if (!input) {
15 //     cerr << "please specify input or run without arguments" << endl;
16 //     return;
17 //   }
18
19   ///////////////////////////////////////////////////////////////////////////////////////////////////
20   //
21   // init the HLT system in order to define the analysis chain below
22   //
23   AliHLTSystem* gHLT=AliHLTPluginBase::GetInstance();
24  
25   ///////////////////////////////////////////////////////////////////////////////////////////////////
26   //
27   // define the analysis chain to be run
28   //
29    
30   int moduleStart = 0;
31   int moduleEnd = 4;
32   int rcuStart = 0;
33   int rcuEnd = 3;
34   TString option="libAliHLTUtil.so libAliHLTRCU.so libAliHLTPHOS.so libAliHLTGlobal.so loglevel=0x7f chains=ESD-FILE";
35   TString ecInput;
36   TString emInput;
37   
38   for (int module = moduleStart; module <= moduleEnd; module++) 
39     {
40       TString clInput;
41       
42       for(int rcu = rcuStart; rcu <= rcuEnd; rcu++) 
43         {
44           TString arg, publisher, ra, dm;
45           // raw data publisher components
46           publisher.Form("PHS-RP_%02d_%d", module, rcu);
47           arg.Form("-minid %d -datatype 'DDL_RAW ' 'PHOS'  -dataspec 0x%x ", 1792 + module*(PhosHLTConst::NRCUSPERMODULE) + rcu, 0x1 << (module*PhosHLTConst::NRCUSPERMODULE + rcu));
48           AliHLTConfiguration pubConf(publisher.Data(), "AliRawReaderPublisher", NULL , arg.Data());
49           
50           // Raw analyzer
51           arg = "";
52           ra.Form("PHS-RA_%02d_%d", module, rcu);
53           //      AliHLTConfiguration rawConf(ra.Data(), "PhosRawCrudev2", publisher.Data(), arg.Data())
54 ;         AliHLTConfiguration rawConf(ra.Data(), "PhosRawCrudev2", publisher.Data(), arg.Data());
55           
56           // digit maker components
57           dm.Form("PHS-DM_%02d_%d", module, rcu);
58           arg="";
59           arg.Form("-sethighgainfactor 0.005 -setlowgainfactor 0.08 -setdigitthresholds 0.005 0.002");
60           AliHLTConfiguration dmConf(dm.Data(), "PhosDigitMaker", ra.Data(), arg.Data());
61
62           if(clInput.Length() > 0) clInput += " ";
63           clInput+=dm;
64         }
65         TString arg, cl, ca;
66
67       cl.Form("PHS-CL_%02d", module);
68       arg = "";
69       arg.Form("-digitthreshold 0.005 -recpointthreshold 0.1 -modulemode");
70       AliHLTConfiguration clConf(cl.Data(), "PhosClusterizer", clInput.Data(), arg.Data());
71         
72       ca.Form("PHS-CA_%02d", module);
73       arg = "";
74       AliHLTConfiguration caConf(ca.Data(), "PhosClusterAnalyser", cl.Data(), arg.Data());
75
76       if(ecInput.Length() > 0) ecInput += " ";
77       ecInput += ca;
78     }
79       
80   emInput = ecInput;
81
82   TString arg, ec, em, hp, ef;
83   
84   em.Form("ESD-MAKER");
85
86   ec.Form("ESD-CONVERTER");
87   arg = "";
88
89   AliHLTConfiguration emConf(em.Data(), "PhosEsdEntriesMaker", ecInput.Data(), "");
90
91   AliHLTConfiguration esdcconf(ec.Data(), "GlobalEsdConverter"   , ecInput.Data(), "");
92   
93   // the root file writer configuration
94   ef.Form("ESD-FILE");
95   AliHLTConfiguration sink(ef.Data(), "EsdCollector", ec.Data(), "-directory hlt-phos-esd");
96
97   ///////////////////////////////////////////////////////////////////////////////////////////////////
98   //
99   // Init and run the reconstruction
100   // All but HLT reconstructio is switched off 
101   //
102   AliReconstruction rec;
103   //  rec.SetInput(input);
104   rec.SetInput("./");
105   rec.SetRunVertexFinder(kFALSE);
106   rec.SetRunLocalReconstruction("HLT PHOS");
107   rec.SetRunTracking(":");
108   rec.SetLoadAlignFromCDB(0);
109   rec.SetRunQA(":");
110
111   // NOTE: FillESD is a step in the AliReconstruction sequence and has
112   // nothing to do with the fact that this macro writes ESD output
113   // HLT processes the HLTOUT during FillESD and extracts data which
114   // has already been prepared. This step is currently not necessary for
115   // this macro
116   //  rec.SetRunLocalReconstruction("PHOS") ;
117
118   rec.SetFillESD("PHOS");
119   rec.SetOption("HLT", option);
120   rec.Run();
121 }