]>
Commit | Line | Data |
---|---|---|
0145e89a | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | ||
18 | #include "AliMUONTrackerOCDBDataMaker.h" | |
19 | ||
20 | #include "AliMUONTrackerData.h" | |
21 | #include "AliCDBManager.h" | |
22 | #include "AliCDBStorage.h" | |
23 | #include "AliMUONCalibrationData.h" | |
24 | #include "AliMUONVStore.h" | |
25 | #include "AliLog.h" | |
26 | #include <TString.h> | |
27 | ||
28 | ///\class AliMUONTrackerOCDBDataMaker | |
29 | /// | |
30 | /// Producer of AliMUONVTrackerData from OCDB data | |
31 | /// | |
32 | ///\author Laurent Aphecetche, Subatech | |
33 | ||
34 | ///\cond CLASSIMP | |
35 | ClassImp(AliMUONTrackerOCDBDataMaker) | |
36 | ///\endcond | |
37 | ||
38 | //_____________________________________________________________________________ | |
39 | AliMUONTrackerOCDBDataMaker::AliMUONTrackerOCDBDataMaker(const char* ocdbPath, | |
40 | Int_t runNumber, | |
41 | const char* type) | |
42 | : AliMUONVTrackerDataMaker(), | |
43 | fIsValid(kTRUE), | |
0145e89a | 44 | fData(0x0), |
45 | fSource(Form("%s-%010d-%s",ocdbPath,runNumber,type)) | |
46 | { | |
47 | /// Ctor | |
48 | AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage(); | |
49 | ||
50 | AliCDBManager::Instance()->SetDefaultStorage(ocdbPath); | |
51 | ||
52 | AliMUONVStore* store(0x0); | |
53 | ||
54 | TString stype(type); | |
55 | stype.ToUpper(); | |
49419555 | 56 | Bool_t isSingleEvent(kTRUE); |
0145e89a | 57 | |
58 | if ( stype == "PEDESTALS" ) | |
59 | { | |
49419555 | 60 | fData = new AliMUONTrackerData(Form("PED%d",runNumber),"Pedestals",2,isSingleEvent); |
0145e89a | 61 | fData->SetDimensionName(0,"Mean"); |
62 | fData->SetDimensionName(1,"Sigma"); | |
63 | store = AliMUONCalibrationData::CreatePedestals(runNumber); | |
64 | } | |
65 | else if ( stype == "GAINS" ) | |
66 | { | |
49419555 | 67 | fData = new AliMUONTrackerData(Form("GAIN%d",runNumber),"Gains",5,isSingleEvent); |
10eb3d17 | 68 | fData->SetDimensionName(0,"a1"); |
69 | fData->SetDimensionName(1,"a2"); | |
0145e89a | 70 | fData->SetDimensionName(2,"thres"); |
71 | fData->SetDimensionName(3,"qual"); | |
72 | fData->SetDimensionName(4,"sat"); | |
73 | store = AliMUONCalibrationData::CreateGains(runNumber); | |
74 | } | |
75 | else if ( stype == "CAPACITANCES" ) | |
76 | { | |
49419555 | 77 | fData = new AliMUONTrackerData(Form("CAPA%d",runNumber),"Capacitances",2,isSingleEvent); |
0145e89a | 78 | fData->SetDimensionName(0,"Capa"); |
79 | fData->SetDimensionName(1,"Injection gain"); | |
80 | store = AliMUONCalibrationData::CreateCapacitances(runNumber); | |
81 | } | |
82 | ||
83 | AliCDBManager::Instance()->SetDefaultStorage(storage); | |
84 | ||
85 | if (!store) | |
86 | { | |
87 | fIsValid = kFALSE; | |
88 | delete fData; | |
89 | fData = 0x0; | |
90 | AliError("Could not create store"); | |
91 | return; | |
92 | } | |
93 | ||
94 | fData->Add(*store); | |
95 | } | |
96 | ||
97 | //_____________________________________________________________________________ | |
98 | AliMUONTrackerOCDBDataMaker::~AliMUONTrackerOCDBDataMaker() | |
99 | { | |
100 | /// dtor | |
49419555 | 101 | delete fData; |
0145e89a | 102 | } |
49419555 | 103 | |
104 | //_____________________________________________________________________________ | |
105 | Long64_t | |
106 | AliMUONTrackerOCDBDataMaker::Merge(TCollection*) | |
107 | { | |
108 | /// Merge | |
109 | AliError("Not implemented. Does it have sense ?"); | |
110 | return 0; | |
111 | } | |
112 |