X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=HMPID%2FAliHMPIDParam.cxx;h=c7a0c859a1e9a96bfad98bb7398ef903f05c4fde;hp=b8822a541811a065f6408ead39c33e7861bb96e0;hb=423554a3220dd16760360cd61193475fd4220c2d;hpb=a1d55ff3c823aa78b70d3b7eb31cde79d45527bc diff --git a/HMPID/AliHMPIDParam.cxx b/HMPID/AliHMPIDParam.cxx index b8822a54181..c7a0c859a1e 100644 --- a/HMPID/AliHMPIDParam.cxx +++ b/HMPID/AliHMPIDParam.cxx @@ -22,22 +22,36 @@ #include //Stack() #include //Stack() #include //Stack() +#include //ctor ClassImp(AliHMPIDParam) AliHMPIDParam* AliHMPIDParam::fgInstance=0x0; //singleton pointer //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -AliHMPIDParam::AliHMPIDParam():TNamed("RichParam","default version") +AliHMPIDParam::AliHMPIDParam():TNamed("HmpidParam","default version") { // Here all the intitializition is taken place when AliHMPIDParam::Instance() is invoked for the first time. // In particulare, matrices to be used for LORS<->MARS trasnformations are initialized from TGeo structure. // Note that TGeoManager should be already initialized from geometry.root file fX=0.5*AliHMPIDDigit::SizeAllX(); fY=0.5*AliHMPIDDigit::SizeAllY(); - for(Int_t i=0;i<7;i++) - if(gGeoManager) - fM[i]=(TGeoHMatrix*)gGeoManager->GetVolume("ALIC")->GetNode(Form("HMPID_%i",i))->GetMatrix(); - else{ + for(Int_t i=AliHMPIDDigit::kMinCh;i<=AliHMPIDDigit::kMaxCh;i++) + if(gGeoManager && gGeoManager->IsClosed()) { +// fM[i]=(TGeoHMatrix*)gGeoManager->GetVolume("ALIC")->GetNode(Form("HMPID_%i",i))->GetMatrix(); // previous style + TGeoPNEntry* pne = gGeoManager->GetAlignableEntry(Form("/HMPID/Chamber%i",i)); + if (!pne) { + AliErrorClass(Form("The symbolic volume %s does not correspond to any physical entry!",Form("HMPID_%i",i))); + fM[i]=new TGeoHMatrix; + IdealPosition(i,fM[i]); + } else { + TGeoPhysicalNode *pnode = pne->GetPhysicalNode(); + if(pnode) fM[i]=pnode->GetMatrix(); + else { + fM[i]=new TGeoHMatrix; + IdealPosition(i,fM[i]); + } + } + } else{ fM[i]=new TGeoHMatrix; IdealPosition(i,fM[i]); } @@ -56,12 +70,12 @@ void AliHMPIDParam::IdealPosition(Int_t iCh, TGeoHMatrix *pMatrix) // Construct ideal position matrix for a given chamber // Arguments: iCh- chamber ID; pMatrix- pointer to precreated unity matrix where to store the results // Returns: none - const Double_t kAngHor=19.5; // horizontal angle between chambers 19.5 grad - const Double_t kAngVer=20; // vertical angle between chambers 20 grad - const Double_t kAngCom=30; // common HMPID rotation with respect to x axis 30 grad - const Double_t trans[3]={490,0,0}; //center of the chamber is on window-gap surface - pMatrix->RotateY(90); //rotate around y since initial position is in XY plane -> now in YZ plane - pMatrix->SetTranslation(trans); //now plane in YZ is shifted along x + const Double_t kAngHor=19.5; // horizontal angle between chambers 19.5 grad + const Double_t kAngVer=20; // vertical angle between chambers 20 grad + const Double_t kAngCom=30; // common HMPID rotation with respect to x axis 30 grad + const Double_t kTrans[3]={490,0,0}; // center of the chamber is on window-gap surface + pMatrix->RotateY(90); // rotate around y since initial position is in XY plane -> now in YZ plane + pMatrix->SetTranslation(kTrans); // now plane in YZ is shifted along x switch(iCh){ case 0: pMatrix->RotateY(kAngHor); pMatrix->RotateZ(-kAngVer); break; //right and down case 1: pMatrix->RotateZ(-kAngVer); break; //down