1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 //-------------------------------------------------------------------------
24 #include <TGeoManager.h>
25 #include <TObjString.h>
26 #include <TGeoPhysicalNode.h>
27 #include <TClonesArray.h>
28 #include <TGeoMatrix.h>
29 #include <TGeoPhysicalNode.h>
31 #include <TStopwatch.h>
32 #include <TGeoOverlap.h>
33 #include <TPluginManager.h>
36 #include "AliGeomManager.h"
38 #include "AliAlignObj.h"
39 #include "AliAlignObjParams.h"
40 #include "AliCDBManager.h"
41 #include "AliCDBStorage.h"
42 #include "AliCDBEntry.h"
44 ClassImp(AliGeomManager)
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
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",
67 "PHOS EMC layer","PHOS CPV layer",
73 TGeoPNEntry** AliGeomManager::fgPNEntry[kLastLayer - kFirstLayer] = {
87 AliAlignObj** AliGeomManager::fgAlignObjs[kLastLayer - kFirstLayer] = {
101 TGeoManager* AliGeomManager::fgGeometry = 0x0;
103 //_____________________________________________________________________________
104 void AliGeomManager::LoadGeometry(const char *geomFileName)
107 // Load geometry either from a file
108 // or from the corresponding CDB entry
111 if (geomFileName && (!gSystem->AccessPathName(geomFileName))) {
112 fgGeometry = TGeoManager::Import(geomFileName);
113 AliInfoClass(Form("From now on using geometry from custom geometry file %s",geomFileName));
117 AliCDBPath path("GRP","Geometry","Data");
119 AliCDBEntry *entry=AliCDBManager::Instance()->Get(path.GetPath());
120 if(!entry) AliFatalClass("Couldn't load geometry data from CDB!");
123 fgGeometry = (TGeoManager*) entry->GetObject();
124 if (!fgGeometry) AliFatalClass("Couldn't find TGeoManager in the specified CDB entry!");
126 AliInfoClass(Form("From now on using geometry from CDB base folder %s",
127 AliCDBManager::Instance()->GetURI("Geometry/Align/Data")));
133 //_____________________________________________________________________________
134 void AliGeomManager::SetGeometry(TGeoManager *geom)
136 // Load already active geometry
137 if (!geom) AliFatalClass("Pointer to the active geometry is 0x0!");
143 //_____________________________________________________________________________
144 AliGeomManager::AliGeomManager():
147 // default constructor
150 //_____________________________________________________________________________
151 AliGeomManager::~AliGeomManager()
156 //_____________________________________________________________________________
157 Int_t AliGeomManager::LayerSize(Int_t layerId)
159 // Get the layer size for layer corresponding to layerId.
160 // Implemented only for ITS,TPC,TRD,TOF and HMPID
162 if (layerId < kFirstLayer || layerId >= kLastLayer) {
163 AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
167 return fgLayerSize[layerId - kFirstLayer];
171 //_____________________________________________________________________________
172 const char* AliGeomManager::LayerName(Int_t layerId)
174 // Get the layer name corresponding to layerId.
175 // Implemented only for ITS,TPC,TRD,TOF and HMPID
177 if (layerId < kFirstLayer || layerId >= kLastLayer) {
178 AliErrorClass(Form("Invalid layer index %d ! Layer range is (%d -> %d) !",layerId,kFirstLayer,kLastLayer));
179 return "Invalid Layer!";
182 return fgLayerName[layerId - kFirstLayer];
186 //_____________________________________________________________________________
187 UShort_t AliGeomManager::LayerToVolUID(ELayerID layerId, Int_t modId)
189 // From detector (layer) name and module number (according to detector
190 // internal numbering) build the unique numerical identity of that volume
192 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
193 // remaining 11 for module ID inside det (2048 possible values).
194 // NO check for validity of given modId inside the layer for speed's sake.
196 return ((UShort_t(layerId) << 11) | UShort_t(modId));
199 //_____________________________________________________________________________
200 UShort_t AliGeomManager::LayerToVolUID(Int_t layerId, Int_t modId)
202 // From detector (layer) name and module number (according to detector
203 // internal numbering) build the unique numerical identity of that volume
205 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
206 // remaining 11 for module ID inside det (2048 possible values).
207 // NO check for validity of given modId inside the layer for speed's sake.
209 return ((UShort_t(layerId) << 11) | UShort_t(modId));
212 //_____________________________________________________________________________
213 UShort_t AliGeomManager::LayerToVolUIDSafe(ELayerID layerId, Int_t modId)
215 // From detector (layer) name and module number (according to detector
216 // internal numbering) build the unique numerical identity of that volume
218 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
219 // remaining 11 for module ID inside det (2048 possible values).
220 // Check validity of given modId inside the layer.
222 if(modId < 0 || modId >= LayerSize(layerId)){
223 AliErrorClass(Form("Invalid volume id %d ! Range of valid ids for layer \"%s\" is [0, %d] !",modId,LayerName(layerId),LayerSize(layerId)-1));
226 return ((UShort_t(layerId) << 11) | UShort_t(modId));
229 //_____________________________________________________________________________
230 UShort_t AliGeomManager::LayerToVolUIDSafe(Int_t layerId, Int_t modId)
232 // From detector (layer) name and module number (according to detector
233 // internal numbering) build the unique numerical identity of that volume
235 // fVolUID is 16 bits, first 5 reserved for layerID (32 possible values),
236 // remaining 11 for module ID inside det (2048 possible values).
237 // Check validity of given modId inside the layer.
239 if(modId < 0 || modId >= LayerSize(layerId)){
240 AliErrorClass(Form("Invalid volume id %d ! Range of valid ids for layer \"%s\" is [0, %d] !",modId,LayerName(layerId),LayerSize(layerId)-1));
243 return ((UShort_t(layerId) << 11) | UShort_t(modId));
246 //_____________________________________________________________________________
247 AliGeomManager::ELayerID AliGeomManager::VolUIDToLayer(UShort_t voluid, Int_t &modId)
249 // From voluid, unique numerical identity of that volume inside ALICE,
250 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
251 // remaining 11 for module ID inside det (2048 possible values)), return
252 // the identity of the layer to which that volume belongs and sets the
253 // argument modId to the identity of that volume internally to the layer.
254 // NO check for validity of given voluid for speed's sake.
256 modId = voluid & 0x7ff;
258 return VolUIDToLayer(voluid);
261 //_____________________________________________________________________________
262 AliGeomManager::ELayerID AliGeomManager::VolUIDToLayer(UShort_t voluid)
264 // From voluid, unique numerical identity of that volume inside ALICE,
265 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
266 // remaining 11 for module ID inside det (2048 possible values)), return
267 // the identity of the layer to which that volume belongs
268 // NO check for validity of given voluid for speed's sake.
270 return ELayerID(voluid >> 11);
273 //_____________________________________________________________________________
274 AliGeomManager::ELayerID AliGeomManager::VolUIDToLayerSafe(UShort_t voluid, Int_t &modId)
276 // From voluid, unique numerical identity of that volume inside ALICE,
277 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
278 // remaining 11 for module ID inside det (2048 possible values)), returns
279 // the identity of the layer to which that volume belongs and sets the
280 // argument modId to the identity of that volume internally to the layer.
281 // Checks the validity of the given voluid
283 ELayerID layId = VolUIDToLayerSafe(voluid);
285 Int_t mId = Int_t(voluid & 0x7ff);
286 if( mId>=0 && mId<LayerSize(layId)){
292 AliErrorClass(Form("Invalid unique volume id: %d !",voluid));
294 return kInvalidLayer;
298 //_____________________________________________________________________________
299 AliGeomManager::ELayerID AliGeomManager::VolUIDToLayerSafe(UShort_t voluid)
301 // From voluid, unique numerical identity of that volume inside ALICE,
302 // (voluid is 16 bits, first 5 reserved for layerID (32 possible values),
303 // remaining 11 for module ID inside det (2048 possible values)), returns
304 // the identity of the layer to which that volume belongs
305 // Checks the validity of the given voluid
307 if( (voluid >> 11) < kLastLayer) return ELayerID(voluid >> 11);
309 AliErrorClass(Form("Invalid layer id: %d !",(voluid >> 11)));
310 return kInvalidLayer;
314 //_____________________________________________________________________________
315 Bool_t AliGeomManager::GetFromGeometry(const char *symname, AliAlignObj &alobj)
317 // Get the alignment object which corresponds to the symbolic volume name
318 // symname (in case equal to the TGeo volume path)
319 // The method is extremely slow due to the searching by string,
320 // therefore it should be used with great care!!
321 // This method returns FALSE if the symname of the object was not
322 // valid neither to get a TGeoPEntry nor as a volume path, or if the path
323 // associated to the TGeoPNEntry was not valid.
326 // Reset the alignment object
327 alobj.SetPars(0,0,0,0,0,0);
328 alobj.SetSymName(symname);
330 if (!fgGeometry || !fgGeometry->IsClosed()) {
331 AliErrorClass("Can't get the alignment object! gGeoManager doesn't exist or it is still opened!");
335 if (!fgGeometry->GetListOfPhysicalNodes()) {
336 AliErrorClass("Can't get the alignment object! gGeoManager doesn't contain any aligned nodes!");
341 TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
343 path = pne->GetTitle();
345 AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
348 TObjArray* nodesArr = fgGeometry->GetListOfPhysicalNodes();
349 TGeoPhysicalNode* node = NULL;
350 for (Int_t iNode = 0; iNode < nodesArr->GetEntriesFast(); iNode++) {
351 TGeoPhysicalNode* tempNode = (TGeoPhysicalNode*) nodesArr->UncheckedAt(iNode);
352 const char *nodePath = tempNode->GetName();
353 if (strcmp(path,nodePath) == 0) {
360 if (!fgGeometry->cd(path)) {
361 AliErrorClass(Form("%s not valid neither as symbolic volume name nor as volume path!",path));
365 AliWarningClass(Form("Volume (%s) has not been misaligned!",path));
370 TGeoHMatrix align,gprime,g,ginv,l;
371 gprime = *node->GetMatrix();
372 l = *node->GetOriginalMatrix();
373 g = *node->GetMatrix(node->GetLevel()-1);
376 align = gprime * ginv;
378 return alobj.SetMatrix(align);
382 //_____________________________________________________________________________
383 void AliGeomManager::InitAlignObjFromGeometry()
385 // Loop over all alignable volumes and extract
386 // the corresponding alignment objects from
389 if(fgAlignObjs[0]) return;
391 for (Int_t iLayer = kFirstLayer; iLayer < AliGeomManager::kLastLayer; iLayer++) {
392 fgAlignObjs[iLayer-kFirstLayer] = new AliAlignObj*[LayerSize(iLayer)];
393 for (Int_t iModule = 0; iModule < LayerSize(iLayer); iModule++) {
394 UShort_t volid = LayerToVolUID(iLayer,iModule);
395 fgAlignObjs[iLayer-kFirstLayer][iModule] = new AliAlignObjParams("",volid,0,0,0,0,0,0,kTRUE);
396 const char *symname = SymName(volid);
397 if (!GetFromGeometry(symname, *fgAlignObjs[iLayer-kFirstLayer][iModule]))
398 AliErrorClass(Form("Failed to extract the alignment object for the volume (ID=%d and path=%s) !",volid,symname));
404 //_____________________________________________________________________________
405 AliAlignObj* AliGeomManager::GetAlignObj(UShort_t voluid)
407 // Returns the alignment object for given volume ID
410 ELayerID layerId = VolUIDToLayer(voluid,modId);
411 return GetAlignObj(layerId,modId);
414 //_____________________________________________________________________________
415 AliAlignObj* AliGeomManager::GetAlignObj(ELayerID layerId, Int_t modId)
417 // Returns pointer to alignment object given its layer and module ID
419 if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
420 AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
423 InitAlignObjFromGeometry();
425 return fgAlignObjs[layerId-kFirstLayer][modId];
428 //_____________________________________________________________________________
429 const char* AliGeomManager::SymName(UShort_t voluid)
431 // Returns the symbolic volume name for given volume ID
434 ELayerID layerId = VolUIDToLayer(voluid,modId);
435 return SymName(layerId,modId);
438 //_____________________________________________________________________________
439 const char* AliGeomManager::SymName(ELayerID layerId, Int_t modId)
441 // Returns the symbolic volume name given for a given layer
444 if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
445 AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
449 return fgPNEntry[layerId-kFirstLayer][modId]->GetName();
452 //_____________________________________________________________________________
453 Bool_t AliGeomManager::CheckSymNamesLUT()
455 // Check the look-up table which associates the unique numerical identity of
456 // each alignable volume to the corresponding symbolic volume name.
457 // The LUT is now hold inside the geometry and handled by TGeo.
458 // The method is meant to be launched when loading a geometry to verify that
459 // no changes in the symbolic names have been introduced, which would prevent
460 // backward compatibility with alignment objects.
461 // To accept both complete and partial geometry, this method skips the check
462 // for TRD and TOF volumes which are missing in the partial geometry.
467 TGeoPNEntry* pne = 0x0;
468 Int_t uid; // global unique identity
469 Int_t modnum; // unique id inside layer; in the following, set it to 0 at the start of each layer
471 /********************* ITS layers ***********************/
472 TString strSPD = "ITS/SPD";
473 TString strSDD = "ITS/SDD";
474 TString strSSD = "ITS/SSD";
475 TString strStave = "/Stave";
476 TString strHalfStave = "/HalfStave";
477 TString strLadder = "/Ladder";
478 TString strSector = "/Sector";
479 TString strSensor = "/Sensor";
480 TString strEntryName1;
481 TString strEntryName2;
482 TString strEntryName3;
484 /********************* SPD layer1 ***********************/
488 for(Int_t cSect = 0; cSect<10; cSect++){
489 strEntryName1 = strSPD;
491 strEntryName1 += strSector;
492 strEntryName1 += cSect;
494 for(Int_t cStave =0; cStave<2; cStave++){
495 strEntryName2 = strEntryName1;
496 strEntryName2 += strStave;
497 strEntryName2 += cStave;
499 for (Int_t cHS=0; cHS<2; cHS++) {
500 strEntryName3 = strEntryName2;
501 strEntryName3 += strHalfStave;
502 strEntryName3 += cHS;
504 for(Int_t cLad =0; cLad<2; cLad++){
505 symname = strEntryName3;
506 symname += strLadder;
507 symname += cLad+cHS*2;
508 uid = LayerToVolUID(kSPD1,modnum++);
509 pne = fgGeometry->GetAlignableEntryByUID(uid);
512 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
515 sname = pne->GetName();
516 if(symname.CompareTo(sname))
518 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d."
519 "Expected was %s, found was %s!", uid, symname.Data(), sname));
528 /********************* SPD layer2 ***********************/
532 for(Int_t cSect = 0; cSect<10; cSect++){
533 strEntryName1 = strSPD;
535 strEntryName1 += strSector;
536 strEntryName1 += cSect;
538 for(Int_t cStave =0; cStave<4; cStave++){
539 strEntryName2 = strEntryName1;
540 strEntryName2 += strStave;
541 strEntryName2 += cStave;
543 for (Int_t cHS=0; cHS<2; cHS++) {
544 strEntryName3 = strEntryName2;
545 strEntryName3 += strHalfStave;
546 strEntryName3 += cHS;
548 for(Int_t cLad =0; cLad<2; cLad++){
549 symname = strEntryName3;
550 symname += strLadder;
551 symname += cLad+cHS*2;
552 uid = LayerToVolUID(kSPD2,modnum++);
553 pne = fgGeometry->GetAlignableEntryByUID(uid);
556 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
559 sname = pne->GetName();
560 if(symname.CompareTo(sname))
562 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d."
563 "Expected was %s, found was %s!", uid, symname.Data(), sname));
572 /********************* SDD layer1 ***********************/
576 for(Int_t c1 = 1; c1<=14; c1++){
577 strEntryName1 = strSDD;
579 strEntryName1 +=strLadder;
580 strEntryName1 += (c1-1);
581 for(Int_t c2 =1; c2<=6; c2++){
582 symname = strEntryName1;
583 symname += strSensor;
585 uid = LayerToVolUID(kSDD1,modnum++);
586 pne = fgGeometry->GetAlignableEntryByUID(uid);
589 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
592 sname = pne->GetName();
593 if(symname.CompareTo(sname))
595 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
596 "Expected was %s, found was %s!", uid, symname.Data(), sname));
603 /********************* SDD layer2 ***********************/
607 for(Int_t c1 = 1; c1<=22; c1++){
608 strEntryName1 = strSDD;
610 strEntryName1 +=strLadder;
611 strEntryName1 += (c1-1);
612 for(Int_t c2 = 1; c2<=8; c2++){
613 symname = strEntryName1;
614 symname += strSensor;
616 uid = LayerToVolUID(kSDD2,modnum++);
617 pne = fgGeometry->GetAlignableEntryByUID(uid);
620 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
623 sname = pne->GetName();
624 if(symname.CompareTo(sname))
626 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
627 "Expected was %s, found was %s!", uid, symname.Data(), sname));
634 /********************* SSD layer1 ***********************/
638 for(Int_t c1 = 1; c1<=34; c1++){
639 strEntryName1 = strSSD;
641 strEntryName1 +=strLadder;
642 strEntryName1 += (c1-1);
643 for(Int_t c2 = 1; c2<=22; c2++){
644 symname = strEntryName1;
645 symname += strSensor;
647 uid = LayerToVolUID(kSSD1,modnum++);
648 pne = fgGeometry->GetAlignableEntryByUID(uid);
651 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
654 sname = pne->GetName();
655 if(symname.CompareTo(sname))
657 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
658 "Expected was %s, found was %s!", uid, symname.Data(), sname));
665 /********************* SSD layer2 ***********************/
669 for(Int_t c1 = 1; c1<=38; c1++){
670 strEntryName1 = strSSD;
672 strEntryName1 +=strLadder;
673 strEntryName1 += (c1-1);
674 for(Int_t c2 = 1; c2<=25; c2++){
675 symname = strEntryName1;
676 symname += strSensor;
678 uid = LayerToVolUID(kSSD2,modnum++);
679 pne = fgGeometry->GetAlignableEntryByUID(uid);
682 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
685 sname = pne->GetName();
686 if(symname.CompareTo(sname))
688 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
689 "Expected was %s, found was %s!", uid, symname.Data(), sname));
697 /*************** TPC inner and outer layers ****************/
698 TString sAsector="TPC/EndcapA/Sector";
699 TString sCsector="TPC/EndcapC/Sector";
700 TString sInner="/InnerChamber";
701 TString sOuter="/OuterChamber";
703 /*************** TPC inner chambers' layer ****************/
707 for(Int_t cnt=1; cnt<=18; cnt++){
711 uid = LayerToVolUID(kTPC1,modnum++);
712 pne = fgGeometry->GetAlignableEntryByUID(uid);
715 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
718 sname = pne->GetName();
719 if(symname.CompareTo(sname))
721 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
722 "Expected was %s, found was %s!", uid, symname.Data(), sname));
726 for(Int_t cnt=1; cnt<=18; cnt++){
730 uid = LayerToVolUID(kTPC1,modnum++);
731 pne = fgGeometry->GetAlignableEntryByUID(uid);
734 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
737 sname = pne->GetName();
738 if(symname.CompareTo(sname))
740 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
741 "Expected was %s, found was %s!", uid, symname.Data(), sname));
747 /*************** TPC outer chambers' layer ****************/
751 for(Int_t cnt=1; cnt<=18; cnt++){
755 uid = LayerToVolUID(kTPC2,modnum++);
756 pne = fgGeometry->GetAlignableEntryByUID(uid);
759 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
762 sname = pne->GetName();
763 if(symname.CompareTo(sname))
765 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
766 "Expected was %s, found was %s!", uid, symname.Data(), sname));
770 for(Int_t cnt=1; cnt<=18; cnt++){
774 uid = LayerToVolUID(kTPC2,modnum++);
775 pne = fgGeometry->GetAlignableEntryByUID(uid);
778 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
781 sname = pne->GetName();
782 if(symname.CompareTo(sname))
784 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
785 "Expected was %s, found was %s!", uid, symname.Data(), sname));
791 /********************* TOF layer ***********************/
799 Int_t nStrips=nstrA+2*nstrB+2*nstrC;
801 Int_t activeSectors[18]={0,0,1,1,1,0,1,1,0,0,0,-1,-1,0,1,1,1,1};// as in config-file for partial geometry
803 TString snSM = "TOF/sm";
804 TString snSTRIP = "/strip";
806 for (Int_t isect = 0; isect < nSectors; isect++) {
807 for (Int_t istr = 1; istr <= nStrips; istr++) {
809 symname += Form("%02d",isect);
811 symname += Form("%02d",istr);
812 uid = LayerToVolUID(kTOF,modnum++);
813 if(!activeSectors[isect]) continue; // taking possible missing TOF sectors (partial geometry) into account
814 if ((isect==13 || isect==14 || isect==15) && (istr >= 39 && istr <= 53)) continue; //taking holes into account
815 pne = fgGeometry->GetAlignableEntryByUID(uid);
818 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
821 sname = pne->GetName();
822 if(symname.CompareTo(sname))
824 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
825 "Expected was %s, found was %s!", uid, symname.Data(), sname));
832 /********************* HMPID layer ***********************/
834 TString str = "/HMPID/Chamber";
836 for (modnum=0; modnum < 7; modnum++) {
839 uid = LayerToVolUID(kHMPID,modnum);
840 pne = fgGeometry->GetAlignableEntryByUID(uid);
843 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
846 sname = pne->GetName();
847 if(symname.CompareTo(sname))
849 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
850 "Expected was %s, found was %s!", uid, symname.Data(), sname));
856 /********************* TRD layers 1-6 *******************/
857 //!! 6 layers with index increasing in outwards direction
859 Int_t arTRDlayId[6] = {kTRD1, kTRD2, kTRD3, kTRD4, kTRD5, kTRD6};
861 Int_t activeSectors[18]={0,0,1,1,1,0,1,0,0,0,0,1,1,0,1,1,0,0};// as in config-file for partial geometry
863 TString snStr = "TRD/sm";
864 TString snApp1 = "/st";
865 TString snApp2 = "/pl";
867 for(Int_t layer=0; layer<6; layer++){
869 for (Int_t isect = 0; isect < 18; isect++) {
870 for (Int_t icham = 0; icham < 5; icham++) {
872 symname += Form("%02d",isect);
877 uid = LayerToVolUID(arTRDlayId[layer],modnum++);
878 if(!activeSectors[isect]) continue;
879 if ((isect==13 || isect==14 || isect==15) && icham==2) continue; //keeping holes into account
880 pne = fgGeometry->GetAlignableEntryByUID(uid);
883 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
886 sname = pne->GetName();
887 if(symname.CompareTo(sname))
889 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
890 "Expected was %s, found was %s!", uid, symname.Data(), sname));
898 /********************* PHOS EMC layer ***********************/
900 TString str = "PHOS/Module";
903 for (Int_t iModule=1; iModule <= 5; iModule++) {
907 uid = LayerToVolUID(kPHOS1,modnum);
908 pne = fgGeometry->GetAlignableEntryByUID(uid);
911 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
914 sname = pne->GetName();
915 if(symname.CompareTo(sname))
917 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
918 "Expected was %s, found was %s!", uid, symname.Data(), sname));
924 /********************* PHOS CPV layer ***********************/
926 TString str = "PHOS/Module";
929 for (Int_t iModule=1; iModule <= 5; iModule++) {
934 uid = LayerToVolUID(kPHOS2,modnum);
935 pne = fgGeometry->GetAlignableEntryByUID(uid);
938 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
941 sname = pne->GetName();
942 if(symname.CompareTo(sname))
944 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
945 "Expected was %s, found was %s!", uid, symname.Data(), sname));
951 /********************* EMCAL layer ***********************/
953 TString str = "EMCAL/FullSupermodule";
956 for (Int_t iModule=1; iModule <= 12; iModule++) {
960 symname = "EMCAL/HalfSupermodule";
961 symname += iModule-10;
964 uid = LayerToVolUID(kEMCAL,modnum);
965 pne = fgGeometry->GetAlignableEntryByUID(uid);
968 AliErrorClass(Form("In the currently loaded geometry there is no TGeoPNEntry with unique id %d",uid));
971 sname = pne->GetName();
972 if(symname.CompareTo(sname))
974 AliErrorClass(Form("Current loaded geometry differs in the definition of symbolic name for uid %d"
975 "Expected was %s, found was %s!", uid, symname.Data(), sname));
985 //_____________________________________________________________________________
986 void AliGeomManager::InitPNEntriesLUT()
988 // Initialize the look-up table which associates the unique
989 // numerical identity of each alignable volume to the
990 // corresponding TGeoPNEntry.
991 // The LUTs are static; they are created at the creation of the
992 // AliGeomManager instance and recreated if the geometry has changed
994 if (fgPNEntry[0]) return;
997 AliErrorClass("Impossible to initialize PNEntries LUT without an active geometry");
1001 for (Int_t iLayer = 0; iLayer < (kLastLayer - kFirstLayer); iLayer++){
1002 fgPNEntry[iLayer] = new TGeoPNEntry*[fgLayerSize[iLayer]];
1003 for(Int_t modnum=0; modnum<fgLayerSize[iLayer]; modnum++){
1004 fgPNEntry[iLayer][modnum] = fgGeometry->GetAlignableEntryByUID(LayerToVolUID(iLayer+1,modnum));
1009 //______________________________________________________________________
1010 TGeoHMatrix* AliGeomManager::GetMatrix(TGeoPNEntry* pne)
1012 // Get the global transformation matrix for a given PNEntry
1013 // by quering the TGeoManager
1015 if (!fgGeometry || !fgGeometry->IsClosed()) {
1016 AliErrorClass("Can't get the global matrix! gGeoManager doesn't exist or it is still opened!");
1020 TGeoPhysicalNode *pnode = pne->GetPhysicalNode();
1021 if (pnode) return pnode->GetMatrix();
1023 const char* path = pne->GetTitle();
1024 if (!fgGeometry->cd(path)) {
1025 AliErrorClass(Form("Volume path %s not valid!",path));
1028 return fgGeometry->GetCurrentMatrix();
1031 //______________________________________________________________________
1032 TGeoHMatrix* AliGeomManager::GetMatrix(Int_t index)
1034 // Get the global transformation matrix for a given alignable volume
1035 // identified by its unique ID 'index' by quering the TGeoManager
1037 TGeoPNEntry *pne = GetPNEntry(index);
1038 if (!pne) return NULL;
1040 return GetMatrix(pne);
1043 //______________________________________________________________________
1044 TGeoHMatrix* AliGeomManager::GetMatrix(const char* symname)
1046 // Get the global transformation matrix for a given alignable volume
1047 // identified by its symbolic name 'symname' by quering the TGeoManager
1049 if (!fgGeometry || !fgGeometry->IsClosed()) {
1050 AliErrorClass("No active geometry or geometry not yet closed!");
1054 TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
1055 if (!pne) return NULL;
1057 return GetMatrix(pne);
1060 //______________________________________________________________________
1061 Bool_t AliGeomManager::GetTranslation(Int_t index, Double_t t[3])
1063 // Get the translation vector for a given module 'index'
1064 // by quering the TGeoManager
1066 TGeoHMatrix *m = GetMatrix(index);
1067 if (!m) return kFALSE;
1069 Double_t *trans = m->GetTranslation();
1070 for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
1075 //______________________________________________________________________
1076 Bool_t AliGeomManager::GetRotation(Int_t index, Double_t r[9])
1078 // Get the rotation matrix for a given module 'index'
1079 // by quering the TGeoManager
1081 TGeoHMatrix *m = GetMatrix(index);
1082 if (!m) return kFALSE;
1084 Double_t *rot = m->GetRotationMatrix();
1085 for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
1090 //_____________________________________________________________________________
1091 Bool_t AliGeomManager::GetDeltaForBranch(Int_t index, TGeoHMatrix &inclusiveD)
1093 // The method sets the matrix passed as argument as the global delta
1094 // (for the volume referred by the unique index) including the displacements
1095 // of all parent volumes in the branch.
1098 TGeoHMatrix go,invgo;
1099 go = *GetOrigGlobalMatrix(index);
1100 invgo = go.Inverse();
1101 inclusiveD = *GetMatrix(index);
1102 inclusiveD.Multiply(&invgo);
1107 //_____________________________________________________________________________
1108 Bool_t AliGeomManager::GetDeltaForBranch(AliAlignObj& aao, TGeoHMatrix &inclusiveD)
1110 // The method sets the matrix passed as argument as the global delta
1111 // (for the volume referred by the alignment object) including the displacements
1112 // of all parent volumes in the brach.
1114 Int_t index = aao.GetVolUID();
1116 AliErrorClass("Either the alignment object or its index are not valid");
1119 return GetDeltaForBranch(index, inclusiveD);
1122 //______________________________________________________________________
1123 Bool_t AliGeomManager::GetOrigGlobalMatrix(const char* symname, TGeoHMatrix &m)
1125 // Get the global transformation matrix (ideal geometry) for a given alignable volume
1126 // The alignable volume is identified by 'symname' which has to be either a valid symbolic
1127 // name, the query being performed after alignment, or a valid volume path if the query is
1128 // performed before alignment.
1132 if (!fgGeometry || !fgGeometry->IsClosed()) {
1133 AliErrorClass("No active geometry or geometry not yet closed!");
1136 if (!fgGeometry->GetListOfPhysicalNodes()) {
1137 AliWarningClass("gGeoManager doesn't contain any aligned nodes!");
1138 if (!fgGeometry->cd(symname)) {
1139 AliErrorClass(Form("Volume path %s not valid!",symname));
1143 m = *fgGeometry->GetCurrentMatrix();
1148 TGeoPNEntry* pne = fgGeometry->GetAlignableEntry(symname);
1149 const char* path = NULL;
1151 m = *pne->GetGlobalOrig();
1154 AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
1158 return GetOrigGlobalMatrixFromPath(path,m);
1161 //_____________________________________________________________________________
1162 Bool_t AliGeomManager::GetOrigGlobalMatrixFromPath(const char *path, TGeoHMatrix &m)
1164 // The method returns the global matrix for the volume identified by
1165 // 'path' in the ideal detector geometry.
1166 // The output global matrix is stored in 'm'.
1167 // Returns kFALSE in case TGeo has not been initialized or the volume
1168 // path is not valid.
1172 if (!fgGeometry || !fgGeometry->IsClosed()) {
1173 AliErrorClass("Can't get the original global matrix! gGeoManager doesn't exist or it is still opened!");
1177 if (!fgGeometry->CheckPath(path)) {
1178 AliErrorClass(Form("Volume path %s not valid!",path));
1182 TIter next(fgGeometry->GetListOfPhysicalNodes());
1183 fgGeometry->cd(path);
1185 while(fgGeometry->GetLevel()){
1187 TGeoPhysicalNode *physNode = NULL;
1189 TGeoNode *node = fgGeometry->GetCurrentNode();
1190 while ((physNode=(TGeoPhysicalNode*)next()))
1191 if (physNode->GetNode() == node) break;
1193 TGeoMatrix *lm = NULL;
1195 lm = physNode->GetOriginalMatrix();
1196 if (!lm) lm = node->GetMatrix();
1198 lm = node->GetMatrix();
1208 //_____________________________________________________________________________
1209 TGeoHMatrix* AliGeomManager::GetOrigGlobalMatrix(TGeoPNEntry* pne)
1211 // The method returns global matrix for the ideal detector geometry
1212 // using the corresponding TGeoPNEntry as an input.
1213 // The returned pointer should be copied by the user, since its content could
1214 // be overwritten by a following call to the method.
1215 // In case of missing TGeoManager the method returns NULL.
1217 if (!fgGeometry || !fgGeometry->IsClosed()) {
1218 AliErrorClass("Can't get the global matrix! gGeoManager doesn't exist or it is still opened!");
1222 return pne->GetGlobalOrig();
1225 //______________________________________________________________________
1226 TGeoHMatrix* AliGeomManager::GetOrigGlobalMatrix(Int_t index)
1228 // The method returns global matrix from the ideal detector geometry
1229 // for the volume identified by its index.
1230 // The returned pointer should be copied by the user, since its content could
1231 // be overwritten by a following call to the method.
1232 // In case of missing TGeoManager the method returns NULL.
1233 // If possible, the method uses the LUT of original ideal matrices
1234 // for fast access. The LUT is reset in case a
1235 // new geometry is loaded.
1237 TGeoPNEntry* pne = GetPNEntry(index);
1238 return pne->GetGlobalOrig();
1241 //______________________________________________________________________
1242 Bool_t AliGeomManager::GetOrigTranslation(Int_t index, Double_t t[3])
1244 // Get the original translation vector (ideal geometry)
1245 // for a given module 'index' by quering the TGeoManager
1247 TGeoHMatrix *m = GetOrigGlobalMatrix(index);
1248 if (!m) return kFALSE;
1250 Double_t *trans = m->GetTranslation();
1251 for (Int_t i = 0; i < 3; i++) t[i] = trans[i];
1256 //______________________________________________________________________
1257 Bool_t AliGeomManager::GetOrigRotation(Int_t index, Double_t r[9])
1259 // Get the original rotation matrix (ideal geometry)
1260 // for a given module 'index' by quering the TGeoManager
1262 TGeoHMatrix *m = GetOrigGlobalMatrix(index);
1263 if (!m) return kFALSE;
1265 Double_t *rot = m->GetRotationMatrix();
1266 for (Int_t i = 0; i < 9; i++) r[i] = rot[i];
1271 //______________________________________________________________________
1272 const TGeoHMatrix* AliGeomManager::GetTracking2LocalMatrix(Int_t index)
1274 // Get the matrix which transforms from the tracking to the local RS
1275 // The method queries directly the TGeoPNEntry
1277 TGeoPNEntry *pne = GetPNEntry(index);
1278 if (!pne) return NULL;
1280 const TGeoHMatrix *m = pne->GetMatrix();
1282 AliErrorClass(Form("TGeoPNEntry (%s) contains no tracking-to-local matrix !",pne->GetName()));
1287 //______________________________________________________________________
1288 Bool_t AliGeomManager::GetTrackingMatrix(Int_t index, TGeoHMatrix &m)
1290 // Get the matrix which transforms from the tracking r.s. to
1292 // Returns kFALSE in case of error.
1296 TGeoHMatrix *m1 = GetMatrix(index);
1297 if (!m1) return kFALSE;
1299 const TGeoHMatrix *m2 = GetTracking2LocalMatrix(index);
1300 if (!m2) return kFALSE;
1308 //_____________________________________________________________________________
1309 TGeoPNEntry* AliGeomManager::GetPNEntry(Int_t voluid) {
1310 // Returns the TGeoPNEntry for the given global volume ID "voluid"
1313 ELayerID layerId = VolUIDToLayer(voluid,modId);
1314 return GetPNEntry(layerId,modId);
1317 //_____________________________________________________________________________
1318 TGeoPNEntry* AliGeomManager::GetPNEntry(ELayerID layerId, Int_t modId)
1320 // Returns the TGeoPNEntry for a given layer
1324 if(modId<0 || modId>=fgLayerSize[layerId-kFirstLayer]){
1325 AliWarningClass(Form("Module number %d not in the valid range (0->%d) !",modId,fgLayerSize[layerId-kFirstLayer]-1));
1329 return fgPNEntry[layerId-kFirstLayer][modId];
1332 //_____________________________________________________________________________
1333 void AliGeomManager::CheckOverlapsOverPNs(Double_t threshold)
1335 // Check for overlaps/extrusions on physical nodes only;
1336 // this overlap-checker is meant to be used to check overlaps/extrusions
1337 // originated by the application of alignment objects.
1340 TObjArray* ovexlist = new TObjArray(64);
1342 AliInfoClass("********* Checking overlaps/extrusions over physical nodes only *********");
1343 TObjArray* pnList = gGeoManager->GetListOfPhysicalNodes();
1344 TGeoVolume* mvol = 0;
1345 TGeoPhysicalNode* pn;
1346 TObjArray* overlaps = new TObjArray(64);
1347 overlaps->SetOwner();
1351 for(Int_t pni=0; pni<pnList->GetEntriesFast(); pni++){
1352 pn = (TGeoPhysicalNode*) pnList->UncheckedAt(pni);
1353 // checking the volume of the mother (go upper in the tree in case it is an assembly)
1355 while(((TGeoVolume*)pn->GetVolume(pn->GetLevel()-levup))->IsAssembly()) levup++;
1356 //Printf("Going to upper level");
1357 mvol = pn->GetVolume(pn->GetLevel()-levup);
1358 if(!mvol->IsSelected()){
1359 AliInfoClass(Form("Checking overlaps for volume %s",mvol->GetName()));
1360 mvol->CheckOverlaps(threshold);
1361 ovexlist = gGeoManager->GetListOfOverlaps();
1362 TIter next(ovexlist);
1364 while ((ov=(TGeoOverlap*)next())) overlaps->Add(ov->Clone());
1365 mvol->SelectVolume();
1368 mvol->SelectVolume(kTRUE); // clears the list of selected volumes
1370 AliInfoClass(Form("Number of overlapping/extruding PNs: %d",overlaps->GetEntriesFast()));
1374 TIter nextN(overlaps);
1376 while ((ovlp=(TGeoOverlap*)nextN())) ovlp->PrintInfo();
1382 //_____________________________________________________________________________
1383 Bool_t AliGeomManager::ApplyAlignObjsFromCDB(const char* AlignDetsList)
1385 // Calls AddAlignObjsFromCDBSingleDet for the detectors appearing in
1386 // the list passed as argument (called by AliSimulation and
1387 // AliReconstruction)
1388 // Read the alignment objects from CDB.
1389 // Each detector is supposed to have the
1390 // alignment objects in DET/Align/Data CDB path.
1391 // All the detector objects are then collected,
1392 // sorted by geometry level (starting from ALIC) and
1393 // then applied to the TGeo geometry.
1394 // Finally an overlaps check is performed.
1397 TObjArray alignObjArray;
1398 alignObjArray.Clear();
1399 alignObjArray.SetOwner(0);
1401 TString alObjsNotLoaded="";
1402 TString alObjsLoaded="";
1404 TString AlignDetsString(AlignDetsList);
1405 TObjArray *detsarr = AlignDetsString.Tokenize(' ');
1406 TIter iter(detsarr);
1407 TObjString *str = 0;
1409 while((str = (TObjString*) iter.Next())){
1410 TString det(str->String());
1411 AliInfoClass(Form("Loading alignment objs for %s",det.Data()));
1412 if(!LoadAlignObjsFromCDBSingleDet(det.Data(),alignObjArray)){
1413 alObjsNotLoaded += det.Data();
1414 alObjsNotLoaded += " ";
1416 alObjsLoaded += det.Data();
1417 alObjsLoaded += " ";
1423 if(!alObjsLoaded.IsNull()) AliInfoClass(Form("Alignment objects loaded for: %s",
1424 alObjsLoaded.Data()));
1425 if(!alObjsNotLoaded.IsNull()) AliInfoClass(Form("Didn't/couldn't load alignment objects for: %s",
1426 alObjsNotLoaded.Data()));
1428 return ApplyAlignObjsToGeom(alignObjArray);
1431 //_____________________________________________________________________________
1432 Bool_t AliGeomManager::LoadAlignObjsFromCDBSingleDet(const char* detName, TObjArray& alignObjArray)
1434 // Adds the alignable objects found in the CDBEntry for the detector
1435 // passed as argument to the array of all alignment objects to be applyed
1438 // Fills array of single detector's alignable objects from CDB
1440 AliDebugClass(2, Form("Loading alignment objs for detector: %s",detName));
1444 AliCDBPath path(detName,"Align","Data");
1446 entry=AliCDBManager::Instance()->Get(path.GetPath());
1448 AliDebugClass(2,Form("Couldn't load alignment data for detector %s",detName));
1452 TClonesArray *alignArray = (TClonesArray*) entry->GetObject();
1453 alignArray->SetOwner(0);
1454 AliDebugClass(2,Form("Found %d alignment objects for %s",
1455 alignArray->GetEntries(),detName));
1457 AliAlignObj *alignObj=0;
1458 TIter iter(alignArray);
1460 // loop over align objects in detector
1461 while( ( alignObj=(AliAlignObj *) iter.Next() ) ){
1462 alignObjArray.Add(alignObj);
1464 // delete entry --- Don't delete, it is cached!
1466 AliDebugClass(2, Form("fAlignObjArray entries: %d",alignObjArray.GetEntries() ));
1471 //_____________________________________________________________________________
1472 Bool_t AliGeomManager::ApplyAlignObjsToGeom(TObjArray& alignObjArray, Bool_t ovlpcheck)
1474 // Read collection of alignment objects (AliAlignObj derived) saved
1475 // in the TClonesArray alObjArray and apply them to gGeoManager
1477 alignObjArray.Sort();
1478 Int_t nvols = alignObjArray.GetEntriesFast();
1480 Bool_t flag = kTRUE;
1482 for(Int_t j=0; j<nvols; j++)
1484 AliAlignObj* alobj = (AliAlignObj*) alignObjArray.UncheckedAt(j);
1485 if (alobj->ApplyToGeometry(ovlpcheck) == kFALSE) flag = kFALSE;
1488 if (AliDebugLevelClass() >= 1) {
1489 fgGeometry->GetTopNode()->CheckOverlaps(1);
1490 TObjArray* ovexlist = fgGeometry->GetListOfOverlaps();
1491 if(ovexlist->GetEntriesFast()){
1492 AliErrorClass("The application of alignment objects to the geometry caused huge overlaps/extrusions!");
1496 // Update the TGeoPhysicalNodes
1497 fgGeometry->RefreshPhysicalNodes();
1503 //_____________________________________________________________________________
1504 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* fileName, const char* clArrayName)
1506 // read collection of alignment objects (AliAlignObj derived) saved
1507 // in the TClonesArray ClArrayName in the file fileName and apply
1508 // them to the geometry
1511 TFile* inFile = TFile::Open(fileName,"READ");
1512 if (!inFile || !inFile->IsOpen()) {
1513 AliErrorClass(Form("Could not open file %s !",fileName));
1517 TClonesArray* alignObjArray = ((TClonesArray*) inFile->Get(clArrayName));
1519 if (!alignObjArray) {
1520 AliErrorClass(Form("Could not get array (%s) from file (%s) !",clArrayName,fileName));
1524 return ApplyAlignObjsToGeom(*alignObjArray);
1528 //_____________________________________________________________________________
1529 Bool_t AliGeomManager::ApplyAlignObjsToGeom(AliCDBParam* param, AliCDBId& Id)
1531 // read collection of alignment objects (AliAlignObj derived) saved
1532 // in the TClonesArray ClArrayName in the AliCDBEntry identified by
1533 // param (to get the AliCDBStorage) and Id; apply the alignment objects
1537 AliCDBStorage* storage = AliCDBManager::Instance()->GetStorage(param);
1538 AliCDBEntry* entry = storage->Get(Id);
1539 TClonesArray* alignObjArray = ((TClonesArray*) entry->GetObject());
1541 return ApplyAlignObjsToGeom(*alignObjArray);
1545 //_____________________________________________________________________________
1546 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* uri, const char* path, Int_t runnum, Int_t version, Int_t sversion)
1548 // read collection of alignment objects (AliAlignObj derived) saved
1549 // in the TClonesArray ClArrayName in the AliCDBEntry identified by
1550 // param (to get the AliCDBStorage) and Id; apply the alignment objects
1554 AliCDBParam* param = AliCDBManager::Instance()->CreateParameter(uri);
1555 AliCDBId id(path, runnum, runnum, version, sversion);
1557 return ApplyAlignObjsToGeom(param, id);
1561 //_____________________________________________________________________________
1562 Bool_t AliGeomManager::ApplyAlignObjsToGeom(const char* detName, Int_t runnum, Int_t version, Int_t sversion)
1564 // read collection of alignment objects (AliAlignObj derived) saved
1565 // in the TClonesArray ClArrayName in the AliCDBEntry identified by
1566 // param (to get the AliCDBStorage) and Id; apply the alignment objects
1570 AliCDBPath path(detName,"Align","Data");
1571 AliCDBEntry* entry = AliCDBManager::Instance()->Get(path.GetPath(),runnum,version,sversion);
1573 if(!entry) return kFALSE;
1574 TClonesArray* alignObjArray = ((TClonesArray*) entry->GetObject());
1576 return ApplyAlignObjsToGeom(*alignObjArray);