/*
$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
+
+Revision 1.18 2007/07/27 08:14:48 morsch
+Write all track references into the same branch.
+
+Revision 1.17 2007/05/14 14:41:13 decaro
+Fix a bug in FTOA volume positionig inside BTOF13,14,15,16,17 in case of holes in 11th and 12th sectors
+
+Revision 1.16 2007/05/04 12:59:26 arcelli
+Change the TOF SM paths for misalignment (one layer up)
+
+Revision 1.15 2007/02/19 15:41:55 decaro
+Coding convention: few corrections
+
Revision 1.14 2006/10/17 15:33:14 arcelli
Moving some printout from Info to Debug level
#include "TNode.h"
#include "TVirtualMC.h"
#include "TGeoManager.h"
+#include <TGeoMatrix.h>
+#include <TGeoPhysicalNode.h>
+#include <TGeoVolume.h>
#include "AliConst.h"
#include "AliLog.h"
#include "AliMagF.h"
#include "AliMC.h"
#include "AliRun.h"
+#include "AliTrackReference.h"
#include "AliTOFGeometry.h"
-#include "AliTOFGeometryV5.h"
#include "AliTOFv5T0.h"
extern TDirectory *gDirectory;
} else{
if (fTOFGeometry) delete fTOFGeometry;
- fTOFGeometry = new AliTOFGeometryV5();
+ fTOFGeometry = new AliTOFGeometry();
if(frame->IsVersion()==1) {
AliDebug(1,Form("Frame version %d", frame->IsVersion()));
for (Int_t isect = 0; isect < nSectors; isect++) {
for (Int_t istr = 1; istr <= nStrips; istr++) {
-
+
+ //if (fTOFSectors[isect]==-1) continue;
+
+ if (fTOFHoles && (isect==13 || isect==14 || isect==15)) {
+ if (istr<39) {
+ vpL3 = "/FTOB_0";
+ vpL4 = "/FLTB_0/FSTR_";
+ }
+ else if (istr>53) {
+ vpL3 = "/FTOC_0";
+ vpL4 = "/FLTC_0/FSTR_";
+ }
+ else continue;
+ }
+ else {
+ vpL3 = "/FTOA_0";
+ vpL4 = "/FLTA_0/FSTR_";
+ }
+
volPath = vpL0;
volPath += isect;
volPath += vpL1;
AliDebug(2,"--------------------------------------------");
gGeoManager->SetAlignableEntry(symName.Data(),volPath.Data());
+
+ //T2L matrices for alignment
+ TGeoPNEntry *e = gGeoManager->GetAlignableEntry(symName.Data());
+ if (e) {
+ const char *path = e->GetTitle();
+ if (!gGeoManager->cd(path)) {
+ AliFatal(Form("Volume path %s not valid!",path));
+ }
+ TGeoHMatrix *globMatrix = gGeoManager->GetCurrentMatrix();
+ Double_t phi = 20.0 * (isect % 18) + 10.0;
+ TGeoHMatrix *t2l = new TGeoHMatrix();
+ t2l->RotateZ(phi);
+ t2l->MultiplyLeft(&(globMatrix->Inverse()));
+ e->SetMatrix(t2l);
+ }
+ else {
+ AliError(Form("Alignable entry %s is not valid!",symName.Data()));
+ }
imod++;
}
}
volPath += vpL1;
volPath += isect;
volPath += vpL2;
- volPath += vpL3;
symName = snSM;
symName += Form("%02d",isect);
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;
gMC->Gspos("FTOB", 0, name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
gMC->Gspos("FTOC", 0, name, xcoor,-ycoor, zcoor, idrotm[0], "ONLY");
}
- else gMC->Gspos("FTOA", 0,name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
+ else {
+ xcoor = 0.;
+ ycoor = 0.;
+ zcoor = 0.;
+ gMC->Gspos("FTOA", 0,name, xcoor, ycoor, zcoor, idrotm[0], "ONLY");
+ }
+
}
// Large not sensitive volumes with Insensitive Freon (FLTA, FLTB and FLTC)
AliMC *mcApplication = (AliMC*)gAlice->GetMCApp();
- AddTrackReference(mcApplication->GetCurrentTrackNumber());
+ AddTrackReference(mcApplication->GetCurrentTrackNumber(), AliTrackReference::kTOF);
//AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
// getting information about hit volumes