]>
Commit | Line | Data |
---|---|---|
ef868168 | 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 | //////////////////////////////////////////////// | |
19 | // class for PHOS alignment parameters // | |
20 | //////////////////////////////////////////////// | |
21 | ||
22 | #include "AliPHOSAlignData.h" | |
23 | ||
24 | ClassImp(AliPHOSAlignData) | |
25 | ||
26 | //________________________________________________________________ | |
27 | AliPHOSAlignData::AliPHOSAlignData() | |
28 | { | |
29 | // Default constructor | |
30 | Reset(); | |
31 | } | |
32 | ||
33 | //________________________________________________________________ | |
34 | AliPHOSAlignData::AliPHOSAlignData(const char* name) | |
35 | { | |
36 | // Constructor | |
37 | TString namst = "Align_"; | |
38 | namst += name; | |
39 | SetName(namst.Data()); | |
40 | SetTitle(namst.Data()); | |
41 | Reset(); | |
42 | } | |
43 | ||
44 | //________________________________________________________________ | |
45 | AliPHOSAlignData::AliPHOSAlignData(const AliPHOSAlignData& alignda) : | |
46 | TNamed(alignda) | |
47 | { | |
48 | // copy constructor | |
49 | SetName(alignda.GetName()); | |
50 | SetTitle(alignda.GetName()); | |
51 | Reset(); | |
52 | fNModules = alignda.GetNModules(); | |
53 | for(Int_t module=0; module<fNModules; module++) { | |
54 | for (Int_t axis=0; axis<3; axis++) { | |
55 | fModuleCenter[module][axis] = | |
56 | alignda.GetModuleCenter(module,axis); | |
57 | for (Int_t angle=0; angle<2; angle++) { | |
58 | fModuleAngle[module][axis][angle] = | |
59 | alignda.GetModuleAngle(module,axis,angle); | |
60 | } | |
61 | } | |
62 | } | |
63 | } | |
64 | ||
65 | //________________________________________________________________ | |
66 | AliPHOSAlignData &AliPHOSAlignData::operator =(const AliPHOSAlignData& alignda) | |
67 | { | |
68 | // assignment operator | |
69 | SetName(alignda.GetName()); | |
70 | SetTitle(alignda.GetName()); | |
71 | Reset(); | |
72 | fNModules = alignda.GetNModules(); | |
73 | for(Int_t module=0; module<fNModules; module++) { | |
74 | for (Int_t axis=0; axis<3; axis++) { | |
75 | fModuleCenter[module][axis] = | |
76 | alignda.GetModuleCenter(module,axis); | |
77 | for (Int_t angle=0; angle<2; angle++) { | |
78 | fModuleAngle[module][axis][angle] = | |
79 | alignda.GetModuleAngle(module,axis,angle); | |
80 | } | |
81 | } | |
82 | } | |
83 | return *this; | |
84 | } | |
85 | ||
86 | //________________________________________________________________ | |
87 | AliPHOSAlignData::~AliPHOSAlignData() | |
88 | { | |
89 | // Destructor | |
90 | } | |
91 | ||
92 | //________________________________________________________________ | |
93 | void AliPHOSAlignData::Reset() | |
94 | { | |
95 | // Set all to default values | |
96 | fNModules = 5; | |
97 | memset(fModuleCenter,0,5*3*sizeof(Float_t)); | |
98 | memset(fModuleAngle ,0,5*3*2*sizeof(Float_t)); | |
99 | } | |
100 | ||
101 | //________________________________________________________________ | |
102 | void AliPHOSAlignData::Print(Option_t */*option =""*/) const | |
103 | { | |
104 | // Print alignment data | |
105 | ||
106 | printf("PHOS alignment object\n"); | |
107 | printf(" Number of modules: %d\n",fNModules); | |
8a622350 | 108 | printf(" Module centers in MARS:\n"); |
109 | Int_t iModule; | |
110 | for (iModule=0; iModule<fNModules; iModule++) { | |
9cce3c59 | 111 | printf(" Module %d: (x=%.3f, y=%.3f, z=%.3f cm\n", |
112 | iModule, | |
8a622350 | 113 | fModuleCenter[iModule][0], |
114 | fModuleCenter[iModule][1], | |
115 | fModuleCenter[iModule][2]); | |
116 | } | |
117 | printf(" Module orientation angles:\n"); | |
118 | for (iModule=0; iModule<fNModules; iModule++) { | |
9cce3c59 | 119 | printf(" Module %d:\n",iModule); |
120 | printf(" (theta1=%.3f, phi1=%.3f degrees\n", | |
8a622350 | 121 | fModuleAngle[iModule][0][0], |
122 | fModuleAngle[iModule][0][1]); | |
9cce3c59 | 123 | printf(" (theta2=%.3f, phi2=%.3f degrees\n", |
8a622350 | 124 | fModuleAngle[iModule][1][0], |
125 | fModuleAngle[iModule][1][1]); | |
9cce3c59 | 126 | printf(" (theta3=%.3f, phi3=%.3f degrees\n", |
8a622350 | 127 | fModuleAngle[iModule][2][0], |
128 | fModuleAngle[iModule][2][1]); | |
129 | } | |
ef868168 | 130 | } |
131 | ||
132 | //________________________________________________________________ |