]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONTrackerACFDataMaker.cxx
Merging of the three alignment macros into one
[u/mrichter/AliRoot.git] / MUON / AliMUONTrackerACFDataMaker.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 "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>
27 #include "AliMUONTrackerOCDBDataMaker.h"
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();
57     TString filename(gSystem->ExpandPathName(acfPath));
58     
59     if ( stype == "PEDESTALS" )
60     {
61       fData = AliMUONTrackerOCDBDataMaker::CreateDataPedestals(number);
62       store = new AliMUON2DMap(kTRUE);
63       AliMUONTrackerIO::ReadPedestals(filename.Data(),*store);
64     }
65     else if ( stype == "GAINS" ) 
66     {
67       fData = AliMUONTrackerOCDBDataMaker::CreateDataGains(number);
68       AliMUONVStore* gains = new AliMUON2DMap(kTRUE);
69       TString comment;
70       AliMUONTrackerIO::ReadGains(filename.Data(),*gains,comment);
71       store = AliMUONTrackerOCDBDataMaker::SplitQuality(*gains);
72       delete gains;      
73     }
74     else if ( stype == "CAPACITANCES" )
75     {
76       fData = AliMUONTrackerOCDBDataMaker::CreateDataCapacitances(number);
77       store = new AliMUON1DMap(20000);
78       AliMUONTrackerIO::ReadCapacitances(filename.Data(),*store);
79     }
80     
81     if (!store)
82     {
83       fIsValid = kFALSE;
84       delete fData;
85       fData = 0x0;
86       AliError("Could not create store");
87       return;
88     }
89     
90     fData->Add(*store);
91 }
92
93 //_____________________________________________________________________________
94 AliMUONTrackerACFDataMaker::~AliMUONTrackerACFDataMaker()
95 {
96   /// dtor
97   delete fData;
98 }
99
100 //_____________________________________________________________________________
101 Long64_t 
102 AliMUONTrackerACFDataMaker::Merge(TCollection*)
103 {
104   /// Merge
105   AliError("Not implemented. Does it have sense ?");
106   return 0;
107 }
108