/home/cern/BDSIM_new/src/BDSQuadrupole.cc

00001 //  
00002 //   BDSIM, (C) 2001-2006 
00003 //   
00004 //   version 0.3
00005 //  
00006 //
00007 //
00008 //   Quadrupole class
00009 //
00010 //   History
00011 //
00012 //     21 Nov 2006 by Agapov,  v.0.3
00013 //     22 Mar 2005 by Agapov, Carter,  v.0.2
00014 //     x  x   2002 by Blair
00015 //
00016 //
00017 
00018 #include "BDSGlobalConstants.hh" // must be first in include list
00019 
00020 #include "BDSQuadrupole.hh"
00021 #include "G4Box.hh"
00022 #include "G4Tubs.hh"
00023 #include "G4VisAttributes.hh"
00024 #include "G4LogicalVolume.hh"
00025 #include "G4VPhysicalVolume.hh"
00026 #include "G4UserLimits.hh"
00027 #include "G4TransportationManager.hh"
00028 
00029 #include <map>
00030 
00031 const int DEBUG = 0;
00032 
00033 //============================================================
00034 
00035 typedef std::map<G4String,int> LogVolCountMap;
00036 extern LogVolCountMap* LogVolCount;
00037 
00038 typedef std::map<G4String,G4LogicalVolume*> LogVolMap;
00039 extern LogVolMap* LogVol;
00040 
00041 extern BDSMaterials* theMaterials;
00042 
00043 extern G4RotationMatrix* RotY90;
00044 //============================================================
00045 
00046 BDSQuadrupole::BDSQuadrupole(G4String aName, G4double aLength, 
00047                              G4double bpRad, G4double FeRad,
00048                              G4double bGrad, G4double tilt, G4double outR,
00049                              G4String aMaterial, G4String spec):
00050   BDSMultipole(aName, aLength, bpRad, FeRad, SetVisAttributes(), aMaterial),
00051   itsBGrad(bGrad)
00052 {
00053   if(DEBUG) G4cout<<"BDSQUADRUPOLE : SPEC : "<<spec<<G4endl;
00054   // get specific quadrupole type
00055   G4String qtype = getParameterValueString(spec, "type");
00056   if(DEBUG) G4cout<<"qtype : "<<qtype<<G4endl;
00057 
00058   SetOuterRadius(outR);
00059   itsTilt=tilt;
00060   itsType="quad";
00061 
00062   if (!(*LogVolCount)[itsName])
00063     {
00064       //
00065       // build external volume
00066       // 
00067       BuildDefaultMarkerLogicalVolume();
00068 
00069       //
00070       // build beampipe (geometry + magnetic field)
00071       //
00072       BuildBPFieldAndStepper();
00073       BuildBPFieldMgr(itsStepper,itsMagField);
00074       BuildBeampipe(itsLength);
00075 
00076       //
00077       // build magnet (geometry + magnetic field)
00078       // according to quad type
00079       //
00080       if(qtype=="standard") 
00081         BuildOuterLogicalVolume(); // standard - quad with poles and pockets
00082       else if(qtype=="cylinder")  
00083         BuildDefaultOuterLogicalVolume(itsLength); // cylinder outer volume
00084       else //default
00085         BuildDefaultOuterLogicalVolume(itsLength); // cylinder outer volume
00086       if(BDSGlobals->GetIncludeIronMagFields())
00087         {
00088           G4double polePos[4];
00089           G4double Bfield[3];
00090 
00091           //coordinate in GetFieldValue
00092           polePos[0]=-BDSGlobals->GetMagnetPoleRadius()*sin(pi/4);
00093           polePos[1]=BDSGlobals->GetMagnetPoleRadius()*cos(pi/4);
00094           polePos[2]=0.;
00095           polePos[3]=-999.;//flag to use polePos rather than local track
00096 
00097           itsMagField->GetFieldValue(polePos,Bfield);
00098           G4double BFldIron=
00099             sqrt(Bfield[0]*Bfield[0]+Bfield[1]*Bfield[1])*
00100             BDSGlobals->GetMagnetPoleSize()/
00101             (BDSGlobals->GetComponentBoxSize()/2-
00102              BDSGlobals->GetMagnetPoleRadius());
00103 
00104           // Magnetic flux from a pole is divided in two directions
00105           BFldIron/=2.;
00106 
00107           BuildOuterFieldManager(4, BFldIron,pi/4);
00108         }
00109 
00110       //
00111       // define sensitive volumes for hit generation
00112       //
00113       SetMultipleSensitiveVolumes(itsBeampipeLogicalVolume);
00114       SetMultipleSensitiveVolumes(itsOuterLogicalVolume);
00115 
00116       //
00117       // set visualization attributes
00118       //
00119       itsVisAttributes=SetVisAttributes();
00120       itsVisAttributes->SetForceSolid(true);
00121       itsOuterLogicalVolume->SetVisAttributes(itsVisAttributes);
00122 
00123       //
00124       // append marker logical volume to volume map
00125       //
00126       (*LogVolCount)[itsName]=1;
00127       (*LogVol)[itsName]=itsMarkerLogicalVolume;
00128     }
00129   else
00130     {
00131       (*LogVolCount)[itsName]++;
00132       if(BDSGlobals->GetSynchRadOn()&& BDSGlobals->GetSynchRescale())
00133         {
00134           // with synchrotron radiation, the rescaled magnetic field
00135           // means elements with the same name must have different
00136           // logical volumes, because they have different fields
00137           itsName+=BDSGlobals->StringFromInt((*LogVolCount)[itsName]);
00138 
00139           //
00140           // build external volume
00141           // 
00142           BuildDefaultMarkerLogicalVolume();
00143 
00144           //
00145           // build beampipe (geometry + magnetic field)
00146           //
00147           BuildBPFieldAndStepper();
00148           BuildBPFieldMgr(itsStepper,itsMagField);
00149           BuildBeampipe(itsLength);
00150 
00151           //
00152           // build magnet (geometry + magnetic field)
00153           // according to quad type
00154           //
00155           if(qtype=="standard") 
00156             BuildOuterLogicalVolume(); // standard - quad with poles and pockets
00157           else if(qtype=="cylinder")  
00158             BuildDefaultOuterLogicalVolume(itsLength); // cylinder outer volume
00159           else //default
00160             BuildDefaultOuterLogicalVolume(itsLength); // cylinder outer volume
00161           if(BDSGlobals->GetIncludeIronMagFields())
00162             {
00163               G4double polePos[4];
00164               G4double Bfield[3];
00165               
00166               //coordinate in GetFieldValue
00167               polePos[0]=-BDSGlobals->GetMagnetPoleRadius()*sin(pi/4);
00168               polePos[1]=BDSGlobals->GetMagnetPoleRadius()*cos(pi/4);
00169               polePos[2]=0.;
00170               polePos[3]=-999.;//flag to use polePos rather than local track
00171 
00172               itsMagField->GetFieldValue(polePos,Bfield);
00173               G4double BFldIron=
00174                 sqrt(Bfield[0]*Bfield[0]+Bfield[1]*Bfield[1])*
00175                 BDSGlobals->GetMagnetPoleSize()/
00176                 (BDSGlobals->GetComponentBoxSize()/2-
00177                  BDSGlobals->GetMagnetPoleRadius());
00178 
00179               // Magnetic flux from a pole is divided in two directions
00180               BFldIron/=2.;
00181               
00182               BuildOuterFieldManager(4, BFldIron,pi/4);
00183             }
00184           //When is SynchRescale(factor) called?
00185 
00186           //
00187           // define sensitive volumes for hit generation
00188           //
00189           SetSensitiveVolume(itsBeampipeLogicalVolume);// for synchrotron
00190           //SetSensitiveVolume(itsOuterLogicalVolume);// for laserwire
00191           
00192           //
00193           // set visualization attributes
00194           //
00195           itsVisAttributes=SetVisAttributes();
00196           itsVisAttributes->SetForceSolid(true);
00197           itsOuterLogicalVolume->SetVisAttributes(itsVisAttributes);
00198           
00199           //
00200           // append marker logical volume to volume map
00201           //
00202           (*LogVol)[itsName]=itsMarkerLogicalVolume;
00203         }
00204       else
00205         {
00206           //
00207           // use already defined marker volume
00208           //
00209           itsMarkerLogicalVolume=(*LogVol)[itsName];
00210         }      
00211     }
00212 }
00213 
00214 void BDSQuadrupole::SynchRescale(G4double factor)
00215 {
00216   itsStepper->SetBGrad(factor*itsBGrad);
00217   itsMagField->SetBGrad(factor*itsBGrad);
00218   if(DEBUG) G4cout << "Quad " << itsName << " has been scaled" << G4endl;
00219 }
00220 
00221 G4VisAttributes* BDSQuadrupole::SetVisAttributes()
00222 {
00223   itsVisAttributes=new G4VisAttributes(G4Colour(1,0,0));
00224   return itsVisAttributes;
00225 }
00226 
00227 void BDSQuadrupole::BuildBPFieldAndStepper()
00228 {
00229   // set up the magnetic field and stepper
00230   itsMagField=new BDSQuadMagField(itsBGrad);
00231   itsEqRhs=new G4Mag_UsualEqRhs(itsMagField);
00232   
00233   itsStepper=new BDSQuadStepper(itsEqRhs);
00234   itsStepper->SetBGrad(itsBGrad);
00235 }
00236 
00237 void BDSQuadrupole::BuildOuterLogicalVolume()
00238 {
00239   G4double outerRadius = itsOuterR;
00240   if(itsOuterR==0) outerRadius = BDSGlobals->GetComponentBoxSize()/2;
00241 
00242   itsOuterLogicalVolume=
00243     new G4LogicalVolume(new G4Tubs(itsName+"_outer_solid",
00244                                    itsInnerIronRadius,
00245                                    outerRadius * sqrt(2.0),
00246                                    itsLength/2,
00247                                    0,twopi*radian),
00248                         theMaterials->GetMaterial("Vacuum"),
00249                         itsName+"_outer");
00250   
00251   // create one quadrant of the quadrupole
00252   G4LogicalVolume* lQuadrant = 
00253     new G4LogicalVolume(new G4Tubs(itsName+"_outer_solid",
00254                                    itsInnerIronRadius,
00255                                    outerRadius * sqrt(2.0),
00256                                    itsLength/2,
00257                                    0,pi/ 2 *radian),
00258                         theMaterials->GetMaterial("Vacuum"),
00259                         itsName+"_outer");
00260   
00261   // pole 
00262   G4double poleR = itsBpRadius;
00263   G4double phiStart = -pi / 4;
00264   G4double dPhi = pi / 2;
00265 
00266   G4LogicalVolume* lPole = 
00267     new G4LogicalVolume(new G4Tubs(itsName+"_pole",
00268                                    0,
00269                                    poleR,
00270                                    itsLength/2,
00271                                    phiStart,
00272                                    dPhi),
00273                         theMaterials->GetMaterial("Iron"),
00274                         itsName+"pole_outer");
00275 
00276   G4RotationMatrix* rotPole = new G4RotationMatrix;
00277   //rotPole = NULL;
00278   rotPole->rotateZ(3.*pi / 4.);
00279 
00280   G4double xPole = (poleR + itsBpRadius) / sqrt(2.0);
00281   G4double yPole = (poleR + itsBpRadius) / sqrt(2.0);
00282 
00283 
00284   G4VPhysicalVolume* itsPhysiQPole1;
00285   itsPhysiQPole1 = new G4PVPlacement(
00286                       rotPole,                      // rotation
00287                       G4ThreeVector(xPole,yPole,0), // its position
00288                       lPole,                        // its logical volume
00289                       itsName+"_solid",             // its name
00290                       lQuadrant,                    // its mother  volume
00291                       false,                        // no boolean operation
00292                       0);                           // copy number
00293   
00294   // color-coding for the pole
00295   G4VisAttributes* VisAtt = 
00296     new G4VisAttributes(G4Colour(1., 0., 0.));
00297   VisAtt->SetForceSolid(true);
00298   lPole->SetVisAttributes(VisAtt);
00299 
00300 
00301   // yoke pieces
00302   G4double rYoke = itsOuterR - poleR - itsBpRadius + poleR * cos(dPhi / 2);
00303 
00304   if(rYoke > 0 ) // place yoke
00305     {
00306 
00307       // random ...
00308       G4double rYoke1 =  itsOuterR; // outer length
00309       G4double rYoke2 =  itsBpRadius;  // inner length 
00310 
00311       G4LogicalVolume* lYoke1 = 
00312         new G4LogicalVolume(new G4Trd(itsName+"_yoke1",
00313                                       rYoke1 / 2,
00314                                       rYoke2 / 2,
00315                                       itsLength/2,
00316                                       itsLength/2,
00317                                       rYoke/2),
00318                             theMaterials->GetMaterial("Iron"),
00319                             itsName+"yoke_outer1");
00320 
00321       G4RotationMatrix* rotYoke = new G4RotationMatrix;
00322       //rotYoke = NULL;
00323       rotYoke->rotateX( - pi / 2.);
00324       rotYoke->rotateY(  pi / 4.);
00325 
00326       G4double xYoke = (poleR - poleR * cos(dPhi / 2) + itsBpRadius + rYoke/2) / sqrt(2.0);
00327       G4double yYoke = (poleR - poleR * cos(dPhi / 2) + itsBpRadius + rYoke/2) / sqrt(2.0);
00328 
00329 
00330       G4VPhysicalVolume* itsPhysiQYoke1;
00331       itsPhysiQYoke1 = new G4PVPlacement(
00332                           rotYoke,                      // rotation
00333                           G4ThreeVector(xYoke,yYoke,0), // its position
00334                           lYoke1,                       // its logical volume
00335                           itsName+"_yoke_solid",        // its name
00336                           lQuadrant,                    // its mother volume
00337                           false,                        // no boolean operation
00338                           0);                           // copy number
00339 
00340       // color-coding 
00341       G4VisAttributes* VisAtt1 = 
00342         new G4VisAttributes(G4Colour(1., 0., 0.4));
00343       VisAtt1->SetForceSolid(true);
00344       lYoke1->SetVisAttributes(VisAtt1);
00345     }
00346   else
00347     {
00348       G4cerr<<"Not enough place for yoke..."<<G4endl;
00349     }
00350 
00351 
00352   // put all quadrants in the outer volume
00353 
00354  
00355   G4VPhysicalVolume* itsPhysiQuadrant1;
00356   itsPhysiQuadrant1 = new G4PVPlacement(
00357                       NULL,                  // rotation
00358                       0,                     // its position
00359                       lQuadrant,             // its logical volume
00360                       itsName+"_solid",      // its name
00361                       itsOuterLogicalVolume, // its mother volume
00362                       false,                 // no boolean operation
00363                       0);                    // copy number
00364 
00365   G4RotationMatrix* rotQ2= new  G4RotationMatrix;
00366   rotQ2->rotateZ( pi / 2.);
00367 
00368   G4VPhysicalVolume* itsPhysiQuadrant2;
00369   itsPhysiQuadrant2 = new G4PVPlacement(
00370                       rotQ2,                 // rotation
00371                       0,                     // its position
00372                       lQuadrant,             // its logical volume
00373                       itsName+"_solid",      // its name
00374                       itsOuterLogicalVolume, // its mother volume
00375                       false,                 // no boolean operation
00376                       0);                    // copy number
00377 
00378   G4RotationMatrix* rotQ3= new  G4RotationMatrix;
00379   rotQ3->rotateZ( pi );
00380   
00381   G4VPhysicalVolume* itsPhysiQuadrant3;
00382   itsPhysiQuadrant3 = new G4PVPlacement(
00383                       rotQ3,                 // rotation
00384                       0,                     // its position
00385                       lQuadrant,             // its logical volume
00386                       itsName+"_solid",      // its name
00387                       itsOuterLogicalVolume, // its mother volume
00388                       false,                 // no boolean operation
00389                       0);                    // copy number
00390 
00391 
00392   G4RotationMatrix* rotQ4= new  G4RotationMatrix;
00393   rotQ4->rotateZ( 3. * pi / 2.);
00394   
00395   G4VPhysicalVolume* itsPhysiQuadrant4;
00396   itsPhysiQuadrant4 = new G4PVPlacement(
00397                       rotQ4,                  // rotation
00398                       0,                      // its position
00399                       lQuadrant,              // its logical volume
00400                       itsName+"_solid",       // its name
00401                       itsOuterLogicalVolume,  // its mother volume
00402                       false,                  // no boolean operation
00403                       0);                     // copy number
00404 
00405 
00406   //rotQ->rotateZ( pi / 4.);
00407 
00408 
00409   // insert the outer volume into the marker volume
00410   itsPhysiComp = 
00411     new G4PVPlacement(
00412                       0,                      // no rotation
00413                       0,                      // its position
00414                       itsOuterLogicalVolume,  // its logical volume
00415                       itsName+"_outer_phys",  // its name
00416                       itsMarkerLogicalVolume, // its mother  volume
00417                       false,                  // no boolean operation
00418                       0);                     // copy number
00419   
00420   itsOuterUserLimits =
00421     new G4UserLimits("quadrupole cut",itsLength,DBL_MAX,DBL_MAX,
00422                      BDSGlobals->GetThresholdCutCharged());
00423   //  itsOuterUserLimits->SetMaxAllowedStep(aLength);
00424   itsOuterLogicalVolume->SetUserLimits(itsOuterUserLimits);
00425 }
00426 
00427 /*
00428 void BDSQuadrupole::BuildOuterLogicalVolume()
00429 {
00430   G4double outerRadius = itsOuterR;
00431   if(itsOuterR==0) outerRadius = BDSGlobals->GetComponentBoxSize()/2;
00432 
00433   // compute sagitta:
00434   // why???? 
00435   // angle is always 0 for quadrupole (see BDSDetectorConstruction.cc)
00436   // and no bending is taken into account in the quadrupole stepper!
00437 
00438   G4double sagitta=0.;
00439 
00440   if(itsNSegments>1)
00441     {
00442       sagitta=itsLength/itsAngle*(1.-cos(itsAngle/2.));
00443     }
00444   
00445   // marker volume
00446   itsOuterLogicalVolume=
00447     new G4LogicalVolume(new G4Tubs(itsName+"_outer_solid",
00448                                    itsInnerIronRadius+sagitta,
00449                                    outerRadius * sqrt(2.0),
00450                                    itsLength/2,
00451                                    0,twopi*radian),
00452                         theMaterials->GetMaterial("Vacuum"),
00453                         itsName+"_outer");
00454   
00455   // create one quadrant of the quadrupole
00456   G4LogicalVolume* lQuadrant = 
00457     new G4LogicalVolume(new G4Tubs(itsName+"_solid",
00458                                    itsInnerIronRadius+sagitta,
00459                                    outerRadius * sqrt(2.0),
00460                                    itsLength/2,
00461                                    0,pi/ 2 *radian),
00462                         theMaterials->GetMaterial("Vacuum"),
00463                         itsName+"_outer");
00464   
00465   // pole 
00466   G4double poleR = itsBpRadius;
00467   G4double phiStart = -pi / 4;
00468   G4double dPhi = pi / 2;
00469 
00470   G4LogicalVolume* lPole = 
00471     new G4LogicalVolume(new G4Tubs(itsName+"_pole",
00472                                    0,
00473                                    poleR,
00474                                    itsLength/2,
00475                                    phiStart,
00476                                    dPhi),
00477                         theMaterials->GetMaterial("Iron"),
00478                         itsName+"pole_outer");
00479 
00480   G4RotationMatrix* rotPole = new G4RotationMatrix;
00481   //rotPole = NULL;
00482   rotPole->rotateZ(3.*pi / 4.);
00483 
00484   G4double xPole = (poleR + itsBpRadius) / sqrt(2.0);
00485   G4double yPole = (poleR + itsBpRadius) / sqrt(2.0);
00486 
00487 
00488   G4VPhysicalVolume* itsPhysiQPole1;
00489   itsPhysiQPole1 = new G4PVPlacement(
00490                       rotPole,                      // rotation
00491                       G4ThreeVector(xPole,yPole,0), // its position
00492                       lPole,                        // its logical volume
00493                       itsName+"_solid",             // its name
00494                       lQuadrant,                    // its mother  volume
00495                       false,                        // no boolean operation
00496                       0);                           // copy number
00497   
00498   // color-coding for the pole
00499   G4VisAttributes* VisAtt = 
00500     new G4VisAttributes(G4Colour(1., 0., 0.));
00501   VisAtt->SetForceSolid(true);
00502   lPole->SetVisAttributes(VisAtt);
00503 
00504 
00505   // yoke pieces
00506   G4double rYoke = itsOuterR - poleR - itsBpRadius + poleR * cos(dPhi / 2);
00507 
00508   if(rYoke > 0 ) // place yoke
00509     {
00510 
00511       // random ...
00512       G4double rYoke1 =  itsOuterR; // outer length
00513       G4double rYoke2 =  itsBpRadius;  // inner length 
00514 
00515       G4LogicalVolume* lYoke1 = 
00516         new G4LogicalVolume(new G4Trd(itsName+"_yoke1",
00517                                       rYoke1 / 2,
00518                                       rYoke2 / 2,
00519                                       itsLength/2,
00520                                       itsLength/2,
00521                                       rYoke/2),
00522                             theMaterials->GetMaterial("Iron"),
00523                             itsName+"yoke_outer1");
00524 
00525       G4RotationMatrix* rotYoke = new G4RotationMatrix;
00526       //rotYoke = NULL;
00527       rotYoke->rotateX( - pi / 2.);
00528       rotYoke->rotateY(  pi / 4.);
00529 
00530       G4double xYoke = (poleR - poleR * cos(dPhi / 2) + itsBpRadius + rYoke/2) / sqrt(2.0);
00531       G4double yYoke = (poleR - poleR * cos(dPhi / 2) + itsBpRadius + rYoke/2) / sqrt(2.0);
00532 
00533 
00534       G4VPhysicalVolume* itsPhysiQYoke1;
00535       itsPhysiQYoke1 = new G4PVPlacement(
00536                           rotYoke,                      // rotation
00537                           G4ThreeVector(xYoke,yYoke,0), // its position
00538                           lYoke1,                       // its logical volume
00539                           itsName+"_yoke_solid",        // its name
00540                           lQuadrant,                    // its mother volume
00541                           false,                        // no boolean operation
00542                           0);                           // copy number
00543 
00544       // color-coding 
00545       G4VisAttributes* VisAtt1 = 
00546         new G4VisAttributes(G4Colour(1., 0., 0.4));
00547       VisAtt1->SetForceSolid(true);
00548       lYoke1->SetVisAttributes(VisAtt1);
00549     }
00550   else
00551     {
00552       G4cerr<<"Not enough place for yoke..."<<G4endl;
00553     }
00554 
00555 
00556   // put all quadrants in the outer volume
00557 
00558  
00559   G4VPhysicalVolume* itsPhysiQuadrant1;
00560   itsPhysiQuadrant1 = new G4PVPlacement(
00561                       NULL,                  // rotation
00562                       0,                     // its position
00563                       lQuadrant,             // its logical volume
00564                       itsName+"_solid",      // its name
00565                       itsOuterLogicalVolume, // its mother volume
00566                       false,                 // no boolean operation
00567                       0);                    // copy number
00568 
00569   G4RotationMatrix* rotQ2= new  G4RotationMatrix;
00570   rotQ2->rotateZ( pi / 2.);
00571 
00572   G4VPhysicalVolume* itsPhysiQuadrant2;
00573   itsPhysiQuadrant2 = new G4PVPlacement(
00574                       rotQ2,                 // rotation
00575                       0,                     // its position
00576                       lQuadrant,             // its logical volume
00577                       itsName+"_solid",      // its name
00578                       itsOuterLogicalVolume, // its mother volume
00579                       false,                 // no boolean operation
00580                       0);                    // copy number
00581 
00582   G4RotationMatrix* rotQ3= new  G4RotationMatrix;
00583   rotQ3->rotateZ( pi );
00584   
00585   G4VPhysicalVolume* itsPhysiQuadrant3;
00586   itsPhysiQuadrant3 = new G4PVPlacement(
00587                       rotQ3,                 // rotation
00588                       0,                     // its position
00589                       lQuadrant,             // its logical volume
00590                       itsName+"_solid",      // its name
00591                       itsOuterLogicalVolume, // its mother volume
00592                       false,                 // no boolean operation
00593                       0);                    // copy number
00594 
00595 
00596   G4RotationMatrix* rotQ4= new  G4RotationMatrix;
00597   rotQ4->rotateZ( 3. * pi / 2.);
00598   
00599   G4VPhysicalVolume* itsPhysiQuadrant4;
00600   itsPhysiQuadrant4 = new G4PVPlacement(
00601                       rotQ4,                  // rotation
00602                       0,                      // its position
00603                       lQuadrant,              // its logical volume
00604                       itsName+"_solid",       // its name
00605                       itsOuterLogicalVolume,  // its mother volume
00606                       false,                  // no boolean operation
00607                       0);                     // copy number
00608 
00609 
00610   //rotQ->rotateZ( pi / 4.);
00611 
00612 
00613   // insert the outer volume into the marker volume
00614 
00615   G4RotationMatrix* Rot=NULL;
00616   if(itsAngle!=0) Rot=RotY90;
00617   
00618   itsPhysiComp = new G4PVPlacement(
00619                       Rot,                    // rotation
00620                       0,                      // its position
00621                       itsOuterLogicalVolume,  // its logical volume
00622                       itsName+"_solid",       // its name
00623                       itsMarkerLogicalVolume, // its mother  volume
00624                       false,                  // no boolean operation
00625                       0);                     // copy number
00626   
00627   itsOuterUserLimits =
00628     new G4UserLimits("quadrupole cut",itsLength,DBL_MAX,DBL_MAX,
00629                      BDSGlobals->GetThresholdCutCharged());
00630   //  itsOuterUserLimits->SetMaxAllowedStep(aLength);
00631   itsOuterLogicalVolume->SetUserLimits(itsOuterUserLimits);
00632 }
00633 */
00634 
00635 BDSQuadrupole::~BDSQuadrupole()
00636 {
00637   delete itsVisAttributes;
00638   delete itsMarkerLogicalVolume;
00639   delete itsOuterLogicalVolume;
00640   delete itsPhysiComp;
00641   delete itsMagField;
00642   delete itsEqRhs;
00643   delete itsStepper;
00644 }

Generated on Wed Mar 5 17:25:22 2008 for BDSIM by  doxygen 1.5.3