void PMDSurveyPointsGen_v1(){ // Macro to generate survey points in the format of AliSurveyObj // by giving some finite rotation and translation. if(!gGeoManager) AliGeomManager::LoadGeometry("geometry.root"); TClonesArray *array = new TClonesArray("AliAlignObjMatrix",10); TClonesArray &mobj = *array; Double_t l_vect[3]={0.,0.,0.}; // a local vector (the origin) Double_t g_vect_1[3]; // vector corresp. to it in global RS for sector-1 Double_t g_vect_2[3]; // vector corresp. to it in global RS for sector-2 Double_t g_vect_3[3]; // vector corresp. to it in global RS for sector-3 Double_t g_vect_4[3]; // vector corresp. to it in global RS for sector-4 //**************** get global matrix ******************* TGeoHMatrix *g3_1 = AliGeomManager::GetMatrix("PMD/Sector1"); TGeoNode* n3_1 = gGeoManager->GetCurrentNode(); TGeoHMatrix* l3_1 = n3_1->GetMatrix();// to get local matrix g3_1->LocalToMaster(l_vect,g_vect_1); // point coordinates in the global RS cout<GetCurrentNode(); TGeoHMatrix* l3_2 = n3_2->GetMatrix(); g3_2->LocalToMaster(l_vect,g_vect_2); cout<GetCurrentNode(); TGeoHMatrix* l3_3 = n3_3->GetMatrix(); g3_3->LocalToMaster(l_vect,g_vect_3); cout<GetCurrentNode(); TGeoHMatrix* l3_4 = n3_4->GetMatrix(); g3_4->LocalToMaster(l_vect,g_vect_4); cout< local x // | | | // | | | // | | | // | | | // | | | // | | | // A-------------|-------------B // // local z exiting the plane of the screen Double_t gA1[3], gB1[3], gC1[3], gD1[3]; g3_1->LocalToMaster(A1,gA1); g3_1->LocalToMaster(B1,gB1); g3_1->LocalToMaster(C1,gC1); g3_1->LocalToMaster(D1,gD1); /* cout<MakePhysicalNode("ALIC_1/EPM1_1"); Double_t dphi_1 = 0.; // tilt around Z Double_t dtheta_1 = 0.; // tilt around X Double_t dpsi_1 = 0.; // tilt around new Z Double_t dx_1 = 2.; // shift along X Double_t dy_1 = 3.; // shift along Y Double_t dz_1 = 4.; // shift along Z TGeoRotation* rrot_1 = new TGeoRotation("rot",dphi_1,dtheta_1,dpsi_1); TGeoCombiTrans localdelta_1 = *(new TGeoCombiTrans(dx_1,dy_1,dz_1, rrot_1)); // new local matrix, representing real position TGeoHMatrix nlocal_1 = *l3_1 * localdelta_1; TGeoHMatrix* nl3_1 = new TGeoHMatrix(nlocal_1); pn3_1->Align(nl3_1); // Let's get the global matrix for later comparison TGeoHMatrix* ng3_1 = pn3_1->GetMatrix(); //"real" global matrix,what survey sees printf("\n\n************ real global matrix for Sector-1 **************\n"); ng3_1->Print(); Double_t ngA1[3], ngB1[3], ngC1[3], ngD1[3]; ng3_1->LocalToMaster(A1,ngA1); ng3_1->LocalToMaster(B1,ngB1); ng3_1->LocalToMaster(C1,ngC1); ng3_1->LocalToMaster(D1,ngD1); cout<LocalToMaster(A2,gA2); g3_2->LocalToMaster(B2,gB2); g3_2->LocalToMaster(C2,gC2); g3_2->LocalToMaster(D2,gD2); /* cout<MakePhysicalNode("ALIC_1/EPM2_1"); Double_t dphi_2 = 0.; // tilt around Z Double_t dtheta_2 = 0.; // tilt around X Double_t dpsi_2 = 0.; // tilt around new Z Double_t dx_2 = 2.; // shift along X Double_t dy_2 = 3.; // shift along Y Double_t dz_2 = 4.; // shift along Z TGeoRotation* rrot_2 = new TGeoRotation("rot",dphi_2,dtheta_2,dpsi_2); TGeoCombiTrans localdelta_2 = *(new TGeoCombiTrans(dx_2,dy_2,dz_2, rrot_2)); // new local matrix, representing real position TGeoHMatrix nlocal_2 = *l3_2 * localdelta_2; TGeoHMatrix* nl3_2 = new TGeoHMatrix(nlocal_2); pn3_2->Align(nl3_2); // Let's get the global matrix for later comparison TGeoHMatrix* ng3_2 = pn3_2->GetMatrix(); //real global matrix printf("\n\n************ real global matrix for Sector-2 **************\n"); ng3_2->Print(); Double_t ngA2[3], ngB2[3], ngC2[3], ngD2[3]; ng3_2->LocalToMaster(A2,ngA2); ng3_2->LocalToMaster(B2,ngB2); ng3_2->LocalToMaster(C2,ngC2); ng3_2->LocalToMaster(D2,ngD2); cout<LocalToMaster(A3,gA3); g3_3->LocalToMaster(B3,gB3); g3_3->LocalToMaster(C3,gC3); g3_3->LocalToMaster(D3,gD3); /* cout<MakePhysicalNode("ALIC_1/EPM3_1"); Double_t dphi_3 = 0.; // tilt around Z Double_t dtheta_3 = 0.; // tilt around X Double_t dpsi_3 = 0.; // tilt around new Z Double_t dx_3 = 2.; // shift along X Double_t dy_3 = 3.; // shift along Y Double_t dz_3 = 4 ; // shift along Z TGeoRotation* rrot_3 = new TGeoRotation("rot",dphi_3,dtheta_3,dpsi_3); TGeoCombiTrans localdelta_3 = *(new TGeoCombiTrans(dx_3,dy_3,dz_3, rrot_3)); // new local matrix, representing real position TGeoHMatrix nlocal_3 = *l3_3 * localdelta_3; TGeoHMatrix* nl3_3 = new TGeoHMatrix(nlocal_3); pn3_3->Align(nl3_3); // Let's get the global matrix for later comparison TGeoHMatrix* ng3_3 = pn3_3->GetMatrix(); //"real" global matrix,what survey sees printf("\n\n************ real global matrix for Sector-3 **************\n"); ng3_3->Print(); Double_t ngA3[3], ngB3[3], ngC3[3], ngD3[3]; ng3_3->LocalToMaster(A3,ngA3); ng3_3->LocalToMaster(B3,ngB3); ng3_3->LocalToMaster(C3,ngC3); ng3_3->LocalToMaster(D3,ngD3); cout<LocalToMaster(A4,gA4); g3_4->LocalToMaster(B4,gB4); g3_4->LocalToMaster(C4,gC4); g3_4->LocalToMaster(D4,gD4); /* cout<MakePhysicalNode("ALIC_1/EPM4_1"); Double_t dphi_4 = 0.; // tilt around Z Double_t dtheta_4 = 0.; // tilt around X Double_t dpsi_4 = 0.; // tilt around new Z Double_t dx_4 = 2.; // shift along X Double_t dy_4 = 3.; // shift along Y Double_t dz_4 = 4.; // shift along Z TGeoRotation* rrot_4 = new TGeoRotation("rot",dphi_4,dtheta_4,dpsi_4); TGeoCombiTrans localdelta_4 = *(new TGeoCombiTrans(dx_4,dy_4,dz_4, rrot_4)); // new local matrix, representing real position TGeoHMatrix nlocal_4 = *l3_4 * localdelta_4; TGeoHMatrix* nl3_4 = new TGeoHMatrix(nlocal_4); pn3_4->Align(nl3_4); // Let's get the global matrix for later comparison TGeoHMatrix* ng3_4 = pn3_4->GetMatrix(); //"real" global matrix,what survey sees printf("\n\n************ real global matrix for Sector-4 **************\n"); ng3_4->Print(); Double_t ngA4[3], ngB4[3], ngC4[3], ngD4[3]; ng3_4->LocalToMaster(A4,ngA4); ng3_4->LocalToMaster(B4,ngB4); ng3_4->LocalToMaster(C4,ngC4); ng3_4->LocalToMaster(D4,ngD4); cout<= 40 && nline < 68) { ftr>>seqno>>xx>>yy>>zz>>PType>>TUsed>>precision; // cout<