Changeset 1010


Ignore:
Timestamp:
Apr 22, 2009, 11:58:58 AM (15 years ago)
Author:
garnier
Message:

update

Location:
trunk/source/geometry/divisions
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/geometry/divisions/History

    r850 r1010  
    1 $Id: History,v 1.28 2008/08/18 16:14:13 gcosmo Exp $
     1$Id: History,v 1.30 2008/12/04 16:01:32 gcosmo Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
     19
     20December, 3rd, 2008     P.Arce  (geomdiv-V09-01-02)
     21- Added division along X of TRD (that results in TRAP's).
     22  Changed G4PVDivision to allow divisions solids to have type different
     23  than mother.
    1924
    2025August, 18th, 2008      T.Nikitina  (geomdiv-V09-01-01)
  • trunk/source/geometry/divisions/include/G4PVDivision.hh

    r850 r1010  
    2525//
    2626//
    27 // $Id: G4PVDivision.hh,v 1.13 2008/08/18 14:06:01 tnikitin Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4PVDivision.hh,v 1.14 2008/12/03 16:41:45 arce Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4PVDivision
     
    145145
    146146    void CheckAndSetParameters( const EAxis pAxis,
     147                                const G4int nDivs,
     148                                const G4double width,
    147149                                const G4double offset,
     150                                      DivisionType divType,
    148151                                const G4LogicalVolume* pMotherLogical );
    149152
  • trunk/source/geometry/divisions/include/G4PVDivisionFactory.hh

    r850 r1010  
    2626//
    2727// $Id: G4PVDivisionFactory.hh,v 1.2 2006/06/29 18:18:09 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030//
  • trunk/source/geometry/divisions/include/G4ParameterisationBox.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationBox.hh,v 1.6 2006/06/29 18:18:11 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationBoxX,
  • trunk/source/geometry/divisions/include/G4ParameterisationCons.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationCons.hh,v 1.6 2006/06/29 18:18:13 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationConsRho,
  • trunk/source/geometry/divisions/include/G4ParameterisationPara.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPara.hh,v 1.7 2006/06/29 18:18:15 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationParaX,
  • trunk/source/geometry/divisions/include/G4ParameterisationPolycone.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPolycone.hh,v 1.7 2006/06/29 18:18:18 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationPolyconeRho,
  • trunk/source/geometry/divisions/include/G4ParameterisationPolyhedra.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPolyhedra.hh,v 1.8 2006/06/29 18:18:20 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationPolyhedraRho,
  • trunk/source/geometry/divisions/include/G4ParameterisationTrd.hh

    r850 r1010  
    2525//
    2626//
    27 // $Id: G4ParameterisationTrd.hh,v 1.7 2006/06/29 18:18:22 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4ParameterisationTrd.hh,v 1.8 2008/12/03 16:48:48 arce Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationTrdX
     
    6161class G4Polycone;
    6262class G4Polyhedra;
     63#include <vector>
    6364
    6465class G4VParameterisationTrd : public G4VDivisionParameterisation
     
    7172 
    7273    virtual ~G4VParameterisationTrd();
     74
     75
     76protected:
     77  G4bool bDivInTrap;
    7378};
    7479
     
    8994                                       G4VPhysicalVolume* physVol) const;
    9095
    91     void ComputeDimensions(G4Trd& trd, const G4int copyNo,
    92                            const G4VPhysicalVolume* pv) const;
     96    virtual void ComputeDimensions(G4Trd& trd, const G4int copyNo,
     97                           const G4VPhysicalVolume* pv) const;
     98
     99    virtual void ComputeDimensions(G4Trap& trd, const G4int copyNo,
     100                           const G4VPhysicalVolume* pv) const;
     101 
     102    virtual G4VSolid*   ComputeSolid(const G4int, G4VPhysicalVolume *);
     103
    93104
    94105  private:  // Dummy declarations to get rid of warnings ...
     
    106117    void ComputeDimensions (G4Para&,const G4int,
    107118                            const G4VPhysicalVolume*) const {}
    108     void ComputeDimensions (G4Trap&,const G4int,
    109                             const G4VPhysicalVolume*) const {}
    110119    void ComputeDimensions (G4Hype&,const G4int,
    111120                            const G4VPhysicalVolume*) const {}
     
    116125    void ComputeDimensions (G4Polyhedra&,const G4int,
    117126                            const G4VPhysicalVolume*) const {}
     127
     128  void ComputeTrapParams();
     129 G4Trap* theTrap;
    118130};
    119131
  • trunk/source/geometry/divisions/include/G4ParameterisationTubs.hh

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationTubs.hh,v 1.6 2006/06/29 18:18:24 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// classes G4ParameterisationTubsRho
  • trunk/source/geometry/divisions/include/G4VDivisionParameterisation.hh

    r850 r1010  
    2626//
    2727// $Id: G4VDivisionParameterisation.hh,v 1.11 2007/05/11 13:26:26 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4VDivisionParameterisation
  • trunk/source/geometry/divisions/include/G4VDivisionParameterisation.icc

    r850 r1010  
    2626//
    2727// $Id: G4VDivisionParameterisation.icc,v 1.4 2006/06/29 18:18:29 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4VDivisionParameterisation Inline Implementation file
  • trunk/source/geometry/divisions/src/G4PVDivision.cc

    r850 r1010  
    2525//
    2626//
    27 // $Id: G4PVDivision.cc,v 1.21 2008/08/18 14:06:13 tnikitin Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4PVDivision.cc,v 1.22 2008/12/03 16:41:45 arce Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4PVDivision Implementation file
     
    7474  SetParameterisation(pMotherLogical, pAxis, nDivs,
    7575                      width, offset, DivNDIVandWIDTH);
    76   CheckAndSetParameters (pAxis,offset, pMotherLogical);
     76  CheckAndSetParameters (pAxis, nDivs, width, offset,
     77                         DivNDIVandWIDTH, pMotherLogical);
    7778}
    7879
     
    104105  SetMotherLogical(pMotherLogical);
    105106  SetParameterisation(pMotherLogical, pAxis, nDivs, 0., offset, DivNDIV);
    106   CheckAndSetParameters (pAxis, offset, pMotherLogical);
     107  CheckAndSetParameters (pAxis, nDivs, 0., offset, DivNDIV, pMotherLogical);
    107108}
    108109
     
    134135  SetMotherLogical(pMotherLogical);
    135136  SetParameterisation(pMotherLogical, pAxis, 0, width, offset, DivWIDTH);
    136   CheckAndSetParameters (pAxis, offset, pMotherLogical);
     137  CheckAndSetParameters (pAxis, 0, width, offset, DivWIDTH, pMotherLogical);
    137138}
    138139
     
    140141void
    141142G4PVDivision::CheckAndSetParameters( const EAxis pAxis,
     143                                     const G4int nDivs,
     144                                     const G4double width,
    142145                                     const G4double offset,
     146                                           DivisionType divType,
    143147                                     const G4LogicalVolume* pMotherLogical )
    144148{
    145   fnReplicas = fparam->GetNoDiv();
    146  
     149  if( divType == DivWIDTH )
     150  {
     151    fnReplicas = fparam->GetNoDiv();
     152  }
     153  else
     154  {
     155    fnReplicas = nDivs;
     156  }
    147157  if (fnReplicas < 1 )
    148158  {
     
    151161  }
    152162
    153   fwidth = fparam->GetWidth();
    154 
     163  if( divType != DivNDIV)
     164  {
     165    fwidth = fparam->GetWidth();
     166  }
     167  else
     168  {
     169    fwidth = width;
     170  }
    155171  if( fwidth < 0 )
    156172  {
     
    202218  G4String msolType = pMotherLogical->GetSolid()->GetEntityType();
    203219  G4String dsolType = GetLogicalVolume()->GetSolid()->GetEntityType();
    204   if( msolType != dsolType )
     220  if( msolType != dsolType && ( msolType != "G4Trd" || dsolType != "G4Trap" ) )
    205221  {
    206222    G4String message =
    207223      "Incorrect solid type for division of volume " + GetName()
    208224    + "    It is: " + msolType + ", while it should be: " + dsolType;
    209     G4Exception("G4VDivisionParameterisation::CheckAndSetParameters()",
     225    G4Exception("G4PVDivision::CheckAndSetParameters()",
    210226                "IllegalConstruct", FatalException, message );
    211227  }
  • trunk/source/geometry/divisions/src/G4PVDivisionFactory.cc

    r850 r1010  
    2626//
    2727// $Id: G4PVDivisionFactory.cc,v 1.2 2006/06/29 18:18:33 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4PVDivisionFactory Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationBox.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationBox.cc,v 1.10 2006/06/29 18:18:35 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationBox Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationCons.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationCons.cc,v 1.9 2006/06/29 18:18:38 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationCons Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationPara.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPara.cc,v 1.11 2006/06/29 18:18:42 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationPara Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationPolycone.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPolycone.cc,v 1.15 2006/06/29 18:18:44 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationPolycone Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationPolyhedra.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationPolyhedra.cc,v 1.16 2007/05/18 07:27:23 gcosmo Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationPolyhedra Implementation file
  • trunk/source/geometry/divisions/src/G4ParameterisationTrd.cc

    r850 r1010  
    2525//
    2626//
    27 // $Id: G4ParameterisationTrd.cc,v 1.14 2006/06/29 18:18:48 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4ParameterisationTrd.cc,v 1.16 2008/12/18 12:57:20 gunter Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationTrd Implementation file
     
    9191  if( divType == DivWIDTH )
    9292  {
    93     fnDiv = CalculateNDiv( 2*msol->GetXHalfLength1(),
     93    fnDiv = CalculateNDiv( msol->GetXHalfLength1()+msol->GetXHalfLength2(),
    9494                           width, offset );
    9595  }
    9696  else if( divType == DivNDIV )
    9797  {
    98     fwidth = CalculateWidth( 2*msol->GetXHalfLength1(), nDiv, offset );
    99   }
    100 
    101 #ifdef G4DIVDEBUG
    102   if( verbose >= -1 )
     98    fwidth = CalculateWidth( msol->GetXHalfLength1()+msol->GetXHalfLength2(), nDiv, offset );
     99  }
     100
     101#ifdef G4DIVDEBUG
     102  if( verbose >= 1 )
    103103  {
    104104    G4cout << " G4ParameterisationTrdX - ## divisions " << fnDiv << " = "
     
    108108  }
    109109#endif
     110
     111  G4double mpDx1 = msol->GetXHalfLength1();
     112  G4double mpDx2 = msol->GetXHalfLength2();
     113  if( std::fabs(mpDx1 - mpDx2) > kCarTolerance )
     114  {
     115    bDivInTrap = true;
     116  }
    110117}
    111118
     
    119126{
    120127  G4Trd* msol = (G4Trd*)(fmotherSolid);
    121   return 2*msol->GetXHalfLength1();
     128  return (msol->GetXHalfLength1()+msol->GetXHalfLength2());
    122129}
    123130
     
    129136{
    130137  G4Trd* msol = (G4Trd*)(fmotherSolid );
    131   G4double mdx = msol->GetXHalfLength1();
     138  G4double mdx = ( msol->GetXHalfLength1() + msol->GetXHalfLength2() ) / 2.;
    132139
    133140  //----- translation
    134141  G4ThreeVector origin(0.,0.,0.);
    135   G4double posi = -mdx + foffset + (copyNo+0.5)*fwidth;
     142  G4double posi;
     143  if( !bDivInTrap ) {
     144    posi = -mdx + foffset + (copyNo+0.5)*fwidth;
     145  } else {
     146    G4double aveHL = (msol->GetXHalfLength1()+msol->GetXHalfLength2())/2.;
     147    posi = - aveHL + foffset + (copyNo+0.5)*aveHL/fnDiv*2;
     148  }
    136149  if( faxis == kXAxis )
    137150  {
     
    146159
    147160#ifdef G4DIVDEBUG
    148   if( verbose >= -2 )
    149   {
    150     G4cout << std::setprecision(8) << " G4ParameterisationTrdX: "
     161  if( verbose >= 2 )
     162  {
     163    G4cout << std::setprecision(8) << " G4ParameterisationTrdX::ComputeTransformation "
    151164           << copyNo << G4endl
    152165           << " Position: " << origin << " - Axis: " << faxis << G4endl;
     
    169182  G4double pDz = msol->GetZHalfLength();
    170183  G4double pDx = fwidth/2.;
    171  
     184  
    172185  trd.SetAllParameters ( pDx, pDx, pDy1, pDy2, pDz );
    173186
    174187#ifdef G4DIVDEBUG
    175   if( verbose >= -2 )
    176   {
    177      G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << G4endl;
     188  if( verbose >= 2 )
     189  {
     190    G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << copyNo << G4endl;
    178191     trd.DumpInfo();
     192  }
     193#endif
     194}
     195
     196G4VSolid* G4ParameterisationTrdX::
     197ComputeSolid(const G4int i, G4VPhysicalVolume * pv)
     198{
     199  if( bDivInTrap )
     200  {
     201    return G4VDivisionParameterisation::ComputeSolid(i, pv);
     202  }
     203  else
     204  {
     205    return theTrap;
     206  }
     207}
     208
     209
     210//--------------------------------------------------------------------------
     211void
     212G4ParameterisationTrdX::
     213ComputeDimensions( G4Trap& trap, const G4int copyNo, const G4VPhysicalVolume* ) const
     214{
     215  G4Trd* msol = (G4Trd*)(fmotherSolid);
     216  G4double pDy1 = msol->GetYHalfLength1();
     217  G4double pDy2 = msol->GetYHalfLength2();
     218  G4double pDz = msol->GetZHalfLength();
     219  G4double pDx1 = msol->GetXHalfLength1()/fnDiv;
     220  G4double pDx2 = msol->GetXHalfLength2()/fnDiv;
     221
     222  G4double cxy1 = -msol->GetXHalfLength1() + foffset + (copyNo+0.5)*pDx1*2;// centre of the side at y=-pDy1
     223  G4double cxy2 = -msol->GetXHalfLength2() + foffset + (copyNo+0.5)*pDx2*2;// centre of the side at y=+pDy1
     224  G4double alp = std::atan( (cxy2-cxy1)/pDz );
     225 
     226  trap.SetAllParameters ( pDz,
     227                          0.,
     228                          0.,
     229                          pDy1,
     230                          pDx1,
     231                          pDx2,
     232                          alp,
     233                          pDy2,
     234                          pDx1,
     235                          pDx2,
     236                          alp);
     237
     238#ifdef G4DIVDEBUG
     239  if( verbose >= 2 )
     240  {
     241    G4cout << " G4ParameterisationTrdX::ComputeDimensions():" << copyNo << G4endl;
     242     trap.DumpInfo();
    179243  }
    180244#endif
     
    190254  G4double mpDx1 = msol->GetXHalfLength1();
    191255  G4double mpDx2 = msol->GetXHalfLength2();
     256  bDivInTrap = false;
    192257
    193258  if( std::fabs(mpDx1 - mpDx2) > kCarTolerance )
    194259  {
     260    return;
     261
    195262    G4cerr << "ERROR - G4ParameterisationTrdX::CheckParametersValidity()"
    196263           << G4endl
     
    206273
    207274//--------------------------------------------------------------------------
     275void G4ParameterisationTrdX::
     276ComputeTrapParams()
     277{
     278}
     279
     280//--------------------------------------------------------------------------
    208281G4ParameterisationTrdY::
    209282G4ParameterisationTrdY( EAxis axis, G4int nDiv,
     
    261334  G4ThreeVector origin(0.,0.,0.);
    262335  G4double posi = -mdy + foffset + (copyNo+0.5)*fwidth;
     336
    263337  if( faxis == kYAxis )
    264338  {
     
    275349  if( verbose >= 2 )
    276350  {
    277     G4cout << std::setprecision(8) << " G4ParameterisationTrdY " << copyNo
     351    G4cout << std::setprecision(8) << " G4ParameterisationTrdY::ComputeTransformation " << copyNo
    278352           << " pos " << origin << " rot mat " << " axis " << faxis << G4endl;
    279353  }
  • trunk/source/geometry/divisions/src/G4ParameterisationTubs.cc

    r850 r1010  
    2626//
    2727// $Id: G4ParameterisationTubs.cc,v 1.8 2006/06/29 18:18:50 gunter Exp $
    28 // GEANT4 tag $Name: HEAD $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4ParameterisationTubs Implementation file
  • trunk/source/geometry/divisions/src/G4VDivisionParameterisation.cc

    r850 r1010  
    2525//
    2626//
    27 // $Id: G4VDivisionParameterisation.cc,v 1.13 2008/07/25 16:23:35 ivana Exp $
    28 // GEANT4 tag $Name: HEAD $
     27// $Id: G4VDivisionParameterisation.cc,v 1.14 2008/12/03 16:41:15 arce Exp $
     28// GEANT4 tag $Name: geant4-09-02-ref-02 $
    2929//
    3030// class G4VDivisionParameterisation Implementation file
     
    163163           << " has too big offset + width*nDiv = " << G4endl
    164164           << "        " << foffset + fwidth*fnDiv << " > "
    165            << maxPar << ". Width = "
     165           << foffset << ". Width = "
    166166           << G4endl
    167167           << "        " << fwidth << ". nDiv = " << fnDiv << " !"
Note: See TracChangeset for help on using the changeset viewer.