MINFDetGeom Class Reference

#include <MINFDetGeom.h>

List of all members.

Public Member Functions

 MINFDetGeom ()
 ~MINFDetGeom ()
virtual void BuildDetectorGeometry (REROOT_Geom *rgeo)
TGeometry * GetGeometry ()

Private Attributes

TGeometry * fGeometry

Detailed Description

Definition at line 19 of file MINFDetGeom.h.


Constructor & Destructor Documentation

MINFDetGeom::MINFDetGeom (  ) 

Definition at line 47 of file MINFDetGeom.cxx.

00047                          :
00048   fGeometry(0)
00049 {
00050 }

MINFDetGeom::~MINFDetGeom (  ) 

Definition at line 53 of file MINFDetGeom.cxx.

References MINFast::Detectors(), fGeometry, and gMINFast.

00054 {
00055 
00056 // Clear geometry node list for each detector.
00057    TIter next(gMINFast->Detectors());
00058    MINFDetector *detector;
00059    while((detector=(MINFDetector *) next())) detector->Nodes()->Clear();
00060 
00061    delete fGeometry;
00062    fGeometry = 0;
00063 }


Member Function Documentation

void MINFDetGeom::BuildDetectorGeometry ( REROOT_Geom rgeo  )  [virtual]

Definition at line 66 of file MINFDetGeom.cxx.

References REROOT_PlanePos::ActvSpec(), MINFast::Detectors(), REROOT_SuperModule::DnSpace(), fGeometry, REROOT_Geom::geommiscs(), MINFOutline::GetGlobalXOffset(), gMINFast, REROOT_PlanePos::ISuper(), MINFOutline::kCalib, MINFOutline::kFar, MINFOutline::kFullActive, MINFOutline::kNear, MINFOutline::kPartialActive, MINFOutline::kSteelEars, MINFOutline::kSteelNoEars, REROOT_Geom::n_planeposs(), REROOT_Geom::n_supermodules(), REROOT_GeomMisc::NearFar(), REROOT_Geom::planeposs(), REROOT_Geom::planespecs(), REROOT_PlanePos::Rotm(), REROOT_Geom::supermodules(), REROOT_SuperModule::SupX0(), REROOT_SuperModule::SupY0(), REROOT_PlaneSpec::Thickness(), REROOT_SuperModule::UpSpace(), REROOT_GeomMisc::VHall(), REROOT_GeomMisc::VMARS(), REROOT_PlaneSpec::Width(), REROOT_SuperModule::Xmax(), REROOT_SuperModule::Xmin(), REROOT_PlanePos::XYActv(), REROOT_SuperModule::Ymax(), REROOT_SuperModule::Ymin(), REROOT_PlanePos::ZFrntActv(), REROOT_SuperModule::Zmax(), and REROOT_SuperModule::Zmin().

Referenced by MINFast::BuildDetectorGeometry().

00067 {
00068 
00069 // Working objects.
00070    TRotMatrix *rotX;
00071    TRotMatrix *rotY;
00072    TRotMatrix *rotU;
00073    TRotMatrix *rotV;
00074    TMaterial *mat;
00075    TMixture *mix;
00076    Int_t vissupermodules = 1;
00077    Int_t vismodules = 0;
00078 
00079 // Pointers to ROOT containers for object versions of ADAMO tables.
00080    const TClonesArray *geommiscs    = rgeo->geommiscs();
00081    const TClonesArray *supermodules = rgeo->supermodules();
00082 //gmi   const TClonesArray *coiltubes    = rgeo->coiltubes();
00083    const TClonesArray *planeposs    = rgeo->planeposs();
00084    const TClonesArray *planespecs   = rgeo->planespecs();
00085 //gmi   const TClonesArray *cellposs     = rgeo->cellposs();
00086 //gmi   const TClonesArray *rotms        = rgeo->rotms();
00087 
00088 // Working pointers to individual row objects for ADAMO tables.
00089    REROOT_GeomMisc    *geommisc  = (REROOT_GeomMisc *) geommiscs->At(0);
00090    REROOT_SuperModule *supermodule = 0;
00091 //gmi   REROOT_CoilTube    *coiltube = 0;
00092    REROOT_PlanePos    *planepos    = 0;
00093    REROOT_PlaneSpec   *planespec   = 0;
00094 //gmi   REROOT_CellPos     *cellpos     = 0;
00095 //gmi   REROOT_Rotm        *rotm        = 0;
00096 
00097 // Create a ROOT TGeometry object.
00098    fGeometry = new TGeometry("MINFGeom","gMINFast Geometry");
00099 
00100 // List of Rotation matrices 
00101    rotX = new TRotMatrix("rotX","rotX",90,  0,90, 90,0,0);
00102    rotY = new TRotMatrix("rotY","rotY",90, 90,90,180,0,0);
00103    rotU = new TRotMatrix("rotU","rotU",90,-45,90, 45,0,0);
00104    rotV = new TRotMatrix("rotV","rotV",90, 45,90,135,0,0);
00105  
00106 // List of materials and mixtures
00107    mat = new TMaterial("mat6","CARBON",12.01,6,2.265);
00108    mat = new TMaterial("mat9","ALUMINIUM",26.97999,13,2.7);
00109    mat = new TMaterial("mat10","IRON",55.84999,26,7.869999);
00110    mat = new TMaterial("mat11","COPPER",63.54,29,8.96);
00111    mat = new TMaterial("mat13","LEAD",207.19,82,11.35);
00112    mat = new TMaterial("mat15","AIR",14.60999,7.3,.001205);
00113    mat = new TMaterial("mat16","VACUUM",0,0,0);
00114    mat = new TMaterial("mat20","SILICON",28.09,14,2.329999);
00115 
00116    mix = new TMixture("mix22","MYLAR",3);
00117      mix->DefineElement(0,12.01,6,.5357684);
00118      mix->DefineElement(1,1.008,1,.0359737);
00119      mix->DefineElement(2,16,8,.4282579);
00120 
00121    mix = new TMixture("mix25","PLASTIC",2);
00122      mix->DefineElement(0,12.01,6,.9225687);
00123      mix->DefineElement(1,1.008,1,.0774312);
00124 
00125    mix = new TMixture("mix32","steel",2);
00126      mix->DefineElement(0,55.84999,26,.98);
00127      mix->DefineElement(1,12.01,6,.02);
00128 
00129 // Working list of nodes for each detector type.
00130    TList *nodes;
00131 
00132 // List of colors for each detector type.
00133    const Int_t kColorFLS  = kBlue;
00134 //gmi   const Int_t kColorEMU  = 19;
00135 
00136 // Create VMARS and VHall.
00137    TBRIK *VMARS = new TBRIK("VMARS","VMARS","mat15",geommisc->VMARS()[0]
00138                                                    ,geommisc->VMARS()[1]
00139                                                  ,geommisc->VMARS()[2]);
00140    VMARS->SetVisibility(0);
00141 
00142 // rwh: a marker at the origin
00143    TSPHE *origin = new TSPHE("origin","origin","void",10.);
00144    TNode *originNode = new TNode("origin","origin",origin,0.,0.,0.,0);
00145    originNode->SetVisibility(0); // not normally visible 
00146    originNode->SetLineColor(kRed);
00147 
00148    TNode *Nodemars =
00149                  new TNode("VMARS","VMARS",(TShape *) VMARS,0.,0.,0.,0);
00150    Nodemars->cd();
00151    TBRIK *VHall = new TBRIK("VHall","VHall","mat15",geommisc->VHall()[0]
00152                                                    ,geommisc->VHall()[1]
00153                                                  ,geommisc->VHall()[2]);
00154    VHall->SetVisibility(0);
00155    TNode *Nodehall =
00156                  new TNode("VHall","VHall",(TShape *) VHall,0.,0.,0.,0);
00157    Nodehall->cd();
00158 
00159 //gmi printf("rgeo->n_rotms() = %d\n",rgeo->n_rotms());
00160 //gmi printf("rgeo->n_geommiscs() = %d\n",rgeo->n_geommiscs());
00161 //gmi printf("rgeo->n_supermodules() = %d\n",rgeo->n_supermodules());
00162 //gmi printf("rgeo->n_planespecs() = %d\n",rgeo->n_planespecs());
00163 //gmi printf("geommisc->NSupmdl() = %d\n",geommisc->NSupmdl());
00164 
00165 // Create FLS in TGeometry.
00166    nodes = ((MINFDetector *)
00167                      gMINFast->Detectors()->FindObject("FLS"))->Nodes();
00168 
00169    TString supname("SMDL");
00170    TString os0name("SteelNoEars");
00171    TString os1name("SteelEars");
00172    TString ofaname("FullActive");
00173    TString opaname("PartialActive");
00174    TString snam;
00175    Char_t* csnam = 0;
00176    Char_t cs[40];
00177    TPGON *pgon = 0;
00178    TNode *Nodesup = 0;
00179 
00180    MINFOutline *outline = 0;
00181 
00182 // Create supermodules inside VHall.
00183 //alt   for (Int_t isupmdl=0; isupmdl<geommisc->NSupmdl(); isupmdl++) {
00184    for (Int_t isupmdl=0; isupmdl<rgeo->n_supermodules(); isupmdl++) {
00185 
00186 //gmi printf("supname = %s\n",supname.Data());
00187      sprintf(cs,"%d",isupmdl);
00188      snam = supname;  snam.Append(cs);
00189 //gmi printf("snam = %s\n",snam.Data());
00190      supermodule = (REROOT_SuperModule *) supermodules->At(isupmdl);
00191      csnam = (Char_t*) snam.Data();
00192      pgon = new TPGON(csnam,csnam,"void",-22.5,360.,8,2);
00193      pgon->SetVisibility(vissupermodules);
00194      Float_t zmin = supermodule->Zmin() + supermodule->UpSpace();
00195      Float_t zmax = supermodule->Zmax() - supermodule->DnSpace();
00196      Float_t radout = 0.5 * (supermodule->Xmax() - supermodule->Xmin());
00197      Float_t radin = radout * (1. - 1.e-8);
00198 //gmipgon->DefineSection(0,zmin, 0., radout);
00199 //gmipgon->DefineSection(1,zmax, 0., radout);
00200      pgon->DefineSection(0,zmin, radin, radout);
00201      pgon->DefineSection(1,zmax, radin, radout);
00202      Float_t x0 = supermodule->SupX0();
00203      Float_t y0 = supermodule->SupY0();
00204      Nodesup = new TNode(csnam,csnam,(TShape*)pgon,x0,y0,0.,0);
00205      Nodesup->SetLineColor(kColorFLS);
00206 //rwh: make old "outline" invisible
00207      Nodesup->SetVisibility(0);
00208 
00209      Float_t dz = 0.5*(zmax - zmin);
00210      Float_t z0 = 0.5*(zmax + zmin);
00211 
00212      MINFOutline::EDetector        nearfar = MINFOutline::kFar;
00213      if (geommisc->NearFar() == 0) nearfar = MINFOutline::kCalib;
00214      if (geommisc->NearFar() <  0) nearfar = MINFOutline::kNear;
00215 
00216      Float_t x0outline;
00217 
00218 // outline "partial" active -- only first SM of near detector
00219      if (nearfar == MINFOutline::kNear && isupmdl == 0) {
00220         snam = opaname; snam.Append(cs);
00221         csnam = (Char_t*) snam.Data();
00222         outline = new MINFOutline(csnam, csnam, "void", nearfar,
00223                                   MINFOutline::kPartialActive, dz, 1.);
00224         x0outline = x0 + outline->GetGlobalXOffset();
00225         Nodesup = new TNode(csnam,csnam,csnam,x0outline,y0,z0);
00226         Nodesup->SetLineColor(kGreen);
00227         Nodesup->SetVisibility(1);
00228      }
00229 
00230 // special case for CalDet supermodules 5th+ (isupmdl>=5) which are placed
00231 // in odd location and orientation
00232 
00233      if (nearfar == MINFOutline::kCalib && isupmdl >= 5) {
00234         snam = os0name; snam.Append(cs);
00235         csnam = (Char_t*) snam.Data();
00236         Float_t dx = 0.5*(supermodule->Xmax() - supermodule->Xmin());
00237         Float_t dy = 0.5*(supermodule->Ymax() - supermodule->Ymin());
00238         Float_t dz = 0.5*(supermodule->Zmax() - supermodule->Zmin());
00239         Float_t x0 = 0.5*(supermodule->Xmax() + supermodule->Xmin());
00240         Float_t y0 = 0.5*(supermodule->Ymax() + supermodule->Ymin());
00241         Float_t z0 = 0.5*(supermodule->Zmax() + supermodule->Zmin());
00242         TBRIK *caldet_special = 0;
00243                caldet_special = new TBRIK(csnam,csnam,"void",dx,dy,dz);
00244         Nodesup = new TNode(csnam,csnam,csnam,x0,y0,z0);
00245         Nodesup->SetLineColor(kGreen);
00246         Nodesup->SetVisibility(1);
00247         // skip the rest of the shapes for this "supermodule"
00248         // move on to next "supermodule"
00249         continue; 
00250      }
00251 
00252 // outline "full" active
00253      snam = ofaname; snam.Append(cs);
00254      csnam = (Char_t*) snam.Data();
00255      outline = new MINFOutline(csnam, csnam, "void", nearfar,
00256                                      MINFOutline::kFullActive, dz, 1.);
00257      x0outline = x0 + outline->GetGlobalXOffset();
00258      Nodesup = new TNode(csnam,csnam,csnam,x0outline,y0,z0);
00259      Nodesup->SetLineColor(kGreen);
00260      Nodesup->SetVisibility(1);
00261 
00262 // outline without ears
00263      snam = os0name; snam.Append(cs);
00264      csnam = (Char_t*) snam.Data();
00265      outline = new MINFOutline(csnam, csnam, "void", nearfar,
00266                                     MINFOutline::kSteelNoEars, dz, 1.);
00267      x0outline = x0 + outline->GetGlobalXOffset();
00268      Nodesup = new TNode(csnam,csnam,csnam,x0outline,y0,z0);
00269      Nodesup->SetLineColor(kColorFLS);
00270      Nodesup->SetVisibility(0);
00271 
00272      // outline with ears
00273      snam = os1name; snam.Append(cs);
00274      csnam = (Char_t*) snam.Data();
00275      outline = new MINFOutline(csnam, csnam, "void", nearfar,
00276                                       MINFOutline::kSteelEars, dz, 1.);
00277      x0outline = x0 + outline->GetGlobalXOffset();
00278      Nodesup = new TNode(csnam,csnam,csnam,x0outline,y0,z0);
00279      Nodesup->SetLineColor(kColorFLS);
00280      Nodesup->SetVisibility(1);
00281    }
00282 
00283 //gmiTString coilname("COIL");
00284 //gmiTString cnam;
00285 //gmiChar_t* clnam = 0;
00286 //gmiChar_t cl[40];
00287 //gmiTTUBE *tube = 0;
00288 //gmiTNode *Nodecoil = 0;
00289 //gmi
00290 // Create coiltube inside each supermodule.
00291 //gmifor (Int_t icoiltub=0; icoiltub<rgeo->n_coiltubes(); icoiltub++) {
00292 //gmisprintf(cl,"%d", icoiltub);
00293 //gmicnam = coilname;  cnam.Append(cl);
00294 //gmicoiltube = (REROOT_CoilTube *) coiltubes->At(icoiltub);
00295 //gmiclnam = (Char_t*) cnam.Data();
00296 //gmiFloat_t zmin = coiltube->Zmin();
00297 //gmiFloat_t zmax = coiltube->Zmax();
00298 //gmiFloat_t dz = 0.5 * (zmax - zmin);
00299 //gmiFloat_t radout = coiltube->OuterRadius();
00300 //gmiFloat_t radin  = coiltube->InnerRadius();
00301 //gmitube = new TTUBE(clnam,clnam,"void",radin,radout,dz);
00302 //gmitube->SetVisibility(vissupermodules);
00303 //gmiFloat_t x0 = coiltube->XYZ1()[0];
00304 //gmiFloat_t y0 = coiltube->XYZ1()[1];
00305 //gmiNodecoil = new TNode(clnam,clnam,(TShape *) tube,x0,y0,0.,0);
00306 //gmiNodecoil->SetLineColor(kColorFLS);
00307 //gmi}
00308 
00309    Int_t savsup = -1;
00310    TString aplname("APLN");
00311    TString anam;
00312    Char_t* canam = 0;
00313    TNode *Nodeapl = 0;
00314    Char_t rnam[5] = "rot ";
00315 
00316 Int_t ljspecprint = -5;
00317 
00318 // Create passive/active pairs inside appropriate supermodules.
00319    for (Int_t ipl=0; ipl<rgeo->n_planeposs(); ipl++) {
00320      sprintf(cs,"%d",ipl);
00321      anam = aplname;  anam.Append(cs);
00322 //gmi if (ipl<5) printf("ipl,cs,anam = %d %s %s\n",ipl,cs,anam.Data());
00323      planepos = (REROOT_PlanePos *) planeposs->At(ipl);
00324      Int_t idx = planepos->ActvSpec();
00325      planespec = (REROOT_PlaneSpec *) planespecs->At(idx);
00326 if (ljspecprint) {
00327 ljspecprint += 1;
00328 //gmi printf("planespec index = %d\n",idx);
00329 //gmi printf("planespec->PlnName() = %s\n",planespec->PlnName());
00330 //gmi printf("planespec->TMedium() = %s\n",planespec->TMedium());
00331 //gmi printf("planespec->DigiType() = %d\n",planespec->DigiType());
00332 //gmi printf("planespec->NExtru() = %d\n",planespec->NExtru());
00333 //gmi printf("planespec->NCell() = %d\n",planespec->NCell());
00334 //gmi printf("planespec->CellWidth() = %f\n",planespec->CellWidth());
00335 //gmi printf("planespec->CellThick() = %f\n",planespec->CellThick());
00336 //gmi printf("planepos->Rotm() = %s\n",planepos->Rotm());
00337 }
00338      Int_t isupmdl = planepos->ISuper();
00339      supermodule = (REROOT_SuperModule *) supermodules->At(isupmdl);
00340      canam = (Char_t*) anam.Data();
00341      pgon = new TPGON(canam,canam,"void",-22.5,360.,8,2);
00342      pgon->SetVisibility(vismodules);
00343      Float_t zmin = planepos->ZFrntActv();
00344      Float_t zmax = zmin + planespec->Thickness();
00345 //rwhFloat_t radout = 0.5411961*planespec->Width(); // 1./(2.*cos(22.5))
00346      Float_t radout = 0.5*planespec->Width();
00347      Float_t radin = radout * (1. - 1.e-8);
00348      pgon->DefineSection(0,zmin, radin, radout);
00349      pgon->DefineSection(1,zmax, radin, radout);
00350      if (isupmdl!=savsup) {   // Nest this plane in correct supermodule.
00351 //gmi printf("moving to planes in supnum = %d, plane = %d\n",
00352 //gmi                                                      isupmdl,ipl);
00353        savsup = isupmdl;
00354        sprintf(cs,"%d",isupmdl);
00355        snam = supname;  snam.Append(cs);
00356        csnam = (Char_t*) snam.Data();
00357        Nodesup = Nodehall->GetNode((Text_t*)csnam);
00358        Nodesup->cd();
00359      }
00360      Float_t x0 = planepos->XYActv()[0];
00361      Float_t y0 = planepos->XYActv()[1];
00362      rnam[3] = planepos->Rotm()[0];
00363      TRotMatrix *rmtx = fGeometry->GetRotMatrix(rnam);
00364      Nodeapl = new TNode(canam,canam,(TShape *) pgon,x0,y0,0.,rmtx);
00365      Nodeapl->SetLineColor(kColorFLS);
00366      nodes->Add(Nodeapl);
00367    }
00368    return;
00369 }

TGeometry* MINFDetGeom::GetGeometry (  )  [inline]

Definition at line 31 of file MINFDetGeom.h.

References fGeometry.

Referenced by MINFast::BuildDetectorGeometry().

00031 {return fGeometry;}


Member Data Documentation

TGeometry* MINFDetGeom::fGeometry [private]

Definition at line 22 of file MINFDetGeom.h.

Referenced by BuildDetectorGeometry(), GetGeometry(), and ~MINFDetGeom().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1