AliRoot Core  edcc906 (edcc906)
AliEMCALSurvey.cxx
Go to the documentation of this file.
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 
17 #include <fstream>
18 
19 #include <TClonesArray.h>
20 #include <TGeoManager.h>
21 #include <TString.h>
22 #include <TMath.h>
23 
24 #include "AliSurveyObj.h"
25 #include "AliSurveyPoint.h"
26 
27 #include "AliAlignObjParams.h"
28 #include "AliEMCALGeometry.h"
29 #include "AliEMCALSurvey.h"
30 #include "AliLog.h"
31 
33 ClassImp(AliEMCALSurvey) ;
35 
38 //____________________________________________________________________________
40  : fNSuperModule(0),
41  fSuperModuleData(0),
42  fDataType(kSurvey)
43 { }
44 
46 namespace
47 {
48  struct AliEMCALSuperModuleCoords
49  {
50  Double_t fX1; //x coordinate of the center of supermodule
51  Double_t fY1; //y coordinate of the center of supermodule
52  Double_t fZ1; //z coordinate of the center of supermodule
53  Double_t fPsi; //yaw (psi) of supermodule
54  Double_t fTheta; //pitch (theta) of supermodule
55  Double_t fPhi; //roll angle (phi) of supermodule
56 
57  };
58 }
59 
64 //____________________________________________________________________________
65 AliEMCALSurvey::AliEMCALSurvey(const TString &txtFileName,const SurveyDataType_t type)
66  : fNSuperModule(0),
68  fDataType(type)
69 {
71  if (!geom)
72  {
73  AliError("Cannot obtain AliEMCALGeometry instance.");
74  return;
75  }
76 
78 
79  if(fDataType == kSurvey)
80  {
81  AliSurveyObj *s1 = new AliSurveyObj();
82  s1->FillFromLocalFile(txtFileName);
83  TObjArray* points = s1->GetData();
84  InitSuperModuleData(points);
85 
86  }
87  else
88  {
89  //Use a dummy file that stores x,y,z of the center of each SM
90  //useful for testing...
91  std::ifstream inputFile(txtFileName.Data());
92  if (!inputFile)
93  {
94  AliError(("Cannot open the survey file " + txtFileName).Data());
95  return;
96  }
97 
98  Int_t dummyInt = 0;
99  Double_t *xReal = new Double_t[fNSuperModule];
100  Double_t *yReal = new Double_t[fNSuperModule];
101  Double_t *zReal = new Double_t[fNSuperModule];
102  Double_t *psiReal = new Double_t[fNSuperModule];
103  Double_t *thetaReal = new Double_t[fNSuperModule];
104  Double_t *phiReal = new Double_t[fNSuperModule];
105 
106  //init the arrays
107  memset(xReal, 0,sizeof(Int_t)*fNSuperModule);
108  memset(yReal, 0,sizeof(Int_t)*fNSuperModule);
109  memset(zReal, 0,sizeof(Int_t)*fNSuperModule);
110  memset(psiReal, 0,sizeof(Int_t)*fNSuperModule);
111  memset(thetaReal, 0,sizeof(Int_t)*fNSuperModule);
112  memset(phiReal, 0,sizeof(Int_t)*fNSuperModule);
113 
114 
115  for (Int_t i = 0; i < fNSuperModule; ++i)
116  {
117  if (!inputFile)
118  {
119  AliError("Error while reading input file.");
120  delete [] xReal;
121  delete [] yReal;
122  delete [] zReal;
123  delete [] psiReal;
124  delete [] thetaReal;
125  delete [] phiReal;
126  return;
127  }
128 
129  inputFile>>dummyInt>>xReal[i]>>yReal[i]>>zReal[i]>>psiReal[i]>>thetaReal[i]>>phiReal[i];
130  }
131 
132  InitSuperModuleData(xReal, yReal, zReal, psiReal, thetaReal, phiReal);
133 
134  delete [] xReal;
135  delete [] yReal;
136  delete [] zReal;
137  delete [] psiReal;
138  delete [] thetaReal;
139  delete [] phiReal;
140  } //kDummy way of doing it
141 }
142 
145 //____________________________________________________________________________
147 {
148  delete [] fSuperModuleData;
149 }
150 
153 //____________________________________________________________________________
155 {
157  if (!geom)
158  {
159  AliError("Cannot obtain AliEMCALGeometry instance.");
160  return;
161  }
162 
163  if (!gGeoManager)
164  {
165  AliWarning("Cannot create local transformations for supermodules - gGeoManager does not exist.");
166  AliInfo("Null shifts and rotations will be created instead.");
167  return CreateNullObjects(array, geom);
168  }
169 
170  Int_t arrayInd = array.GetEntries(), iIndex = 0;
172  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
173  AliAlignObjParams* myobj = 0x0;
174 
175  TString SMName;
176  Int_t tmpType = -1;
177  Int_t SMOrder = 0;
178 
179  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
180  {
181  if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard ) SMName = "FullSupermodule";
182  else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) SMName = "HalfSupermodule";
183  else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd ) SMName = "OneThrdSupermodule";
184  else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
185  else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) SMName = "DCALExtensionSM";
186  else AliError("Unkown SM Type!!");
187 
188  if(geom->GetSMType(smodnum) == tmpType)
189  {
190  SMOrder++;
191  }
192  else
193  {
194  tmpType = geom->GetSMType(smodnum);
195  SMOrder = 1;
196  }
197 
198  TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));
200 
202  // JLK 13-July-2010
203  //
204  // VERY IMPORTANT!!!!
205  //
206  // All numbers were calculated in ALICE global c.s., which means
207  // that the last argument in the creation of AliAlignObjParams
208  // MUST BE set to true
210  new(array[arrayInd])
212  smodName.Data(), volid,
213  t.fXShift, t.fYShift, t.fZShift,
214  -t.fPsi, -t.fTheta, -t.fPhi,
215  true
216  );
217 
218  ++arrayInd;
219  myobj = (AliAlignObjParams*)array.UncheckedAt(smodnum);
220  printf("==== AliAlignObjParams for SM %d ====\n",smodnum);
221  myobj->Print("");
222 
223  }
224 }
225 
228 //____________________________________________________________________________
230 {
231  Int_t arrayInd = array.GetEntries(), iIndex = 0;
233  UShort_t volid = AliGeomManager::LayerToVolUID(iLayer,iIndex);
234 
235  TString SMName;
236  Int_t tmpType = -1;
237  Int_t SMOrder = 0;
238 
239  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
240  {
241  if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Standard ) SMName = "FullSupermodule";
242  else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half ) SMName = "HalfSupermodule";
243  else if(geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd ) SMName = "OneThrdSupermodule";
244  else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard ) SMName = "DCALSupermodule";
245  else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext ) SMName = "DCALExtensionSM";
246  else AliError("Unkown SM Type!!");
247 
248  if(geom->GetSMType(smodnum) == tmpType)
249  {
250  SMOrder++;
251  }
252  else
253  {
254  tmpType = geom->GetSMType(smodnum);
255  SMOrder = 1;
256  }
257 
258  TString smodName(TString::Format("EMCAL/%s%d", SMName.Data(), SMOrder));
259 
260  new(array[arrayInd]) AliAlignObjParams(smodName.Data(), volid, 0., 0., 0., 0., 0., 0., true);
261  ++arrayInd;
262  }
263 }
264 
267 //____________________________________________________________________________
269 {
270  AliEMCALSuperModuleDelta t = {0., 0., 0., 0., 0., 0.};
271 
272  if (!fSuperModuleData)
273  return t;
274 
275  return fSuperModuleData[supModIndex];
276 }
277 
323 //____________________________________________________________________________
325 {
327 
328  // Center of supermodules
329  Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
330  Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
331  Float_t fInnerEdge = geom->GetDCALInnerEdge();
332  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
333 
334  AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
335  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
336  {
337  AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
338 
339  phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
340  phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
341 
342  xpos = rpos * TMath::Cos(phiRad);
343  ypos = rpos * TMath::Sin(phiRad);
344  zpos = pars[2];
345 
346  if( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half
347  || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd
348  || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext )
349  {
350  xpos += (pars[1]/2. * TMath::Sin(phiRad));
351  ypos -= (pars[1]/2. * TMath::Cos(phiRad));
352  }
353  else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard)
354  {
355  zpos = pars[2] + fInnerEdge/2.;
356  }
357 
358  smc.fX1 = xpos;
359  smc.fY1 = ypos;
360  smc.fPhi = phi; //degrees
361  smc.fTheta = 0.; //degrees
362  smc.fPsi = 0.; //degrees
363 
364  if(smodnum%2==0)
365  {
366  smc.fZ1 = zpos;
367  }
368  else
369  {
370  smc.fZ1 = -zpos;
371  }
372 
373  printf("<SM %d> IDEAL x,y,z positions: %.2f,%.2f,%.2f, IDEAL phi,theta,psi angles: %.2f,%.2f,%.2f\n",smodnum,smc.fX1,smc.fY1,smc.fZ1,smc.fPhi,smc.fTheta,smc.fPsi);
374  }
375 
376  //Real coordinates of center and rotation angles need to be computed
377  //from the survey/CATIA points
378  const Int_t buffersize = 255;
379  char substr[buffersize];
380  AliEMCALSuperModuleCoords *realSM = new AliEMCALSuperModuleCoords[fNSuperModule];
381  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
382  {
383  AliEMCALSuperModuleCoords &smc = realSM[smodnum];
384  Double_t zLength = pars[2]*2.; //length of SM in z from software
385  Double_t halfHeight = pars[0]; //half the height of the SM in y direction
386  Double_t halfWidth = pars[1];
387 
388  printf("AliEMCALGeometry says zlength = %.2f, halfheight = %.2f, halfwidth = %.2f\n",zLength,halfHeight,halfWidth);
389 
390  snprintf(substr,buffersize,"4096%d",smodnum);
391  //retrieve components of four face points and determine average position of center
392  //in x,y,z
393 
394  std::vector<Double_t> xval;
395  std::vector<Double_t> yval;
396  std::vector<Double_t> zval;
397 
398  for(Int_t i = 0; i < svypts->GetEntries(); i++)
399  {
400  AliSurveyPoint* pt = (AliSurveyPoint*)svypts->At(i);
401  TString ptname = pt->GetPointName();
402  if(ptname.Contains(substr))
403  {
404  //Note: order of values is 00, 01, 10, 11
405  xval.push_back(pt->GetX()*100.); //convert m to cm
406  yval.push_back(pt->GetY()*100.);
407  zval.push_back(pt->GetZ()*100.);
408  }
409  }
410 
411  //compute center of active area of each SM on bottome face from survey points
412  Double_t activeX = ((xval[0] + (xval[2] - xval[0])/2.) //x00 and x10
413  +(xval[1] + (xval[3] - xval[1])/2.) ) /2.; //x01 and x11
414 
415  Double_t activeY = ((yval[0] + (yval[2] - yval[0])/2.)
416  +(yval[1] + (yval[3] - yval[1])/2.) ) /2.;
417 
418  Double_t activeZ = ((zval[0] + (zval[2] - zval[0])/2.)
419  +(zval[1] + (zval[3] - zval[1])/2.) ) /2.;
420 
421  printf("Bottom Center of active area of SM %s: %.2f, %.2f, %.2f\n",substr,activeX,activeY,activeZ);
422 
423  //compute angles for each SM
424  //rotation about each axis
425  //phi = angle in x-y plane
426 
427  Double_t realphi = 0.;
428  //Note: this is phi wrt y axis. To get phi wrt to x, add pi/2
429  if(smodnum%2 == 0)
430  {
431  realphi = ( TMath::ATan((yval[2] - yval[0])/(xval[2] - xval[0]))
432  +TMath::ATan((yval[3] - yval[1])/(xval[3] - xval[1])) )/2.;
433  } else
434  {
435  realphi = ( TMath::ATan((yval[0] - yval[2])/(xval[0] - xval[2]))
436  +TMath::ATan((yval[1] - yval[3])/(xval[1] - xval[3])) )/2.;
437  }
438 
439  //NOTE: Psi angle is always zero because the two z values being
440  //subtracted are exactly the same, but just in case that could change...
441  //psi = angle in x-z plane
442  Double_t realpsi = ( TMath::ATan((zval[0] - zval[2])/(xval[2] - xval[0]))
443  +TMath::ATan((zval[1] - zval[3])/(xval[3] - xval[1])) )/2.;
444 
445  //theta = angle in y-z plane
446  Double_t realtheta = TMath::Pi()/2.
447  + ( TMath::ATan((zval[2] - zval[3])/(yval[3] - yval[2]))
448  +TMath::ATan((zval[0] - zval[1])/(yval[1] - yval[0])) )/2.;
449 
450  printf("Old edge of %s 01: %.2f, %.2f, %.2f\n",substr,xval[1],yval[1],zval[1]);
451  printf("Old edge of %s 11: %.2f, %.2f, %.2f\n",substr,xval[3],yval[3],zval[3]);
452  printf("Real theta angle (degrees) = %.2f\n",realtheta*TMath::RadToDeg());
453 
454  //Now calculate the center of the box in z with length added to the 01
455  //and 11 corners, corrected by the theta angle
456  Double_t activeLength = TMath::Abs(((zval[1] - zval[0]) + (zval[3] - zval[2]))/2.);
457  printf("ACTIVE LENGTH = %.2f\n",activeLength);
458  if(smodnum%2 == 0)
459  {
460  yval[1] += (zLength - activeLength)*sin(realtheta);
461  yval[3] += (zLength - activeLength)*sin(realtheta);
462  zval[1] += (zLength - activeLength)*cos(realtheta);
463  zval[3] += (zLength - activeLength)*cos(realtheta);
464  } else {
465  yval[1] -= (zLength - activeLength)*sin(realtheta);
466  yval[3] -= (zLength - activeLength)*sin(realtheta);
467  zval[1] -= (zLength - activeLength)*cos(realtheta);
468  zval[3] -= (zLength - activeLength)*cos(realtheta);
469  }
470 
471  printf("New extended edge of %s 01: %.2f, %.2f, %.2f\n",substr,xval[1],yval[1],zval[1]);
472  printf("New extended edge of %s 11: %.2f, %.2f, %.2f\n",substr,xval[3],yval[3],zval[3]);
473 
474  //Compute the center of the bottom of the box in x,y,z
475  Double_t realX = activeX;
476  Double_t realY = ( (yval[0] + (yval[2] - yval[0])/2.)
477  +(yval[1] + (yval[3] - yval[1])/2.) ) /2.;
478  Double_t realZ = ( (zval[0] + (zval[2] - zval[0])/2.)
479  +(zval[1] + (zval[3] - zval[1])/2.) ) /2.;
480 
481 
482  printf("Bottom Center of SM %s Box: %.2f, %.2f, %.2f\n",substr,realX,realY,realZ);
483 
484  //correct the SM centers so that we have the center of the box in
485  //x,y using the phi,theta angles
486  realX += halfHeight* TMath::Cos(TMath::Pi()/2+realphi);
487  realY += halfHeight*(TMath::Sin(TMath::Pi()/2+realphi) + TMath::Sin(realtheta));
488  realZ += halfHeight* TMath::Cos(TMath::Pi()/2-realtheta);
489 
490  printf("Rotation angles of SM %s (phi,psi,theta) in degrees: %.4f, %.4f, %.4f\n",substr,realphi*TMath::RadToDeg(),realpsi*TMath::RadToDeg(),realtheta*TMath::RadToDeg());
491  printf("Middle of SM %s: %.2f, %.2f, %.2f\n\n",substr,realX,realY,realZ);
492 
493  smc.fX1 = realX;
494  smc.fY1 = realY;
495  smc.fZ1 = realZ;
496 
497  smc.fPhi = 90. + realphi*TMath::RadToDeg();
498  smc.fTheta = 0. + realtheta*TMath::RadToDeg();
499  smc.fPsi = 0. + realpsi*TMath::RadToDeg();
500 
501  }//loop over supermodules
502 
503  //Now take average values for A and C side SMs (0&1,2&3) and set
504  //their values to be equal to that average
505  for (Int_t i = 0; i < fNSuperModule; i++)
506  {
507  if(i%2==0)
508  {
509  AliEMCALSuperModuleCoords &realA = realSM[i];
510  AliEMCALSuperModuleCoords &realC = realSM[i+1];
511  Double_t avgx = (realA.fX1 + realC.fX1)/2.;
512  Double_t avgy = (realA.fY1 + realC.fY1)/2.;
513  Double_t avgphi = (realA.fPhi + realC.fPhi)/2.;
514  Double_t avgtheta = (realA.fTheta + realC.fTheta)/2.;
515  Double_t avgpsi = (realA.fPsi + realC.fPsi)/2.;
516  printf("AVERAGE VALUES: %.2f,%.2f,%.2f,%.2f,%.2f\n",avgx,avgy,avgphi,avgtheta,avgpsi);
517 
518  realA.fX1 = avgx; realC.fX1 = avgx;
519  realA.fY1 = avgy; realC.fY1 = avgy;
520  realA.fPhi = avgphi; realC.fPhi = avgphi;
521  realA.fTheta = avgtheta; realC.fTheta = avgtheta;
522  realA.fPsi = avgpsi; realC.fPhi = avgphi;
523  }
524  }
525 
527 
528  for (Int_t i = 0; i < fNSuperModule; ++i)
529  {
530  const AliEMCALSuperModuleCoords &real = realSM[i];
531  const AliEMCALSuperModuleCoords &ideal = idealSM[i];
532 
534 
535  t.fXShift = real.fX1 - ideal.fX1;
536  t.fYShift = real.fY1 - ideal.fY1;
537  t.fZShift = real.fZ1 - ideal.fZ1;
538  t.fPhi = real.fPhi - ideal.fPhi;
539  t.fTheta = real.fTheta - ideal.fTheta;
540  t.fPsi = real.fPsi - ideal.fPsi;
541 
542  printf("===================== SM %d =======================\n",i);
543  printf("real x (%.2f) - ideal x (%.2f) = shift in x (%.2f)\n",real.fX1,ideal.fX1,t.fXShift);
544  printf("real y (%.2f) - ideal y (%.2f) = shift in y (%.2f)\n",real.fY1,ideal.fY1,t.fYShift);
545  printf("real z (%.2f) - ideal z (%.2f) = shift in z (%.2f)\n",real.fZ1,ideal.fZ1,t.fZShift);
546  printf("real theta (%.2f) - ideal theta (%.2f) = shift in theta %.2f\n",real.fTheta,ideal.fTheta,t.fTheta);
547  printf("real psi (%.2f) - ideal psi (%.2f) = shift in psi %.2f\n",real.fPsi,ideal.fPsi,t.fPsi);
548  printf("real phi (%.2f) - ideal phi (%.2f) = shift in phi %.2f\n",real.fPhi,ideal.fPhi,t.fPhi);
549  printf("===================================================\n");
550  }
551 
552  delete [] realSM;
553  delete [] idealSM;
554 }
555 
560 //____________________________________________________________________________
561 void AliEMCALSurvey::InitSuperModuleData(const Double_t *xReal, const Double_t *yReal,
562  const Double_t *zReal, const Double_t *psiReal,
563  const Double_t *thetaReal, const Double_t *phiReal)
564 {
566 
567  //Center of supermodules
568  Float_t pars[] = {geom->GetSuperModulesPar(0),geom->GetSuperModulesPar(1),geom->GetSuperModulesPar(2)};
569  Double_t rpos = (geom->GetEnvelop(0) + geom->GetEnvelop(1))/2.;
570  Float_t fInnerEdge = geom->GetDCALInnerEdge();
571  Double_t phi=0, phiRad=0, xpos=0, ypos=0, zpos=0;
572 
573  zpos = pars[2];
574 
575  AliEMCALSuperModuleCoords *idealSM = new AliEMCALSuperModuleCoords[fNSuperModule];
576  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
577  {
578  AliEMCALSuperModuleCoords &smc = idealSM[smodnum];
579  phiRad = geom->GetPhiCenterOfSMSec(smodnum); //comes in radians
580  phi = phiRad*180./TMath::Pi(); //need degrees for AliAlignObjParams
581  xpos = rpos * TMath::Cos(phiRad);
582  ypos = rpos * TMath::Sin(phiRad);
583 
584  if( geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_Half
585  || geom->GetSMType(smodnum) == AliEMCALGeometry::kEMCAL_3rd
586  || geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Ext )
587  {
588  xpos += (pars[1]/2. * TMath::Sin(phiRad));
589  ypos -= (pars[1]/2. * TMath::Cos(phiRad));
590  } else if( geom->GetSMType(smodnum) == AliEMCALGeometry::kDCAL_Standard)
591  {
592  zpos = pars[2] + fInnerEdge/2.;
593  }
594 
595  smc.fX1 = xpos;
596  smc.fY1 = ypos;
597 
598  smc.fPhi = phi; //degrees
599  smc.fTheta = 0.; //degrees
600  smc.fPsi = 0.; //degrees
601 
602  if(smodnum%2==0)
603  {
604  smc.fZ1 = zpos;
605  } else {
606  smc.fZ1 = -zpos;
607  }
608 
609  }
610 
611  AliEMCALSuperModuleCoords *realSM = new AliEMCALSuperModuleCoords[fNSuperModule];
612  for (Int_t smodnum = 0; smodnum < geom->GetNumberOfSuperModules(); ++smodnum)
613  {
614  AliEMCALSuperModuleCoords &smc = realSM[smodnum];
615  smc.fX1 = xReal[smodnum];
616  smc.fY1 = yReal[smodnum];
617  smc.fZ1 = zReal[smodnum];
618  smc.fTheta = thetaReal[smodnum];
619  smc.fPsi = psiReal[smodnum];
620  smc.fPhi = phiReal[smodnum];
621  }
622 
624 
625  for (Int_t i = 0; i < fNSuperModule; ++i)
626  {
627  const AliEMCALSuperModuleCoords &real = realSM[i];
628  const AliEMCALSuperModuleCoords &ideal = idealSM[i];
630  t.fTheta = real.fTheta - ideal.fTheta;
631  t.fPsi = 0.;
632  t.fPhi = real.fPhi - ideal.fPhi;
633  t.fXShift = real.fX1 - ideal.fX1;
634  t.fYShift = real.fY1 - ideal.fY1;
635  t.fZShift = real.fZ1 - ideal.fZ1;
636 
637  printf("===================== SM %d =======================\n",i);
638  printf("real x (%.2f) - ideal x (%.2f) = shift in x (%.2f)\n",real.fX1,ideal.fX1,t.fXShift);
639  printf("real y (%.2f) - ideal y (%.2f) = shift in y (%.2f)\n",real.fY1,ideal.fY1,t.fYShift);
640  printf("real z (%.2f) - ideal z (%.2f) = shift in z (%.2f)\n",real.fZ1,ideal.fZ1,t.fZShift);
641  printf("real theta (%.2f) - ideal theta (%.2f) = shift in theta %.2f\n",real.fTheta,ideal.fTheta,t.fTheta);
642  printf("real psi (%.2f) - ideal psi (%.2f) = shift in psi %.2f\n",real.fPsi,ideal.fPsi,t.fPsi);
643  printf("real phi (%.2f) - ideal phi (%.2f) = shift in phi %.2f\n",real.fPhi,ideal.fPhi,t.fPhi);
644  printf("===================================================\n");
645  }
646 
647  delete [] realSM;
648  delete [] idealSM;
649 }
650 
Float_t GetDCALInnerEdge(void) const
virtual ~AliEMCALSurvey()
Destructor.
use real survey parameters
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Float_t GetZ() const
#define TObjArray
Float_t GetX() const
void Print(Option_t *) const
void InitSuperModuleData(const Double_t *xReal, const Double_t *yReal, const Double_t *zReal, const Double_t *psiReal, const Double_t *thetaReal, const Double_t *phiReal)
Int_t GetNumberOfSuperModules(void) const
Read survey data and create alignement.
void CreateAliAlignObjParams(TClonesArray &array)
Create AliAlignObjParams.
Float_t GetEnvelop(Int_t index) const
#define AliWarning(message)
Definition: AliLog.h:541
TObjArray * array
Definition: AnalyzeLaser.C:12
Double_t GetPhiCenterOfSMSec(Int_t nsupmod) const
AliEMCALSuperModuleDelta * fSuperModuleData
Supermodule transformation data.
#define AliInfo(message)
Definition: AliLog.h:484
Bool_t FillFromLocalFile(const Char_t *filename)
Int_t fDataType
! which date type (survey or dummy) to use
TObjArray * GetData() const
Definition: AliSurveyObj.h:66
TGeoManager * gGeoManager
Int_t GetSMType(Int_t nSupMod) const
TString GetPointName() const
AliEMCALSurvey()
Default constructor.
virtual AliEMCALSuperModuleDelta GetSuperModuleTransformation(Int_t smIndex) const
Supermodule transformation.
static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId)
Float_t GetSuperModulesPar(Int_t ipar) const
void CreateNullObjects(TClonesArray &alObj, const AliEMCALGeometry *geom) const
Create null shifts and rotations.
#define AliError(message)
Definition: AliLog.h:591
static AliEMCALGeometry * GetInstance()
TEveGeoShape * geom
Definition: tpc_tracks.C:10
Float_t GetY() const
EMCal geometry, singleton.
Int_t fNSuperModule
Number of supermodules.