]>
Commit | Line | Data |
---|---|---|
1286237e | 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 "AliMUONTrackerACFDataMaker.h" | |
19 | ||
20 | #include "AliMUONTrackerData.h" | |
21 | #include "AliMUONTrackerIO.h" | |
22 | #include "AliMUON2DMap.h" | |
23 | #include "AliMUON1DMap.h" | |
24 | #include "AliLog.h" | |
25 | #include <TString.h> | |
26 | #include <TSystem.h> | |
1ffbeb9d | 27 | #include "AliMUONTrackerOCDBDataMaker.h" |
1286237e | 28 | |
29 | ///\class AliMUONTrackerACFDataMaker | |
30 | /// | |
31 | /// Producer of AliMUONVTrackerData from ASCII calibration files | |
32 | /// | |
33 | ///\author Laurent Aphecetche, Subatech | |
34 | ||
35 | ///\cond CLASSIMP | |
36 | ClassImp(AliMUONTrackerACFDataMaker) | |
37 | ///\endcond | |
38 | ||
39 | //_____________________________________________________________________________ | |
40 | AliMUONTrackerACFDataMaker::AliMUONTrackerACFDataMaker(const char* acfPath, | |
41 | const char* type) | |
42 | : AliMUONVTrackerDataMaker(), | |
43 | fIsValid(kTRUE), | |
44 | fData(0x0), | |
45 | fSource(Form("%s-%s",acfPath,type)) | |
46 | { | |
47 | /// Ctor | |
48 | ||
49 | static Int_t number(0); | |
50 | ||
51 | ++number; | |
52 | ||
53 | AliMUONVStore* store(0x0); | |
54 | ||
55 | TString stype(type); | |
56 | stype.ToUpper(); | |
1286237e | 57 | TString filename(gSystem->ExpandPathName(acfPath)); |
58 | ||
59 | if ( stype == "PEDESTALS" ) | |
60 | { | |
1ffbeb9d | 61 | fData = AliMUONTrackerOCDBDataMaker::CreateDataPedestals(number); |
1286237e | 62 | store = new AliMUON2DMap(kTRUE); |
63 | AliMUONTrackerIO::ReadPedestals(filename.Data(),*store); | |
64 | } | |
65 | else if ( stype == "GAINS" ) | |
66 | { | |
1ffbeb9d | 67 | fData = AliMUONTrackerOCDBDataMaker::CreateDataGains(number); |
68 | AliMUONVStore* gains = new AliMUON2DMap(kTRUE); | |
1286237e | 69 | TString comment; |
1ffbeb9d | 70 | AliMUONTrackerIO::ReadGains(filename.Data(),*gains,comment); |
71 | store = AliMUONTrackerOCDBDataMaker::SplitQuality(*gains); | |
72 | delete gains; | |
1286237e | 73 | } |
74 | else if ( stype == "CAPACITANCES" ) | |
75 | { | |
1ffbeb9d | 76 | fData = AliMUONTrackerOCDBDataMaker::CreateDataCapacitances(number); |
1286237e | 77 | store = new AliMUON1DMap(20000); |
78 | AliMUONTrackerIO::ReadCapacitances(filename.Data(),*store); | |
79 | } | |
7eafe398 | 80 | else if ( stype == "OCCUPANCY" ) |
81 | { | |
82 | store = new AliMUON2DMap(true); | |
83 | AliMUONTrackerIO::ReadOccupancy(filename.Data(),*store); | |
84 | fData = new AliMUONTrackerData(Form("OCC%d",number),"OccupancyMap",*store); | |
85 | fData->SetDimensionName(0,"One"); | |
86 | fData->SetDimensionName(1,"Zero"); | |
87 | } | |
88 | ||
1286237e | 89 | if (!store) |
90 | { | |
91 | fIsValid = kFALSE; | |
92 | delete fData; | |
93 | fData = 0x0; | |
94 | AliError("Could not create store"); | |
95 | return; | |
96 | } | |
97 | ||
7eafe398 | 98 | if (stype != "OCCUPANCY" ) |
99 | { | |
1286237e | 100 | fData->Add(*store); |
7eafe398 | 101 | } |
102 | ||
103 | delete store; | |
1286237e | 104 | } |
105 | ||
106 | //_____________________________________________________________________________ | |
107 | AliMUONTrackerACFDataMaker::~AliMUONTrackerACFDataMaker() | |
108 | { | |
109 | /// dtor | |
110 | delete fData; | |
111 | } | |
112 | ||
113 | //_____________________________________________________________________________ | |
114 | Long64_t | |
115 | AliMUONTrackerACFDataMaker::Merge(TCollection*) | |
116 | { | |
117 | /// Merge | |
118 | AliError("Not implemented. Does it have sense ?"); | |
119 | return 0; | |
120 | } | |
121 |