3 /**************************************************************************
4 * This file is property of and copyright by the ALICE HLT Project *
5 * ALICE Experiment at CERN, All rights reserved. *
7 * Primary Authors: Matthias Richter <Matthias.Richter@ift.uib.no> *
8 * for The ALICE HLT Project. *
10 * Permission to use, copy, modify and distribute this software and its *
11 * documentation strictly for non-commercial purposes is hereby granted *
12 * without fee, provided that the above copyright notice appears in all *
13 * copies and that both the copyright notice and this permission notice *
14 * appear in the supporting documentation. The authors make no claims *
15 * about the suitability of this software for any purpose. It is *
16 * provided "as is" without express or implied warranty. *
17 **************************************************************************/
19 /** @file AliHLTSimulation.cxx
20 @author Matthias Richter
22 @brief Binding class for HLT simulation in AliRoot. */
26 #include "AliHLTSimulation.h"
28 #include "AliRunLoader.h"
29 #include "AliHLTSystem.h"
31 #if ALIHLTSIMULATION_LIBRARY_VERSION != LIBHLTSIM_VERSION
32 #error library version in header file and lib*.pkg do not match
35 /** ROOT macro for the implementation of ROOT specific class methods */
36 ClassImp(AliHLTSimulation);
38 AliHLTSimulation::AliHLTSimulation()
43 // see header file for class documentation
45 // refer to README to build package
47 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
50 AliHLTSimulation::~AliHLTSimulation()
52 // see header file for function documentation
59 AliHLTSimulation* AliHLTSimulation::CreateInstance()
61 // see header file for function documentation
62 return new AliHLTSimulation;
65 int AliHLTSimulation::DeleteInstance(AliHLTSimulation* pSim)
67 // see header file for function documentation
73 int AliHLTSimulation::Init(AliRunLoader* pRunLoader, const char* options)
75 // init the simulation
78 if (!fpSystem) fpSystem=new AliHLTSystem;
80 AliError("can not create AliHLTSystem object");
83 if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
84 AliError("HLT system in error state");
88 if (fpSystem->ScanOptions(options)<0) {
89 AliError("error setting options for HLT system");
93 if (!fpSystem->CheckStatus(AliHLTSystem::kReady)) {
94 if ((fpSystem->Configure(pRunLoader))<0) {
95 AliError("error during HLT system configuration");
104 int AliHLTSimulation::Run(AliRunLoader* pRunLoader)
106 // HLT reconstruction for simulated data
108 AliError("Missing RunLoader! 0x0");
112 Int_t nEvents = pRunLoader->GetNumberOfEvents();
115 if (fpSystem->CheckStatus(AliHLTSystem::kError)) {
116 AliError("HLT system in error state");
119 if ((iResult=fpSystem->Reconstruct(nEvents, pRunLoader, NULL))>=0) {
125 AliHLTSimulation* AliHLTSimulationCreateInstance()
127 // see header file for function documentation
128 return AliHLTSimulation::CreateInstance();
131 int AliHLTSimulationDeleteInstance(AliHLTSimulation* pSim)
133 // see header file for function documentation
134 return AliHLTSimulation::DeleteInstance(pSim);
137 int AliHLTSimulationInit(AliHLTSimulation* pSim, AliRunLoader* pRunLoader, const char* options)
141 return pSim->Init(pRunLoader, options);
146 int AliHLTSimulationRun(AliHLTSimulation* pSim, AliRunLoader* pRunLoader)
150 return pSim->Run(pRunLoader);
155 int AliHLTSimulationGetLibraryVersion()
157 // see header file for function documentation
158 return LIBHLTSIM_VERSION;