X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=ITS%2FAliITSv11Geometry.cxx;h=be7d4fefb5106a5d8ac49a8a5349c16e44193b8f;hp=71516baef14d4923c266098c09ee91cdd053257d;hb=bdef344f5f7f141690b8987bf50766ab8ae5f877;hpb=166d14ba9486c9333c3c32d684dbb3cdd2ab00d4 diff --git a/ITS/AliITSv11Geometry.cxx b/ITS/AliITSv11Geometry.cxx index 71516baef14..be7d4fefb51 100644 --- a/ITS/AliITSv11Geometry.cxx +++ b/ITS/AliITSv11Geometry.cxx @@ -31,19 +31,112 @@ #include #include +#include +#include +#include +#include +#include #include #include #include // contaings TGeoTubeSeg #include +#include +#include #include #include +#include +#include #include "AliITSv11Geometry.h" +using std::endl; +using std::cout; +using std::cin; ClassImp(AliITSv11Geometry) + +const Double_t AliITSv11Geometry::fgkmicron = 1.0E-4; +const Double_t AliITSv11Geometry::fgkmm = 0.10; +const Double_t AliITSv11Geometry::fgkcm = 1.00; +const Double_t AliITSv11Geometry::fgkDegree = 1.0; +const Double_t AliITSv11Geometry::fgkRadian = 180./3.14159265358979323846; +const Double_t AliITSv11Geometry::fgkgcm3 = 1.0; // assume default is g/cm^3 +const Double_t AliITSv11Geometry::fgkKgm3 = 1.0E+3;// assume Kg/m^3 +const Double_t AliITSv11Geometry::fgkKgdm3 = 1.0; // assume Kg/dm^3 +const Double_t AliITSv11Geometry::fgkCelsius = 1.0; // Assume default is C +const Double_t AliITSv11Geometry::fgkPascal = 1.0E-3; // Assume kPascal +const Double_t AliITSv11Geometry::fgkKPascal = 1.0; // Asume kPascal +const Double_t AliITSv11Geometry::fgkeV = 1.0E-9; // GeV default +const Double_t AliITSv11Geometry::fgkKeV = 1.0e-6; // GeV default +const Double_t AliITSv11Geometry::fgkMeV = 1.0e-3; // GeV default +const Double_t AliITSv11Geometry::fgkGeV = 1.0; // GeV default +//______________________________________________________________________ +void AliITSv11Geometry::IntersectLines(Double_t m, Double_t x0, Double_t y0, + Double_t n, Double_t x1, Double_t y1, + Double_t &xi, Double_t &yi)const{ + // Given the two lines, one passing by (x0,y0) with slope m and + // the other passing by (x1,y1) with slope n, returns the coordinates + // of the intersecting point (xi,yi) + // Inputs: + // Double_t m The slope of the first line + // Double_t x0,y0 The x and y coord. of the first point + // Double_t n The slope of the second line + // Double_t x1,y1 The x and y coord. of the second point + // Outputs: + // The coordinates xi and yi of the intersection point + // Return: + // none. + // Created: 14 Dec 2009 Mario Sitta + + if (TMath::Abs(m-n) < 0.000001) { + AliError(Form("Lines are parallel: m = %f n = %f\n",m,n)); + return; + } + + xi = (y1 - n*x1 - y0 + m*x0)/(m - n); + yi = y0 + m*(xi - x0); + + return; +} +//______________________________________________________________________ +Bool_t AliITSv11Geometry::IntersectCircle(Double_t m, Double_t x0, Double_t y0, + Double_t rr, Double_t xc, Double_t yc, + Double_t &xi1, Double_t &yi1, + Double_t &xi2, Double_t &yi2){ + // Given a lines passing by (x0,y0) with slope m and a circle with + // radius rr and center (xc,yc), returns the coordinates of the + // intersecting points (xi1,yi1) and (xi2,yi2) (xi1 > xi2) + // Inputs: + // Double_t m The slope of the line + // Double_t x0,y0 The x and y coord. of the point + // Double_t rr The radius of the circle + // Double_t xc,yc The x and y coord. of the center of circle + // Outputs: + // The coordinates xi and yi of the intersection points + // Return: + // kFALSE if the line does not intercept the circle, otherwise kTRUE + // Created: 18 Dec 2009 Mario Sitta + + Double_t p = m*x0 - y0; + Double_t q = m*m + 1; + + p = p-m*xc+yc; + + Double_t delta = m*m*p*p - q*(p*p - rr*rr); + + if (delta < 0) + return kFALSE; + else { + Double_t root = TMath::Sqrt(delta); + xi1 = (m*p + root)/q + xc; + xi2 = (m*p - root)/q + xc; + yi1 = m*(xi1 - x0) + y0; + yi2 = m*(xi2 - x0) + y0; + return kTRUE; + } +} //______________________________________________________________________ Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0, Double_t x1,Double_t y1, - Double_t x){ + Double_t x)const{ // Given the two points (x0,y0) and (x1,y1) and the location x, returns // the value y corresponding to that point x on the line defined by the // two points. @@ -75,7 +168,7 @@ Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0, //______________________________________________________________________ Double_t AliITSv11Geometry::Xfrom2Points(Double_t x0,Double_t y0, Double_t x1,Double_t y1, - Double_t y){ + Double_t y)const{ // Given the two points (x0,y0) and (x1,y1) and the location y, returns // the value x corresponding to that point y on the line defined by the // two points. @@ -106,7 +199,7 @@ Double_t AliITSv11Geometry::Xfrom2Points(Double_t x0,Double_t y0, } //______________________________________________________________________ Double_t AliITSv11Geometry::RmaxFrom2Points(const TGeoPcon *p,Int_t i1, - Int_t i2,Double_t z){ + Int_t i2,Double_t z)const{ // functions Require at parts of Volume A to be already defined. // Retruns the value of Rmax corresponding to point z alone the line // defined by the two points p.Rmax(i1),p-GetZ(i1) and p->GetRmax(i2), @@ -130,7 +223,7 @@ Double_t AliITSv11Geometry::RmaxFrom2Points(const TGeoPcon *p,Int_t i1, } //______________________________________________________________________ Double_t AliITSv11Geometry::RminFrom2Points(const TGeoPcon *p,Int_t i1, - Int_t i2,Double_t z){ + Int_t i2,Double_t z)const{ // Retruns the value of Rmin corresponding to point z alone the line // defined by the two points p->GetRmin(i1),p->GetZ(i1) and // p->GetRmin(i2), p->GetZ(i2). @@ -149,7 +242,7 @@ Double_t AliITSv11Geometry::RminFrom2Points(const TGeoPcon *p,Int_t i1, } //______________________________________________________________________ Double_t AliITSv11Geometry::RFrom2Points(const Double_t *p,const Double_t *az, - Int_t i1,Int_t i2,Double_t z){ + Int_t i1,Int_t i2,Double_t z)const{ // Retruns the value of Rmin corresponding to point z alone the line // defined by the two points p->GetRmin(i1),p->GetZ(i1) and // p->GetRmin(i2), p->GetZ(i2). @@ -168,7 +261,7 @@ Double_t AliITSv11Geometry::RFrom2Points(const Double_t *p,const Double_t *az, } //______________________________________________________________________ Double_t AliITSv11Geometry::Zfrom2MinPoints(const TGeoPcon *p,Int_t i1, - Int_t i2,Double_t r){ + Int_t i2,Double_t r)const{ // Retruns the value of Z corresponding to point R alone the line // defined by the two points p->GetRmin(i1),p->GetZ(i1) and // p->GetRmin(i2),p->GetZ(i2) @@ -188,7 +281,7 @@ Double_t AliITSv11Geometry::Zfrom2MinPoints(const TGeoPcon *p,Int_t i1, } //______________________________________________________________________ Double_t AliITSv11Geometry::Zfrom2MaxPoints(const TGeoPcon *p,Int_t i1, - Int_t i2,Double_t r){ + Int_t i2,Double_t r)const{ // Retruns the value of Z corresponding to point R alone the line // defined by the two points p->GetRmax(i1),p->GetZ(i1) and // p->GetRmax(i2),p->GetZ(i2) @@ -208,7 +301,7 @@ Double_t AliITSv11Geometry::Zfrom2MaxPoints(const TGeoPcon *p,Int_t i1, } //______________________________________________________________________ Double_t AliITSv11Geometry::Zfrom2Points(const Double_t *z,const Double_t *ar, - Int_t i1,Int_t i2,Double_t r){ + Int_t i1,Int_t i2,Double_t r)const{ // Retruns the value of z corresponding to point R alone the line // defined by the two points p->GetRmax(i1),p->GetZ(i1) and // p->GetRmax(i2),p->GetZ(i2) @@ -228,7 +321,7 @@ Double_t AliITSv11Geometry::Zfrom2Points(const Double_t *z,const Double_t *ar, //______________________________________________________________________ Double_t AliITSv11Geometry::RmaxFromZpCone(const TGeoPcon *p,int ip, Double_t tc,Double_t z, - Double_t th){ + Double_t th)const{ // General Outer Cone surface equation Rmax. // Intputs: // TGeoPcon *p The poly cone where the initial point comes from @@ -242,8 +335,8 @@ Double_t AliITSv11Geometry::RmaxFromZpCone(const TGeoPcon *p,int ip, // Return: // The value Rmax correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmin[ip] at the location z. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return -tantc*(z-p->GetZ(ip))+p->GetRmax(ip)+th/costc; } @@ -251,7 +344,7 @@ Double_t AliITSv11Geometry::RmaxFromZpCone(const TGeoPcon *p,int ip, Double_t AliITSv11Geometry::RFromZpCone(const Double_t *ar, const Double_t *az,int ip, Double_t tc,Double_t z, - Double_t th){ + Double_t th)const{ // General Cone surface equation R(z). // Intputs: // Double_t ar The array of R values @@ -266,15 +359,15 @@ Double_t AliITSv11Geometry::RFromZpCone(const Double_t *ar, // Return: // The value R correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmax[ip] at the locatin z. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return -tantc*(z-az[ip])+ar[ip]+th/costc; } //______________________________________________________________________ Double_t AliITSv11Geometry::RminFromZpCone(const TGeoPcon *p,Int_t ip, Double_t tc,Double_t z, - Double_t th){ + Double_t th)const{ // General Inner Cone surface equation Rmin. // Intputs: // TGeoPcon *p The poly cone where the initial point comes from @@ -288,15 +381,15 @@ Double_t AliITSv11Geometry::RminFromZpCone(const TGeoPcon *p,Int_t ip, // Return: // The value Rmin correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmin[ip] at the location z. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return -tantc*(z-p->GetZ(ip))+p->GetRmin(ip)+th/costc; } //______________________________________________________________________ Double_t AliITSv11Geometry::ZFromRmaxpCone(const TGeoPcon *p,int ip, Double_t tc,Double_t r, - Double_t th){ + Double_t th)const{ // General Outer cone Surface equation for z. // Intputs: // TGeoPcon *p The poly cone where the initial point comes from @@ -310,8 +403,8 @@ Double_t AliITSv11Geometry::ZFromRmaxpCone(const TGeoPcon *p,int ip, // Return: // The value Z correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmax[ip] at the location r. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return p->GetZ(ip)+(p->GetRmax(ip)+th/costc-r)/tantc; } @@ -319,7 +412,7 @@ Double_t AliITSv11Geometry::ZFromRmaxpCone(const TGeoPcon *p,int ip, Double_t AliITSv11Geometry::ZFromRmaxpCone(const Double_t *ar, const Double_t *az,int ip, Double_t tc,Double_t r, - Double_t th){ + Double_t th)const{ // General Outer cone Surface equation for z. // Intputs: // Double_t ar The array of R values @@ -334,15 +427,15 @@ Double_t AliITSv11Geometry::ZFromRmaxpCone(const Double_t *ar, // Return: // The value Z correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmax[ip] at the locatin r. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return az[ip]+(ar[ip]+th/costc-r)/tantc; } //______________________________________________________________________ Double_t AliITSv11Geometry::ZFromRminpCone(const TGeoPcon *p,int ip, Double_t tc,Double_t r, - Double_t th){ + Double_t th)const{ // General Inner cone Surface equation for z. // Intputs: // TGeoPcon *p The poly cone where the initial point comes from @@ -356,8 +449,8 @@ Double_t AliITSv11Geometry::ZFromRminpCone(const TGeoPcon *p,int ip, // Return: // The value Z correstponding to the line at angle th, offeset by // th, and the point p->GetZ/Rmin[ip] at the location r. - Double_t tantc = TanD(tc); - Double_t costc = CosD(tc); + Double_t tantc = TMath::Tan(tc*TMath::DegToRad()); + Double_t costc = TMath::Cos(tc*TMath::DegToRad()); return p->GetZ(ip)+(p->GetRmin(ip)+th/costc-r)/tantc; } @@ -365,7 +458,7 @@ Double_t AliITSv11Geometry::ZFromRminpCone(const TGeoPcon *p,int ip, void AliITSv11Geometry::RadiusOfCurvature(Double_t rc,Double_t theta0, Double_t z0,Double_t r0, Double_t theta1,Double_t &z1, - Double_t &r1){ + Double_t &r1)const{ // Given a initial point z0,r0, the initial angle theta0, and the radius // of curvature, returns the point z1, r1 at the angle theta1. Theta // measured from the r axis in the clock wise direction [degrees]. @@ -381,14 +474,14 @@ void AliITSv11Geometry::RadiusOfCurvature(Double_t rc,Double_t theta0, // Return: // none. - z1 = rc*(SinD(theta1)-SinD(theta0))+z0; - r1 = rc*(CosD(theta1)-CosD(theta0))+r0; + z1 = rc*(TMath::Sin(theta1*TMath::DegToRad())-TMath::Sin(theta0*TMath::DegToRad()))+z0; + r1 = rc*(TMath::Cos(theta1*TMath::DegToRad())-TMath::Cos(theta0*TMath::DegToRad()))+r0; return; } //______________________________________________________________________ void AliITSv11Geometry::InsidePoint(const TGeoPcon *p,Int_t i1,Int_t i2, Int_t i3,Double_t c,TGeoPcon *q,Int_t j1, - Bool_t max){ + Bool_t max)const{ // Given two lines defined by the points i1, i2,i3 in the TGeoPcon // class p that intersect at point p->GetZ(i2) return the point z,r // that is Cthick away in the TGeoPcon class q. If points i1=i2 @@ -440,9 +533,9 @@ void AliITSv11Geometry::InsidePoint(const TGeoPcon *p,Int_t i1,Int_t i2, void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0, Double_t x1,Double_t y1, Double_t x2,Double_t y2,Double_t c, - Double_t &x,Double_t &y){ + Double_t &x,Double_t &y)const{ // Given two intersecting lines defined by the points (x0,y0), (x1,y1) and - // (x1,y1), (x1,y2) {intersecting at (x1,y1)} the point (x,y) a distance + // (x1,y1), (x2,y2) {intersecting at (x1,y1)} the point (x,y) a distance // c away is returned such that two lines a distance c away from the // lines defined above intersect at (x,y). // Inputs: @@ -459,6 +552,9 @@ void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0, // Return: // none. Double_t dx01,dx12,dy01,dy12,r01,r12,m; + + //printf("InsidePoint: x0=% #12.7g y0=% #12.7g x1=% #12.7g y1=% #12.7g " + // "x2=% #12.7g y2=% #12.7g c=% #12.7g ",x0,y0,x1,y2,x2,y2,c); dx01 = x0-x1; //cout <<"L410 dx01="<GetName()); - a->InspectShape(); - } // end if + if(!GetDebug()) return; + printf("%s",a->GetName()); + a->InspectShape(); return; } //---------------------------------------------------------------------- @@ -512,7 +611,7 @@ void AliITSv11Geometry:: PrintPcon(const TGeoPcon *a)const{ // Return: // none. - if(GetDebug()) return; + if(!GetDebug()) return; cout << a->GetName() << ": N=" << a->GetNz() << " Phi1=" << a->GetPhi1() << ", Dphi=" << a->GetDphi() << endl; cout << "i\t Z \t Rmin \t Rmax" << endl; @@ -532,7 +631,7 @@ void AliITSv11Geometry::PrintTube(const TGeoTube *a)const{ // Return: // none. - if(GetDebug()) return; + if(!GetDebug()) return; cout << a->GetName() <<": Rmin="<GetRmin() <<" Rmax=" <GetRmax()<<" Dz="<GetDz()<GetName() <<": Phi1="<GetPhi1()<< " Phi2="<GetPhi2()<<" Rmin="<GetRmin() <<" Rmax=" <GetRmax()<<" Dz="<GetDz()<GetName() <<": Phi1="<GetPhi1()<< " Phi2="<GetPhi2()<<" Rmin1="<GetRmin1() <<" Rmax1=" <GetRmax1()<<" Rmin2="<GetRmin2() @@ -580,12 +679,523 @@ void AliITSv11Geometry::PrintBBox(const TGeoBBox *a)const{ // Return: // none. - if(GetDebug()) return; + if(!GetDebug()) return; cout << a->GetName() <<": Dx="<GetDX()<< " Dy="<GetDY()<<" Dz="<GetDZ() <AddElement(itsN,w);// Nitorgen, atomic + w = 23.29E-2 + // O2 + 5.90E-4 * 2.*15.994/(12.0107+2.*15.994);// CO2. + itsAir->AddElement(itsO,w);// Oxygen, atomic + w = 1.28E-2; + itsAir->AddElement(itsAr,w);// Argon, atomic + w = 5.90E-4*12.0107/(12.0107+2.*15.994)+ // CO2 + 2.0E-5 *12.0107/(12.0107+4.* 1.00794); // CH4 + itsAir->AddElement(itsC,w);// Carbon, atomic + w = 1.818E-5; + itsAir->AddElement(itsNe,w);// Ne, atomic + w = 3.5E-8; + itsAir->AddElement(itsHe,w);// Helium, atomic + w = 7.0E-7; + itsAir->AddElement(itsKr,w);// Krypton, atomic + w = 3.0E-6; + itsAir->AddElement(itsH,w);// Hydrogen, atomic + w = 4.0E-7; + itsAir->AddElement(itsXe,w);// Xenon, atomic + itsAir->SetDensity(351.0*fgkKgm3); // + itsAir->SetPressure(101325*fgkPascal); + itsAir->SetTemperature(15.0*fgkCelsius); + itsAir->SetState(TGeoMaterial::kMatStateGas); + // + // Silicone + TGeoMaterial *itsSiDet = new TGeoMaterial("ITS_Si",itsSi,2.33*fgkgcm3); + itsSiDet->SetTemperature(15.0*fgkCelsius); + itsSiDet->SetState(TGeoMaterial::kMatStateSolid); + // + // Epoxy C18 H19 O3 + TGeoMixture *itsEpoxy = new TGeoMixture("ITS_Epoxy",3); + itsEpoxy->AddElement(itsC,18); + itsEpoxy->AddElement(itsH,19); + itsEpoxy->AddElement(itsO,3); + itsEpoxy->SetDensity(1.8*fgkgcm3); + itsEpoxy->SetTemperature(15.0*fgkCelsius); + itsEpoxy->SetState(TGeoMaterial::kMatStateSolid); + // + // Carbon Fiber, M55J, 60% fiber by volume. Fiber density + // 1.91 g/cm^3. See ToryaCA M55J data sheet. + //Begin_Html + /* + Data Sheet + + */ + //End_Html + TGeoMixture *itsCarbonFiber = new TGeoMixture("ITS_CarbonFiber-M55J",4); + // Assume that the epoxy fill in the space between the fibers and so + // no change in the total volume. To compute w, assume 1cm^3 total + // volume. + w = 1.91/(1.91+(1.-.60)*itsEpoxy->GetDensity()); + itsCarbonFiber->AddElement(itsC,w); + w = (1.-.60)*itsEpoxy->GetDensity()/(1.91+(1.-.06)*itsEpoxy->GetDensity()); + for(i=0;iGetNelements();i++) + itsCarbonFiber->AddElement(itsEpoxy->GetElement(i), + itsEpoxy->GetWmixt()[i]*w); + itsCarbonFiber->SetDensity((1.91+(1.-.60)*itsEpoxy->GetDensity())*fgkgcm3); + itsCarbonFiber->SetTemperature(22.0*fgkCelsius); + itsCarbonFiber->SetState(TGeoMaterial::kMatStateSolid); + // + // + // + // Rohacell 51A millable foam product. + // C9 H13 N1 O2 52Kg/m^3 + // Elemental composition, Private comunications with + // Bjorn S. Nilsen + //Begin_Html + /* + + Rohacell-A see Properties + + */ + //End_Html + TGeoMixture *itsFoam = new TGeoMixture("ITS_Foam",4); + itsFoam->AddElement(itsC,9); + itsFoam->AddElement(itsH,13); + itsFoam->AddElement(itsN,1); + itsFoam->AddElement(itsO,2); + itsFoam->SetTitle("Rohacell 51 A"); + itsFoam->SetDensity(52.*fgkKgm3); + itsFoam->SetTemperature(22.0*fgkCelsius); + itsFoam->SetState(TGeoMaterial::kMatStateSolid); + // + // Kapton % by weight, H 2.6362, C69.1133, N 7.3270, O 20.0235 + // Density 1.42 g/cm^3 + //Begin_Html + /* + + Kapton. also see + + + */ + //End_Html + TGeoMixture *itsKapton = new TGeoMixture("ITS_Kapton",4); + itsKapton->AddElement(itsH,0.026362); + itsKapton->AddElement(itsC,0.691133); + itsKapton->AddElement(itsN,0.073270); + itsKapton->AddElement(itsO,0.200235); + itsKapton->SetTitle("Kapton ribon and cable base"); + itsKapton->SetDensity(1.42*fgkgcm3); + itsKapton->SetTemperature(22.0*fgkCelsius); + itsKapton->SetState(TGeoMaterial::kMatStateSolid); + // + // UPILEX-S C16 H6 O4 N2 polymer (a Kapton like material) + // Density 1.47 g/cm^3 + //Begin_Html + /* + + UPILEX-S. also see + + + */ + //End_Html + TGeoMixture *itsUpilex = new TGeoMixture("ITS_Upilex",4); + itsUpilex->AddElement(itsC,16); + itsUpilex->AddElement(itsH,6); + itsUpilex->AddElement(itsN,2); + itsUpilex->AddElement(itsO,4); + itsUpilex->SetTitle("Upilex ribon, cable, and pcb base"); + itsUpilex->SetDensity(1.47*fgkgcm3); + itsUpilex->SetTemperature(22.0*fgkCelsius); + itsUpilex->SetState(TGeoMaterial::kMatStateSolid); + // + // Aluminum 6061 (Al used by US groups) + // % by weight, Cr 0.04-0.35 range [0.0375 nominal value used] + // Cu 0.15-0.4 [0.275], Fe Max 0.7 [0.35], Mg 0.8-1.2 [1.0], + // Mn Max 0.15 [0.075] Si 0.4-0.8 [0.6], Ti Max 0.15 [0.075], + // Zn Max 0.25 [0.125], Rest Al [97.4625]. Density 2.7 g/cm^3 + //Begin_Html + /* + + Aluminum 6061 specifications + + */ + //End_Html + TGeoMixture *itsAl6061 = new TGeoMixture("ITS_Al6061",9); + itsAl6061->AddElement(itsCr,0.000375); + itsAl6061->AddElement(itsCu,0.00275); + itsAl6061->AddElement(itsFe,0.0035); + itsAl6061->AddElement(itsMg,0.01); + itsAl6061->AddElement(itsMn,0.00075); + itsAl6061->AddElement(itsSi,0.006); + itsAl6061->AddElement(itsTi,0.00075); + itsAl6061->AddElement(itsZn,0.00125); + itsAl6061->AddElement(itsAl,0.974625); + itsAl6061->SetTitle("Aluminum Alloy 6061"); + itsAl6061->SetDensity(2.7*fgkgcm3); + itsAl6061->SetTemperature(22.0*fgkCelsius); + itsAl6061->SetState(TGeoMaterial::kMatStateSolid); + // + // Aluminum 7075 (Al used by Italian groups) + // % by weight, Cr 0.18-0.28 range [0.23 nominal value used] + // Cu 1.2-2.0 [1.6], Fe Max 0.5 [0.25], Mg 2.1-2.9 [2.5], + // Mn Max 0.3 [0.125] Si Max 0.4 [0.2], Ti Max 0.2 [0.1], + // Zn 5.1-6.1 [5.6], Rest Al [89.395]. Density 2.81 g/cm^3 + //Begin_Html + /* + + Aluminum 7075 specifications + + */ + //End_Html + TGeoMixture *itsAl7075 = new TGeoMixture("ITS_Al7075",9); + itsAl7075->AddElement(itsCr,0.0023); + itsAl7075->AddElement(itsCu,0.016); + itsAl7075->AddElement(itsFe,0.0025); + itsAl7075->AddElement(itsMg,0.025); + itsAl7075->AddElement(itsMn,0.00125); + itsAl7075->AddElement(itsSi,0.002); + itsAl7075->AddElement(itsTi,0.001); + itsAl7075->AddElement(itsZn,0.056); + itsAl7075->AddElement(itsAl,0.89395); + itsAl7075->SetTitle("Aluminum Alloy 7075"); + itsAl7075->SetDensity(2.81*fgkgcm3); + itsAl7075->SetTemperature(22.0*fgkCelsius); + itsAl7075->SetState(TGeoMaterial::kMatStateSolid); + // + // "Ruby" spheres, Al2 O3 + // "Ruby" Sphere posts, Ryton R-4 04 + //Begin_Html + /* + + Ruby Sphere Posts + + */ + //End_Html + TGeoMixture *itsRuby = new TGeoMixture("ITS_RubySphere",2); + itsRuby->AddElement(itsAl,2); + itsRuby->AddElement(itsO,3); + itsRuby->SetTitle("Ruby reference sphere"); + itsRuby->SetDensity(2.81*fgkgcm3); + itsRuby->SetTemperature(22.0*fgkCelsius); + itsRuby->SetState(TGeoMaterial::kMatStateSolid); + // + // + // Inox, AISI 304L, compoistion % by weight (assumed) + // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50] + // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 8.0-10.5 [9.25] + // Cr 18-20 [19.], Mo 2.-2.5 [2.25], rest Fe: density 7.93 Kg/dm^3 + //Begin_Html + /* + + Stainless steal (INOX) AISI 304L composition + + */ + //End_Html + TGeoMixture *itsInox304L = new TGeoMixture("ITS_Inox304L",9); + itsInox304L->AddElement(itsC,0.00015); + itsInox304L->AddElement(itsMn,0.010); + itsInox304L->AddElement(itsSi,0.005); + itsInox304L->AddElement(itsP,0.000225); + itsInox304L->AddElement(itsS,0.00015); + itsInox304L->AddElement(itsNi,0.0925); + itsInox304L->AddElement(itsCr,0.1900); + itsInox304L->AddElement(itsMo,0.0225); + itsInox304L->AddElement(itsFe,0.679475); // Rest Fe + itsInox304L->SetTitle("ITS Stainless Steal (Inox) type AISI 304L"); + itsInox304L->SetDensity(7.93*fgkKgdm3); + itsInox304L->SetTemperature(22.0*fgkCelsius); + itsInox304L->SetState(TGeoMaterial::kMatStateSolid); + // + // Inox, AISI 316L, composition % by weight (assumed) + // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50] + // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 10.0-14. [12.] + // Cr 16-18 [17.], Mo 2-3 [2.5]: density 7.97 Kg/dm^3 + //Begin_Html + /* + + Stainless steal (INOX) AISI 316L composition + + */ + //End_Html + TGeoMixture *itsInox316L = new TGeoMixture("ITS_Inox316L",9); + itsInox316L->AddElement(itsC,0.00015); + itsInox316L->AddElement(itsMn,0.010); + itsInox316L->AddElement(itsSi,0.005); + itsInox316L->AddElement(itsP,0.000225); + itsInox316L->AddElement(itsS,0.00015); + itsInox316L->AddElement(itsNi,0.12); + itsInox316L->AddElement(itsCr,0.17); + itsInox316L->AddElement(itsMo,0.025); + itsInox316L->AddElement(itsFe,0.66945); // Rest Fe + itsInox316L->SetTitle("ITS Stainless Steal (Inox) type AISI 316L"); + itsInox316L->SetDensity(7.97*fgkKgdm3); + itsInox316L->SetTemperature(22.0*fgkCelsius); + itsInox316L->SetState(TGeoMaterial::kMatStateSolid); + // + // Inox, Phynox or Elgiloy AMS 5833, composition % by weight + // C Max 0.15 [0.15], Mn Max 2.00 [2.00], Be max 0.0001 [none] + // Ni 18. [18.], Cr 21.5 [21.5], Mo 7.5 [7.5], Co 42 [42.]: + // density 8.3 Kg/dm^3 + //Begin_Html + /* + + Compostion of Phynox or Elgiloy AMS 5833, also see + + + under corss reference number [0024]. + + */ + //End_Html + TGeoMixture *itsPhynox = new TGeoMixture("ITS_Phynox",7); + itsPhynox->AddElement(itsC,0.0015); + itsPhynox->AddElement(itsMn,0.020); + itsPhynox->AddElement(itsNi,0.18); + itsPhynox->AddElement(itsCr,0.215); + itsPhynox->AddElement(itsMo,0.075); + itsPhynox->AddElement(itsCo,0.42); + itsPhynox->AddElement(itsFe,0.885); + itsPhynox->SetTitle("ITS Cooling tube alloy"); + itsPhynox->SetDensity(8.3*fgkgcm3); + itsPhynox->SetTemperature(22.0*fgkCelsius); + itsPhynox->SetState(TGeoMaterial::kMatStateSolid); + // + // G10FR4 + // + // Demineralized Water H2O SDD & SSD Cooling liquid + TGeoMixture *itsWater = new TGeoMixture("ITS_Water",2); + itsWater->AddElement(itsH,2); + itsWater->AddElement(itsO,1); + itsWater->SetTitle("ITS Cooling Water"); + itsWater->SetDensity(1.0*fgkgcm3); + itsWater->SetTemperature(22.0*fgkCelsius); + itsWater->SetState(TGeoMaterial::kMatStateLiquid); + // + // Freon SPD Cooling liquid PerFluorobuthane C4F10 + //Begin_Html + /* + + SPD 2 phase cooling using PerFluorobuthane + + */ + //End_Html + TGeoMixture *itsFreon = new TGeoMixture("ITS_SPD_Freon",2); + itsFreon->AddElement(itsC,4); + itsFreon->AddElement(itsF,10); + itsFreon->SetTitle("ITS SPD 2 phase Cooling freon"); + itsFreon->SetDensity(1.52*fgkgcm3); + itsFreon->SetTemperature(22.0*fgkCelsius); + itsFreon->SetState(TGeoMaterial::kMatStateLiquid); + // + // Int_t ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); + // Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); + + // Float_t tmaxfd = 0.1;// 1.0;// Degree + // Float_t stemax = 1.0;// cm + // Float_t deemax = 0.1;// 30.0;// Fraction of particle's energy 0t[j]) {t0 = t[i];t[i] = t[j];t[j] = t0;} + } // end for i,j + t0 = t[0]; + t1 = t[1]; + // + return kTRUE; +} +//______________________________________________________________________ +Double_t AliITSv11Geometry::AngleForRoundedCorners0(Double_t dx,Double_t dy, + Double_t sdr)const{ + // Basic function used to determine the ending angle and starting angles + // for rounded corners given the relative distance between the centers + // of the circles and the difference/sum of their radii. Case 0. + // Inputs: + // Double_t dx difference in x locations of the circle centers + // Double_t dy difference in y locations of the circle centers + // Double_t sdr difference or sum of the circle radii + // Outputs: + // none. + // Return: + // the angle in Degrees + Double_t a,b; + + b = dy*dy+dx*dx-sdr*sdr; + if(b<0.0) Error("AngleForRoundedCorners0", + "dx^2(%e)+dy^2(%e)-sdr^2(%e)=b=%e<0",dx,dy,sdr,b); + b = TMath::Sqrt(b); + a = -sdr*dy+dx*b; + b = -sdr*dx-dy*b; + return TMath::ATan2(a,b)*TMath::RadToDeg(); + +} +//______________________________________________________________________ +Double_t AliITSv11Geometry::AngleForRoundedCorners1(Double_t dx,Double_t dy, + Double_t sdr)const{ + // Basic function used to determine the ending angle and starting angles + // for rounded corners given the relative distance between the centers + // of the circles and the difference/sum of their radii. Case 1. + // Inputs: + // Double_t dx difference in x locations of the circle centers + // Double_t dy difference in y locations of the circle centers + // Double_t sdr difference or sum of the circle radii + // Outputs: + // none. + // Return: + // the angle in Degrees + Double_t a,b; + + b = dy*dy+dx*dx-sdr*sdr; + if(b<0.0) Error("AngleForRoundedCorners1", + "dx^2(%e)+dy^2(%e)-sdr^2(%e)=b=%e<0",dx,dy,sdr,b); + b = TMath::Sqrt(b); + a = -sdr*dy-dx*b; + b = -sdr*dx+dy*b; + return TMath::ATan2(a,b)*TMath::RadToDeg(); + +} //---------------------------------------------------------------------- +void AliITSv11Geometry::AnglesForRoundedCorners(Double_t x0,Double_t y0, + Double_t r0,Double_t x1, + Double_t y1,Double_t r1, + Double_t &t0,Double_t &t1) + const{ + // Function to compute the ending angle, for arc 0, and starting angle, + // for arc 1, such that a straight line will connect them with no + // discontinuities. + //Begin_Html + /* + + */ + //End_Html + // Inputs: + // Double_t x0 X Coordinate of arc 0 center. + // Double_t y0 Y Coordinate of arc 0 center. + // Double_t r0 Radius of curvature of arc 0. For signe see figure. + // Double_t x1 X Coordinate of arc 1 center. + // Double_t y1 Y Coordinate of arc 1 center. + // Double_t r1 Radius of curvature of arc 1. For signe see figure. + // Outputs: + // Double_t t0 Ending angle of arch 0, with respect to x axis, Degrees. + // Double_t t1 Starting angle of arch 1, with respect to x axis, + // Degrees. + // Return: + // none. + Double_t t; + + if(r0>=0.0&&r1>=0.0) { // Inside to inside ++ + t = AngleForRoundedCorners1(x1-x0,y1-y0,r1-r0); + t0 = t1 = t; + return; + }else if(r0>=0.0&&r1<=0.0){ // Inside to Outside +- + r1 = -r1; // make positive + t = AngleForRoundedCorners0(x1-x0,y1-y0,r1+r0); + t0 = 180.0 + t; + if(t0<0.0) t += 360.; + if(t<0.0) t += 360.; + t1 = t; + return; + }else if(r0<=0.0&&r1>=0.0){ // Outside to Inside -+ + r0 = - r0; // make positive + t = AngleForRoundedCorners1(x1-x0,y1-y0,r1+r0); + t0 = 180.0 + t; + if(t0>180.) t0 -= 360.; + if(t >180.) t -= 360.; + t1 = t; + return; + }else if(r0<=0.0&&r1<=0.0) { // Outside to outside -- + r0 = -r0; // make positive + r1 = -r1; // make positive + t = AngleForRoundedCorners0(x1-x0,y1-y0,r1-r0); + t0 = t1 = t; + return; + } // end if + return; +} +//---------------------------------------------------------------------- +void AliITSv11Geometry::MakeFigure1(Double_t x0,Double_t y0,Double_t r0, + Double_t x1,Double_t y1,Double_t r1){ + // Function to create the figure discribing how the function + // AnglesForRoundedCorners works. + // + // Inputs: + // Double_t x0 X Coordinate of arc 0 center. + // Double_t y0 Y Coordinate of arc 0 center. + // Double_t r0 Radius of curvature of arc 0. For signe see figure. + // Double_t x1 X Coordinate of arc 1 center. + // Double_t y1 Y Coordinate of arc 1 center. + // Double_t r1 Radius of curvature of arc 1. For signe see figure. + // Outputs: + // none. + // Return: + // none. + Double_t t0[4],t1[4],xa0[4],ya0[4],xa1[4],ya1[4],ra0[4],ra1[4]; + Double_t xmin,ymin,xmax,ymax,h; + Int_t j; + + for(j=0;j<4;j++) { + ra0[j] = r0; if(j%2) ra0[j] = -r0; + ra1[j] = r1; if(j>1) ra1[j] = -r1; + AnglesForRoundedCorners(x0,y0,ra0[j],x1,y1,ra1[j],t0[j],t1[j]); + xa0[j] = TMath::Abs(r0)*CosD(t0[j])+x0; + ya0[j] = TMath::Abs(r0)*SinD(t0[j])+y0; + xa1[j] = TMath::Abs(r1)*CosD(t1[j])+x1; + ya1[j] = TMath::Abs(r1)*SinD(t1[j])+y1; + } // end for j + if(r0<0.0) r0 = -r0; + if(r1<0.0) r1 = -r1; + xmin = TMath::Min(x0 - r0,x1-r1); + ymin = TMath::Min(y0 - r0,y1-r1); + xmax = TMath::Max(x0 + r0,x1+r1); + ymax = TMath::Max(y0 + r0,y1+r1); + for(j=1;j<4;j++) { + xmin = TMath::Min(xmin,xa0[j]); + xmin = TMath::Min(xmin,xa1[j]); + ymin = TMath::Min(ymin,ya0[j]); + ymin = TMath::Min(ymin,ya1[j]); + + xmax = TMath::Max(xmax,xa0[j]); + xmax = TMath::Max(xmax,xa1[j]); + ymax = TMath::Max(ymax,ya0[j]); + ymax = TMath::Max(ymax,ya1[j]); + } // end for j + if(xmin<0.0) xmin *= 1.1; else xmin *= 0.9; + if(ymin<0.0) ymin *= 1.1; else ymin *= 0.9; + if(xmax<0.0) xmax *= 0.9; else xmax *= 1.1; + if(ymax<0.0) ymax *= 0.9; else ymax *= 1.1; + j = (Int_t)(500.0*(ymax-ymin)/(xmax-xmin)); + TCanvas *can = new TCanvas("AliITSv11Geometry_AnglesForRoundedCorners", + "Figure for AliITSv11Geometry",500,j); + h = ymax-ymin; if(h<0) h = -h; + can->Range(xmin,ymin,xmax,ymax); + TArc *c0 = new TArc(x0,y0,r0); + TArc *c1 = new TArc(x1,y1,r1); + TLine *line[4]; + TArrow *ar0[4]; + TArrow *ar1[4]; + for(j=0;j<4;j++){ + ar0[j] = new TArrow(x0,y0,xa0[j],ya0[j]); + ar1[j] = new TArrow(x1,y1,xa1[j],ya1[j]); + line[j] = new TLine(xa0[j],ya0[j],xa1[j],ya1[j]); + ar0[j]->SetLineColor(j+1); + ar0[j]->SetArrowSize(0.1*r0/h); + ar1[j]->SetLineColor(j+1); + ar1[j]->SetArrowSize(0.1*r1/h); + line[j]->SetLineColor(j+1); + } // end for j + c0->Draw(); + c1->Draw(); + for(j=0;j<4;j++){ + ar0[j]->Draw(); + ar1[j]->Draw(); + line[j]->Draw(); + } // end for j + TText *t = new TText(); + t->SetTextSize(0.02); + Char_t txt[100]; + snprintf(txt,99,"(x0=%5.2f,y0=%5.2f)",x0,y0); + t->DrawText(x0,y0,txt); + snprintf(txt,99,"(x1=%5.2f,y1=%5.2f)",x1,y1); + for(j=0;j<4;j++) { + t->SetTextColor(j+1); + t->DrawText(x1,y1,txt); + snprintf(txt,99,"r0=%5.2f",ra0[j]); + t->DrawText(0.5*(x0+xa0[j]),0.5*(y0+ya0[j]),txt); + snprintf(txt,99,"r1=%5.2f",ra1[j]); + t->DrawText(0.5*(x1+xa1[j]),0.5*(y1+ya1[j]),txt); + } // end for j +}