AliRoot Core  edcc906 (edcc906)
AliGeomManager.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 // Implementation of AliGeomManager, the geometry manager class
17 // which interfaces to TGeo and the look-up table mapping unique
18 // volume indices to symbolic volume names. For that it collects
19 // several static methods.
20 //-------------------------------------------------------------------------
21 
22 #include <TClass.h>
23 #include <TFile.h>
24 #include <TGeoManager.h>
25 #include <TObjString.h>
26 #include <TGeoPhysicalNode.h>
27 #include <TClonesArray.h>
28 #include <TGeoMatrix.h>
29 #include <TGeoPhysicalNode.h>
30 #include <TSystem.h>
31 #include <TStopwatch.h>
32 #include <TGeoOverlap.h>
33 #include <TPluginManager.h>
34 #include <TROOT.h>
35 
36 #include "AliGeomManager.h"
37 #include "AliLog.h"
38 #include "AliAlignObj.h"
39 #include "AliAlignObjParams.h"
40 #include "AliCDBManager.h"
41 #include "AliCDBStorage.h"
42 #include "AliCDBEntry.h"
43 
44 ClassImp(AliGeomManager)
45 
46 Int_t AliGeomManager::fgLayerSize[kLastLayer - kFirstLayer] = {
47  80, 160, // ITS SPD first and second layer
48  84, 176, // ITS SDD first and second layer
49  748, 950, // ITS SSD first and second layer
50  36, 36, // TPC inner and outer chambers
51  90, 90, 90, 90, 90, 90, // 6 TRD chambers' layers
52  1638, // TOF
53  5, 5, // PHOS,CPV
54  7, // HMPID ??
55  1, // MUON ??
56  22 // EMCAL and DCAL
57 };
58 
59 const char* AliGeomManager::fgLayerName[kLastLayer - kFirstLayer] = {
60  "ITS inner pixels layer", "ITS outer pixels layer",
61  "ITS inner drifts layer", "ITS outer drifts layer",
62  "ITS inner strips layer", "ITS outer strips layer",
63  "TPC inner chambers layer", "TPC outer chambers layer",
64  "TRD chambers layer 1", "TRD chambers layer 2", "TRD chambers layer 3",
65  "TRD chambers layer 4", "TRD chambers layer 5", "TRD chambers layer 6",
66  "TOF layer",
67  "PHOS EMC layer","PHOS CPV layer",
68  "HMPID layer",
69  "MUON ?",
70  "EMCAL layer"
71 };
72 
73 TGeoPNEntry** AliGeomManager::fgPNEntry[kLastLayer - kFirstLayer] = {
74  0x0,0x0,
75  0x0,0x0,
76  0x0,0x0,
77  0x0,0x0,
78  0x0,0x0,0x0,
79  0x0,0x0,0x0,
80  0x0,
81  0x0,0x0,
82  0x0,
83  0x0,
84  0x0
85 };
86 
87 AliAlignObj** AliGeomManager::fgAlignObjs[kLastLayer - kFirstLayer] = {
88  0x0,0x0,
89  0x0,0x0,
90  0x0,0x0,
91  0x0,0x0,
92  0x0,0x0,0x0,
93  0x0,0x0,0x0,
94  0x0,
95  0x0,0x0,
96  0x0,
97  0x0,
98  0x0
99 };
100 
102 {"GRP","ITS","TPC","TRD","TOF","PHOS","HMPID","EMCAL","MUON","FMD","ZDC","PMD","T0","VZERO","ACORDE","AD","MFT","FIT"};
103 Int_t AliGeomManager::fgNalignable[fgkNDetectors] = {0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
104 
105 TGeoManager* AliGeomManager::fgGeometry = 0x0;
106 
107 //_____________________________________________________________________________
109 {
110  // destroy the manager as well as gGeoManager (if it was not attached to fgGeometry)
111  TGeoManager::UnlockGeometry();
112  delete gGeoManager;
113  fgGeometry = gGeoManager = 0;
115 }
116 
117 //_____________________________________________________________________________
118 void AliGeomManager::LoadGeometry(const char *geomFileName)
119 {
120  // initialization
121  // Load geometry either from a file
122  // or from the corresponding CDB entry
123 
124  if(fgGeometry->IsLocked()){
125  AliErrorClass("Cannot load a new geometry, the current one being locked. Setting internal geometry to null!!");
126  fgGeometry = NULL;
127  return;
128  }
129 
130  fgGeometry = NULL;
131  if (geomFileName && (!gSystem->AccessPathName(geomFileName))) {
132  fgGeometry = TGeoManager::Import(geomFileName);
133  AliInfoClass(Form("From now on using geometry from custom geometry file \"%s\"",geomFileName));
134  }
135 
136  if (!fgGeometry) {
137  AliCDBPath path("GRP","Geometry","Data");
138 
140  if(!entry) AliFatalClass("Couldn't load geometry data from CDB!");
141 
142  entry->SetOwner(0);
143  fgGeometry = (TGeoManager*) entry->GetObject();
144  if (!fgGeometry) AliFatalClass("Couldn't find TGeoManager in the specified CDB entry!");
145 
146  AliInfoClass(Form("From now on using geometry from CDB base folder \"%s\"",
147  AliCDBManager::Instance()->GetURI("GRP/Geometry/Data")));
148  }
151  InitNalignable();
152 }
153 
154 //_____________________________________________________________________________
155 void AliGeomManager::SetGeometry(TGeoManager * const geom)
156 {
157  // Load already active geometry
158  if (!geom) AliFatalClass("Pointer to the active geometry is 0x0!");
160  fgGeometry = geom;
162  InitNalignable();
163 }
164 
165 //_____________________________________________________________________________
167  TObject()
168 {
169  // default constructor
170 }
171 
172 //_____________________________________________________________________________
174 {
175  // dummy destructor
176 }
177 
178 //_____________________________________________________________________________
179 Int_t AliGeomManager::LayerSize(Int_t layerId)
180 {
181  // Get the layer size for layer corresponding to layerId.
182  // Implemented only for ITS,TPC,TRD,TOF and HMPID
183  //
184  if (layerId < kFirstLayer || layerId >= kLastLayer) {
185  AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
186  return 0;
187  }
188  else {
189  return fgLayerSize[layerId - kFirstLayer];
190  }
191 }
192 
193 //_____________________________________________________________________________
194 const char* AliGeomManager::LayerName(Int_t layerId)
195 {
196  // Get the layer name corresponding to layerId.
197  // Implemented only for ITS,TPC,TRD,TOF and HMPID
198  //
199  if (layerId < kFirstLayer || layerId >= kLastLayer) {
200  AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
201  return "Invalid Layer!";
202  }
203  else {
204  return fgLayerName[layerId - kFirstLayer];
205  }
206 }
207 
208 //_____________________________________________________________________________
209 UShort_t AliGeomManager::LayerToVolUID(ELayerID layerId, Int_t modId)
210 {
211  // From detector (layer) name and module number (according to detector
212  // internal numbering) build the unique numerical identity of that volume
213  // inside ALICE
214  // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
215  // remaining 11 for module ID inside det (2048 possible values).
216  // NO check for validity of given modId inside the layer for speed's sake.
217  //
218  return ((UShort_t(layerId) << 11) | UShort_t(modId));
219 }
220 
221 //_____________________________________________________________________________
222 UShort_t AliGeomManager::LayerToVolUID(Int_t layerId, Int_t modId)
223 {
224  // From detector (layer) name and module number (according to detector
225  // internal numbering) build the unique numerical identity of that volume
226  // inside ALICE
227  // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
228  // remaining 11 for module ID inside det (2048 possible values).
229  // NO check for validity of given modId inside the layer for speed's sake.
230  //
231  return ((UShort_t(layerId) << 11) | UShort_t(modId));
232 }
233 
234 //_____________________________________________________________________________
235 UShort_t AliGeomManager::LayerToVolUIDSafe(ELayerID layerId, Int_t modId)
236 {
237  // From detector (layer) name and module number (according to detector
238  // internal numbering) build the unique numerical identity of that volume
239  // inside ALICE
240  // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
241  // remaining 11 for module ID inside det (2048 possible values).
242  // Check validity of given modId inside the layer.
243  //
244  if(modId < 0 || modId >= LayerSize(layerId)){
245  AliErrorClass(Form("Invalid volume id %d ! Range of valid ids for layer \"%s\" is [0, %d] !",modId,LayerName(layerId),LayerSize(layerId)-1));
246  return 0;
247  }
248  return ((UShort_t(layerId) << 11) | UShort_t(modId));
249 }
250 
251 //_____________________________________________________________________________
252 UShort_t AliGeomManager::LayerToVolUIDSafe(Int_t layerId, Int_t modId)
253 {
254  // From detector (layer) name and module number (according to detector
255  // internal numbering) build the unique numerical identity of that volume
256  // inside ALICE
257  // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
258  // remaining 11 for module ID inside det (2048 possible values).
259  // Check validity of given modId inside the layer.
260  //
261  if(modId < 0 || modId >= LayerSize(layerId)){
262  AliErrorClass(Form("Invalid volume id %d ! Range of valid ids for layer \"%s\" is [0, %d] !",modId,LayerName(layerId),LayerSize(layerId)-1));
263  return 0;
264  }
265  return ((UShort_t(layerId) << 11) | UShort_t(modId));
266 }
267 
268 //_____________________________________________________________________________
270 {
271  // From voluid, unique numerical identity of that volume inside ALICE,
272  // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
273  // remaining 11 for module ID inside det (2048 possible values)), return
274  // the identity of the layer to which that volume belongs and sets the
275  // argument modId to the identity of that volume internally to the layer.
276  // NO check for validity of given voluid for speed's sake.
277  //
278  modId = voluid & 0x7ff;
279 
280  return VolUIDToLayer(voluid);
281 }
282 
283 //_____________________________________________________________________________
285 {
286  // From voluid, unique numerical identity of that volume inside ALICE,
287  // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
288  // remaining 11 for module ID inside det (2048 possible values)), return
289  // the identity of the layer to which that volume belongs
290  // NO check for validity of given voluid for speed's sake.
291  //
292  return ELayerID(voluid >> 11);
293 }
294 
295 //_____________________________________________________________________________
297 {
298  // From voluid, unique numerical identity of that volume inside ALICE,
299  // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
300  // remaining 11 for module ID inside det (2048 possible values)), returns
301  // the identity of the layer to which that volume belongs and sets the
302  // argument modId to the identity of that volume internally to the layer.
303  // Checks the validity of the given voluid
304  //
305  ELayerID layId = VolUIDToLayerSafe(voluid);
306  if(layId != AliGeomManager::kInvalidLayer){
307  Int_t mId = Int_t(voluid & 0x7ff);
308  if( mId>=0 && mId<LayerSize(layId)){
309  modId = mId;
310  return layId;
311  }
312  }
313 
314  AliErrorClass(Form("Invalid unique volume id: %d !",voluid));
315  modId = -1;
316  return kInvalidLayer;
317 
318 }
319 
320 //_____________________________________________________________________________
322 {
323  // From voluid, unique numerical identity of that volume inside ALICE,
324  // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
325  // remaining 11 for module ID inside det (2048 possible values)), returns
326  // the identity of the layer to which that volume belongs
327  // Checks the validity of the given voluid
328  //
329  if( (voluid >> 11) < kLastLayer) return ELayerID(voluid >> 11);
330 
331  AliErrorClass(Form("Invalid layer id: %d !",(voluid >> 11)));
332  return kInvalidLayer;
333 
334 }
335 
336 //_____________________________________________________________________________
337 Bool_t AliGeomManager::GetFromGeometry(const char *symname, AliAlignObj &alobj)
338 {
339  // Get the alignment object which corresponds to the symbolic volume name
340  // symname (in case equal to the TGeo volume path)
341  // The method is extremely slow due to the searching by string,
342  // therefore it should be used with great care!!
343  // This method returns FALSE if the symname of the object was not
344  // valid neither to get a TGeoPEntry nor as a volume path, or if the path
345  // associated to the TGeoPNEntry was not valid.
346  //
347 
348  // Reset the alignment object
349  alobj.SetPars(0,0,0,0,0,0);
350  alobj.SetSymName(symname);
351 
352  if (!fgGeometry || !fgGeometry->IsClosed()) {
353  AliErrorClass("Can't get the alignment object! gGeoManager doesn't exist or it is still opened!");
354  return kFALSE;
355  }
356 
357  if (!fgGeometry->GetListOfPhysicalNodes()) {
358  AliErrorClass("Can't get the alignment object! gGeoManager doesn't contain any aligned nodes!");
359  return kFALSE;
360  }
361 
362  const char *path;
363  TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
364  if(pne){
365  path = pne->GetTitle();
366  }else{
367  AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
368  path = symname;
369  }
370  TObjArray* nodesArr = fgGeometry->GetListOfPhysicalNodes();
371  TGeoPhysicalNode* node = NULL;
372  for (Int_t iNode = 0; iNode < nodesArr->GetEntriesFast(); iNode++) {
373  TGeoPhysicalNode* tempNode = (TGeoPhysicalNode*) nodesArr->UncheckedAt(iNode);
374  const char *nodePath = tempNode->GetName();
375  if (strcmp(path,nodePath) == 0) {
376  node = tempNode;
377  break;
378  }
379  }
380 
381  if (!node) {
382  if (!fgGeometry->cd(path)) {
383  AliErrorClass(Form("%s not valid neither as symbolic volume name nor as volume path!",path));
384  return kFALSE;
385  }
386  else {
387  AliWarningClass(Form("Volume (%s) has not been misaligned!",path));
388  return kTRUE;
389  }
390  }
391 
392  TGeoHMatrix align,gprime,g,ginv,l;
393  gprime = *node->GetMatrix();
394  l = *node->GetOriginalMatrix();
395  g = *node->GetMatrix(node->GetLevel()-1);
396  g *= l;
397  ginv = g.Inverse();
398  align = gprime * ginv;
399 
400  return alobj.SetMatrix(align);
401 }
402 
403 
404 //_____________________________________________________________________________
406 {
407  // Loop over all alignable volumes and extract
408  // the corresponding alignment objects from
409  // the TGeo geometry
410  //
411  for (Int_t iLayer = kFirstLayer; iLayer < AliGeomManager::kLastLayer; iLayer++) {
412  if (!fgAlignObjs[iLayer-kFirstLayer]) {
413  fgAlignObjs[iLayer-kFirstLayer] = new AliAlignObj*[LayerSize(iLayer)];
414  }
415  for (Int_t iModule = 0; iModule < LayerSize(iLayer); iModule++) {
416  UShort_t volid = LayerToVolUID(iLayer,iModule);
417  fgAlignObjs[iLayer-kFirstLayer][iModule] = new AliAlignObjParams("",volid,0,0,0,0,0,0,kTRUE);
418  const char *symname = SymName(volid);
419  if (!GetFromGeometry(symname, *fgAlignObjs[iLayer-kFirstLayer][iModule]))
420  AliErrorClass(Form("Failed to extract the alignment object for the volume (ID=%d and path=%s) !",volid,symname));
421  }
422  }
423 
424 }
425 
426 //_____________________________________________________________________________
428 {
429  // Returns the alignment object for given volume ID
430  //
431  Int_t modId;
432  ELayerID layerId = VolUIDToLayer(voluid,modId);
433  return GetAlignObj(layerId,modId);
434 }
435 
436 //_____________________________________________________________________________
438 {
439  // Returns pointer to alignment object given its layer and module ID
440  //
441  if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
442  AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
443  return NULL;
444  }
446 
447  return fgAlignObjs[layerId-kFirstLayer][modId];
448 }
449 
450 //_____________________________________________________________________________
451 const char* AliGeomManager::SymName(UShort_t voluid)
452 {
453  // Returns the symbolic volume name for given volume ID
454  //
455  Int_t modId;
456  ELayerID layerId = VolUIDToLayer(voluid,modId);
457  return SymName(layerId,modId);
458 }
459 
460 //_____________________________________________________________________________
461 const char* AliGeomManager::SymName(ELayerID layerId, Int_t modId)
462 {
463  // Returns the symbolic volume name given for a given layer
464  // and module ID
465  //
466  if(!fgGeometry){
467  AliErrorClass("No geometry instance loaded yet!");
468  return NULL;
469  }
470  if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
471  AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
472  return NULL;
473  }
474 
475  TGeoPNEntry* pne = fgPNEntry[layerId-kFirstLayer][modId];
476  if(!pne)
477  {
478  AliWarningClass(Form("Module %d of layer %s is not activated!",modId,LayerName(layerId)));
479  return NULL;
480  }
481  return pne->GetName();
482 
483 }
484 
485 //_____________________________________________________________________________
486 Bool_t AliGeomManager::CheckSymNamesLUT(const char* /*detsToBeChecked*/)
487 {
488  // Check the look-up table which associates the unique numerical identity of
489  // each alignable volume to the corresponding symbolic volume name.
490  // The LUT is now held inside the geometry and handled by TGeo.
491  // The method is meant to be launched when loading a geometry to verify that
492  // no changes in the symbolic names have been introduced, which would prevent
493  // backward compatibility with alignment objects.
494  // To accept both complete and partial geometry, this method skips the check
495  // for TRD and TOF volumes which are missing in the partial geometry.
496  //
497 
498 // TString detsString(detsToBeChecked);
499 // if(detsString.Contains("ALL")) detsString="ITS TPC TOF TRD HMPID PHOS EMCAL";
500 
501  // Temporary measure to face the case of reconstruction over detectors not present in the geometry
502  TString detsString = "";
503  if(fgGeometry->CheckPath("ALIC_1/ITSV_1")) detsString+="ITS ";
504  if(fgGeometry->CheckPath("ALIC_1/TPC_M_1")) detsString+="TPC ";
505 
506  TString tofsm;
507  TString baseTof("ALIC_1/B077_1/BSEGMO");
508  TString middleTof("_1/BTOF");
509  TString trailTof("_1/FTOA_0");
510  Bool_t tofActive=kFALSE;
511  Bool_t tofSMs[18];
512  for(Int_t sm=0; sm<18; sm++)
513  {
514  tofSMs[sm]=kFALSE;
515  tofsm=baseTof;
516  tofsm += sm;
517  tofsm += middleTof;
518  tofsm += sm;
519  tofsm += trailTof;
520  if(fgGeometry->CheckPath(tofsm.Data()))
521  {
522  tofActive=kTRUE;
523  tofSMs[sm]=kTRUE;
524  }
525  }
526  if(tofActive) detsString+="TOF ";
527 
528  TString trdsm;
529  TString baseTrd("ALIC_1/B077_1/BSEGMO");
530  TString middleTrd("_1/BTRD");
531  TString trailTrd("_1/UTR1_1");
532  Bool_t trdActive=kFALSE;
533  Bool_t trdSMs[18];
534  for(Int_t sm=0; sm<18; sm++)
535  {
536  trdSMs[sm]=kFALSE;
537  trdsm=baseTrd;
538  trdsm += sm;
539  trdsm += middleTrd;
540  trdsm += sm;
541  trdsm += trailTrd;
542  if(fgGeometry->CheckPath(trdsm.Data()))
543  {
544  trdActive=kTRUE;
545  trdSMs[sm]=kTRUE;
546  }
547  }
548  if(trdActive) detsString+="TRD ";
549 
550  if(fgGeometry->CheckPath("ALIC_1/Hmp0_0")) detsString+="HMPID ";
551 
552  TString phosMod, cpvMod;
553  TString basePhos("ALIC_1/PHOS_");
554  Bool_t phosActive=kFALSE;
555  Bool_t cpvActive=kFALSE;
556  Bool_t phosMods[5];
557  for(Int_t pmod=0; pmod<5; pmod++)
558  {
559  phosMods[pmod]=kFALSE;
560  phosMod = basePhos;
561  phosMod += (pmod+1);
562  cpvMod = phosMod;
563  cpvMod += "/PCPV_1";
564  if(fgGeometry->CheckPath(phosMod.Data()))
565  {
566  phosActive=kTRUE;
567  phosMods[pmod]=kTRUE;
568  if(fgGeometry->CheckPath(cpvMod.Data())) cpvActive=kTRUE;
569  }
570  }
571  if(phosActive) detsString+="PHOS ";
572 
573  // Check over the ten EMCAL full supermodules and the two EMCAL half supermodules
574  TString emcalSM;
575  TString baseEmcalSM("ALIC_1/XEN1_1/");
576  Bool_t emcalActive=kFALSE;
577  Bool_t emcalSMs[22] = {kFALSE};
578  for(Int_t sm=0; sm<22; sm++)
579  {
580  emcalSM=baseEmcalSM;
581  if(sm<10){
582  emcalSM += "SMOD_";
583  emcalSM += (sm+1);
584  }else if(sm/2 == 5){
585  emcalSM += "SM10_";
586  emcalSM += (sm-9);
587  }else if(sm > 11){
588  emcalSM += "DCSM_";
589  emcalSM += (sm-11);
590  }
591  if(fgGeometry->CheckPath(emcalSM.Data()))
592  {
593  emcalActive=kTRUE;
594  emcalSMs[sm]=kTRUE;
595  }
596  }
597  if(emcalActive) detsString+="EMCAL ";
598 
599 
600  TString symname;
601  const char* sname;
602  TGeoPNEntry* pne = 0x0;
603  Int_t uid; // global unique identity
604  Int_t modnum; // unique id inside layer; in the following, set it to 0 at the start of each layer
605 
606  if(detsString.Contains("ITS")){
607  /********************* ITS layers ***********************/
608  AliDebugClass(2,"Checking consistency of symbolic names for ITS layers");
609  TString strSPD = "ITS/SPD";
610  TString strSDD = "ITS/SDD";
611  TString strSSD = "ITS/SSD";
612  TString strStave = "/Stave";
613  TString strHalfStave = "/HalfStave";
614  TString strLadder = "/Ladder";
615  TString strSector = "/Sector";
616  TString strSensor = "/Sensor";
617  TString strEntryName1;
618  TString strEntryName2;
619  TString strEntryName3;
620 
621  /********************* SPD layer1 ***********************/
622  {
623  modnum = 0;
624 
625  for(Int_t cSect = 0; cSect<10; cSect++){
626  strEntryName1 = strSPD;
627  strEntryName1 += 0;
628  strEntryName1 += strSector;
629  strEntryName1 += cSect;
630 
631  for(Int_t cStave =0; cStave<2; cStave++){
632  strEntryName2 = strEntryName1;
633  strEntryName2 += strStave;
634  strEntryName2 += cStave;
635 
636  for (Int_t cHS=0; cHS<2; cHS++) {
637  strEntryName3 = strEntryName2;
638  strEntryName3 += strHalfStave;
639  strEntryName3 += cHS;
640 
641  for(Int_t cLad =0; cLad<2; cLad++){
642  symname = strEntryName3;
643  symname += strLadder;
644  symname += cLad+cHS*2;
645  uid = LayerToVolUID(kSPD1,modnum++);
646  pne = fgGeometry->GetAlignableEntryByUID(uid);
647  if(!pne)
648  {
649  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
650  return kFALSE;
651  }
652  sname = pne->GetName();
653  if(symname.CompareTo(sname))
654  {
655  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d."
656  "Expected was %s, found was %s!", uid, symname.Data(), sname));
657  return kFALSE;
658  }
659  }
660  }
661  }
662  }
663  }
664 
665  /********************* SPD layer2 ***********************/
666  {
667  modnum = 0;
668 
669  for(Int_t cSect = 0; cSect<10; cSect++){
670  strEntryName1 = strSPD;
671  strEntryName1 += 1;
672  strEntryName1 += strSector;
673  strEntryName1 += cSect;
674 
675  for(Int_t cStave =0; cStave<4; cStave++){
676  strEntryName2 = strEntryName1;
677  strEntryName2 += strStave;
678  strEntryName2 += cStave;
679 
680  for (Int_t cHS=0; cHS<2; cHS++) {
681  strEntryName3 = strEntryName2;
682  strEntryName3 += strHalfStave;
683  strEntryName3 += cHS;
684 
685  for(Int_t cLad =0; cLad<2; cLad++){
686  symname = strEntryName3;
687  symname += strLadder;
688  symname += cLad+cHS*2;
689  uid = LayerToVolUID(kSPD2,modnum++);
690  pne = fgGeometry->GetAlignableEntryByUID(uid);
691  if(!pne)
692  {
693  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
694  return kFALSE;
695  }
696  sname = pne->GetName();
697  if(symname.CompareTo(sname))
698  {
699  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d."
700  "Expected was %s, found was %s!", uid, symname.Data(), sname));
701  return kFALSE;
702  }
703  }
704  }
705  }
706  }
707  }
708 
709  /********************* SDD layer1 ***********************/
710  {
711  modnum=0;
712 
713  for(Int_t c1 = 1; c1<=14; c1++){
714  strEntryName1 = strSDD;
715  strEntryName1 += 2;
716  strEntryName1 +=strLadder;
717  strEntryName1 += (c1-1);
718  for(Int_t c2 =1; c2<=6; c2++){
719  symname = strEntryName1;
720  symname += strSensor;
721  symname += (c2-1);
722  uid = LayerToVolUID(kSDD1,modnum++);
723  pne = fgGeometry->GetAlignableEntryByUID(uid);
724  if(!pne)
725  {
726  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
727  return kFALSE;
728  }
729  sname = pne->GetName();
730  if(symname.CompareTo(sname))
731  {
732  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
733  "Expected was %s, found was %s!", uid, symname.Data(), sname));
734  return kFALSE;
735  }
736  }
737  }
738  }
739 
740  /********************* SDD layer2 ***********************/
741  {
742  modnum=0;
743 
744  for(Int_t c1 = 1; c1<=22; c1++){
745  strEntryName1 = strSDD;
746  strEntryName1 += 3;
747  strEntryName1 +=strLadder;
748  strEntryName1 += (c1-1);
749  for(Int_t c2 = 1; c2<=8; c2++){
750  symname = strEntryName1;
751  symname += strSensor;
752  symname += (c2-1);
753  uid = LayerToVolUID(kSDD2,modnum++);
754  pne = fgGeometry->GetAlignableEntryByUID(uid);
755  if(!pne)
756  {
757  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
758  return kFALSE;
759  }
760  sname = pne->GetName();
761  if(symname.CompareTo(sname))
762  {
763  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
764  "Expected was %s, found was %s!", uid, symname.Data(), sname));
765  return kFALSE;
766  }
767  }
768  }
769  }
770 
771  /********************* SSD layer1 ***********************/
772  {
773  modnum=0;
774 
775  for(Int_t c1 = 1; c1<=34; c1++){
776  strEntryName1 = strSSD;
777  strEntryName1 += 4;
778  strEntryName1 +=strLadder;
779  strEntryName1 += (c1-1);
780  for(Int_t c2 = 1; c2<=22; c2++){
781  symname = strEntryName1;
782  symname += strSensor;
783  symname += (c2-1);
784  uid = LayerToVolUID(kSSD1,modnum++);
785  pne = fgGeometry->GetAlignableEntryByUID(uid);
786  if(!pne)
787  {
788  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
789  return kFALSE;
790  }
791  sname = pne->GetName();
792  if(symname.CompareTo(sname))
793  {
794  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
795  "Expected was %s, found was %s!", uid, symname.Data(), sname));
796  return kFALSE;
797  }
798  }
799  }
800  }
801 
802  /********************* SSD layer2 ***********************/
803  {
804  modnum=0;
805 
806  for(Int_t c1 = 1; c1<=38; c1++){
807  strEntryName1 = strSSD;
808  strEntryName1 += 5;
809  strEntryName1 +=strLadder;
810  strEntryName1 += (c1-1);
811  for(Int_t c2 = 1; c2<=25; c2++){
812  symname = strEntryName1;
813  symname += strSensor;
814  symname += (c2-1);
815  uid = LayerToVolUID(kSSD2,modnum++);
816  pne = fgGeometry->GetAlignableEntryByUID(uid);
817  if(!pne)
818  {
819  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
820  return kFALSE;
821  }
822  sname = pne->GetName();
823  if(symname.CompareTo(sname))
824  {
825  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
826  "Expected was %s, found was %s!", uid, symname.Data(), sname));
827  return kFALSE;
828  }
829  }
830  }
831  }
832 
833  AliDebugClass(2,"Consistency check for ITS symbolic names finished successfully.");
834  }
835 
836  if(detsString.Contains("TPC"))
837  {
838  /*************** TPC inner and outer layers ****************/
839 
840  AliDebugClass(2,"Checking consistency of symbolic names for TPC layers");
841  TString sAsector="TPC/EndcapA/Sector";
842  TString sCsector="TPC/EndcapC/Sector";
843  TString sInner="/InnerChamber";
844  TString sOuter="/OuterChamber";
845 
846  /*************** TPC inner chambers' layer ****************/
847  {
848  modnum = 0;
849 
850  for(Int_t cnt=1; cnt<=18; cnt++)
851  {
852  symname = sAsector;
853  symname += cnt;
854  symname += sInner;
855  uid = LayerToVolUID(kTPC1,modnum++);
856  pne = fgGeometry->GetAlignableEntryByUID(uid);
857  if(!pne)
858  {
859  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
860  return kFALSE;
861  }
862  sname = pne->GetName();
863  if(symname.CompareTo(sname))
864  {
865  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
866  "Expected was %s, found was %s!", uid, symname.Data(), sname));
867  return kFALSE;
868  }
869  }
870 
871  for(Int_t cnt=1; cnt<=18; cnt++)
872  {
873  symname = sCsector;
874  symname += cnt;
875  symname += sInner;
876  uid = LayerToVolUID(kTPC1,modnum++);
877  pne = fgGeometry->GetAlignableEntryByUID(uid);
878  if(!pne)
879  {
880  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
881  return kFALSE;
882  }
883  sname = pne->GetName();
884  if(symname.CompareTo(sname))
885  {
886  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
887  "Expected was %s, found was %s!", uid, symname.Data(), sname));
888  return kFALSE;
889  }
890  }
891  }
892 
893  /*************** TPC outer chambers' layer ****************/
894  {
895  modnum = 0;
896 
897  for(Int_t cnt=1; cnt<=18; cnt++)
898  {
899  symname = sAsector;
900  symname += cnt;
901  symname += sOuter;
902  uid = LayerToVolUID(kTPC2,modnum++);
903  pne = fgGeometry->GetAlignableEntryByUID(uid);
904  if(!pne)
905  {
906  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
907  return kFALSE;
908  }
909  sname = pne->GetName();
910  if(symname.CompareTo(sname))
911  {
912  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
913  "Expected was %s, found was %s!", uid, symname.Data(), sname));
914  return kFALSE;
915  }
916  }
917 
918  for(Int_t cnt=1; cnt<=18; cnt++)
919  {
920  symname = sCsector;
921  symname += cnt;
922  symname += sOuter;
923  uid = LayerToVolUID(kTPC2,modnum++);
924  pne = fgGeometry->GetAlignableEntryByUID(uid);
925  if(!pne)
926  {
927  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
928  return kFALSE;
929  }
930  sname = pne->GetName();
931  if(symname.CompareTo(sname))
932  {
933  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
934  "Expected was %s, found was %s!", uid, symname.Data(), sname));
935  return kFALSE;
936  }
937  }
938  }
939 
940  AliDebugClass(2,"Consistency check for TPC symbolic names finished successfully.");
941  }
942 
943  if(detsString.Contains("TOF"))
944  {
945  /********************* TOF layer ***********************/
946 
947  AliDebugClass(2,"Checking consistency of symbolic names for TOF layers");
948  modnum=0;
949 
950  Int_t nstrA=15;
951  Int_t nstrB=19;
952  Int_t nstrC=19;
953  Int_t nSectors=18;
954  Int_t nStrips=nstrA+2*nstrB+2*nstrC;
955 
956  TString snSM = "TOF/sm";
957  TString snSTRIP = "/strip";
958 
959  for (Int_t isect = 0; isect < nSectors; isect++) {
960  if(tofSMs[isect]) AliDebugClass(3,Form("Consistency check for symnames of TOF supermodule %d.",isect));
961  for (Int_t istr = 1; istr <= nStrips; istr++) {
962  symname = snSM;
963  symname += Form("%02d",isect);
964  symname += snSTRIP;
965  symname += Form("%02d",istr);
966  uid = LayerToVolUID(kTOF,modnum++);
967  if(!tofSMs[isect]) continue; // taking possible missing TOF sectors (partial geometry) into account
968  if ((isect==13 || isect==14 || isect==15) && (istr >= 39 && istr <= 53)) continue; //taking holes into account
969  pne = fgGeometry->GetAlignableEntryByUID(uid);
970  if(!pne)
971  {
972  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
973  return kFALSE;
974  }
975  sname = pne->GetName();
976  if(symname.CompareTo(sname))
977  {
978  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
979  "Expected was %s, found was %s!", uid, symname.Data(), sname));
980  return kFALSE;
981  }
982  }
983  }
984 
985  AliDebugClass(2,"Consistency check for TOF symbolic names finished successfully.");
986  }
987 
988  if(detsString.Contains("HMPID"))
989  {
990  /********************* HMPID layer ***********************/
991 
992  AliDebugClass(2,"Checking consistency of symbolic names for HMPID layers");
993  TString str = "/HMPID/Chamber";
994 
995  for (modnum=0; modnum < 7; modnum++) {
996  symname = str;
997  symname += modnum;
998  uid = LayerToVolUID(kHMPID,modnum);
999  pne = fgGeometry->GetAlignableEntryByUID(uid);
1000  if(!pne)
1001  {
1002  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
1003  return kFALSE;
1004  }
1005  sname = pne->GetName();
1006  if(symname.CompareTo(sname))
1007  {
1008  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
1009  "Expected was %s, found was %s!", uid, symname.Data(), sname));
1010  return kFALSE;
1011  }
1012  }
1013 
1014  AliDebugClass(2,"Consistency check for HMPID symbolic names finished successfully.");
1015  }
1016 
1017  if(detsString.Contains("TRD"))
1018  {
1019  /********************* TRD layers 1-6 *******************/
1021 
1022  AliDebugClass(2,"Checking consistency of symbolic names for TRD layers");
1023  Int_t arTRDlayId[6] = {kTRD1, kTRD2, kTRD3, kTRD4, kTRD5, kTRD6};
1024 
1025  TString snStr = "TRD/sm";
1026  TString snApp1 = "/st";
1027  TString snApp2 = "/pl";
1028 
1029  for(Int_t layer=0; layer<6; layer++){
1030  modnum=0;
1031  AliDebugClass(3,Form("Consistency check for symnames of TRD layer %d.",layer));
1032  for (Int_t isect = 0; isect < 18; isect++) {
1033  for (Int_t icham = 0; icham < 5; icham++) {
1034  symname = snStr;
1035  symname += Form("%02d",isect);
1036  symname += snApp1;
1037  symname += icham;
1038  symname += snApp2;
1039  symname += layer;
1040  uid = LayerToVolUID(arTRDlayId[layer],modnum++);
1041  if(!trdSMs[isect]) continue;
1042  if ((isect==13 || isect==14 || isect==15) && icham==2) continue; //keeping holes into account
1043  pne = fgGeometry->GetAlignableEntryByUID(uid);
1044  if(!pne)
1045  {
1046  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
1047  return kFALSE;
1048  }
1049  sname = pne->GetName();
1050  if(symname.CompareTo(sname))
1051  {
1052  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
1053  "Expected was %s, found was %s!", uid, symname.Data(), sname));
1054  return kFALSE;
1055  }
1056  }
1057  }
1058  }
1059 
1060  AliDebugClass(2,"Consistency check for TRD symbolic names finished successfully.");
1061  }
1062 
1063  if(detsString.Contains("PHOS"))
1064  {
1065  /********************* PHOS EMC layer ***********************/
1066 
1067  AliDebugClass(2,"Checking consistency of symbolic names for PHOS layers");
1068 
1069  TString str = "PHOS/Module";
1070  modnum=0;
1071 
1072  for (Int_t iModule=0; iModule < 5; iModule++) {
1073  if(!phosMods[iModule]) continue;
1074  symname = str;
1075  symname += (iModule+1);
1076  uid = LayerToVolUID(kPHOS1,iModule);
1077  pne = fgGeometry->GetAlignableEntryByUID(uid);
1078  if(!pne)
1079  {
1080  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
1081  return kFALSE;
1082  }
1083  sname = pne->GetName();
1084  if(symname.CompareTo(sname))
1085  {
1086  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
1087  "Expected was %s, found was %s!", uid, symname.Data(), sname));
1088  return kFALSE;
1089  }
1090  /********************* PHOS CPV layer ***********************/
1091  if(!cpvActive) continue;
1092  symname += "/CPV";
1093  uid = LayerToVolUID(kPHOS2,iModule);
1094  pne = fgGeometry->GetAlignableEntryByUID(uid);
1095  if(!pne)
1096  {
1097  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
1098  return kFALSE;
1099  }
1100  sname = pne->GetName();
1101  if(symname.CompareTo(sname))
1102  {
1103  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
1104  "Expected was %s, found was %s!", uid, symname.Data(), sname));
1105  return kFALSE;
1106  }
1107  }
1108  AliDebugClass(2,"Consistency check for PHOS symbolic names finished successfully.");
1109  }
1110 
1111  if(detsString.Contains("EMCAL"))
1112  {
1113  /********************* EMCAL layer ***********************/
1114 
1115  AliDebugClass(2,"Checking consistency of symbolic names for EMCAL layers");
1116  TString str = "EMCAL/FullSupermodule";
1117  modnum=0;
1118 
1119  for (Int_t iModule=0; iModule < 22; iModule++) {
1120  if(!emcalSMs[iModule]) continue;
1121  symname = str;
1122  symname += iModule+1;
1123  if(iModule/2 == 5) {// 10,11
1124  symname = "EMCAL/HalfSupermodule";
1125  symname += iModule-9;
1126  }else if(iModule > 11) {// 12 ~ 21
1127  symname = "EMCAL/DCALSupermodule";
1128  symname += iModule-11;
1129  }
1130  modnum = iModule;
1131  uid = LayerToVolUID(kEMCAL,modnum);
1132  pne = fgGeometry->GetAlignableEntryByUID(uid);
1133  if(!pne)
1134  {
1135  AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
1136  return kFALSE;
1137  }
1138  sname = pne->GetName();
1139  if(symname.CompareTo(sname))
1140  {
1141  AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
1142  "Expected was %s, found was %s!", uid, symname.Data(), sname));
1143  return kFALSE;
1144  }
1145  }
1146 
1147  AliDebugClass(2,"Consistency check for EMCAL symbolic names finished successfully.");
1148  }
1149 
1150  return kTRUE;
1151 
1152 }
1153 
1154 //_____________________________________________________________________________
1156 {
1157  // Initialize the look-up table which associates the unique
1158  // numerical identity of each alignable volume to the
1159  // corresponding TGeoPNEntry.
1160  // The LUTs are static; they are created at the creation of the
1161  // AliGeomManager instance and recreated if the geometry has changed
1162  //
1163  if(!fgGeometry) {
1164  AliErrorClass("Impossible to initialize PNEntries LUT without an active geometry");
1165  return;
1166  }
1167 
1168  for (Int_t iLayer = 0; iLayer < (kLastLayer - kFirstLayer); iLayer++){
1169  if (!fgPNEntry[iLayer]) fgPNEntry[iLayer] = new TGeoPNEntry*[fgLayerSize[iLayer]];
1170  for(Int_t modnum=0; modnum<fgLayerSize[iLayer]; modnum++){
1171  fgPNEntry[iLayer][modnum] = fgGeometry->GetAlignableEntryByUID(LayerToVolUID(iLayer+1,modnum));
1172  }
1173  }
1174 }
1175 
1176 //______________________________________________________________________
1177 TGeoHMatrix* AliGeomManager::GetMatrix(TGeoPNEntry *pne)
1178 {
1179  // Get the global transformation matrix for a given PNEntry
1180  // by quering the TGeoManager
1181 
1182  if (!fgGeometry || !fgGeometry->IsClosed()) {
1183  AliErrorClass("Can't get the global matrix! gGeoManager doesn't exist or it is still opened!");
1184  return NULL;
1185  }
1186 
1187  // if matrix already known --> return it
1188  TGeoPhysicalNode *pnode = pne->GetPhysicalNode();
1189  if (pnode) return pnode->GetMatrix();
1190 
1191  // otherwise calculate it from title and attach via TGeoPhysicalNode
1192  pne->SetPhysicalNode(new TGeoPhysicalNode(pne->GetTitle()));
1193  return pne->GetPhysicalNode()->GetMatrix();
1194 }
1195 
1196 //______________________________________________________________________
1197 TGeoHMatrix* AliGeomManager::GetMatrix(Int_t index)
1198 {
1199  // Get the global transformation matrix for a given alignable volume
1200  // identified by its unique ID 'index' by quering the TGeoManager
1201 
1202  TGeoPNEntry *pne = GetPNEntry(index);
1203  if (!pne) return NULL;
1204 
1205  return GetMatrix(pne);
1206 }
1207 
1208 //______________________________________________________________________
1209 TGeoHMatrix* AliGeomManager::GetMatrix(const char* symname)
1210 {
1211  // Get the global transformation matrix for a given alignable volume
1212  // identified by its symbolic name 'symname' by quering the TGeoManager
1213 
1214  if (!fgGeometry || !fgGeometry->IsClosed()) {
1215  AliErrorClass("No active geometry or geometry not yet closed!");
1216  return NULL;
1217  }
1218 
1219  TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
1220  if (!pne) return NULL;
1221 
1222  return GetMatrix(pne);
1223 }
1224 
1225 //______________________________________________________________________
1226 Bool_t AliGeomManager::GetTranslation(Int_t index, Double_t t[3])
1227 {
1228  // Get the translation vector for a given module 'index'
1229  // by quering the TGeoManager
1230 
1231  TGeoHMatrix *m = GetMatrix(index);
1232  if (!m) return kFALSE;
1233 
1234  Double_t *trans = m->GetTranslation();
1235  for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
1236 
1237  return kTRUE;
1238 }
1239 
1240 //______________________________________________________________________
1241 Bool_t AliGeomManager::GetRotation(Int_t index, Double_t r[9])
1242 {
1243  // Get the rotation matrix for a given module 'index'
1244  // by quering the TGeoManager
1245 
1246  TGeoHMatrix *m = GetMatrix(index);
1247  if (!m) return kFALSE;
1248 
1249  Double_t *rot = m->GetRotationMatrix();
1250  for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
1251 
1252  return kTRUE;
1253 }
1254 
1255 //_____________________________________________________________________________
1256 Bool_t AliGeomManager::GetDeltaForBranch(Int_t index, TGeoHMatrix &inclusiveD)
1257 {
1258  // The method sets the matrix passed as argument as the global delta
1259  // (for the volume referred by the unique index) including the displacements
1260  // of all parent volumes in the branch.
1261  //
1262 
1263  TGeoHMatrix go,invgo;
1264  go = *GetOrigGlobalMatrix(index);
1265  invgo = go.Inverse();
1266  inclusiveD = *GetMatrix(index);
1267  inclusiveD.Multiply(&invgo);
1268 
1269  return kTRUE;
1270 }
1271 
1272 //_____________________________________________________________________________
1273 Bool_t AliGeomManager::GetDeltaForBranch(AliAlignObj& aao, TGeoHMatrix &inclusiveD)
1274 {
1275  // The method sets the matrix passed as argument as the global delta
1276  // (for the volume referred by the alignment object) including the displacements
1277  // of all parent volumes in the brach.
1278  //
1279  Int_t index = aao.GetVolUID();
1280  if(!index){
1281  AliErrorClass("Either the alignment object or its index are not valid");
1282  return kFALSE;
1283  }
1284  return GetDeltaForBranch(index, inclusiveD);
1285 }
1286 
1287 //______________________________________________________________________
1288 Bool_t AliGeomManager::GetOrigGlobalMatrix(const char* symname, TGeoHMatrix &m)
1289 {
1290  // Get the global transformation matrix (ideal geometry) for a given alignable volume
1291  // The alignable volume is identified by 'symname' which has to be either a valid symbolic
1292  // name, the query being performed after alignment, or a valid volume path if the query is
1293  // performed before alignment.
1294  //
1295  m.Clear();
1296 
1297  if (!fgGeometry || !fgGeometry->IsClosed()) {
1298  AliErrorClass("No active geometry or geometry not yet closed!");
1299  return kFALSE;
1300  }
1301  if (!fgGeometry->GetListOfPhysicalNodes()) {
1302  AliWarningClass("gGeoManager doesn't contain any aligned nodes!");
1303  if (!fgGeometry->cd(symname)) {
1304  AliErrorClass(Form("Volume path %s not valid!",symname));
1305  return kFALSE;
1306  }
1307  else {
1308  m = *fgGeometry->GetCurrentMatrix();
1309  return kTRUE;
1310  }
1311  }
1312 
1313  TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
1314  const char* path = NULL;
1315  if(pne){
1316  m = *pne->GetGlobalOrig();
1317  return kTRUE;
1318  }else{
1319  AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
1320  path=symname;
1321  }
1322 
1323  return GetOrigGlobalMatrixFromPath(path,m);
1324 }
1325 
1326 //_____________________________________________________________________________
1327 Bool_t AliGeomManager::GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m)
1328 {
1329  // The method returns the global matrix for the volume identified by
1330  // 'path' in the ideal detector geometry.
1331  // The output global matrix is stored in 'm'.
1332  // Returns kFALSE in case TGeo has not been initialized or the volume
1333  // path is not valid.
1334  //
1335  m.Clear();
1336 
1337  if (!fgGeometry || !fgGeometry->IsClosed()) {
1338  AliErrorClass("Can't get the original global matrix! gGeoManager doesn't exist or it is still opened!");
1339  return kFALSE;
1340  }
1341 
1342  if (!fgGeometry->CheckPath(path)) {
1343  AliErrorClass(Form("Volume path %s not valid!",path));
1344  return kFALSE;
1345  }
1346 
1347  TIter next(fgGeometry->GetListOfPhysicalNodes());
1348  fgGeometry->cd(path);
1349 
1350  while(fgGeometry->GetLevel()){
1351 
1352  TGeoPhysicalNode *physNode = NULL;
1353  next.Reset();
1354  TGeoNode *node = fgGeometry->GetCurrentNode();
1355  while ((physNode=(TGeoPhysicalNode*)next()))
1356  if (physNode->GetNode() == node) break;
1357 
1358  TGeoMatrix *lm = NULL;
1359  if (physNode) {
1360  lm = physNode->GetOriginalMatrix();
1361  if (!lm) lm = node->GetMatrix();
1362  } else
1363  lm = node->GetMatrix();
1364 
1365  m.MultiplyLeft(lm);
1366 
1367  fgGeometry->CdUp();
1368  }
1369 
1370  return kTRUE;
1371 }
1372 
1373 //_____________________________________________________________________________
1374 TGeoHMatrix* AliGeomManager::GetOrigGlobalMatrix(TGeoPNEntry * const pne)
1375 {
1376  // The method returns global matrix for the ideal detector geometry
1377  // using the corresponding TGeoPNEntry as an input.
1378  // The returned pointer should be copied by the user, since its content could
1379  // be overwritten by a following call to the method.
1380  // In case of missing TGeoManager the method returns NULL.
1381  //
1382  if (!fgGeometry || !fgGeometry->IsClosed()) {
1383  AliErrorClass("Can't get the global matrix! gGeoManager doesn't exist or it is still opened!");
1384  return NULL;
1385  }
1386 
1387  return pne->GetGlobalOrig();
1388 }
1389 
1390 //______________________________________________________________________
1391 TGeoHMatrix* AliGeomManager::GetOrigGlobalMatrix(Int_t index)
1392 {
1393  // The method returns global matrix from the ideal detector geometry
1394  // for the volume identified by its index.
1395  // The returned pointer should be copied by the user, since its content could
1396  // be overwritten by a following call to the method.
1397  // In case of missing TGeoManager the method returns NULL.
1398  // If possible, the method uses the LUT of original ideal matrices
1399  // for fast access. The LUT is reset in case a
1400  // new geometry is loaded.
1401  //
1402  TGeoPNEntry* pne = GetPNEntry(index);
1403  return pne->GetGlobalOrig();
1404 }
1405 
1406 //______________________________________________________________________
1407 Bool_t AliGeomManager::GetOrigTranslation(Int_t index, Double_t t[3])
1408 {
1409  // Get the original translation vector (ideal geometry)
1410  // for a given module 'index' by quering the TGeoManager
1411 
1412  TGeoHMatrix *m = GetOrigGlobalMatrix(index);
1413  if (!m) return kFALSE;
1414 
1415  Double_t *trans = m->GetTranslation();
1416  for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
1417 
1418  return kTRUE;
1419 }
1420 
1421 //______________________________________________________________________
1422 Bool_t AliGeomManager::GetOrigRotation(Int_t index, Double_t r[9])
1423 {
1424  // Get the original rotation matrix (ideal geometry)
1425  // for a given module 'index' by quering the TGeoManager
1426 
1427  TGeoHMatrix *m = GetOrigGlobalMatrix(index);
1428  if (!m) return kFALSE;
1429 
1430  Double_t *rot = m->GetRotationMatrix();
1431  for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
1432 
1433  return kTRUE;
1434 }
1435 
1436 //______________________________________________________________________
1437 const TGeoHMatrix* AliGeomManager::GetTracking2LocalMatrix(Int_t index)
1438 {
1439  // Get the matrix which transforms from the tracking to the local RS
1440  // The method queries directly the TGeoPNEntry
1441 
1442  TGeoPNEntry *pne = GetPNEntry(index);
1443  if (!pne) return NULL;
1444 
1445  const TGeoHMatrix *m = pne->GetMatrix();
1446  if (!m)
1447  AliErrorClass(Form("TGeoPNEntry (%s) contains no tracking-to-local matrix !",pne->GetName()));
1448 
1449  return m;
1450 }
1451 
1452 //______________________________________________________________________
1453 Bool_t AliGeomManager::GetTrackingMatrix(Int_t index, TGeoHMatrix &m)
1454 {
1455  // Get the matrix which transforms from the tracking r.s. to
1456  // the global one.
1457  // Returns kFALSE in case of error.
1458 
1459  m.Clear();
1460 
1461  TGeoHMatrix *m1 = GetMatrix(index);
1462  if (!m1) return kFALSE;
1463 
1464  const TGeoHMatrix *m2 = GetTracking2LocalMatrix(index);
1465  if (!m2) return kFALSE;
1466 
1467  m = *m1;
1468  m.Multiply(m2);
1469 
1470  return kTRUE;
1471 }
1472 
1473 //_____________________________________________________________________________
1474 TGeoPNEntry* AliGeomManager::GetPNEntry(Int_t voluid) {
1475  // Returns the TGeoPNEntry for the given global volume ID "voluid"
1476  //
1477  Int_t modId;
1478  ELayerID layerId = VolUIDToLayer(voluid,modId);
1479  return GetPNEntry(layerId,modId);
1480 }
1481 
1482 //_____________________________________________________________________________
1483 TGeoPNEntry* AliGeomManager::GetPNEntry(ELayerID layerId, Int_t modId)
1484 {
1485  // Returns the TGeoPNEntry for a given layer
1486  // and module ID
1487  //
1488 
1489  if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
1490  AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
1491  return NULL;
1492  }
1493 
1494  return fgPNEntry[layerId-kFirstLayer][modId];
1495 }
1496 
1497 //_____________________________________________________________________________
1499 {
1500  // Check for overlaps/extrusions on physical nodes only;
1501  // this overlap-checker is meant to be used to check overlaps/extrusions
1502  // originated by the application of alignment objects.
1503  //
1504 
1505  TObjArray* ovexlist = 0x0;
1506 
1507  AliInfoClass("********* Checking overlaps/extrusions over physical nodes only *********");
1508  TObjArray* pnList = gGeoManager->GetListOfPhysicalNodes();
1509  TGeoVolume* mvol = 0;
1510  TGeoPhysicalNode* pn;
1511  TObjArray* overlaps = new TObjArray(64);
1512  overlaps->SetOwner();
1513 
1514  TStopwatch timer2;
1515  timer2.Start();
1516  for(Int_t pni=0; pni<pnList->GetEntriesFast(); pni++){
1517  pn = (TGeoPhysicalNode*) pnList->UncheckedAt(pni);
1518  // checking the volume of the mother (go upper in the tree in case it is an assembly)
1519  Int_t levup=1;
1520  while(((TGeoVolume*)pn->GetVolume(pn->GetLevel()-levup))->IsAssembly()) levup++;
1521  //Printf("Going to upper level");
1522  mvol = pn->GetVolume(pn->GetLevel()-levup);
1523  if(!mvol->IsSelected()){
1524  AliInfoClass(Form("Checking overlaps for volume %s",mvol->GetName()));
1525  mvol->CheckOverlaps(threshold);
1526  ovexlist = gGeoManager->GetListOfOverlaps();
1527  TIter next(ovexlist);
1528  TGeoOverlap *ov;
1529  while ((ov=(TGeoOverlap*)next())) overlaps->Add(ov->Clone());
1530  mvol->SelectVolume();
1531  }
1532  }
1533  mvol->SelectVolume(kTRUE); // clears the list of selected volumes
1534 
1535  AliInfoClass(Form("Number of overlapping/extruding PNs: %d",overlaps->GetEntriesFast()));
1536  timer2.Stop();
1537  timer2.Print();
1538 
1539  TIter nextN(overlaps);
1540  TGeoOverlap *ovlp;
1541  while ((ovlp=(TGeoOverlap*)nextN())) ovlp->PrintInfo();
1542 
1543  overlaps->Delete();
1544  delete overlaps;
1545 }
1546 
1547 //_____________________________________________________________________________
1548 Int_t AliGeomManager::GetNalignable(const char* module)
1549 {
1550  // Get number of declared alignable volumes in current geometry
1551  // for the given detector "module" passed as a vaild detector name
1552  // if the detector name is invalid return -1
1553 
1554  // return the detector index corresponding to detector
1555  Int_t index = -1 ;
1556  for (index = 0; index < fgkNDetectors ; index++) {
1557  if ( strcmp(module, fgkDetectorName[index]) == 0 )
1558  break ;
1559  }
1560  if(index==fgkNDetectors) return -1;
1561  return fgNalignable[index];
1562 }
1563 
1564 //_____________________________________________________________________________
1566 {
1567  // Set number of declared alignable volumes for given detector in current geometry
1568  // by looping on the list of PNEntries
1569  //
1570 
1571  Int_t nAlE = gGeoManager->GetNAlignable(); // total number of alignable entries
1572  TGeoPNEntry *pne = 0;
1573  const char* detName;
1574 
1575  for (Int_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
1576  detName = fgkDetectorName[iDet];
1577  Int_t nAlDet = 0;
1578 
1579  for(Int_t iE = 0; iE < nAlE; iE++)
1580  {
1581  pne = gGeoManager->GetAlignableEntry(iE);
1582  TString pneName = pne->GetName();
1583  if(pneName.Contains(detName)) nAlDet++;
1584  if(!strcmp(detName,"GRP")) if(pneName.Contains("ABSO") || pneName.Contains("DIPO") ||
1585  pneName.Contains("FRAME") || pneName.Contains("PIPE") ||
1586  pneName.Contains("SHIL")) nAlDet++;
1587  }
1588  fgNalignable[iDet] = nAlDet;
1589  }
1590 
1591 }
1592 
1593 //_____________________________________________________________________________
1594 Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* alignDetsList)
1595 {
1596  // Calls AddAlignObjsFromCDBSingleDet for the detectors appearing in
1597  // the list passed as argument (called by AliSimulation and
1598  // AliReconstruction)
1599  // Read the alignment objects from CDB.
1600  // Each detector is supposed to have the
1601  // alignment objects in DET/Align/Data CDB path.
1602  // All the detector objects are then collected,
1603  // sorted by geometry level (starting from ALIC) and
1604  // then applied to the TGeo geometry.
1605  // Finally an overlaps check is performed.
1606  //
1607 
1608  // avoid alignment procedure if geometry already locked
1609  if(gGeoManager->IsLocked()){
1610  AliWarningClass("Not aligning geometry (again); Geometry is locked");
1611  return kFALSE;
1612  }
1613 
1614 
1615  TObjArray alignObjArray;
1616  alignObjArray.Clear();
1617  alignObjArray.SetOwner(0);
1618 
1619  TString alObjsNotLoaded="";
1620  TString alObjsLoaded="";
1621 
1622  TString alignDetsString(alignDetsList);
1623  TObjArray *detsarr = alignDetsString.Tokenize(' ');
1624  TIter iter(detsarr);
1625  TObjString *str = 0;
1626 
1627  while((str = (TObjString*) iter.Next())){
1628  TString det(str->String());
1629  AliDebugClass(5,Form("Loading alignment objs for %s",det.Data()));
1630  if(!LoadAlignObjsFromCDBSingleDet(det.Data(),alignObjArray)){
1631  alObjsNotLoaded += det.Data();
1632  alObjsNotLoaded += " ";
1633  } else {
1634  alObjsLoaded += det.Data();
1635  alObjsLoaded += " ";
1636  }
1637  }
1638  detsarr->Delete();
1639  delete detsarr;
1640 
1641  if(!alObjsLoaded.IsNull()) AliInfoClass(Form("Alignment objects loaded for: %s",
1642  alObjsLoaded.Data()));
1643  if(!alObjsNotLoaded.IsNull())
1644  AliFatalClass(Form("Could not load alignment objects from OCDB for: %s",
1645  alObjsNotLoaded.Data()));
1646 
1647  return ApplyAlignObjsToGeom(alignObjArray);
1648 }
1649 
1650 //_____________________________________________________________________________
1651 Bool_t AliGeomManager::LoadAlignObjsFromCDBSingleDet(const char* detName, TObjArray& alignObjArray)
1652 {
1653  // Adds the alignable objects found in the CDBEntry for the detector
1654  // passed as argument to the array of all alignment objects to be applyed
1655  // to geometry
1656  //
1657  // Fills array of single detector's alignable objects from CDB
1658 
1659  AliDebugClass(2, Form("Loading alignment objs for detector: %s",detName));
1660 
1661  AliCDBEntry *entry;
1662 
1663  AliCDBPath path(detName,"Align","Data");
1664 
1665  entry=AliCDBManager::Instance()->Get(path.GetPath());
1666  if(!entry){
1667  AliDebugClass(2,Form("Couldn't load alignment data for detector %s",detName));
1668  return kFALSE;
1669  }
1670  entry->SetOwner(1);
1671  TClonesArray *alignArray = (TClonesArray*) entry->GetObject();
1672  alignArray->SetOwner(0);
1673  Int_t nAlObjs = alignArray->GetEntries();
1674  AliDebugClass(2,Form("Found %d alignment objects for %s",nAlObjs,detName));
1675  Int_t nAlVols = GetNalignable(detName);
1676  if(nAlObjs!=nAlVols) AliWarningClass(Form("%d alignment objects loaded for %s, which has %d alignable volumes",nAlObjs,detName,GetNalignable(detName)));
1677 
1678  AliAlignObj *alignObj=0;
1679  TIter iter(alignArray);
1680 
1681  // loop over align objects in detector
1682  while( ( alignObj=(AliAlignObj *) iter.Next() ) ){
1683  alignObjArray.Add(alignObj);
1684  }
1685  // delete entry --- Don't delete, it is cached!
1686 
1687  AliDebugClass(2, Form("fAlignObjArray entries: %d",alignObjArray.GetEntries() ));
1688  return kTRUE;
1689 
1690 }
1691 
1692 //_____________________________________________________________________________
1693 Bool_t AliGeomManager::ApplyAlignObjsToGeom(TObjArray& alignObjArray, Bool_t ovlpcheck)
1694 {
1695  // Read collection of alignment objects (AliAlignObj derived) saved
1696  // in the TClonesArray alObjArray and apply them to gGeoManager
1697  //
1698  alignObjArray.Sort();
1699  Int_t nvols = alignObjArray.GetEntriesFast();
1700 
1701  Bool_t flag = kTRUE;
1702 
1703  for(Int_t j=0; j<nvols; j++)
1704  {
1705  AliAlignObj* alobj = (AliAlignObj*) alignObjArray.UncheckedAt(j);
1706  if(!alobj->ApplyToGeometry(ovlpcheck))
1707  {
1708  flag = kFALSE;
1709  AliDebugClass(5,Form("Error applying alignment object for volume %s !",alobj->GetSymName()));
1710  }else{
1711  AliDebugClass(5,Form("Alignment object for volume %s applied successfully",alobj->GetSymName()));
1712  }
1713 
1714  }
1715 
1716  if (AliDebugLevelClass() > 5) {
1717  fgGeometry->CheckOverlaps(0.001);
1718  TObjArray* ovexlist = fgGeometry->GetListOfOverlaps();
1719  if(ovexlist->GetEntriesFast()){
1720  AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
1721  fgGeometry->PrintOverlaps();
1722  }
1723  }
1724 
1725  // Update the TGeoPhysicalNodes
1726  fgGeometry->RefreshPhysicalNodes();
1727 
1728  return flag;
1729 
1730 }
1731 
1732 //_____________________________________________________________________________
1733 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* fileName, const char* clArrayName)
1734 {
1735  // read collection of alignment objects (AliAlignObj derived) saved
1736  // in the TClonesArray ClArrayName in the file fileName and apply
1737  // them to the geometry
1738  //
1739 
1740  TFile* inFile = TFile::Open(fileName,"READ");
1741  if (!inFile || !inFile->IsOpen()) {
1742  AliErrorClass(Form("Could not open file %s !",fileName));
1743  return kFALSE;
1744  }
1745 
1746  TClonesArray* alignObjArray = ((TClonesArray*) inFile->Get(clArrayName));
1747  inFile->Close();
1748  if (!alignObjArray) {
1749  AliErrorClass(Form("Could not get array (%s) from file (%s) !",clArrayName,fileName));
1750  return kFALSE;
1751  }
1752 
1753  return ApplyAlignObjsToGeom(*alignObjArray);
1754 
1755 }
1756 
1757 //_____________________________________________________________________________
1758 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion)
1759 {
1760  // read collection of alignment objects (AliAlignObj derived) saved
1761  // in the TClonesArray ClArrayName in the AliCDBEntry identified by
1762  // param (to get the AliCDBStorage) and Id; apply the alignment objects
1763  // to the geometry
1764  //
1765 
1767  AliCDBId id(path, runnum, runnum, version, sversion);
1768  AliCDBEntry* entry = storage->Get(id);
1769  TClonesArray* alignObjArray = dynamic_cast<TClonesArray*>(entry->GetObject());
1770 
1771  return ApplyAlignObjsToGeom(*alignObjArray);
1772 
1773 }
1774 
1775 //_____________________________________________________________________________
1776 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* detName, Int_t runnum, Int_t version, Int_t sversion)
1777 {
1778  // read collection of alignment objects (AliAlignObj derived) saved
1779  // in the TClonesArray ClArrayName in the AliCDBEntry identified by
1780  // param (to get the AliCDBStorage) and Id; apply the alignment objects
1781  // to the geometry
1782  //
1783 
1784  AliCDBPath path(detName,"Align","Data");
1785  AliCDBEntry* entry = AliCDBManager::Instance()->Get(path.GetPath(),runnum,version,sversion);
1786 
1787  if(!entry) return kFALSE;
1788  TClonesArray* alignObjArray = ((TClonesArray*) entry->GetObject());
1789 
1790  return ApplyAlignObjsToGeom(*alignObjArray);
1791 }
1792 
1793 //_____________________________________________________________________________
1795 {
1796  // cleans static arrays containing the information on currently loaded geometry
1797  //
1798  for (Int_t iLayer = 0; iLayer < (kLastLayer - kFirstLayer); iLayer++){
1799  if (!fgPNEntry[iLayer]) continue;
1800  for (Int_t modnum=0; modnum<fgLayerSize[iLayer]; modnum++) fgPNEntry[iLayer][modnum] = 0;
1801  }
1802  //
1803 }
1804 
static Bool_t GetFromGeometry(const char *symname, AliAlignObj &alobj)
AliCDBEntry * Get(const AliCDBId &query)
static void InitAlignObjFromGeometry()
static Bool_t GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m)
TFile * Open(const char *filename, Long64_t &nevents)
const TString & GetPath() const
Definition: AliCDBPath.h:38
static void CheckOverlapsOverPNs(Double_t threshold)
static const char * SymName(UShort_t voluid)
static Int_t fgLayerSize[kLastLayer-kFirstLayer]
static AliAlignObj * GetAlignObj(UShort_t voluid)
static void Destroy()
static const char * LayerName(Int_t layerId)
static AliAlignObj ** fgAlignObjs[kLastLayer-kFirstLayer]
#define TObjArray
AliTPCcalibAlign align
Definition: CalibAlign.C:43
static Int_t GetNalignable(const char *module)
const char * path
void SetSymName(const TString &symname)
Definition: AliAlignObj.h:54
static Bool_t ApplyAlignObjsFromCDB(const char *AlDetsList)
#define AliDebugLevelClass()
Definition: AliLog.h:251
static Bool_t GetOrigRotation(Int_t index, Double_t r[9])
Bool_t ApplyToGeometry(Bool_t ovlpcheck=kFALSE)
static TGeoManager * fgGeometry
static Int_t fgNalignable[fgkNDetectors]
static TGeoHMatrix * GetOrigGlobalMatrix(Int_t index)
static TGeoHMatrix * GetMatrix(Int_t index)
static Int_t LayerSize(Int_t layerId)
static void InitNalignable()
static ELayerID VolUIDToLayerSafe(UShort_t voluid, Int_t &modId)
#define AliFatalClass(message)
Definition: AliLog.h:645
#define AliInfoClass(message)
Definition: AliLog.h:489
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
static const Int_t fgkNDetectors
virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t phi)
static Bool_t LoadAlignObjsFromCDBSingleDet(const char *detName, TObjArray &alignObjArray)
AliCDBEntry * Get(const AliCDBId &query, Bool_t forceCaching=kFALSE)
bool trans(const AliFMDIndex &x, const AliFMDIndex &y, const AliFMDIndex &z)
Definition: TestIndex.C:94
static void InitPNEntriesLUT()
#define AliErrorClass(message)
Definition: AliLog.h:596
TObject * GetObject()
Definition: AliCDBEntry.h:56
#define AliDebugClass(logLevel, message)
Definition: AliLog.h:313
TString strSector
Definition: AnalyzeLaser.C:30
AliCDBStorage * GetStorage(const char *dbString)
static const TGeoHMatrix * GetTracking2LocalMatrix(Int_t index)
static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId)
TGeoManager * gGeoManager
#define AliWarningClass(message)
Definition: AliLog.h:546
static const char * fgkDetectorName[fgkNDetectors]
static void SetGeometry(TGeoManager *const geom)
virtual Bool_t SetMatrix(const TGeoMatrix &m)
static Bool_t GetDeltaForBranch(AliAlignObj &aao, TGeoHMatrix &inclusiveD)
static Bool_t GetRotation(Int_t index, Double_t r[9])
Definition: AliCDBEntry.h:18
static TGeoPNEntry * GetPNEntry(Int_t index)
static Bool_t GetTrackingMatrix(Int_t index, TGeoHMatrix &m)
static void ResetPNEntriesLUT()
static Bool_t CheckSymNamesLUT(const char *detsToBeChecked)
static Bool_t ApplyAlignObjsToGeom(TObjArray &alObjArray, Bool_t ovlpcheck=kFALSE)
static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId)
const char * GetSymName() const
Definition: AliAlignObj.h:63
UShort_t GetVolUID() const
Definition: AliAlignObj.h:64
static const char * fgLayerName[kLastLayer-kFirstLayer]
static TGeoPNEntry ** fgPNEntry[kLastLayer-kFirstLayer]
void SetOwner(Bool_t owner)
Definition: AliCDBEntry.h:64
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
TEveGeoShape * geom
Definition: tpc_tracks.C:10
static Bool_t GetTranslation(Int_t index, Double_t t[3])
static void LoadGeometry(const char *geomFileName=NULL)
static UShort_t LayerToVolUIDSafe(ELayerID layerId, Int_t modId)
static Bool_t GetOrigTranslation(Int_t index, Double_t t[3])