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

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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  }
Note: See TracChangeset for help on using the changeset viewer.