G4MaterialCutsCouple.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file 
00032 //
00033 //
00034 // Class Description
00035 //  This class is 
00036 //
00037 // ------------------------------------------------------------
00038 //   First Implementation          17 Sep. 2002  H.Kurahige
00039 // ------------------------------------------------------------
00040 
00041 #ifndef G4MaterialCutsCouple_h 
00042 #define G4MaterialCutsCouple_h 1
00043 
00044 #include "globals.hh"
00045 #include "G4ios.hh"
00046 
00047 class G4Material;
00048 #include "G4ProductionCuts.hh"
00049 
00050 class G4MaterialCutsCouple  
00051 {
00052   public: // with description
00053   //  constructor 
00054   G4MaterialCutsCouple();
00055   G4MaterialCutsCouple(const G4Material*, G4ProductionCuts* cut=0);
00056 
00057   //  copy constructor 
00058   G4MaterialCutsCouple(const G4MaterialCutsCouple &right);
00059 
00060   G4MaterialCutsCouple & operator=(const G4MaterialCutsCouple &right);
00061 
00062   public: 
00063   //  destructor 
00064   virtual ~G4MaterialCutsCouple();
00065 
00066   // equal opperators
00067   G4int operator==(const G4MaterialCutsCouple &right) const;
00068   G4int operator!=(const G4MaterialCutsCouple &right) const;
00069 
00070   public: // with description
00071   void              SetMaterial(const G4Material*);
00072   // Set pointer to material
00073 
00074   const G4Material* GetMaterial() const;
00075   // Get pointer to material
00076 
00077   void              SetProductionCuts(G4ProductionCuts*);
00078   // Set pointer to production cuts
00079 
00080   G4ProductionCuts* GetProductionCuts() const;
00081   // Get pointer to production cuts
00082 
00083   G4bool           IsRecalcNeeded() const;
00084   // return true if cut and/or material has been modified 
00085   // after last calculation of PhysicsTable          
00086 
00087   void             PhysicsTableUpdated();
00088   // inform end of calculation of PhysicsTable  
00089 
00090   void             SetIndex(G4int idx);
00091   G4int            GetIndex() const;
00092   // Set/Get the index number in G4ProductionCutsTable
00093 
00094   void             SetUseFlag(G4bool flg=true);
00095   G4bool           IsUsed() const;
00096  
00097   private:
00098   G4bool                   isMaterialModified;
00099   const G4Material*        fMaterial;
00100   G4ProductionCuts*        fCuts;
00101   G4int                    indexNumber;
00102   G4bool                   isUsedInGeometry;
00103 };
00104 
00105 #include "G4ProductionCuts.hh"
00106 inline 
00107  void G4MaterialCutsCouple::SetIndex(G4int idx)
00108 { indexNumber = idx; }
00109 
00110 inline
00111  G4int G4MaterialCutsCouple::GetIndex() const
00112 { return indexNumber; }
00113 
00114 inline 
00115  void G4MaterialCutsCouple::SetUseFlag(G4bool flg)
00116 { isUsedInGeometry = flg; }
00117 
00118 inline
00119  G4bool G4MaterialCutsCouple::IsUsed() const
00120 { return isUsedInGeometry; }
00121 
00122 inline
00123  void G4MaterialCutsCouple::SetProductionCuts(G4ProductionCuts* aCut)
00124 { fCuts = aCut; }
00125 
00126 inline
00127  G4ProductionCuts* G4MaterialCutsCouple::GetProductionCuts() const
00128 { return fCuts; }
00129 
00130 inline
00131  G4int G4MaterialCutsCouple::operator==(const G4MaterialCutsCouple &right) const
00132 {
00133   return (this == &right);
00134 }
00135 
00136 inline
00137  G4int G4MaterialCutsCouple::operator!=(const G4MaterialCutsCouple &right) const
00138 {
00139   return (this !=  &right);
00140 }
00141 
00142 inline
00143   void  G4MaterialCutsCouple::SetMaterial(const G4Material* material)
00144 {
00145   fMaterial = material;
00146   isMaterialModified = true;
00147 }
00148 
00149 inline
00150   const G4Material* G4MaterialCutsCouple::GetMaterial() const
00151 {
00152   return fMaterial;
00153 }
00154 
00155 inline
00156 G4bool  G4MaterialCutsCouple::IsRecalcNeeded() const
00157 {
00158   G4bool isCutModified = false;
00159   if (fCuts !=0 ) isCutModified = fCuts->IsModified();
00160   return (isMaterialModified || isCutModified);
00161 }
00162 
00163 inline
00164 void   G4MaterialCutsCouple::PhysicsTableUpdated()
00165 {
00166   if (fCuts !=0 ) fCuts->PhysicsTableUpdated();
00167   isMaterialModified = false;
00168 }
00169 
00170 
00171 #endif
00172 
00173 
00174 
00175 
00176 
00177 

Generated on Mon May 27 17:48:51 2013 for Geant4 by  doxygen 1.4.7