Attachment 'PDGB.cc'

Download

   1 #include <iostream>
   2 #include <assert.h>
   3 #include <typeinfo>
   4 #include <math.h>
   5 
   6 #include "myPhys_Geom_Database.h"
   7 
   8 #include <marlin/Global.h>
   9 #include <gear/GEAR.h>
  10 #include <gear/TPCParameters.h>
  11 #include <gearimpl/TPCParametersImpl.h>
  12 #include <gearimpl/FixedPadSizeDiskLayout.h>
  13 #include <gear/CalorimeterParameters.h>
  14 #include <gear/LayerLayout.h>
  15 
  16 #include <Elements.h>
  17 
  18 using namespace std;
  19 using namespace marlin;
  20 
  21 /**  
  22  *    Physical Geometrical database will be used in the reconstruction
  23  *    procedure to get fast access to values/variables dependent on
  24  *    the particular and different calorimeter zones with different
  25  *    physical properties and geometrical relations between cells. 
  26  *
  27  *    Such a database can be created after reading the geometry 
  28  *    record in LCIO if it will be presented in or another kind of 
  29  *           outstanding geometrical database like GEAR.
  30  *
  31  *    Another way is to create such database during simulation
  32  *      step as an obligatory for any simulation program, 
  33  *             during the detector geometry creation.
  34  *       That is much easy way to form such a database.
  35  *            and put it as member (or class) of LCIO.
  36  *
  37  *
  38  *
  39  *
  40  *       myPGdb::ZONE myPGdb::get_zone(Point3D &p)
  41  *
  42  *     function returns zone "number" (enum type)
  43  *          for any arbitrary 3-d point
  44  *
  45  *
  46  *    @author V. L. Morgunov, A. Zhelezov  (DESY/ITEP)
  47  * 
  48  **/
  49 
  50 myPGdb myPGDB;
  51 
  52 myPGDBP amyPGDB;
  53 
  54 //============================================================================
  55 myPGDBP::myPGDBP() : Processor("myPGDBP") {
  56 //============================================================================
  57   _description = "Physical and Geometrical Database (for Boojum at least)" ;
  58 }
  59 //============================================================================
  60 void myPGDBP::init() {             //the begin of the job
  61 //============================================================================
  62   myPGDB.init();
  63 }
  64 //============================================================================
  65 void myPGdb::Zone::_init_tpc() {
  66 //============================================================================
  67   const gear::TPCParameters  &pTPC      = Global::GEAR->getTPCParameters();
  68   const gear::PadRowLayout2D &padLayout = pTPC.getPadLayout();
  69   const gear::DoubleVec      &planeExt  = padLayout.getPlaneExtent();
  70   no=TPC;
  71   shape = CYLINDER; 
  72   symmetry  = 0;
  73   phi0      = 0.;
  74   r_inner   = planeExt[0]; 
  75   r_outer   = planeExt[1]; 
  76   z_inner   = 0.0; 
  77   z_outer   = pTPC.getMaxDriftLength(); 
  78   n_sampl   = padLayout.getNRows (); 
  79   sampling  = (r_outer- r_inner)/n_sampl; 
  80   min_lay   = 0; 
  81   max_lay   = n_sampl-1; 
  82   absorber  = 0.0; 
  83   abs_mat   = 0; 
  84   detector  = sampling; 
  85   det_mat   = 18;       //  Argon has been taken for the moment
  86   cell_size = sampling; // formaly 
  87 //---------------------------------
  88   mip_vis   = 30.0e-9 ; // Should be in GEAR
  89   e_coeff   = 1.0     ; // Should be in GEAR
  90 //---------------------------------
  91 }
  92 //============================================================================
  93 void myPGdb::Zone::_init_endpl1(){
  94 //============================================================================
  95   const gear::TPCParameters  &pTPC      = Global::GEAR->getTPCParameters();
  96   const gear::PadRowLayout2D &padLayout = pTPC.getPadLayout();
  97   const gear::DoubleVec      &planeExt  = padLayout.getPlaneExtent();
  98   no        = ENDPLATE1;
  99   shape     = CYLINDER;
 100   symmetry  = 0;
 101   phi0      = 0.;
 102   r_inner   = planeExt[0];
 103   r_outer   = planeExt[1];
 104   z_inner   =  pTPC.getMaxDriftLength();
 105   z_outer   =  pTPC.getMaxDriftLength()+160.0;
 106  //-----------------added KP
 107   Zeff      =    21.01;
 108   Aeff      =    45.09;
 109   Rhoeff    =   0.2643;
 110   Ieff      = 145.13e-9;
 111   Rmeff     = 504.54;// mm
 112   x0eff     = 419.29 ;  // mm
 113   Eceff     = 17.628 ; // MeV  
 114   _init_all_common();
 115 }
 116 //============================================================================
 117 void myPGdb::Zone::_init_endpl2(){
 118 //============================================================================
 119   const gear::TPCParameters  &pTPC      = Global::GEAR->getTPCParameters();
 120   const gear::PadRowLayout2D &padLayout = pTPC.getPadLayout();
 121   const gear::DoubleVec      &planeExt  = padLayout.getPlaneExtent();
 122   no        = ENDPLATE2;
 123   shape     = CYLINDER;
 124   symmetry  = 0;
 125   phi0      = 0.;
 126   r_inner   = planeExt[0];
 127   r_outer   = planeExt[1];
 128   z_inner   = -pTPC.getMaxDriftLength();
 129   z_outer   = -(pTPC.getMaxDriftLength()+160.0);
 130  //-----------------dodao KP
 131   Zeff      =    21.01;
 132   Aeff      =    45.09;
 133   Rhoeff    =   0.2643;
 134   Ieff      = 145.13e-9;
 135   Rmeff     = 504.54;// mm
 136   x0eff     = 419.29 ;  // mm
 137   Eceff     = 17.628 ; // MeV
 138   _init_all_common();
 139 }
 140 //============================================================================
 141 static int _ecal_last_layer(const gear::CalorimeterParameters& pCAL){
 142 //============================================================================
 143   int i;
 144   const gear::LayerLayout &lb = pCAL.getLayerLayout() ;
 145   int nLayerb = lb.getNLayers() ;
 146   double tlb  = lb.getThickness(0);
 147   double dlb  = lb.getAbsorberThickness(0);
 148   for( i=1 ; i < nLayerb ; i++ )
 149     if(fabs(tlb-lb.getThickness(i))>0.0000001 ||
 150        fabs(dlb-lb.getAbsorberThickness(i))>0.0000001)
 151       return i;
 152   cerr<<"ERROR: Can't get boundary of ECAL"<<endl;
 153   std::cout<<"Last ECAL layer "<<i<<std::endl;
 154   return i;
 155 }
 156 //============================================================================
 157 void myPGdb::Zone::_init_ecal_bar_common(){
 158 //============================================================================
 159   const gear::CalorimeterParameters& pECAL_B = 
 160     Global::GEAR->getEcalBarrelParameters();
 161   shape    = POLYGON;
 162   symmetry = pECAL_B.getSymmetryOrder();
 163   phi0     = pECAL_B.getPhi0();
 164   z_inner  = 0.0;
 165   z_outer  = pECAL_B.getExtent()[3];
 166   abs_mat  = 74;  // Tungsten Should be in GEAR
 167   detector = 0.5; // No chance to extract  Should be in GEAR
 168   det_mat  = 14;  // Silicon Should be in GEAR
 169 }
 170 //============================================================================
 171 void myPGdb::Zone::_init_ecal1_bar(int last_layer){
 172 //============================================================================
 173   const gear::CalorimeterParameters& pECAL_B = 
 174     Global::GEAR->getEcalBarrelParameters();
 175   const gear::LayerLayout &lb = pECAL_B.getLayerLayout() ;
 176   no        = ECAL1_BAR;
 177   r_inner   = lb.getDistance(0);
 178   r_outer   = lb.getDistance(last_layer); 
 179   n_sampl   = last_layer; 
 180   sampling  = lb.getThickness(0); 
 181   min_lay   = 0;
 182   max_lay   = last_layer-1; 
 183   absorber  = lb.getAbsorberThickness(0); 
 184   cell_size = lb.getCellSize0(0); // should be 10 mm in GEAR
 185 //---------------------------------
 186   mip_vis   = 170.0e-6 ;  // Should be in GEAR
 187   //  e_coeff   = 33.02346 ;  // for model LDC00
 188   // e_coeff   = 46.7703 ;  // for model LDC01  Should be in GEAR
 189   e_coeff   = 41.97 ;  // for model LDCPrime_02Sc
 190   //-----------------added KP
 191   Zeff      =   67.41;
 192   Aeff      =  166.868;
 193   Rhoeff    =    7.75;
 194   Ieff      =  706.67e-9;
 195   Rmeff     =   22.0833;   // mm
 196   x0eff     =    9.4587 ;  // mm
 197   Eceff     =    9.0804  ; // MeV
 198   eprime    =    0.72002;
 199 
 200   _init_ecal_bar_common();
 201 }
 202 //============================================================================
 203 void myPGdb::Zone::_init_ecal2_bar(int last_ecal1_layer){
 204 //============================================================================
 205   const gear::CalorimeterParameters& pECAL_B = 
 206     Global::GEAR->getEcalBarrelParameters();
 207   const gear::LayerLayout &lb = pECAL_B.getLayerLayout() ;
 208   int nLayerb = lb.getNLayers() ;
 209   no        = ECAL2_BAR;
 210   r_inner   = lb.getDistance(last_ecal1_layer); 
 211   r_outer   = lb.getDistance(nLayerb-1)+lb.getThickness(nLayerb-1); 
 212   n_sampl   = nLayerb-last_ecal1_layer; 
 213   sampling  = lb.getThickness(nLayerb-1); 
 214   min_lay   = last_ecal1_layer;
 215   max_lay   = nLayerb-1; 
 216   absorber  = lb.getAbsorberThickness(nLayerb-1); 
 217   cell_size = lb.getCellSize0(nLayerb-1); // should be 10 mm
 218 //---------------------------------
 219   mip_vis   = 170.0e-6 ;  // Should be in GEAR
 220   //e_coeff   = 93.56822 ;  //for model LDC00
 221   //e_coeff   =  86.3749 ;  //for model LDC01
 222   e_coeff   =  83.93 ;  //for model LDCPrime_02Sc
 223  //-----------------added KP
 224   Zeff      =   71.635;
 225   Aeff      =  177.614;
 226   Rhoeff    =   12.577;
 227   Ieff      =  729.09e-9;  //GeV
 228   Rmeff     =   13.8418;   // mm
 229   x0eff     =    8.135953; // mm
 230   Eceff     =    8.4709;   // MeV  dou
 231   eprime    =    0.709672;
 232 
 233   _init_ecal_bar_common();
 234 }
 235 //============================================================================
 236 void myPGdb::Zone::_init_ecal_cap_common(){
 237 //============================================================================
 238   const gear::CalorimeterParameters& pECAL_E = 
 239     Global::GEAR->getEcalEndcapParameters();
 240   shape     = POLYGON;
 241   symmetry  = pECAL_E.getSymmetryOrder();
 242   phi0      = pECAL_E.getPhi0();
 243   r_inner   = pECAL_E.getExtent()[0]; 
 244   r_outer   = pECAL_E.getExtent()[1]; 
 245   abs_mat   = 74;  // Tungsten
 246   detector  = 0.5; // No chance to extract 
 247   det_mat   = 14;  // Silicon
 248 }
 249 //============================================================================
 250 void myPGdb::Zone::_init_ecal1_cap(int last_layer){
 251 //============================================================================
 252   const gear::CalorimeterParameters& pECAL_E = 
 253     Global::GEAR->getEcalEndcapParameters();
 254   const gear::LayerLayout &le = pECAL_E.getLayerLayout() ;
 255   no        = ECAL1_CAP;
 256   z_inner   = le.getDistance(0);; 
 257   z_outer   = le.getDistance(last_layer); 
 258   n_sampl   = last_layer; 
 259   sampling  = le.getThickness(0); 
 260   min_lay   = 0;
 261   max_lay   = last_layer-1; 
 262   absorber  = le.getAbsorberThickness(0); 
 263   cell_size = le.getCellSize0(0); // should be 10 mm
 264 //---------------------------------
 265   mip_vis   = 170.0e-6 ;  // Should be in GEAR
 266   //e_coeff   = 33.02346 ;  // for model LDC00
 267   //e_coeff   = 46.7703 ;  // for model LDC01  Should be in parameters
 268   e_coeff   = 41.97 ;  // for model LDCPrime_02Sc
 269   //-----------------added KP
 270   Zeff      =   67.41;
 271   Aeff      =  166.868;
 272   Rhoeff    =    7.75;
 273   Ieff      =  706.67e-9;
 274   Rmeff     =   22.0833; // mm
 275   x0eff     =    9.4587; // mm
 276   Eceff     =    9.0804; // MeV
 277   eprime    =    0.72002;
 278 
 279   _init_ecal_cap_common();
 280 }
 281 //============================================================================
 282 void myPGdb::Zone::_init_ecal2_cap(int last_ecal1_layer){
 283 //============================================================================
 284   const gear::CalorimeterParameters& pECAL_E = 
 285     Global::GEAR->getEcalEndcapParameters();
 286   const gear::LayerLayout &le = pECAL_E.getLayerLayout() ;
 287   int nLayere = le.getNLayers() ;
 288   no        = ECAL2_CAP;
 289   z_inner   = le.getDistance(last_ecal1_layer); 
 290   z_outer   = le.getDistance(nLayere-1)+le.getThickness(nLayere-1);; 
 291   n_sampl   = nLayere-last_ecal1_layer; 
 292   sampling  = le.getThickness(nLayere-1); 
 293   min_lay   = last_ecal1_layer;
 294   max_lay   = nLayere-1; 
 295   absorber  = le.getAbsorberThickness(nLayere-1); 
 296   cell_size = le.getCellSize0(nLayere-1); // should be 10 mm
 297 //---------------------------------
 298   mip_vis   = 170.0e-6 ;  // Should be in GEAR
 299   //  e_coeff   = 93.56822 ;  //for model LDC00
 300 //    e_coeff   =  86.3749 ;  //for model LDC01   
 301   e_coeff   = 83.93 ;  //for model LDCPrime_02Sc
 302  //-----------------added KP
 303   Zeff      =   71.635;
 304   Aeff      =  177.614;
 305   Rhoeff    =   12.577;
 306   Ieff      =729.09e-9;
 307   Rmeff     = 13.8418;// mm
 308   x0eff     = 8.135953 ;  // mm
 309   Eceff     = 8.4709  ; // MeV
 310   eprime    = 0.709672;
 311 
 312   _init_ecal_cap_common();
 313 }
 314 //============================================================================
 315 void myPGdb::Zone::_init_hcal(myPGdb::ZONE zone){
 316 //============================================================================
 317   const gear::CalorimeterParameters *pHCAL;
 318   if(zone==HCAL_BAR)
 319    pHCAL = & Global::GEAR->getHcalBarrelParameters();
 320   else
 321    pHCAL = & Global::GEAR->getHcalEndcapParameters();
 322   const gear::LayerLayout &lhb = pHCAL->getLayerLayout() ;
 323   no        = zone;
 324   shape     = POLYGON;
 325   symmetry  = pHCAL->getSymmetryOrder();
 326   phi0      = pHCAL->getPhi0();
 327   r_inner   = pHCAL->getExtent()[0]; 
 328   r_outer   = pHCAL->getExtent()[1]; 
 329   z_inner   = pHCAL->getExtent()[2]; 
 330   z_outer   = pHCAL->getExtent()[3]; 
 331   n_sampl   = lhb.getNLayers() ;
 332   sampling  = lhb.getThickness(0); 
 333   min_lay   = 0;
 334   max_lay   = n_sampl-1; 
 335   absorber  = lhb.getAbsorberThickness(0); 
 336   abs_mat   = 26;  // atomic number = Iron
 337   detector  = 5.0; // Thickness [mm] -- No chance to extract 
 338   det_mat   = 6;   //  atomic number = Carbon
 339   cell_size = lhb.getCellSize0(0); // should be 30 mm
 340   //---------------------------------
 341   mip_vis   = 875.0e-6 ;   // Should be in GEAR
 342   //  e_coeff   = 21.196262;   // for model LDC00
 343   //    e_coeff   = 22.01925 ;  //for model LDC01
 344   e_coeff   = 34.5;   // for model LDCPrime_02Sc
 345  //-----------------added KP
 346   Zeff      =   25.318;
 347   Aeff      =   54.354;
 348   Rhoeff    =    6.134;
 349   Ieff      = 283.34e-9;
 350 }
 351 //============================================================================
 352 void myPGdb::Zone::_init_all_common(){
 353 //============================================================================
 354 //   Absolutly voluntary -- never used
 355   n_sampl  = 1; // Number of layers in calorimeter or TPC rings
 356   sampling = 1; // Sampling layer thickness
 357   min_lay  = 1; // Minimal Layer number
 358   max_lay  = 1; // Maximal Layer number
 359   absorber = 1; // Absorber layer thickness
 360   abs_mat  = 1; // Absorber material
 361   detector = 1; // Detector layer thickness
 362   det_mat  = 1; // Detector material
 363   cell_size= 1; // Cell size in X and Y (square shape)
 364   mip_vis  = 1;
 365   e_coeff  = 1;
 366 }
 367 //============================================================================
 368 void myPGdb::Zone::_init_vtx(){
 369 //============================================================================
 370   no        = VTX;
 371   shape     = CYLINDER;
 372   symmetry  = 0;
 373   phi0      = 0.;
 374   r_inner   = 0.; 
 375   r_outer   = myPGDB[ECAL1_CAP].r_inner; 
 376   z_inner   = 0; 
 377   z_outer   = myPGDB[HCAL_CAP].z_outer; 
 378   _init_all_common();
 379 }
 380 //============================================================================
 381 void myPGdb::Zone::_init_coil(){
 382 //============================================================================
 383   no        = COIL;
 384   shape     = CYLINDER;
 385   symmetry  = 0;
 386   phi0      = 0.;
 387   r_inner   = myPGDB[HCAL_BAR].r_outer/cos(M_PI/myPGDB[HCAL_BAR].symmetry); 
 388   r_outer   = r_inner+850;  // Should be in GEAR
 389   z_inner   = 0;
 390   z_outer   = myPGDB[HCAL_CAP].z_outer; 
 391  //-----------------added KP
 392   Zeff      =  13.0;
 393   Aeff      =  27.0;
 394   Rhoeff    =   2.7;
 395   Ieff      = 166.0e-9;
 396 
 397   _init_all_common();
 398 }
 399 //============================================================================
 400 void myPGdb::Zone::_init_detector(){
 401 //============================================================================
 402   no        = DETECTOR;
 403   shape     = CYLINDER;
 404   symmetry  = 0;
 405   phi0      = 0.;
 406   r_inner   = 0.; 
 407   r_outer   = myPGDB[COIL].r_outer; 
 408   z_inner   = 0; 
 409   z_outer   = myPGDB[HCAL_CAP].z_outer; 
 410   x0eff     = 100000.0 ;  // mm
 411   _init_all_common();
 412 }
 413 //============================================================================
 414 void myPGdb::Zone::_init_world(){
 415 //============================================================================
 416   no        = WORLD;
 417   shape     = CYLINDER;
 418   symmetry  = 0;
 419   phi0      = 0.;
 420   r_inner   = myPGDB[COIL].r_outer; 
 421   r_outer   = 1.e10; 
 422   z_inner   = myPGDB[HCAL_CAP].z_outer; 
 423   z_outer   = 1.e10; 
 424   x0eff     = 100000.0 ;  // mm
 425   _init_all_common();
 426 }
 427 //============================================================================
 428 void myPGdb::Zone::_init_final() {
 429 //============================================================================
 430   //      Predicted distance to neighbor for particular zone
 431   //               1.41 is ~ sqrt(2)
 432   r_neighbor = 1.4*((cell_size < sampling) ? sampling : cell_size/2.);
 433   r_neighbor = r_neighbor * r_neighbor;
 434 
 435   //          Volume including absorber
 436   cell_vol = cell_size*cell_size*sampling;  
 437 
 438 //  Predicted cutoffs  for particular zone around MIP
 439 //             Should be in GEAR
 440   //   0.5 -- no MIP signal less than this energy
 441   cut_noise = 0.3*mip_vis;   // in units of RAW data 
 442 
 443   //   MIP peak is within 0.5 MIP and 2.0 MIP
 444   //    2.0 -- choosen by eyes see page 267 old log book
 445   cut_mip  = 2.0*mip_vis;   // in units of RAW data 
 446 
 447   //      3.7 -- choosen by eyes see page 267 in old log book
 448   cut_hadr = 3.7*mip_vis;   // in units of RAW data 
 449 
 450   //        Just only green and red hits -- no blue hits at all
 451   //      cut_hadr = 2.0*mip_vis;   // in units of RAW data 
 452 
 453   // MIP most probable  physical energy, i.e. including energy lost in absorber
 454   //       Predicted MIP amplitude and density
 455   mip_whole = mip_vis*e_coeff;    // in [GeV]
 456   // MIP energy density in whole cell volume
 457   mip_dens = mip_whole/cell_vol; // in [GeV]/[mm]^3
 458 
 459   if(shape==POLYGON && symmetry){
 460     if(symmetry == 2)  
 461 // because GEAR think that endcap has a symmetry = 2 instead of 8
 462       symmetry = 8;
 463     a0 = 2*M_PI/symmetry;
 464     r_max=r_outer/cos(a0/2.);
 465     r_min=r_inner/cos(a0/2.);
 466   } else {
 467     a0 = 2.*M_PI/8;  // default symmetry
 468     r_max=r_outer;
 469     r_min=r_inner;
 470   }
 471 }
 472 //============================================================================
 473 void myPGdb::init(){
 474 //============================================================================
 475   B_Field  = Global::GEAR->getTPCParameters().getDoubleVal("BField");
 476   
 477   // Sequence is important !!!
 478   zone[TPC]._init_tpc();
 479   zone[ENDPLATE1]._init_endpl1();
 480   zone[ENDPLATE2]._init_endpl2();
 481 
 482   int last_layer=_ecal_last_layer(Global::GEAR->getEcalBarrelParameters());
 483   zone[ECAL1_BAR]._init_ecal1_bar(last_layer);
 484   zone[ECAL2_BAR]._init_ecal2_bar(last_layer);
 485 
 486   last_layer=_ecal_last_layer(Global::GEAR->getEcalEndcapParameters());
 487   zone[ECAL1_CAP]._init_ecal1_cap(last_layer);
 488   zone[ECAL2_CAP]._init_ecal2_cap(last_layer);
 489 
 490   zone[HCAL_BAR]._init_hcal(HCAL_BAR);
 491   zone[HCAL_CAP]._init_hcal(HCAL_CAP);
 492 
 493   zone[VTX]._init_vtx();
 494   zone[COIL]._init_coil();
 495   zone[DETECTOR]._init_detector();
 496   zone[WORLD]._init_world();
 497 
 498   for( int k=0 ; k < ZONE_COUNT ; k++ )
 499     zone[k]._init_final();
 500 
 501   cout << "    =================================================================" 
 502        << endl ;
 503   cout << "          Phys_Geom_Database created and initialized  "
 504        <<" with "<< ZONE_COUNT <<" zones "<< endl;
 505   cout << "    =================================================================" 
 506        << endl ;
 507 }   // End myPGdb_init() 
 508 //============================================================================
 509 //      Simple Detector Geometry Zone Finder
 510 //============================================================================
 511 bool myPGdb::Zone::in_polygon(double r,Point3D &p){
 512 //============================================================================
 513   double ph = atan2(p.y,p.x) + phi0;
 514   if (ph < 0.0) ph = 2.*M_PI + ph;
 515   return (p.rz > r/cos(ph-(trunc((ph+a0/2.)/a0)*a0) ))?false:true;
 516 }
 517 //============================================================================
 518 bool myPGdb::Zone::inside(Point3D &p){
 519 //============================================================================
 520   if(p.z < z_inner || p.z > z_outer)
 521     return false;
 522   if(p.rz > r_max)
 523     return false;
 524   if(p.rz > r_outer)
 525     if(!in_polygon(r_outer,p))
 526       return false;
 527   if(p.rz > r_min)
 528     return true;
 529   if(p.rz > r_inner)
 530     return !in_polygon(r_inner,p);
 531   return false;
 532 }
 533 //============================================================================
 534 myPGdb::ZONE myPGdb::get_zone(Point3D &p){
 535 //============================================================================
 536 // As well as number of zones is small we can go along all of them
 537 //           can be optimized  -- latter
 538 //  DETECTOR contains of all of them; WORLD is outside region of DETECTOR
 539 //============================================================================
 540   Point3D ap(fabs(p.x),fabs(p.y),fabs(p.z));
 541   if( p.x==0.0 && p.y==0.0 && p.z==0.0)// ???????
 542     return VTX;
 543   if(!zone[DETECTOR].inside(ap))
 544     return WORLD;
 545   for(unsigned i=0;i<DETECTOR;i++)
 546     if(zone[i].inside(ap))
 547       return (ZONE)i;
 548   return DETECTOR;
 549 }
 550 //============================================================================
 551 const char *myPGdb::Zone::get_name() const {
 552 //============================================================================
 553 // These names should be the same as in ZONE typedef
 554   static const char *names[]={ 
 555     "VTX", "TPC" , "ECAL1_BAR", "ECAL2_BAR", "ECAL1_CAP", "ECAL2_CAP",
 556     "HCAL_BAR", "HCAL_CAP", "COIL", "DETECTOR", "WORLD"
 557   };
 558   if(no>=sizeof(names)/sizeof(names[0]))
 559     return "Unknown";
 560   return names[no];
 561 }
 562 //============================================================================
 563 ostream &operator<<(ostream &o,const myPGdb &d){
 564 //============================================================================
 565   o<<"==================================================================="<< endl;
 566   o<<" ================ Physical Geometrical Database  ================="<< endl;  
 567   for (unsigned i = 0; i < myPGdb::ZONE_COUNT; i++){
 568     const myPGdb::Zone &z=d[static_cast<myPGdb::ZONE>(i)];
 569     o<<"==================================================================="<< endl;
 570     o<<" \x1b[30;46m                 Zone   "<< i << "  " << z.get_name() 
 571      <<"                        \x1b[0m\x1b[30m"<< endl;
 572     o<<"-----------------------------------------------------------------------"<< endl;
 573     o<<" R inner    R outer    Z inner   Z outer    Shape    N samples"<< endl;
 574     o<<"   "<<z.r_inner
 575      <<"       "<<z.r_outer
 576      <<"       "<<z.z_inner
 577      <<"       "<<z.z_outer
 578      <<"       "<<z.shape
 579      <<"       "<<z.n_sampl<<endl;
 580     o<<"-----------------------------------------------------------------------"<< endl;
 581     o<<" Min--Max layers,    Thicknesses,         Cell size,        Volume,       R-neib  "<< endl;
 582     o<<"    "<< z.min_lay 
 583      <<"    "<< z.max_lay
 584      <<"       "<< z.sampling         <<" mm, "
 585      <<"  "<< z.detector         <<" mm, "
 586      <<"        "<< z.cell_size        <<" mm, "
 587      <<"      "<< z.cell_vol         <<" mm^3, "
 588      <<"      "<< sqrt(z.r_neighbor)  <<" mm"        <<endl; 
 589     if(i==myPGdb::HCAL_CAP  ||
 590        i==myPGdb::HCAL_BAR  ||  
 591        i==myPGdb::ECAL1_BAR ||  
 592        i==myPGdb::ECAL2_BAR ||  
 593        i==myPGdb::ECAL1_CAP ||  
 594        i==myPGdb::ECAL2_CAP ){
 595       o<<"-----------------------------------------------------------------------"<< endl;
 596       o<<"      MIP visible       Noise cut,          MIP cut,          HADR cut "<< endl
 597        <<"      "<< z.mip_vis*1.e6   <<" [keV], "
 598        <<"      "<< z.cut_noise*1.e6 <<" [keV], "
 599        <<"      "<< z.cut_mip*1.e6   <<" [keV], "
 600        <<"      "<< z.cut_hadr*1.e6  <<" [keV]  " << endl;
 601       o<<"-----------------------------------------------------------------------"<< endl;
 602       o<<"     E_coeff;                      MIP whole [GeV];               MIP density "<< endl
 603        <<"   "<< z.e_coeff   <<" Phys./Vis.[GeV],"  
 604        <<"      "<< z.mip_whole <<" [GeV], "    
 605        <<"      "<< z.mip_dens  <<" [GeV/mm^3]" << endl <<endl;
 606     }
 607   }
 608   o<<"-----------------------------------------------------------------------"<< endl;
 609   return o;
 610 } // ------- end Output stream
 611 
 612 // +++++++++++ End Phys_Geom_Database definition  +++++++++++++++++++++++
 613 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-03-23 09:57:46, 33.4 KB) [[attachment:KIT.cc]]
  • [get | view] (2010-03-23 09:58:09, 4.3 KB) [[attachment:KIT.h]]
  • [get | view] (2010-03-23 10:20:16, 10.0 KB) [[attachment:KITcalibrator.cc]]
  • [get | view] (2010-03-23 12:53:20, 2.9 KB) [[attachment:KITcalibrator.h]]
  • [get | view] (2010-03-23 09:55:11, 66.1 KB) [[attachment:KITutil.cc]]
  • [get | view] (2010-03-23 09:55:36, 8.2 KB) [[attachment:KITutil.h]]
  • [get | view] (2010-03-23 09:53:52, 22.9 KB) [[attachment:PDGB.cc]]
  • [get | view] (2010-03-23 09:54:13, 8.2 KB) [[attachment:PDGB.h]]
  • [get | view] (2010-03-23 10:26:19, 3.2 KB) [[attachment:calibrateKIT.xml]]
  • [get | view] (2010-03-23 09:33:22, 3.9 KB) [[attachment:marlinKIT.xml]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.