// $Id$ void sampleRawAnalysis(); /** * @file sampleRawAnalysis.C * @brief Example macro to run the AliHLTSampleRawAnalysisComponent in * AliReconstruction. * * The component subscribes to DDL raw data published by the * AliHLTRawReaderPublisherComponent. The macros requires a raw data file * and a corresponding GRP entry. * *
 * Usage: aliroot -b -q -l \
 *     sampleRawAnalysis.C'("rawfile", "cdb", minEvent, maxEvent)'
 *
 * Examples:
 *     sampleRawAnalysis.C'("raw.root", minEvent, MaxEvent)'
 *     sampleRawAnalysis.C'("./", minEvent, MaxEvent)'
 *     sampleRawAnalysis.C'("alien:///alice/data/2010/.../raw/....root")' 
 *
 * Defaults
 *     cdb="local://$ALICE_ROOT/OCDB" -> take local OCDB from distribution
 *     minEvent=-1   -> no lower event selection
 *     maxEvent=-1   -> no upper event selection
 *
 * 
* * The input file can be a local raw.root file but also a file from the * GRID. The separate DDL files generated in simulation can be accessed * using AliRawReaderFile by speficying "directory/". * * Since the macro runs AliReconstruction the OCDB needs to be set up, in * particular the GRP entry. If testing with a local OCDB you have to * simulate some events and run the macro in the folder of the simulation. * Also HLT components configure from objects in the OCDB. * * Note: You need a valid GRID token, if you want to access files directly * from the Grid, use 'alien-token-init' of your alien installation. * * @author Matthias.Richter@ift.uib.no * @ingroup alihlt_tutorial */ void sampleRawAnalysis(const char *filename, const char *cdbURI, int minEvent=-1, int maxEvent=-1) { if(!gSystem->AccessPathName("galice.root")){ cerr << "AliReconstruction on raw data requires to delete galice.root, or run at different place." << endl; cerr << "!!! DO NOT DELETE the galice.root of your simulation, but create a subfolder !!!!" << endl; return; } if (gSystem->AccessPathName(filename)) { cerr << "can not find file " << filename << endl; return; } // connect to the GRID if we use a file or OCDB from the GRID TString struri=cdbURI; TString strfile=filename; if (struri.BeginsWith("raw://") || strfile.Contains("://") && !strfile.Contains("local://")) { TGrid::Connect("alien"); } // Set the CDB storage location AliCDBManager * man = AliCDBManager::Instance(); man->SetDefaultStorage(cdbURI); if (struri.BeginsWith("local://")) { // set specific storage for GRP entry // search in the working directory and one level above, the latter // follows the standard simulation setup like e.g. in test/ppbench if (!gSystem->AccessPathName("GRP/GRP/Data")) { man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD"); } else if (!gSystem->AccessPathName("../GRP/GRP/Data")) { man->SetSpecificStorage("GRP/GRP/Data", "local://$PWD/.."); } else { cerr << "can not find a GRP entry, please run the macro in the folder" << endl; cerr << "of a simulated data sample, or specify a GRID OCDB" << endl; sampleRawAnalysis(); return; } } ////////////////////////////////////////////////////////////////////////////////////// // // Reconstruction settings AliReconstruction rec; if (minEvent>=0 || maxEvent>minEvent) { if (minEvent<0) minEvent=0; if (maxEvent take local OCDB" << endl; cout << " minEvent=-1 -> no lower event selection" << endl; cout << " maxEvent=-1 -> no upper event selection" << endl; }