// From it two derived concrete representation of alignment object class
// (AliAlignObjAngles, AliAlignObjMatrix) are derived in separate files.
//-----------------------------------------------------------------
+
+#include <TClass.h>
#include <TGeoManager.h>
#include <TGeoPhysicalNode.h>
#include <TMath.h>
+#include "TObjString.h"
#include "AliAlignObj.h"
#include "AliTrackPointArray.h"
path = pne->GetTitle();
node = gGeoManager->MakeAlignablePN(pne);
}else{
- AliWarning(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
+ AliDebug(1,Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
path=symname;
if (!gGeoManager->CheckPath(path)) {
- AliError(Form("Volume path %s not valid!",path));
+ AliDebug(1,Form("Volume path %s not valid!",path));
return kFALSE;
}
if (gGeoManager->GetListOfPhysicalNodes()->FindObject(path)) {
return alobj.SetMatrix(align);
}
+//_____________________________________________________________________________
+Bool_t AliAlignObj::GetOrigGlobalMatrix(const char *symname, TGeoHMatrix &m)
+{
+ // The method returns global matrix for the ideal detector geometry
+ // Symname identifies either the corresponding TGeoPNEntry or directly
+ // the volume path. The output global matrix is stored in 'm'.
+ // Returns kFALSE in case, TGeo has not been initialized or the symname
+ // is invalid.
+ //
+
+ if (!gGeoManager || !gGeoManager->IsClosed()) {
+ AliErrorClass("Can't get the original global matrix! gGeoManager doesn't exist or it is still opened!");
+ return kFALSE;
+ }
+
+ if (!gGeoManager->GetListOfPhysicalNodes()) {
+ AliWarningClass("gGeoManager doesn't contain any aligned nodes!");
+ if (!gGeoManager->cd(symname)) {
+ AliErrorClass(Form("Volume path %s not valid!",symname));
+ return kFALSE;
+ }
+ else {
+ m = *gGeoManager->GetCurrentMatrix();
+ return kTRUE;
+ }
+ }
+
+ const char* path = NULL;
+ TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(symname);
+ if(pne){
+ path = pne->GetTitle();
+ }else{
+ AliWarningClass(Form("The symbolic volume name %s does not correspond to a physical entry. Using it as a volume path!",symname));
+ path=symname;
+ }
+
+ if (!gGeoManager->CheckPath(path)) {
+ AliErrorClass(Form("Volume path %s not valid!",path));
+ return kFALSE;
+ }
+
+ m.Clear();
+
+ TIter next(gGeoManager->GetListOfPhysicalNodes());
+ gGeoManager->cd(path);
+
+ while(gGeoManager->GetLevel()){
+
+ TGeoPhysicalNode *physNode = NULL;
+ next.Reset();
+ TGeoNode *node = gGeoManager->GetCurrentNode();
+ while ((physNode=(TGeoPhysicalNode*)next()))
+ if (physNode->GetNode() == node) break;
+
+ TGeoMatrix *lm = NULL;
+ if (physNode) {
+ lm = physNode->GetOriginalMatrix();
+ if (!lm) lm = node->GetMatrix();
+ } else
+ lm = node->GetMatrix();
+
+ m.MultiplyLeft(lm);
+
+ gGeoManager->CdUp();
+ }
+
+ return kTRUE;
+}
+
//_____________________________________________________________________________
void AliAlignObj::InitAlignObjFromGeometry()
{
/********************* HMPID layer ***********************/
{
TString str = "/HMPID/Chamber";
- TString symname;
for (modnum=0; modnum < 7; modnum++) {
symname = str;