]>
Commit | Line | Data |
---|---|---|
1 | void MakeITSResMisAlignment() { | |
2 | //======================================================================== | |
3 | // | |
4 | // Steering macro for ITS residual (realistic) misalignment | |
5 | // | |
6 | // Main author: L. Gaudichet | |
7 | // Contact: andrea.dainese@lnl.infn.it | |
8 | // | |
9 | //======================================================================== | |
10 | ||
11 | ||
12 | const char* macroname = "MakeITSResMisAlignment.C"; | |
13 | ||
14 | // Activate CDB storage and load geometry from CDB | |
15 | AliCDBManager* cdb = AliCDBManager::Instance(); | |
16 | if(!cdb->IsDefaultStorageSet()) cdb->SetDefaultStorage("local://$ALICE_ROOT"); | |
17 | cdb->SetRun(0); | |
18 | ||
19 | AliCDBStorage* storage = NULL; | |
20 | ||
21 | if(TString(gSystem->Getenv("TOCDB")) == TString("kTRUE")){ | |
22 | TString Storage = gSystem->Getenv("STORAGE"); | |
23 | if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { | |
24 | Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); | |
25 | return; | |
26 | } | |
27 | storage = cdb->GetStorage(Storage.Data()); | |
28 | if(!storage){ | |
29 | Error(macroname,"Unable to open storage %s\n",Storage.Data()); | |
30 | return; | |
31 | } | |
32 | AliCDBPath path("GRP","Geometry","Data"); | |
33 | AliCDBEntry *entry = storage->Get(path.GetPath(),cdb->GetRun()); | |
34 | if(!entry) Fatal(macroname,"Could not get the specified CDB entry!"); | |
35 | entry->SetOwner(0); | |
36 | TGeoManager* geom = (TGeoManager*) entry->GetObject(); | |
37 | AliGeomManager::SetGeometry(geom); | |
38 | }else{ | |
39 | AliGeomManager::LoadGeometry("geometry.root"); //load geom from default CDB storage | |
40 | } | |
41 | ||
42 | // SETTINGS: | |
43 | // - tranformations are defined by the "maximum transformation" | |
44 | // dx,dy,dz,dpsi,dtheta,dphi: then we take a Gaussian with sigma=dx/3 | |
45 | // and we cut it at +- 3*sigma = dx | |
46 | // (the option "unif" allows to sample from a uniform distr.) | |
47 | // - units are cm and deg | |
48 | // - transformations are defined in the local frame of the volume | |
49 | // being misaligned | |
50 | // | |
51 | const Float_t kRadToDeg = 180./TMath::Pi(); | |
52 | ||
53 | ||
54 | //=**************************************** | |
55 | // overall ITS misalignment : source - | |
56 | //=**************************************** | |
57 | Float_t its_dx = 0.0000; // ? | |
58 | Float_t its_dy = 0.0000; // ? | |
59 | Float_t its_dz = 0.0000; // ? | |
60 | Float_t its_dpsi = 0.0000; // ? | |
61 | Float_t its_dtheta = 0.0000; // ? | |
62 | Float_t its_dphi = 0.0000; // ? | |
63 | ||
64 | //=**************************************** | |
65 | // misalignment at the level of SPD sectors : source - A.Pepato | |
66 | //=**************************************** | |
67 | Float_t spdsector_dx = 0.0050/5.; // 50 micron (~tangetial, i.e. rphi) | |
68 | Float_t spdsector_dy = 0.0100/5.; // 100 micron (~radial) | |
69 | Float_t spdsector_dz = 0.0100/5.; // 100 micron | |
70 | Float_t spdsector_dpsi = 0.0100/30.*kRadToDeg/5.; // so as to have 100 micron difference at the two extremes | |
71 | Float_t spdsector_dtheta = 0.0100/30.*kRadToDeg/5.; // so as to have 100 micron difference at the two extremes | |
72 | Float_t spdsector_dphi = 0.0050/1.5*kRadToDeg/5.; // so as to have 50 micron difference at the two extremes | |
73 | Bool_t unifspdsector=kFALSE; | |
74 | ||
75 | //=**************************************** | |
76 | // misalignment at the level of SPD half-barrels : source - A.Pepato | |
77 | //=**************************************** | |
78 | Float_t spdhalfbarrel_dx = 0.000; // 200 micron | |
79 | Float_t spdhalfbarrel_dy = 0.000; // 200 micron | |
80 | Float_t spdhalfbarrel_dz = 0.000; // 200 micron | |
81 | Float_t spdhalfbarrel_dpsi = 0.000/30.*kRadToDeg; // so as to have 100 micron difference at the two extremes | |
82 | Float_t spdhalfbarrel_dtheta = 0.000/30.*kRadToDeg; // so as to have 100 micron difference at the two extremes | |
83 | Float_t spdhalfbarrel_dphi = 0.000/7.*kRadToDeg; // so as to have 100 micron difference at the two extremes | |
84 | ||
85 | //=**************************************** | |
86 | // misalignment at the level of SPD barrel : source - A.Pepato | |
87 | //=**************************************** | |
88 | Float_t spdbarrel_dx = 0.000; // 1 mm (very pessimistic) | |
89 | Float_t spdbarrel_dy = 0.000; // 1 mm (very pessimistic) | |
90 | Float_t spdbarrel_dz = 0.000; // 1 mm (very pessimistic) | |
91 | Float_t spdbarrel_dpsi = 0.000/30.*kRadToDeg; // so as to have 500 micron difference at the two extremes | |
92 | Float_t spdbarrel_dtheta = 0.000/30.*kRadToDeg; // so as to have 500 micron difference at the two extremes | |
93 | Float_t spdbarrel_dphi = 0.000/7.*kRadToDeg; // so as to have 500 micron difference at the two extremes | |
94 | ||
95 | ||
96 | //=**************************************** | |
97 | // misalignment at the level of SDD and SSD layers: source | |
98 | //=**************************************** | |
99 | Float_t sddlayer_dx = 0.0000; | |
100 | Float_t sddlayer_dy = 0.0000; | |
101 | Float_t sddlayer_dz = 0.0000; | |
102 | Float_t sddlayer_dpsi = 0.0000; | |
103 | Float_t sddlayer_dtheta = 0.0000; | |
104 | Float_t sddlayer_dphi = 0.0000; | |
105 | ||
106 | Float_t ssdlayer_dx = 0.0000; | |
107 | Float_t ssdlayer_dy = 0.0000; | |
108 | Float_t ssdlayer_dz = 0.0000; | |
109 | Float_t ssdlayer_dpsi = 0.0000; | |
110 | Float_t ssdlayer_dtheta = 0.0000; | |
111 | Float_t ssdlayer_dphi = 0.0000; | |
112 | ||
113 | ||
114 | //=**************************************** | |
115 | // misalignment at the level of half-staves (SPD) : source - S.Moretto | |
116 | // ladders (SDD,SSD) : source - | |
117 | //=**************************************** | |
118 | Float_t spdhalfstave_dx = 0.0100/4.; // 100 micron | |
119 | Float_t spdhalfstave_dy = 0.0020/4.; // 20 micron | |
120 | Float_t spdhalfstave_dz = 0.0020/4.; // 20 micron | |
121 | Float_t spdhalfstave_dpsi = 0.0020/7.*kRadToDeg/4.; // so as to have 20 micron difference at the two extremes | |
122 | Float_t spdhalfstave_dtheta = 0.0050/7.*kRadToDeg/4.; // so as to have 50 micron difference at the two extremes | |
123 | Float_t spdhalfstave_dphi = 0.0050/0.7*kRadToDeg/4.; // so as to have 50 micron difference at the two extremes | |
124 | Bool_t unifspdhalfstave=kFALSE; | |
125 | ||
126 | Float_t sddladder_dx = 0.0005; // 5 micron | |
127 | Float_t sddladder_dy = 0.0005; // 5 micron | |
128 | Float_t sddladder_dz = 0.0005; // 5 micron | |
129 | Float_t sddladder_dpsi = 0.00; // ? | |
130 | Float_t sddladder_dtheta = 0.00; // ? | |
131 | Float_t sddladder_dphi = 0.00; // ? | |
132 | ||
133 | Float_t ssdladder_dx = 0.0005; // 5 micron | |
134 | Float_t ssdladder_dy = 0.0005; // 5 micron | |
135 | Float_t ssdladder_dz = 0.0005; // 5 micron | |
136 | Float_t ssdladder_dpsi = 0.00; // ? | |
137 | Float_t ssdladder_dtheta = 0.00; // ? | |
138 | Float_t ssdladder_dphi = 0.00; // ? | |
139 | ||
140 | ||
141 | //=**************************************** | |
142 | // misalignment at the level of ladders (SPD) : source - R.Santoro | |
143 | // modules (SDD) : source - L.Gaudichet | |
144 | // modules (SSD) : source - | |
145 | //=**************************************** | |
146 | Float_t spdladder_dx = 0.0010/5.; // 10 micron | |
147 | Float_t spdladder_dy = 0.0050/5.; // 50 micron | |
148 | Float_t spdladder_dz = 0.0010/5.; // 10 micron | |
149 | Float_t spdladder_dpsi = 0.0001*kRadToDeg/5.; // 0.1 mrad | |
150 | Float_t spdladder_dtheta = 0.0001*kRadToDeg/5.; // 0.1 mrad | |
151 | Float_t spdladder_dphi = 0.0001*kRadToDeg/5.; // 0.1 mrad | |
152 | ||
153 | Float_t sddmodule_dx = 0.0045/5.; // 45 micron | |
154 | Float_t sddmodule_dy = 0.0045/5.; // 45 micron | |
155 | Float_t sddmodule_dz = 0.0105/5.; // 105 micron | |
156 | Float_t sddmodule_dpsi = 0.00; // ? | |
157 | Float_t sddmodule_dtheta = 0.00; // ? | |
158 | Float_t sddmodule_dphi = 0.00; // ? | |
159 | ||
160 | Float_t ssdmodule_dx = 0.0050/5.; // 50 micron | |
161 | Float_t ssdmodule_dy = 0.0050/5.; // 50 micron | |
162 | Float_t ssdmodule_dz = 0.0050/5.; // 50 micron | |
163 | Float_t ssdmodule_dpsi = 0.00; // ? | |
164 | Float_t ssdmodule_dtheta = 0.00; // ? | |
165 | Float_t ssdmodule_dphi = 0.00; // ? | |
166 | // | |
167 | // END SETTINGS | |
168 | ||
169 | ||
170 | AliITSMisalignMaker alignMaker; | |
171 | ||
172 | //=**************************************** | |
173 | // overall ITS misalignment : | |
174 | //=**************************************** | |
175 | ||
176 | alignMaker.AddAlignObj("ITS",its_dx,its_dy,its_dz,its_dpsi,its_dtheta,its_dphi,kFALSE); | |
177 | ||
178 | ||
179 | //=**************************************** | |
180 | // misalignment at the level of SPD barrel, half-barrels, and at the level | |
181 | // of SPD sectors | |
182 | //=**************************************** | |
183 | ||
184 | Double_t vx,vy,vz,vpsi,vtheta,vphi; | |
185 | Double_t vxbarrel,vybarrel,vzbarrel,vpsibarrel,vthetabarrel,vphibarrel; | |
186 | ||
187 | // barrel | |
188 | vxbarrel = alignMaker.GaussCut(0,spdbarrel_dx/3,spdbarrel_dx); | |
189 | vybarrel = alignMaker.GaussCut(0,spdbarrel_dy/3,spdbarrel_dy); | |
190 | vzbarrel = alignMaker.GaussCut(0,spdbarrel_dz/3,spdbarrel_dz); | |
191 | vpsibarrel = alignMaker.GaussCut(0,spdbarrel_dpsi/3,spdbarrel_dpsi); | |
192 | vthetabarrel = alignMaker.GaussCut(0,spdbarrel_dtheta/3,spdbarrel_dtheta); | |
193 | vphibarrel = alignMaker.GaussCut(0,spdbarrel_dphi/3,spdbarrel_dphi); | |
194 | ||
195 | // top half-barrel | |
196 | vx = alignMaker.GaussCut(0,spdhalfbarrel_dx/3,spdhalfbarrel_dx); | |
197 | vy = alignMaker.GaussCut(0,spdhalfbarrel_dy/3,spdhalfbarrel_dy); | |
198 | vz = alignMaker.GaussCut(0,spdhalfbarrel_dz/3,spdhalfbarrel_dz); | |
199 | vpsi = alignMaker.GaussCut(0,spdhalfbarrel_dpsi/3,spdhalfbarrel_dpsi); | |
200 | vtheta = alignMaker.GaussCut(0,spdhalfbarrel_dtheta/3,spdhalfbarrel_dtheta); | |
201 | vphi = alignMaker.GaussCut(0,spdhalfbarrel_dphi/3,spdhalfbarrel_dphi); | |
202 | ||
203 | vx += vxbarrel; | |
204 | vy += vybarrel; | |
205 | vz += vzbarrel; | |
206 | vpsi += vpsibarrel; | |
207 | vtheta += vthetabarrel; | |
208 | vphi += vphibarrel; | |
209 | ||
210 | alignMaker.AddSectorAlignObj(1,5,spdsector_dx,spdsector_dy,spdsector_dz, | |
211 | spdsector_dpsi,spdsector_dtheta,spdsector_dphi, | |
212 | vx,vy,vz,vpsi,vtheta,vphi,unifspdsector); | |
213 | ||
214 | // bottom half-barrel | |
215 | vx = alignMaker.GaussCut(0,spdhalfbarrel_dx/3,spdhalfbarrel_dx); | |
216 | vy = alignMaker.GaussCut(0,spdhalfbarrel_dy/3,spdhalfbarrel_dy); | |
217 | vz = alignMaker.GaussCut(0,spdhalfbarrel_dz/3,spdhalfbarrel_dz); | |
218 | vpsi = alignMaker.GaussCut(0,spdhalfbarrel_dpsi/3,spdhalfbarrel_dpsi); | |
219 | vtheta = alignMaker.GaussCut(0,spdhalfbarrel_dtheta/3,spdhalfbarrel_dtheta); | |
220 | vphi = alignMaker.GaussCut(0,spdhalfbarrel_dphi/3,spdhalfbarrel_dphi); | |
221 | ||
222 | vx += vxbarrel; | |
223 | vy += vybarrel; | |
224 | vz += vzbarrel; | |
225 | vpsi += vpsibarrel; | |
226 | vtheta += vthetabarrel; | |
227 | vphi += vphibarrel; | |
228 | ||
229 | alignMaker.AddSectorAlignObj(6,10,spdsector_dx,spdsector_dy,spdsector_dz, | |
230 | spdsector_dpsi,spdsector_dtheta,spdsector_dphi, | |
231 | vx,vy,vz,vpsi,vtheta,vphi,unifspdsector); | |
232 | ||
233 | ||
234 | //=**************************************** | |
235 | // misalignment at the level of half-staves (SPD)/ladders (SDD,SSD) : | |
236 | //=**************************************** | |
237 | ||
238 | alignMaker.AddAlignObj(0,-1,spdhalfstave_dx,spdhalfstave_dy,spdhalfstave_dz,spdhalfstave_dpsi,spdhalfstave_dtheta,spdhalfstave_dphi,0,0,0,0,0,0,unifspdhalfstave); // all SPD1 half-staves | |
239 | alignMaker.AddAlignObj(1,-1,spdhalfstave_dx,spdhalfstave_dy,spdhalfstave_dz,spdhalfstave_dpsi,spdhalfstave_dtheta,spdhalfstave_dphi,0,0,0,0,0,0,unifspdhalfstave); // all SPD2 half-staves | |
240 | ||
241 | alignMaker.AddAlignObj(2,-1,sddladder_dx,sddladder_dy,sddladder_dz,sddladder_dpsi,sddladder_dtheta,sddladder_dphi,0,0,0,0,0,0,kFALSE); // all SDD1 ladders | |
242 | alignMaker.AddAlignObj(3,-1,sddladder_dx,sddladder_dy,sddladder_dz,sddladder_dpsi,sddladder_dtheta,sddladder_dphi,0,0,0,0,0,0,kFALSE); // all SDD2 ladders | |
243 | ||
244 | alignMaker.AddAlignObj(4,-1,ssdladder_dx,ssdladder_dy,ssdladder_dz,ssdladder_dpsi,ssdladder_dtheta,ssdladder_dphi,0,0,0,0,0,0,kFALSE); // all SSD1 ladders | |
245 | alignMaker.AddAlignObj(5,-1,ssdladder_dx,ssdladder_dy,ssdladder_dz,ssdladder_dpsi,ssdladder_dtheta,ssdladder_dphi,0,0,0,0,0,0,kFALSE); // all SSD2 ladders | |
246 | ||
247 | //=**************************************** | |
248 | // misalignment at the level of ladders (SPD)/modules (SDD,SSD) : | |
249 | //=**************************************** | |
250 | ||
251 | alignMaker.AddAlignObj(0,spdladder_dx,spdladder_dy,spdladder_dz,spdladder_dpsi,spdladder_dtheta,spdladder_dphi,kFALSE); // all SPD1 ladders | |
252 | alignMaker.AddAlignObj(1,spdladder_dx,spdladder_dy,spdladder_dz,spdladder_dpsi,spdladder_dtheta,spdladder_dphi,kFALSE); // all SPD2 ladders | |
253 | ||
254 | alignMaker.AddAlignObj(2,sddmodule_dx,sddmodule_dy,sddmodule_dz,sddmodule_dpsi,sddmodule_dtheta,sddmodule_dphi,kFALSE); // all SDD1 modules | |
255 | alignMaker.AddAlignObj(3,sddmodule_dx,sddmodule_dy,sddmodule_dz,sddmodule_dpsi,sddmodule_dtheta,sddmodule_dphi,kFALSE); // all SDD2 modules | |
256 | ||
257 | alignMaker.AddAlignObj(4,ssdmodule_dx,ssdmodule_dy,ssdmodule_dz,ssdmodule_dpsi,ssdmodule_dtheta,ssdmodule_dphi,kFALSE); // all SSD1 modules | |
258 | alignMaker.AddAlignObj(5,ssdmodule_dx,ssdmodule_dy,ssdmodule_dz,ssdmodule_dpsi,ssdmodule_dtheta,ssdmodule_dphi,kFALSE); // all SSD2 modules | |
259 | ||
260 | ||
261 | ||
262 | if( TString(gSystem->Getenv("TOCDB")) != TString("kTRUE") ){ | |
263 | // save on file | |
264 | const char* filename = "ITSresidualMisalignment.root"; | |
265 | TFile f(filename,"RECREATE"); | |
266 | if(!f.IsOpen()){ | |
267 | Error(macroname,"cannot open file for output\n"); | |
268 | return; | |
269 | } | |
270 | Info(macroname,"Saving alignment objects to the file %s",filename); | |
271 | f.cd(); | |
272 | f.WriteObject(alignMaker.GetArray(),"ITSAlignObjs","kSingleKey"); | |
273 | f.Close(); | |
274 | }else{ | |
275 | // save in CDB storage | |
276 | AliCDBMetaData *md= new AliCDBMetaData(); | |
277 | md->SetResponsible("Andrea Dainese"); | |
278 | md->SetComment("Alignment objects with residual ITS misalignment"); | |
279 | md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); | |
280 | AliCDBId id("ITS/Align/Data",0,AliCDBRunRange::Infinity()); | |
281 | storage->Put(alignMaker.GetArray(),id,md); | |
282 | } | |
283 | ||
284 | ||
285 | return; | |
286 | } |