Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MinosOutline.cxx

Go to the documentation of this file.
00001 
00002 // $Id: MinosOutline.cxx,v 1.16 2007/01/15 21:05:47 rhatcher Exp $
00003 //
00004 // MinosOutline
00005 //
00006 // MinosOutline is an extrusion (TXTRU shape) with fixed outline shape
00007 // in x-y and a user defined z extent.  A variety of selected outlines
00008 // relevant to MINOS are available for selection.
00009 //
00010 // Authoor:  R. Hatcher 2000.04.21
00011 //
00013 
00014 #include "UgliGeometry/MinosOutline.h"
00015 
00016 #include "Conventions/Munits.h"
00017 #include "MessageService/MsgService.h"
00018 CVSID("$Id: MinosOutline.cxx,v 1.16 2007/01/15 21:05:47 rhatcher Exp $");
00019 
00020 #include "TMath.h"
00021 
00022 ClassImp(MinosOutline)
00023 
00024 const float nearxoffset      =  21.96 * Munits::inch;
00025 const float farxoffset       =   0.00;
00026 const float caldetxoffset    =   0.00;
00027 const float caldet_half_size =  50.00 * Munits::cm;
00028 const float farwidth         = 800.00 * Munits::cm;
00029 const float stripwidth       =   4.1  * Munits::cm;
00030 
00031 //_____________________________________________________________________________
00032 MinosOutline::MinosOutline()
00033 {
00034    // Default constructor
00035 
00036 }
00037 
00038 //_____________________________________________________________________________
00039 MinosOutline::MinosOutline(const Text_t *name, const Text_t *title,
00040                            const Text_t *material,
00041                            const PlexPlaneId plnid, Bool_t showEars,
00042                            const Float_t dz, const Float_t scale)
00043    : TXTRU(name,title,material,8,2), fDetCover(plnid), fShowEars(showEars)
00044 {
00045 
00046    this->DefineSection(0,-dz,scale,0.,0.);
00047    this->DefineSection(1,+dz,scale,0.,0.);
00048 
00049    if ( fShowEars && !fDetCover.IsSteel() ) {
00050       if (!plnid.IsVetoShield()) 
00051         MSG("Ugli",Msg::kWarning)
00052           << " MinosOutline ctor error: " 
00053           << " doesn't make sense to build active with ears -- ignore flag"
00054           << endl;
00055       fShowEars = false;
00056    }
00057 
00058    switch ( fDetCover.GetDetector() ) {
00059    case Detector::kNear:   BuildNear();    break;
00060    case Detector::kFar:    BuildFar();     break;
00061    case Detector::kCalDet: BuildCalDet();  break;
00062    default:
00063       MSG("Ugli",Msg::kError) 
00064          << " MinosOutline ctor error: " 
00065          << " can't construct Detector = " 
00066          << "\"" << Detector::AsString(fDetCover.GetDetector()) << "\""
00067          << endl;
00068    }
00069 
00070 }
00071 
00072 
00073 //_____________________________________________________________________________
00074 MinosOutline::~MinosOutline()
00075 {
00076 }
00077 
00078 //_____________________________________________________________________________
00079 MinosOutline::MinosOutline(const MinosOutline &so)
00080   : TXTRU()
00081 {
00082    ((MinosOutline&)so).Copy(*this);
00083 }
00084 
00085 //_____________________________________________________________________________
00086 void MinosOutline::Copy(TObject &obj) const
00087 {
00088    TXTRU::Copy(obj);
00089 //   this->fDetCover      = obj.fDetCover;
00090 //   this->fShowEars      = obj.fShowEars;
00091 //   this->fGlobalXOffset = obj.fGlobalXOffset;
00092 }
00093 
00094 //_____________________________________________________________________________
00095 void MinosOutline::BuildNear()
00096 {
00097    // decision tree for Near
00098    if (fDetCover.IsSteel()) {
00099       // Steel
00100       if (fShowEars) BuildNearSteelEars();
00101       else           BuildNearSteelBasic();
00102    }
00103    else {
00104       // Active
00105       PlaneCoverage::PlaneCoverage_t cover = fDetCover.GetPlaneCoverage();
00106       PlaneView::PlaneView_t         view  = fDetCover.GetPlaneView();
00107       switch (cover) {
00108       case (PlaneCoverage::kNearFull):    BuildNearFullActive(view);    break;
00109       case (PlaneCoverage::kNearPartial): BuildNearPartialActive(view); break;
00110       default:
00111          MSG("Ugli",Msg::kWarning) 
00112             << " MinosOutline ctor error: " 
00113             << " can't construct Near with " 
00114             << "\"" << PlaneCoverage::AsString(cover) << "\" coverage"
00115             << endl;
00116          BuildNearFullActive(view);
00117       }
00118    }
00119 }
00120 
00121 //_____________________________________________________________________________
00122 void MinosOutline::BuildFar()
00123 {
00124    // decision tree for Far
00125    if (fDetCover.IsVetoShield()) {
00126      BuildFarVetoActive();
00127    }
00128    else if (fDetCover.IsSteel()) {
00129       if (fShowEars) BuildFarSteelEars();
00130       else           BuildFarSteelBasic();
00131    }
00132    else {
00133       BuildFarActive();
00134       PlaneCoverage::PlaneCoverage_t cover = fDetCover.GetPlaneCoverage();
00135       if (cover != PlaneCoverage::kComplete)
00136          MSG("Ugli",Msg::kWarning) 
00137             << " MinosOutline ctor error: " 
00138             << " can't construct Far with " 
00139             << "\"" << PlaneCoverage::AsString(cover) << "\" coverage"
00140             << endl;
00141    }
00142 }
00143 
00144 //_____________________________________________________________________________
00145 void MinosOutline::BuildCalDet()
00146 {
00147    // decision tree for CalDet
00148 
00149    // easy since all CalDet planes are the same
00150 
00151    BuildCalDetBasic();
00152 
00153    // complain about nonsense
00154    PlaneCoverage::PlaneCoverage_t cover = fDetCover.GetPlaneCoverage();
00155    if (cover != PlaneCoverage::kComplete &&
00156        cover != PlaneCoverage::kNoActive    ) {
00157       MSG("Ugli",Msg::kInfo) 
00158          << " MinosOutline: odd request for CalDet plane with " 
00159          << "\"" << PlaneCoverage::AsString(cover) << "\" coverage"
00160          << endl;
00161    }
00162 }
00163 
00164 //_____________________________________________________________________________
00165 void MinosOutline::BuildNearSteelEars()
00166 {
00167    // Near Steel w/ Ears
00168    fGlobalXOffset = nearxoffset;
00169    this->DefineVertex( 0, -121.43*Munits::inch,   0.47*Munits::inch);
00170    this->DefineVertex( 1, -120.25*Munits::inch,   0.47*Munits::inch);
00171    this->DefineVertex( 2, -115.14*Munits::inch,   3.42*Munits::inch);
00172    this->DefineVertex( 3, -110.24*Munits::inch,   3.42*Munits::inch);
00173    this->DefineVertex( 4,  -95.24*Munits::inch,  -1.48*Munits::inch);
00174    this->DefineVertex( 5,  -95.24*Munits::inch, -35.47*Munits::inch);
00175    this->DefineVertex( 6,  -69.80*Munits::inch, -60.91*Munits::inch);
00176    this->DefineVertex( 7,  -69.80*Munits::inch, -75.04*Munits::inch);
00177    this->DefineVertex( 8,   69.80*Munits::inch, -75.04*Munits::inch);
00178    this->DefineVertex( 9,   69.80*Munits::inch, -60.91*Munits::inch);
00179    this->DefineVertex(10,   95.24*Munits::inch, -35.47*Munits::inch);
00180    this->DefineVertex(11,   95.24*Munits::inch,  -1.48*Munits::inch);
00181    this->DefineVertex(12,  110.16*Munits::inch,   3.42*Munits::inch);
00182    this->DefineVertex(13,  117.30*Munits::inch,   3.42*Munits::inch);
00183    this->DefineVertex(14,  120.25*Munits::inch,   0.47*Munits::inch);
00184    this->DefineVertex(15,  121.43*Munits::inch,   0.47*Munits::inch);
00185    this->DefineVertex(16,  121.43*Munits::inch,   9.28*Munits::inch);
00186    this->DefineVertex(17,   69.80*Munits::inch,  60.91*Munits::inch);
00187    this->DefineVertex(18,   69.80*Munits::inch,  75.04*Munits::inch);
00188    this->DefineVertex(19,  -69.80*Munits::inch,  75.04*Munits::inch);
00189    this->DefineVertex(20,  -69.80*Munits::inch,  60.91*Munits::inch);
00190    this->DefineVertex(21, -121.43*Munits::inch,   9.28*Munits::inch);
00191 }
00192 
00193 //_____________________________________________________________________________
00194 void MinosOutline::BuildNearSteelBasic()
00195 {
00196    // Near Steel w/o Ears
00197    fGlobalXOffset = nearxoffset;
00198    this->DefineVertex( 0,  241.91*Munits::cm,  -90.12*Munits::cm);
00199    this->DefineVertex( 1,  241.91*Munits::cm,   90.08*Munits::cm);
00200    this->DefineVertex( 2,  141.41*Munits::cm,  190.59*Munits::cm);
00201    this->DefineVertex( 3, -141.39*Munits::cm,  190.60*Munits::cm);
00202    this->DefineVertex( 4, -241.90*Munits::cm,   90.11*Munits::cm);
00203    this->DefineVertex( 5, -241.91*Munits::cm,  -90.08*Munits::cm);
00204    this->DefineVertex( 6, -141.42*Munits::cm, -190.59*Munits::cm);
00205    this->DefineVertex( 7,  141.38*Munits::cm, -190.62*Munits::cm);
00206 }
00207 
00208 //_____________________________________________________________________________
00209 void MinosOutline::BuildNearPartialActive(PlaneView::PlaneView_t view)
00210 {
00211    // Near Partial Active
00212    fGlobalXOffset = nearxoffset;
00213 
00214    Double_t r_sqrt2 = 1.0 / TMath::Sqrt(2.0);
00215    Double_t pxy[16] = {
00216       141.37*Munits::cm, -190.62*Munits::cm,
00217       241.91*Munits::cm,  -90.09*Munits::cm,
00218       241.91*Munits::cm,   90.08*Munits::cm,
00219       141.41*Munits::cm,  190.59*Munits::cm,
00220       122.19*Munits::cm,  190.59*Munits::cm,
00221        -8.77*Munits::cm,   59.66*Munits::cm,
00222        -8.78*Munits::cm,  -59.67*Munits::cm,
00223       122.16*Munits::cm, -190.62*Munits::cm
00224    };
00225 
00226    for (int i=0; i<8; i++) {
00227       Double_t x = pxy[i*2] + nearxoffset;
00228       Double_t y = pxy[i*2+1];
00229       Double_t xp, yp;
00230       switch (view) {
00231       case (PlaneView::kU):
00232          xp = ( x - y ) * r_sqrt2; yp = ( x + y ) * r_sqrt2;
00233          break;
00234       case (PlaneView::kV):
00235          xp = ( x + y ) * r_sqrt2; yp = (-x + y ) * r_sqrt2;
00236          break;
00237       default:
00238          xp = x; yp = y;
00239          break;
00240       }
00241       this->DefineVertex(i,xp,yp);
00242    }
00243 }
00244 
00245 //_____________________________________________________________________________
00246 void MinosOutline::BuildNearFullActive(PlaneView::PlaneView_t view)
00247 {
00248    // Near Full Active
00249    fGlobalXOffset = nearxoffset;
00250 
00251    Double_t r_sqrt2 = 1.0 / TMath::Sqrt(2.0);
00252    Double_t pxy[16] = {
00253       141.48*Munits::cm, -190.51*Munits::cm,
00254       241.91*Munits::cm,  -90.09*Munits::cm,
00255       241.91*Munits::cm,   90.08*Munits::cm,
00256       141.41*Munits::cm,  190.59*Munits::cm,
00257       -43.64*Munits::cm,  190.60*Munits::cm,
00258      -234.25*Munits::cm,    0.01*Munits::cm,
00259      -234.25*Munits::cm,    0.01*Munits::cm,
00260       -43.78*Munits::cm, -190.49*Munits::cm
00261    };
00262 
00263    for (int i=0; i<8; i++) {
00264       Double_t x = pxy[i*2] + nearxoffset;
00265       Double_t y = pxy[i*2+1];
00266       Double_t xp, yp;
00267       switch (view) {
00268       case (PlaneView::kU):
00269          xp = ( x - y ) * r_sqrt2; yp = ( x + y ) * r_sqrt2;
00270          break;
00271       case (PlaneView::kV):
00272          xp = ( x + y ) * r_sqrt2; yp = (-x + y ) * r_sqrt2;
00273          break;
00274       default:
00275          xp = x; yp = y;
00276          break;
00277       }
00278       this->DefineVertex(i,xp,yp);
00279    }
00280 }
00281 
00282 //_____________________________________________________________________________
00283 void MinosOutline::BuildFarSteelEars()
00284 {
00285    // Far Steel w/ Ears
00286    fGlobalXOffset = farxoffset;
00287    this->DefineVertex(  0,  421.8893*Munits::cm, -142.8867*Munits::cm);
00288    this->DefineVertex(  1,  421.8893*Munits::cm, -138.3342*Munits::cm);
00289    this->DefineVertex(  2,  400.1614*Munits::cm, -115.9855*Munits::cm);
00290    this->DefineVertex(  3,  400.7823*Munits::cm,   87.6358*Munits::cm);
00291    this->DefineVertex(  4,  406.9902*Munits::cm,   94.0507*Munits::cm);
00292    this->DefineVertex(  5,  429.1319*Munits::cm,  101.5003*Munits::cm);
00293    this->DefineVertex(  6,  447.1350*Munits::cm,  101.5003*Munits::cm);
00294    this->DefineVertex(  7,  454.7915*Munits::cm,   94.2577*Munits::cm);
00295    this->DefineVertex(  8,  457.6886*Munits::cm,   94.2577*Munits::cm);
00296    this->DefineVertex(  9,  457.6886*Munits::cm,  109.3637*Munits::cm);
00297    this->DefineVertex( 10,  143.7724*Munits::cm,  423.2799*Munits::cm);
00298    this->DefineVertex( 11,  139.4268*Munits::cm,  423.2799*Munits::cm);
00299    this->DefineVertex( 12,  117.2850*Munits::cm,  401.1382*Munits::cm);
00300    this->DefineVertex( 13, -116.9622*Munits::cm,  401.1382*Munits::cm);
00301    this->DefineVertex( 14, -139.1040*Munits::cm,  423.2799*Munits::cm);
00302    this->DefineVertex( 15, -143.4496*Munits::cm,  423.2799*Munits::cm);
00303    this->DefineVertex( 16, -457.3658*Munits::cm,  109.3637*Munits::cm);
00304    this->DefineVertex( 17, -457.3658*Munits::cm,   94.2577*Munits::cm);
00305    this->DefineVertex( 18, -454.4687*Munits::cm,   94.2577*Munits::cm);
00306    this->DefineVertex( 19, -439.9834*Munits::cm,  101.9141*Munits::cm);
00307    this->DefineVertex( 20, -429.8438*Munits::cm,  101.9141*Munits::cm);
00308    this->DefineVertex( 21, -406.6674*Munits::cm,   94.2577*Munits::cm);
00309    this->DefineVertex( 22, -399.8386*Munits::cm,   84.7388*Munits::cm);
00310    this->DefineVertex( 23, -399.8386*Munits::cm, -115.9855*Munits::cm);
00311    this->DefineVertex( 24, -421.5665*Munits::cm, -137.7134*Munits::cm);
00312    this->DefineVertex( 25, -421.5665*Munits::cm, -142.8867*Munits::cm);
00313    this->DefineVertex( 26, -143.4496*Munits::cm, -421.0036*Munits::cm);
00314    this->DefineVertex( 27, -139.1040*Munits::cm, -421.0036*Munits::cm);
00315    this->DefineVertex( 28, -116.9622*Munits::cm, -398.8619*Munits::cm);
00316    this->DefineVertex( 29,  116.8712*Munits::cm, -398.8619*Munits::cm);
00317    this->DefineVertex( 30,  139.4268*Munits::cm, -421.0036*Munits::cm);
00318    this->DefineVertex( 31,  143.7724*Munits::cm, -421.0036*Munits::cm);
00319 }
00320 
00321 //_____________________________________________________________________________
00322 void MinosOutline::BuildFarSteelBasic()
00323 {
00324    // Far Steel w/o Ears
00325    fGlobalXOffset = farxoffset;
00326    this->DefineVertex( 0,  400.00*Munits::cm, -165.72*Munits::cm);
00327    this->DefineVertex( 1,  400.00*Munits::cm,  165.67*Munits::cm);
00328    this->DefineVertex( 2,  165.70*Munits::cm,  399.99*Munits::cm);
00329    this->DefineVertex( 3, -165.66*Munits::cm,  400.01*Munits::cm);
00330    this->DefineVertex( 4, -399.98*Munits::cm,  165.71*Munits::cm);
00331    this->DefineVertex( 5, -400.01*Munits::cm, -165.65*Munits::cm);
00332    this->DefineVertex( 6, -165.72*Munits::cm, -399.98*Munits::cm);
00333    this->DefineVertex( 7,  165.64*Munits::cm, -400.02*Munits::cm);
00334 }
00335 
00336 //_____________________________________________________________________________
00337 void MinosOutline::BuildFarActive()
00338 {
00339    // Far Active
00340    fGlobalXOffset = farxoffset;
00341 
00342    Double_t r_inscribed = 400.0 * Munits::cm;
00343    Double_t dangle = 360./8. * Munits::degree;
00344    Double_t R_outside = r_inscribed /TMath::Cos(0.5*dangle);
00345    Double_t angleoff = 0.;
00346    Double_t x0 = 0, y0 = 0;
00347 
00348    for (int i = 0; i < 8; i++ ) {
00349       Double_t angle = (float(i)+0.5)*dangle + angleoff;
00350       Double_t x = TMath::Cos(angle)*R_outside + x0;
00351       Double_t y = TMath::Sin(angle)*R_outside + y0;
00352       this->DefineVertex(i,x,y);
00353    }
00354 }
00355 
00356 //_____________________________________________________________________________
00357 void MinosOutline::BuildFarVetoActive()
00358 {
00359    // Far Veto Active
00360    fGlobalXOffset = 0;
00361 
00362    Double_t half_width  = 0.5*farwidth;
00363    Double_t half_height = 0.5*20*stripwidth;
00364 
00365    this->DefineVertex( 0, -half_width, -half_height);
00366    this->DefineVertex( 1,  half_width, -half_height);
00367    this->DefineVertex( 2,  half_width,  half_height);
00368    this->DefineVertex( 3, -half_width,  half_height);
00369    TruncateNxy(4);
00370 }
00371 
00372 //_____________________________________________________________________________
00373 void MinosOutline::BuildCalDetBasic()
00374 {
00375 
00376    fGlobalXOffset = caldetxoffset;
00377    this->DefineVertex( 0,-caldet_half_size,-caldet_half_size);
00378    this->DefineVertex( 1, caldet_half_size,-caldet_half_size);
00379    this->DefineVertex( 2, caldet_half_size, caldet_half_size);
00380    this->DefineVertex( 3,-caldet_half_size, caldet_half_size);
00381    TruncateNxy(4);                                          
00382 }                                                           
00383                                                             
00384 //_____________________________________________________________________________

Generated on Mon Feb 15 11:07:00 2010 for loon by  doxygen 1.3.9.1