2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
6 //* Primary Authors Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
7 //* for The ALICE HLT Project. *
9 //* Permission to use, copy, modify and distribute this software and its *
10 //* documentation strictly for non-commercial purposes is hereby granted *
11 //* without fee, provided that the above copyright notice appears in all *
12 //* copies and that both the copyright notice and this permission notice *
13 //* appear in the supporting documentation. The authors make no claims *
14 //* about the suitability of this software for any purpose. It is *
15 //* provided "as is" without express or implied warranty. *
16 //**************************************************************************
19 * @file transformFCFtoSFC.C
20 * @author Kalliopi.Kanaki@ift.uib.no
22 * @brief Test macro for the AliHLTTPCHWClusterTransformComponent.cxx
25 * This macro tests the component that does the tranformation from the HW
26 * cluster format to the software cluster structure.
27 * For the macro to work, the user needs to use the FilePublisher component
28 * to make the input files available. The data specification has to be given
29 * and the input files have to be present.
31 * In order for the reconstruction to work properly at the absence of raw/ folders,
32 * a directory has to be specified as the input argument of the function
33 * and an empty raw0 folder will be created if not present.
35 * The macro looks for a folder called FCFFiles by default, where the produced FCF files
36 * should be (format TPC_ddlnumber.fcf or .bin). Argument number 2 can be set to look in a different
39 * In addition, since the $ALICE_ROOT/OCDB/GRP/GRP/Data entry has been removed as obsolete,
40 * the user needs to produce 1 simulated event, in order to create a proper GRP entry in the
41 * local folder, which will be used by the line
43 * rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));
45 * The component runs without arguments, except for the case when we want to differentiate
46 * between the FCF and the SFC output. Then the argument -change-dataId will change the
47 * data Id of the FCF output.
50 void transformFCFtoSCF(const char* input="./",const char* dirName="./"){
52 gSystem->Exec("rm galice.root");
54 if(!gSystem->AccessPathName("galice.root")){
55 cerr << "Please delete file galice.root or run at a different place." << endl;
60 cerr << "please specify input or run without arguments" << endl;
65 inputStr.Form("%s",input);
68 if(inputStr.CompareTo("./") == 0){
69 if(gSystem->AccessPathName("./raw0")){
70 cout<<"No raw folder found, making dummy raw0 directory...."<<endl;
71 gSystem->Exec("mkdir raw0");
73 inputStr.Form("%s/",gSystem->pwd());
76 if(!inputStr.EndsWith("/")){
81 dir.Form("%s%s/raw0",inputStr.Data(),dirName);
83 if(!dir.EndsWith("/")){
87 if(gSystem->AccessPathName(dir)){
88 cerr << "Input directory does not exist: "<<dir.Data() << endl;
93 /////////////////////////////////////////////////////////////////////////////////////////////////
95 // init the HLT system in order to define the analysis chain below
97 gSystem->Load("libHLTrec");
98 AliHLTSystem *gHLT = AliHLTReconstructorBase::GetInstance();
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
102 // define the analysis chain to be run
115 for(int slice=iMinSlice; slice<=iMaxSlice; slice++){
117 TString trackerInput;
118 for(int part=iMinPart; part<=iMaxPart; part++){
121 if (part>1) ddlno+=72+4*slice+(part-2);
122 else ddlno+=2*slice+part;
125 file.Form("raw0/TPC_%d.bin",ddlno);
127 if(gSystem->AccessPathName(file)){
128 cerr << "Input file does not exist: "<< file.Data() << endl;
132 TString publisher, fcf, dumpout;
133 publisher.Form("DP_%02d_%d", slice, part);
135 argument.Form("-datatype 'HWCLUST1' 'TPC ' -datafile %s -dataspec 0x%02x%02x%02x%02x", file.Data(), slice, slice, part, part);
137 AliHLTConfiguration pubconf(publisher.Data(), "FilePublisher", NULL, argument.Data());
138 fcf.Form("FCF_%02d_%d", slice, part);
140 AliHLTConfiguration hwconf(fcf.Data(), "TPCHWClusterTransform", publisher.Data(), "");
142 if(trackerInput.Length()>0) trackerInput+=" ";
144 if(allclusters.Length()>0) allclusters+=" ";
147 dumpout.Form("DUMP_%02d_%d", slice, part);
149 TString argDump, dFile;
150 dFile.Form("FCF_%d.dump",ddlno);
151 argDump.Form("-directory FCFClusterDump -subdir=raw -datafile %s -specfmt= -blcknofmt= -idfmt= -skip-datatype", dFile.Data());
153 AliHLTConfiguration clusDumpconf(dumpout.Data(), "TPCClusterDump", fcf.Data(), argDump.Data());
155 if(dumpOutput.Length()>0) dumpOutput+=",";
160 tracker.Form("TR_%02d", slice);
161 AliHLTConfiguration trackerconf(tracker.Data(), "TPCCATracker", trackerInput.Data(), "");
163 if(mergerInput.Length()>0) mergerInput+=" ";
164 mergerInput+=tracker;
167 AliHLTConfiguration mergerconf("globalmerger","TPCCAGlobalMerger",mergerInput.Data(),"");
168 AliHLTConfiguration esdconf("ESD","GlobalEsdConverter","globalmerger","");
169 AliHLTConfiguration sink("esdfile", "EsdCollector", "ESD", "-directory FCF-hlt-tpc-esd");
172 if(histoInput.Length()>0) histoInput+=" ";
173 histoInput+=allclusters;
175 histoInput+="globalmerger";
177 AliHLTConfiguration histconf("histo","TPCTrackHisto",histoInput.Data(),"");
179 AliHLTConfiguration cfcompconf("comparison","TPCCFComparison",allclusters.Data(),"");
181 AliHLTConfiguration rfwconf("RFW","ROOTFileWriter","histo","-datafile FCF_trackhisto -overwrite -concatenate-events");
184 ///////////////////////////////////////////////////////////////////////////////////////////////////
186 // Init and run the reconstruction
187 // All but HLT reconstruction is switched off
189 AliReconstruction rec;
191 rec.SetRunVertexFinder(kFALSE);
192 rec.SetRunReconstruction("HLT");
193 rec.SetRunTracking("");
194 rec.SetLoadAlignFromCDB(0);
196 rec.SetDefaultStorage("local://$ALICE_ROOT/OCDB");
197 rec.SetSpecificStorage("GRP/GRP/Data", Form("local://%s",gSystem->pwd()));
199 option.Form("libAliHLTUtil.so libAliHLTRCU.so libAliHLTTPC.so libAliHLTGlobal.so loglevel=0x7c chains=comparison,RFW,esdfile,%s",dumpOutput.Data());
200 rec.SetOption("HLT", option);