134{
135 TH2F *zphiCoarse=0, *xyCoarse=0;
136 TH2F *xyFine=0;
137 gStyle->SetPalette(1);
139 Log(1,
"Alignment Report",
"TestAl OK");
140 }
144 float dx,dy;
147
151
153 Log(2,
"Alignment Report",
"Coarse %s: %d coins with peak of %d/%6.3f",
"OK",
155 else {
156 Log(1,
"Alignment Report",
"Coarse %s: %d coins with peak of %d/%6.3f",
"FAILED!",
158 return;
159 }
160 }
161
162
168
170 Log(2,
"Alignment Report",
"Fine %s: %d coins inside (%6.1f %6.1f) with angular acc: (%6.3f %6.3f)",
"OK",
174 else {
175 Log(2,
"Alignment Report",
"Fine %s: %d coins inside (%6.1f %6.1f) with angular acc: (%6.3f %6.3f)",
"FAILED!",
179 return;
180 }
181 }
182
183
185 Log(2,
"Alignment Report",
"Save to file %s",
eOutputFile->GetName());
186 gStyle->SetPalette(1);
187 bool batch = gROOT->IsBatch();
188 gROOT->SetBatch();
189
191
195 float xoffset= aXY->
A11()*xcenter1 + aXY->
A12()*ycenter1 + aXY->
B1() - xcenter1;
196 float yoffset= aXY->
A21()*xcenter1 + aXY->
A22()*ycenter1 + aXY->
B2() - ycenter1;
197
199
200 const char *str = Form( "Nfinal= %5d Peak: %5d/%6.3f dx,dy,dz = %7.3f %7.3f %7.3f",
203 Log(1,
"Alignment Report",
"%s", str);
204
205 TPaveText *ctit = new TPaveText(0.01,0.943,0.99,0.998);
206 ctit->AddText( Form(
"Alignment of %s",
eOutputFile->GetName()) );
207 ctit->AddText( str );
208 ctit->Draw();
209
210 TPad *c = new TPad("c","plots",0.01,0.05,0.99,0.94);
211 c->Divide(3,3);
212 c->Draw();
213 TH2F *hp1 =
ePC[0].
DrawH2(
"hp1",
"Pattern1"); c->cd(1); hp1->SetStats(0); hp1->Draw(
"colz");
214 TH2F *hp2 =
ePC[1].
DrawH2(
"hp2",
"Pattern2"); c->cd(2); hp2->SetStats(0); hp2->Draw(
"colz");
215 if(zphiCoarse) { c->cd(3); zphiCoarse->SetStats(0); zphiCoarse->Draw("colz"); }
216 if(xyCoarse) { c->cd(4); xyCoarse->SetStats(0); xyCoarse->Draw("colz"); }
217 if(xyFine) { c->cd(5); xyFine->SetStats(0); xyFine->Draw("colz"); }
218
219
224
225 Log(2,
"Alignment Report",
"xmax-xmin: %f (%f-%f) ymax-ymin: %f (%f-%f)",
226 (xmax-xmin),xmax,xmin, (ymax-ymin),ymax,ymin);
227
228
230
231 c->cd(6);
232
233 TH2I *hdtxy =
new TH2I(
"dTXdTY",
"dTY vs dTX after final alignment",25,-3*
eSigma[1], 3*
eSigma[1], 25, -3*
eSigma[1], 3*
eSigma[1]);
234 for(int i=0; i<n; i++) {
239 hdtxy->Fill(dtx,dty);
240 }
241 hdtxy->SetStats(0); hdtxy->Draw("colz");
242
243 c->cd(8);
244
245 TH2I *
h2 =
new TH2I(
"plateXY",
"plateXY",100,xmin-10, xmax+10, 100, ymin-10,ymax+10);
248
249 if(n<1000) {
250 for(int i=0; i<n; i++) {
253 float x1 =
X(0,*
s1), y1 =
Y(0,*
s1);
254 float x2 =
X(1,*
s2), y2 =
Y(1,*
s2);
255 TMarker *m1 = new TMarker(x1,y1,22);
256 m1->SetMarkerColor(kRed);
257 m1->SetMarkerSize(0.6);
258 m1->Draw();
259 TMarker *m2 = new TMarker(x2,y2,23);
260 m2->SetMarkerColor(kBlue);
261 m2->SetMarkerSize(0.6);
262 m2->Draw();
263 }
264 }
265
266 c->cd(9);
267 TH2I *h2t = new TH2I("plateTXTY","plateTXTY",100,-1, 1, 100, -1,1 );
268 h2t->SetStats(0);
269 h2t->Draw();
270 if(n<1000) {
271 for(int i=0; i<n; i++) {
274 float tx1 =
TX(0, *
s1), ty1 =
TY(0, *
s1);
275 float tx2 =
TX(1, *
s2), ty2 =
TY(1, *
s2);
276 TMarker *m1 = new TMarker(tx1,ty1,22);
277 m1->SetMarkerColor(kRed);
278 m1->SetMarkerSize(0.6);
279 m1->Draw();
280 TMarker *m2 = new TMarker(tx2,ty2,23);
281 m2->SetMarkerColor(kBlue);
282 m2->SetMarkerSize(0.6);
283 m2->Draw();
284 }
285 }
286
287
288 c->cd(7);
289 int nbin=25;
290 TArrayF xbins(nbin+1);
291 xbins[0]= 0.15;
292 float s0 = xbins[0]*xbins[0];
293 for(int i=1; i<nbin+1; i++) xbins[i] = Sqrt( xbins[i-1]*xbins[i-1] + s0 );
294
295
296 TH1F *thetadens = new TH1F("thetadens","theta density",nbin,xbins.GetArray() );
297 for(int i=0; i<n; i++) {
298
300 float tx =
TX(1,*
s2), ty =
TY(1,*
s2);
301 float theta = Sqrt(tx*tx+ty*ty);
302 thetadens->Fill(theta);
303 }
304 thetadens->Draw();
305
306
307
309 if(zphiCoarse) zphiCoarse->Write();
310 if(xyCoarse) xyCoarse->Write();
311 if(xyFine) xyFine->Write();
312 cc->Write("report_al");
313 eCorrL[0].Write(
"corr_layer1");
314 eCorrL[1].Write(
"corr_layer2");
315 SafeDelete(c);
316
317 SafeDelete(cc);
318
319 gROOT->SetBatch(batch);
320 }
321
322 SafeDelete(zphiCoarse);
323 SafeDelete(xyCoarse);
324 SafeDelete(xyFine);
325}
cout<< tr-> GetEntries()<< endl
Float_t B2() const
Definition: EdbAffine.h:48
Float_t A22() const
Definition: EdbAffine.h:46
Float_t A21() const
Definition: EdbAffine.h:45
Float_t A12() const
Definition: EdbAffine.h:44
Float_t B1() const
Definition: EdbAffine.h:47
Float_t A11() const
Definition: EdbAffine.h:43
float Y(int side, EdbSegP &s)
Definition: EdbAlignmentV.h:119
static Int_t CheckEqualArr(TObjArray &arr1, TObjArray &arr2)
Definition: EdbAlignmentV.cxx:389
float TY(int side, EdbSegP &s)
Definition: EdbAlignmentV.h:121
float Ymin(int side, EdbPattern &p)
Definition: EdbAlignmentV.cxx:1065
TFile * eOutputFile
Definition: EdbAlignmentV.h:35
EdbCell2 ePC[2]
2-d position cells with patterns segments
Definition: EdbAlignmentV.h:18
float Xmax(int side, EdbPattern &p)
Definition: EdbAlignmentV.cxx:1054
float X(int side, EdbSegP &s)
Correction parameters handling.
Definition: EdbAlignmentV.h:118
float Ymax(int side, EdbPattern &p)
Definition: EdbAlignmentV.cxx:1076
float TX(int side, EdbSegP &s)
Definition: EdbAlignmentV.h:120
float Xmin(int side, EdbPattern &p)
Definition: EdbAlignmentV.cxx:1043
float Xmax() const
Definition: EdbCell2.h:65
float Ymin() const
Definition: EdbCell2.h:66
Long_t Integral()
Definition: EdbCell2.cpp:216
TH2F * DrawH2(const char *name="plot2d", const char *title="EdbH2plot2D")
Definition: EdbCell2.cpp:187
float Xmin() const
Definition: EdbCell2.h:64
float Ymax() const
Definition: EdbCell2.h:67
float Zcorr() const
Definition: EdbLayer.h:90
void SetXY(float x, float y)
Definition: EdbLayer.h:96
TArrayF eMean
Definition: EdbCell2.h:111
TArrayF ePeak
Definition: EdbCell2.h:109
float ProbPeak()
Definition: EdbCell2.cpp:287
float FindPeak9(float &x, float &y)
Definition: EdbCell2.cpp:345
TH1F * h2
Definition: energy.C:19
EdbSegP * s1
Definition: tlg2couples.C:29
EdbSegP * s2
Definition: tlg2couples.C:30