/*
$Log$
+Revision 1.22 2007/10/07 19:40:46 decaro
+right handling of l2t matrices and alignable entries in case of TOF staging geometry
+
+Revision 1.21 2007/10/04 13:15:30 arcelli
+updates to comply with AliTOFGeometryV5 becoming AliTOFGeometry
+
+Revision 1.20 2007/10/03 18:07:22 arcelli
+right handling of l2t matrices and alignable entries in case of TOF holes (Annalisa)
+
Revision 1.19 2007/10/03 10:41:12 arcelli
adding tracking-to-local matrices for new AliTOFcluster
// //
///////////////////////////////////////////////////////////////////////////////
+#include "TDirectory.h"
#include "TBRIK.h"
#include "TGeometry.h"
#include "TLorentzVector.h"
#include <TGeoVolume.h>
#include "AliConst.h"
+#include "AliGeomManager.h"
#include "AliLog.h"
#include "AliMagF.h"
#include "AliMC.h"
#include "AliTrackReference.h"
#include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
#include "AliTOFv5T0.h"
extern TDirectory *gDirectory;
fIdFTOC(-1),
fIdFLTA(-1),
fIdFLTB(-1),
- fIdFLTC(-1),
- fTOFHoles(kFALSE)
+ fIdFLTC(-1)//,
+ //fTOFHoles(kFALSE)
{
//
// Default constructor
fIdFTOC(-1),
fIdFLTA(-1),
fIdFLTB(-1),
- fIdFLTC(-1),
- fTOFHoles(kFALSE)
+ fIdFLTC(-1)//,
+ //fTOFHoles(kFALSE)
{
//
// Standard constructor
// Check that FRAME is there otherwise we have no place where to
// put TOF
-
+ /*
AliModule* frame = (AliModule*)gAlice->GetModule("FRAME");
if(!frame) {
AliFatal("TOF needs FRAME to be present");
} else{
if (fTOFGeometry) delete fTOFGeometry;
- fTOFGeometry = new AliTOFGeometryV5();
+ fTOFGeometry = new AliTOFGeometry();
if(frame->IsVersion()==1) {
AliDebug(1,Form("Frame version %d", frame->IsVersion()));
fTOFHoles=true;}
}
fTOFGeometry->SetHoles(fTOFHoles);
+ */
+
+ if (fTOFGeometry) delete fTOFGeometry;
+ fTOFGeometry = new AliTOFGeometry();
+ fTOFGeometry->SetHoles(fTOFHoles);
//AliTOF::fTOFGeometry = fTOFGeometry;
// eventual changes in the geometry.
//
+ AliGeomManager::ELayerID idTOF = AliGeomManager::kTOF;
+ Int_t modUID, modnum=0;
+
TString volPath;
TString symName;
for (Int_t isect = 0; isect < nSectors; isect++) {
for (Int_t istr = 1; istr <= nStrips; istr++) {
- if (fTOFHoles && (isect==11 || isect==12)) {
+ modUID = AliGeomManager::LayerToVolUID(idTOF,modnum++);
+ if (fTOFSectors[isect]==-1) continue;
+
+ if (fTOFHoles && (isect==13 || isect==14 || isect==15)) {
if (istr<39) {
vpL3 = "/FTOB_0";
vpL4 = "/FLTB_0/FSTR_";
AliDebug(2,Form("symName=%s\n",symName.Data()));
AliDebug(2,"--------------------------------------------");
- gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+ if(!gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data(),modUID))
+ AliError(Form("Alignable entry %s not set",symName.Data()));
//T2L matrices for alignment
- TGeoPNEntry *e = gGeoManager->GetAlignableEntry(symName.Data());
+ TGeoPNEntry *e = gGeoManager->GetAlignableEntryByUID(modUID);
if (e) {
- const char *path = e->GetTitle();
- if (!gGeoManager->cd(path)) {
- AliFatal(Form("Volume path %s not valid!",path));
- }
- TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+ TGeoHMatrix *globMatrix = e->GetGlobalOrig();
Double_t phi = 20.0 * (isect % 18) + 10.0;
TGeoHMatrix *t2l = new TGeoHMatrix();
t2l->RotateZ(phi);
symName = snSM;
symName += Form("%02d",isect);
- AliDebug(2,"--------------------------------------------");
- AliDebug(2,Form("Alignable object %d", isect+imod));
- AliDebug(2,Form("volPath=%s\n",volPath.Data()));
- AliDebug(2,Form("symName=%s\n",symName.Data()));
- AliDebug(2,"--------------------------------------------");
-
+ AliDebug(2,"--------------------------------------------");
+ AliDebug(2,Form("Alignable object %d", isect+imod));
+ AliDebug(2,Form("volPath=%s\n",volPath.Data()));
+ AliDebug(2,Form("symName=%s\n",symName.Data()));
+ AliDebug(2,"--------------------------------------------");
+
gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
}
if(fTOFSectors[isec]==-1)continue;
char name[16];
sprintf(name, "BTOF%d",isec);
- if (fTOFHoles && (isec==11||isec==12)) {
+ if (fTOFHoles && (isec==13 || isec==14 || isec==15)) {
// if (fTOFHoles && (isec==16||isec==17)) { \\Old 6h convention
xcoor = 0.;
ycoor = (zlenA*0.5 + kInterCentrModBorder1)*0.5;