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