// $Id$ /** * @file sampleCalibrationProcessor.C * @brief Run the SampleCalibration component (AliHLTSampleCalibrationComponent) * *
 * Usage: aliroot -b -q -l \
 *     sampleCalibrationProcessor.C'("file", "cdb", minEvent, maxEvent)'
 *
 * Examples:
 *     sampleCalibrationProcessor.C'("alien:///alice/data/2009/.../....root")' 
 *     sampleCalibrationProcessor.C'("raw.root", "local://$PWD", minEvent, MaxEvent)'
 *
 * Defaults
 *     cdb="local://$ALICE_ROOT/OCDB"  -> take local OCDB
 *     minEvent=-1   -> no lower event selection
 *     maxEvent=-1   -> no upper event selection
 *
 * 
* * An HLT chain is set up with one publisher for raw data which the calibration * component subscribes to. The output of the component is directed to a * ROOTFileWriter producing the file 'calibdata.root'. Another FileWriter * writes the data block designated for storage in the FXS. * The HLT chain is run in the context of AliReconstruction. * * The input file can be a file on the grid, indicated by the tag * 'alien://'. * If either the file or the OCDB is taken from the GRID, the macros * connects to the Grid in the beginning. * Note: You need a valid GRID token, use 'alien-token-init' of your * alien installation. * * This example uses the local OCDB as default, but other locations can * be specified, like e.g. "raw://". * * @author Matthias.Richter@ift.uib.no * @ingroup alihlt_tutorial */ void sampleCalibrationProcessor(const char *filename, const char *cdbURI, int minEvent=-1, int maxEvent=-1) { // 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; }