]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTrackerOCDBDataMaker.cxx
Removing warnings (Andrea)
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerOCDBDataMaker.cxx
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),
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();
56     Bool_t isSingleEvent(kTRUE);
57     
58     if ( stype == "PEDESTALS" )
59     {
60       fData = new AliMUONTrackerData(Form("PED%d",runNumber),"Pedestals",2,isSingleEvent);
61       fData->SetDimensionName(0,"Mean");
62       fData->SetDimensionName(1,"Sigma");
63       store = AliMUONCalibrationData::CreatePedestals(runNumber);
64     }
65     else if ( stype == "GAINS" ) 
66     {
67       fData = new AliMUONTrackerData(Form("GAIN%d",runNumber),"Gains",5,isSingleEvent);
68       fData->SetDimensionName(0,"a1");
69       fData->SetDimensionName(1,"a2");
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     {
77       fData = new AliMUONTrackerData(Form("CAPA%d",runNumber),"Capacitances",2,isSingleEvent);
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
101   delete fData;
102 }
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