/**************************************************************************
* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
* *
* Author: The ALICE Off-line Project. *
* Contributors are mentioned in the code where appropriate. *
* *
* Permission to use, copy, modify and distribute this software and its *
* documentation strictly for non-commercial purposes is hereby granted *
* without fee, provided that the above copyright notice appears in all *
* copies and that both the copyright notice and this permission notice *
* appear in the supporting documentation. The authors make no claims *
* about the suitability of this software for any purpose. It is *
* provided "as is" without express or implied warranty. *
**************************************************************************/
/* $Id$ */
#if !defined(__CINT__) || defined(__MAKECINT__)
/// \ingroup macros
/// \file TestMUONPreprocessor.C
/// \brief The macro for testing the shuttle preprocessors
///
/// This macro runs the test preprocessor for MUON.
/// It uses AliTestShuttle to simulate a full Shuttle process
///
/// You must load relevant libraries (besides normal MUON ones -which is done
/// easily by executing root from the $ALICE_ROOT/MUON directory to use
/// the rootlogon.C there) before compiling this macro :
///
/// Last line above assume you have $ALICE_ROOT/MUON/lib/tgt_[arch] (where
/// libMUONshuttle is located) in your LD_LIBRARY_PATH
///
/// Having $ALICE_ROOT/SHUTTLE/TestShuttle directory in your LD_LIBRARY_PATH
/// (or DYLD_LIBRARY_PATH on Mac OS X) won't hurt either...
///
/// You must also make a link of some OCDB entries to have the mapping loaded
/// correctly :
///
///
/// cd $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB
/// mkdir -p MUON/Calib
/// cd MUON/Calib
/// ln -si $ALICE_ROOT/OCDB/MUON/Calib/MappingData .
///
///
/// and Align/Baseline if you'd like to test GMS subprocessor :
///
///
/// cd $ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB
/// mkdir -p MUON/Align
/// cd MUON/Align
/// ln -si $ALICE_ROOT/OCDB/MUON/Align/Baseline .
///
///
/// The input data has to be created first by other processes (or is created
/// here by CreateDCSAliasMap() for tracker HV).
///
/// To play with it, you'll have to set/modify several lines, to
/// - a) select input files, using shuttle->AddInputFile()
/// - b) select run type, using shuttle->AddInputRunParameter() (the run type
/// dictates which task is really performed by the MUONPreprocessor
///
/// The sourceDirectory is there to "emulate" what the real preprocessor will
/// find on the FXS, and is assumed to have the following structure :
///
///
/// IMPORTANT:
/// The trigger files have to be present in order for the algorithm to work correctly.
/// If you want to test the Trigger DCS maps only, but you don't have the .dat trigger files,
/// you have to create dummy files through :
///
///
/// For more information on usage, please see the \ref README_shuttle page.
///
/// \author Laurent Aphecetche, SUBATECH Nantes; \n
/// Diego Stocco, SUBATECH Nantes
#include "TestMUONPreprocessor.h"
#include "AliMUONTrackerPreprocessor.h"
#include "AliMUONTriggerPreprocessor.h"
#include "AliLog.h"
#include "AliMpBusPatch.h"
#include "AliMpExMap.h"
#include "AliMpHelper.h"
#include "AliMpDDLStore.h"
#include "AliMpDCSNamer.h"
#include "AliMpCDB.h"
#include "AliCDBManager.h"
#include "AliCDBEntry.h"
#include "AliCDBId.h"
#include "AliShuttleInterface.h"
#include "AliTestShuttle.h"
#include "AliDCSValue.h"
#include "Riostream.h"
#include "TSystem.h"
#include "TMap.h"
#include "TObjArray.h"
#include "TObjString.h"
#include "TString.h"
#include "TRandom.h"
#endif
//______________________________________________________________________________
void TestMUONPreprocessor(Int_t runNumber=80,
const char* runType="CALIBRATION",
const char* sourceDirectory="/afs/cern.ch/user/l/laphecet/public")
{
// runType can be :
//
// PEDESTAL -> pedestals
// CALIBRATION -> gains
// PHYSICS -> HV
// GMS
// create AliTestShuttle instance
// The parameters are run, startTime, endTime
gSystem->Load("libTestShuttle.so");
AliTestShuttle* shuttle = new AliTestShuttle(runNumber, 0, 1);
const char* inputCDB = "local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB";
AliTestShuttle::SetMainCDB(inputCDB);
AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/OCDB/SHUTTLE/TestShuttle/TestReference");
TString rt(runType);
rt.ToUpper();
if ( rt.Contains("PHYSICS") )
{
// Create DCS aliases
TMap* dcsAliasMap = CreateDCSAliasMap(inputCDB, runNumber);
if ( dcsAliasMap )
{
// now give the alias map to the shuttle
shuttle->SetDCSInput(dcsAliasMap);
}
}
printf("Test Shuttle temp dir: %s\n", AliShuttleInterface::GetShuttleTempDir());
printf("Test Shuttle log dir: %s\n", AliShuttleInterface::GetShuttleLogDir());
printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data());
printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data());
// The shuttle can process files that originate from DCS, DAQ and HLT.
// To test it, we provide some local files and locations where these would be found when
// the online machinery would be there.
// In real life this functions would be produces by the sub-detectors
// calibration programs in DCS, DAQ or HLT. These files can then be retrieved using the Shuttle.
//
// Files are added with the function AliTestShuttle::AddInputFile. The syntax is:
// AddInputFile(, , ,