1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
6 * Artur Szostak <artursz@iafrica.com> *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 **************************************************************************/
20 /// @file AliHLTMUONProcessor.cxx
21 /// @author Artur Szostak <artursz@iafrica.com>
23 /// @brief Implementation of the abstract base dHLT processor component.
25 /// This component is the abstract base class of dHLT specific components.
26 /// It implements some common methods used by all the dHLT components.
29 #include "AliHLTMUONProcessor.h"
30 #include "AliCDBManager.h"
31 #include "AliCDBStorage.h"
33 #include "AliMpDDLStore.h"
34 #include "AliMpDEStore.h"
36 ClassImp(AliHLTMUONProcessor)
39 int AliHLTMUONProcessor::FetchMappingStores(
40 const char* cdbPath, Int_t run, bool useDefault
43 /// Fetches the DDL and detector element store objects for MUON mapping.
44 /// \param cdbPath The CDB path to use. If set to NULL and the path has
45 /// not been set in the CDB manager then the default path
46 /// "local://$ALICE_ROOT" is used if the 'useDefault' flag is also true.
47 /// \param run The run number to use. If set to -1 and the run number has
48 /// not been set in the CDB manager then a value of zero is used if
49 /// the 'useDefault' flag is also true.
50 /// \param useDefault If set to true then a default CDB path and run number
51 /// is used if they have not been set and 'cdbPath' == NULL or
53 /// \return Zero if the object could be loaded. Otherwise an error code is
54 /// returned, which is compatible with the HLT framework.
55 /// \note AliMpDDLStore::Instance() and AliMpDEStore::Instance() must be used
56 /// to fetch the objects after this method returns a code equal to zero.
60 // Check if the objects are already loaded. If they are then exit early,
61 // otherwise we need to try load the objects.
62 if (AliMpDDLStore::Instance(warn) != NULL and AliMpDEStore::Instance(warn) != NULL)
65 const char* defaultPath = "local://$ALICE_ROOT";
68 AliCDBManager* cdbManager = AliCDBManager::Instance();
69 if (cdbManager == NULL)
71 HLTError("CDB manager instance does not exist.");
75 // Setup the CDB path.
76 const char* cdbPathUsed = "unknown (not set)";
79 cdbManager->SetDefaultStorage(cdbPath);
80 cdbPathUsed = cdbPath;
84 AliCDBStorage* store = cdbManager->GetDefaultStorage();
89 cdbManager->SetDefaultStorage(defaultPath);
90 cdbPathUsed = defaultPath;
95 cdbPathUsed = store->GetURI().Data();
99 // Now setup the run number.
102 cdbManager->SetRun(run);
106 if (useDefault) cdbManager->SetRun(defaultRun);
108 Int_t runUsed = cdbManager->GetRun();
110 // Now we can try load the DDL and DE store objects.
111 if (not AliMpCDB::LoadDDLStore(warn))
113 HLTError("Failed to load DDL or detector element store specified"
114 " for CDB path '%s' and run no. %d.",
120 if (AliMpDDLStore::Instance(warn) == NULL or AliMpDEStore::Instance(warn) == NULL)
122 HLTError("Could not find or load the DDL or detector element store instance.");