]>
Commit | Line | Data |
---|---|---|
dadc7068 | 1 | // $Id$ |
2 | //************************************************************************** | |
3 | //* This file is property of and copyright by the ALICE HLT Project * | |
4 | //* ALICE Experiment at CERN, All rights reserved. * | |
5 | //* * | |
6 | //* Primary Authors: Kalliopi Kanaki <Kalliopi.Kanaki@ift.uib.no> * | |
7 | //* for The ALICE HLT Project. * | |
8 | //* * | |
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 | //************************************************************************** | |
17 | ||
18 | /** @file AliHLTTPCNoiseMap.cxx | |
19 | @author Kalliopi Kanaki | |
3a3550fa | 20 | @date |
dadc7068 | 21 | @brief Class for reading the noise map from HCDB. |
22 | */ | |
23 | ||
24 | #if __GNUC__>= 3 | |
25 | using namespace std; | |
26 | #endif | |
27 | ||
28 | #include "AliHLTTPCNoiseMap.h" | |
29 | ||
30 | #include "AliCDBEntry.h" | |
31 | #include "AliCDBManager.h" | |
32 | #include "AliCDBStorage.h" | |
33 | #include "AliCDBPath.h" | |
34 | ||
35 | #include "TObjString.h" | |
36 | ||
37 | ClassImp(AliHLTTPCNoiseMap) | |
38 | ||
39 | AliHLTTPCNoiseMap::AliHLTTPCNoiseMap(){ | |
40 | // see header file for class documentation // | |
41 | // or // | |
42 | // refer to README to build package // | |
43 | // or // | |
44 | // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt // | |
45 | } | |
46 | ||
47 | AliHLTTPCNoiseMap* AliHLTTPCNoiseMap::pNoiseMapInstance = 0; // initialize pointer | |
48 | ||
49 | AliHLTTPCNoiseMap* AliHLTTPCNoiseMap::Instance(){ | |
50 | // see header file for class documentation | |
51 | ||
52 | if (pNoiseMapInstance == 0){ | |
53 | pNoiseMapInstance = new AliHLTTPCNoiseMap; // create sole instance | |
54 | } | |
55 | return pNoiseMapInstance; // address of sole instance | |
56 | } | |
57 | ||
58 | AliTPCCalPad* AliHLTTPCNoiseMap::ReadNoiseMap(){ | |
59 | // see header file for class documentation | |
60 | ||
61 | const char* pathNoiseMap = "TPC/Calib/PadNoise"; | |
62 | AliTPCCalPad *padNoise = NULL; | |
63 | ||
64 | if(pathNoiseMap){ | |
65 | ||
66 | //AliCDBPath path(pathNoiseMap); | |
67 | //AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(path); // read from the default storage | |
68 | // for local testing purposes | |
69 | ||
70 | AliCDBStorage *stor = AliCDBManager::Instance()->GetStorage(pathNoiseMap); | |
71 | AliCDBEntry *pEntry = stor->Get(pathNoiseMap,AliCDBManager::Instance()->GetRun()); | |
72 | ||
73 | if(pEntry){ | |
74 | padNoise = (AliTPCCalPad*)pEntry->GetObject(); | |
75 | TObjString *pString = dynamic_cast<TObjString*>(pEntry->GetObject()); | |
76 | if(pString){ HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data()); } | |
77 | } // end if pEntry | |
78 | else { HLTError("cannot fetch object \"%s\" from CDB", pathNoiseMap); } | |
79 | } // end if pathNoiseMap | |
80 | return padNoise; | |
81 | } |