// Latest changes by Christian Holm Christensen
//
-#include <math.h>
-
+#include <math.h> // fmod
+#include <AliLog.h> // ALILOG_H
#include "AliFMDRing.h" // ALIFMDRING_H
-#include "AliLog.h" // ALILOG_H
-#include "TMath.h" // ROOT_TMath
-#include "TH2.h" // ROOT_TH2
-#include "TVirtualMC.h" // ROOT_TVirtualMC
-#include "TVector2.h" // ROOT_TVector2
-#include "TBrowser.h" // ROOT_TBrowser
-#include "TString.h" // ROOT_TString
-#include "TArc.h" // ROOT_TArc
-#include "TObjArray.h" // ROOT_TObjArray
-#include "TXTRU.h" // ROOT_TXTRU
-#include "TNode.h" // ROOT_TNode
-#include "TRotMatrix.h" // ROOT_TRotMatrix
-#include "TList.h" // ROOT_TList
-
-const Char_t* AliFMDRing::fgkRingFormat = "FRG%c";
-const Char_t* AliFMDRing::fgkVirtualFormat = "FV%c%c";
-const Char_t* AliFMDRing::fgkActiveFormat = "FAC%c";
-const Char_t* AliFMDRing::fgkSectorFormat = "FSE%c";
-const Char_t* AliFMDRing::fgkStripFormat = "FST%c";
-const Char_t* AliFMDRing::fgkPrintboardFormat = "FP%c%c";
+#include "AliFMD.h" // ALIFMD_H
+#include <TMath.h> // ROOT_TMath
+#include <TH2.h> // ROOT_TH2
+#include <TVirtualMC.h> // ROOT_TVirtualMC
+#include <TVector2.h> // ROOT_TVector2
+#include <TBrowser.h> // ROOT_TBrowser
+#include <TString.h> // ROOT_TString
+#include <TArc.h> // ROOT_TArc
+#include <TObjArray.h> // ROOT_TObjArray
+#include <TXTRU.h> // ROOT_TXTRU
+#include <TNode.h> // ROOT_TNode
+#include <TRotMatrix.h> // ROOT_TRotMatrix
+#include <TList.h> // ROOT_TList
+
+const Char_t* AliFMDRing::fgkRingFormat = "F%cRG";
+const Char_t* AliFMDRing::fgkVirtualFormat = "F%cV%c";
+const Char_t* AliFMDRing::fgkActiveFormat = "F%cAC";
+const Char_t* AliFMDRing::fgkSectorFormat = "F%cAP";
+const Char_t* AliFMDRing::fgkStripFormat = "F%cAR";
+const Char_t* AliFMDRing::fgkPrintboardFormat = "F%cP%c";
//____________________________________________________________________
-ClassImp(AliFMDRing);
+ClassImp(AliFMDRing)
//____________________________________________________________________
AliFMDRing::AliFMDRing(Char_t id, Bool_t detailed)
{
// Initialize the ring object.
// DebugGuard guard("AliFMDRing::Init");
- AliDebug(10, "AliFMDRing::Init");
+ AliDebug(30, Form("\tInitializing ring %c", fId));
fPolygon.Clear();
SetupCoordinates();
}
AliFMDRing::~AliFMDRing()
{
// Destructor - deletes shape and rotation matricies
+ AliDebug(30, Form("\tDestructing ring %c", fId));
if (fShape) delete fShape;
if (fRotMatricies) delete fRotMatricies;
}
AliFMDRing::Browse(TBrowser* /* b */)
{
// DebugGuard guard("AliFMDRing::Browse");
- AliDebug(10, "AliFMDRing::Browse");
+ AliDebug(30, Form("\tBrowsing ring %c", fId));
}
{
// Calculates the parameters of the polygon shape.
//
- // DebugGuard guard("AliFMDRing::SetupCoordinates");
- AliDebug(10, "AliFMDRing::SetupCoordinates");
+ //
+
// Get out immediately if we have already done all this
if (fPolygon.GetNVerticies() > 1) return;
+ AliDebug(10, Form("\tSetting up the coordinates for ring %c", fId));
double tanTheta = TMath::Tan(fTheta * TMath::Pi() / 180.);
double tanTheta2 = TMath::Power(tanTheta,2);
double xD = fLowR + TMath::Sqrt(r2 - tanTheta2 * lr2);
double xD2 = TMath::Power(xD,2);
//double xD_2 = fLowR - TMath::Sqrt(r2 - tanTheta2 * lr2);
- double yB = sqrt(r2 - hr2 + 2 * fHighR * xD - xD2);
+ double yB = TMath::Sqrt(r2 - hr2 + 2 * fHighR * xD - xD2);
double xC = ((xD + TMath::Sqrt(-tanTheta2 * xD2 + r2
+ r2 * tanTheta2))
/ (1 + tanTheta2));
// Checks if a point (x,y) is inside the module with number moduleNo
//
// DebugGuard guard("AliFMDRing::IsWithin");
- AliDebug(10, "AliFMDRing::IsWithin");
+ AliDebug(20, Form("\tChecking wether the hit at (%lf,%lf) in module %d "
+ "is within this ring (%c)", x, y, moduleNo, fId));
bool ret = false;
double r2 = x * x + y * y;
if (r2 < fHighR * fHighR && r2 > fLowR * fLowR) {
// hits in the detector.
//
// DebugGuard guard("AliFMDRing::Draw");
- AliDebug(10, "AliFMDRing::Draw");
+ AliDebug(20, Form("\tDrawing ring %c", fId));
// The unrotated coordinates of the polygon verticies
if (fPolygon.GetNVerticies() < 1) return;
// idRotId Identity rotation matrix
//
// DebugGuard guard("AliFMDRing::SetupGeometry");
- AliDebug(10, "AliFMDRing::SetupGeometry");
+ AliDebug(10, Form("\tSetting up the geometry for ring %c", fId));
const TVector2& bCorner = fPolygon.GetVertex(3); // Third corner
const TVector2& aCorner = fPolygon.GetVertex(5); // First corner
pars[1] = rmax;
pars[3] = -fTheta;
pars[4] = fTheta;
- name = Form(fgkVirtualFormat, 'F', fId);
+ name = Form(fgkVirtualFormat, fId, 'F');
fVirtualFrontId = gMC->Gsvolu(name.Data(), "TUBS", vacuumId, pars, 5);
// Virtual volume for modules with long legs
pars[2] = (fRingDepth - fModuleSpacing) / 2;
- name = Form(fgkVirtualFormat, 'B', fId);
+ name = Form(fgkVirtualFormat, fId, 'B');
fVirtualBackId = gMC->Gsvolu(name.Data(), "TUBS", vacuumId, pars, 5);
// Virtual mother volume for silicon
pars[1] = bCorner.Y() - pars[4];
pars[2] = fPrintboardThickness / 2; // PCB half thickness
pars[3] = (bCorner.X() - cCorner.X()) / 2;
- name = Form(fgkPrintboardFormat, 'T', fId);
+ name = Form(fgkPrintboardFormat, fId, 'T');
fPrintboardTopId = gMC->Gsvolu(name.Data(), "TRD1", pcbId, pars, 4);
// Bottom of the print board
pars[0] = aCorner.Y() - pars[4];
pars[1] = cCorner.Y() - pars[4];
pars[3] = (cCorner.X() - aCorner.X()) / 2;
- name = Form(fgkPrintboardFormat, 'B', fId);
+ name = Form(fgkPrintboardFormat, fId, 'B');
fPrintboardBottomId = gMC->Gsvolu(name.Data(), "TRD1", pcbId, pars, 4);
// Define rotation matricies
Double_t w = fRingDepth - (isFront ? 0 : fModuleSpacing);
// Place virtual module volume
- name = Form(fgkVirtualFormat, (isFront ? 'F' : 'B'), fId);
+ name = Form(fgkVirtualFormat, fId, (isFront ? 'F' : 'B'));
dz = (w - fRingDepth) / 2;
- gMC->Gspos(name.Data(), id, name2.Data(), 0., 0., dz,fRotations[i]);
+ gMC->Gspos(name.Data(), id, name2.Data(), 0., 0., dz,fRotations[i],
+ "ONLY");
// We only need to place the children once, they are copied when
// we place the other virtual volumes.
// the silicon is on the edge of the virtual volume.
name = Form(fgkActiveFormat, fId);
dz = (w - fSiThickness) / 2;
- gMC->Gspos(name.Data(), id, name2.Data(),0.,0.,dz,idRotId);
+ gMC->Gspos(name.Data(), id, name2.Data(),0.,0.,dz,idRotId, "ONLY");
// Place print board. This is put immediately behind the silicon
- name = Form(fgkPrintboardFormat, 'T', fId);
+ name = Form(fgkPrintboardFormat, fId, 'T');
dz = w / 2 - fSiThickness - fPrintboardThickness / 2;
gMC->Gspos(name.Data(), id, name2.Data(),
fLowR + pbBotL + pbTopL / 2, 0, dz, pbRotId, "ONLY");
- name = Form(fgkPrintboardFormat, 'B', fId);
+ name = Form(fgkPrintboardFormat, fId, 'B');
gMC->Gspos(name.Data(), id, name2.Data(),
fLowR + pbBotL / 2, 0, dz, pbRotId, "ONLY");
// This is put immediately behind the pringboard.
dz = (w / 2 - fSiThickness - fPrintboardThickness
- (fLegLength + (isFront ? fModuleSpacing : 0)) /2);
- name = (isFront ? "FLL" : "FSL");
+ name = (isFront ? AliFMD::fgkLongLegName : AliFMD::fgkShortLegName);
gMC->Gspos(name.Data(), id*10 + 1, name2.Data(),
- aCorner.X() + fLegOffset + fLegRadius, 0., dz, idRotId, "");
+ aCorner.X() + fLegOffset + fLegRadius, 0., dz, idRotId, "ONLY");
Double_t y = cCorner.Y() - yoffset - fLegOffset - fLegRadius;
- gMC->Gspos(name.Data(),id*10+2,name2.Data(),cCorner.X(), y,dz,idRotId,"");
- gMC->Gspos(name.Data(),id*10+3,name2.Data(),cCorner.X(), -y,dz,idRotId,"");
+ gMC->Gspos(name.Data(),id*10+2,name2.Data(),cCorner.X(),y,dz,
+ idRotId,"ONLY");
+ gMC->Gspos(name.Data(),id*10+3,name2.Data(),cCorner.X(),-y,dz,
+ idRotId,"ONLY");
}
}
//____________________________________________________________________
// idRotId Identity rotation matrix
//
// DebugGuard guard("AliFMDRing::Geometry");
- AliDebug(10, "AliFMDRing::Geometry");
TString name;
Double_t offsetZ = (fSiThickness
+ fPrintboardThickness
+ fLegLength + fModuleSpacing) / 2;
name = Form(fgkRingFormat, fId);
- gMC->Gspos(name.Data(), baseId, mother, 0., 0., z - offsetZ, idRotId, "");
+ AliDebug(10, Form("\tPlacing ring %s in %s at z=%lf-%lf=%lf (base ID: %d)",
+ name.Data(), mother, z, offsetZ, z-offsetZ, baseId));
+ gMC->Gspos(name.Data(), baseId, mother, 0., 0., z - offsetZ, idRotId,
+ "ONLY");
}
//____________________________________________________________________
// n Detector number
//
// DebugGuard guard("AliFMDRing::SimpleGeometry");
- AliDebug(10, "AliFMDRing::SimpleGeometry");
SetupCoordinates();
+ AliDebug(10, Form("\tCreating simple geometry for "
+ "ring %c at z=%lf cm in %s",
+ fId, z, mother->GetName()));
// If the shape hasn't been defined yet, we define it here.
if (!fShape) {
+
TString name(Form(fgkActiveFormat, fId));
TString title(Form("Shape of modules in %c Rings", fId));
Int_t n = fPolygon.GetNVerticies();
// Set drawing attributes for the RING
//
// DebugGuard guard("AliFMDRing::Gsatt");
- AliDebug(10, "AliFMDRing::Gsatt");
+ AliDebug(10, Form("\tSetting drawing attributes for Ring %c", fId));
TString name;
name = Form(fgkRingFormat,fId);
gMC->Gsatt(name.Data(), "SEEN", 0);
- name = Form(fgkVirtualFormat, 'T', fId);
+ name = Form(fgkVirtualFormat, fId, 'F');
gMC->Gsatt(name.Data(), "SEEN", 0);
- name = Form(fgkVirtualFormat, 'B', fId);
+ name = Form(fgkVirtualFormat, fId, 'B');
gMC->Gsatt(name.Data(), "SEEN", 0);
name = Form(fgkActiveFormat,fId);
gMC->Gsatt(name.Data(), "SEEN", 1);
- name = Form(fgkPrintboardFormat, 'T', fId);
+ name = Form(fgkSectorFormat,fId);
+ gMC->Gsatt(name.Data(), "SEEN", 0);
+
+ name = Form(fgkStripFormat,fId);
+ gMC->Gsatt(name.Data(), "SEEN", 0);
+
+ name = Form(fgkPrintboardFormat, fId, 'T');
gMC->Gsatt(name.Data(), "SEEN", 1);
- name = Form(fgkPrintboardFormat, 'B',fId);
+ name = Form(fgkPrintboardFormat, fId, 'B');
gMC->Gsatt(name.Data(), "SEEN", 1);
}