2 //**************************************************************************
3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
6 //* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> *
7 //* for The ALICE HLT Project. *
9 //* Permission to use, copy, modify and distribute this software and its *
10 //* documentation strictly for non-commercial purposes is hereby granted *
11 //* without fee, provided that the above copyright notice appears in all *
12 //* copies and that both the copyright notice and this permission notice *
13 //* appear in the supporting documentation. The authors make no claims *
14 //* about the suitability of this software for any purpose. It is *
15 //* provided "as is" without express or implied warranty. *
16 //**************************************************************************
18 /** @file AliHLTTPCNoiseMap.cxx
19 @author Kalliopi Kanaki
21 @brief Class for reading the noise map from HCDB.
28 #include "AliHLTTPCNoiseMap.h"
30 #include "AliCDBEntry.h"
31 #include "AliCDBManager.h"
32 #include "AliCDBStorage.h"
33 #include "AliCDBPath.h"
35 #include "TObjString.h"
37 ClassImp(AliHLTTPCNoiseMap)
39 AliHLTTPCNoiseMap::AliHLTTPCNoiseMap(){
40 // see header file for class documentation //
42 // refer to README to build package //
44 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt //
47 AliHLTTPCNoiseMap* AliHLTTPCNoiseMap::pNoiseMapInstance = 0; // initialize pointer
49 AliHLTTPCNoiseMap* AliHLTTPCNoiseMap::Instance(){
50 // see header file for class documentation
52 if (pNoiseMapInstance == 0){
53 pNoiseMapInstance = new AliHLTTPCNoiseMap; // create sole instance
55 return pNoiseMapInstance; // address of sole instance
58 AliTPCCalPad* AliHLTTPCNoiseMap::ReadNoiseMap(Int_t runNo){
59 // see header file for class documentation
60 const char* pathNoiseMap = "TPC/Calib/PadNoise";
61 AliTPCCalPad *padNoise = NULL;
65 //AliCDBPath path(pathNoiseMap);
66 //AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path); // read from the default storage
67 // for local testing purposes
69 AliCDBStorage *stor = AliCDBManager::Instance()->GetDefaultStorage();
71 HLTError("Cannot get HCDB default storage.");
75 AliCDBPath path(pathNoiseMap);
76 Int_t version = stor->GetLatestVersion(pathNoiseMap, runNo);
77 Int_t subVersion = stor->GetLatestSubVersion(pathNoiseMap, runNo, version);
79 //HLTInfo("RunNo %d, version %d, subversion %d", runNo, version, subVersion);
81 AliCDBEntry *pEntry = stor->Get(path, runNo, version, subVersion);
84 padNoise = (AliTPCCalPad*)pEntry->GetObject();
86 TObjString *pString = dynamic_cast<TObjString*>(pEntry->GetObject());
88 HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); }
92 HLTError("cannot fetch object \"%s\" from CDB", pathNoiseMap);
94 } // end if pathNoiseMap