]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
const additions
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Aug 2001 07:58:07 +0000 (07:58 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Aug 2001 07:58:07 +0000 (07:58 +0000)
AliGeant4/AliLVStructure.cxx
AliGeant4/AliLVStructure.h
AliGeant4/AliMagneticField.cxx
AliGeant4/AliMagneticField.h
AliGeant4/AliModuleConstruction.cxx
AliGeant4/AliModuleConstruction.h
AliGeant4/AliModulesComposition.cxx
AliGeant4/AliModulesComposition.h

index dcfb66c07eb862c8d6770ee934b4f94ec945b812..85fb192641c10c16daa760e096b05fb7e8e2adcc 100644 (file)
@@ -96,7 +96,7 @@ G4int AliLVStructure::operator==(const AliLVStructure &right) const
 // private methods
 
 //_____________________________________________________________________________
-AliLVStructure* AliLVStructure::FindSubDirectory(G4String subDir)
+AliLVStructure* AliLVStructure::FindSubDirectory(const G4String& subDir) const
 {
 // Finds the subdirectory.
 // ---
@@ -108,7 +108,7 @@ AliLVStructure* AliLVStructure::FindSubDirectory(G4String subDir)
 }
 
 //_____________________________________________________________________________
-G4String AliLVStructure::ExtractDirName(G4String name)
+G4String AliLVStructure::ExtractDirName(const G4String& name) const
 {
 // Extracts the directory name from the path.
 // ---
@@ -123,7 +123,7 @@ G4String AliLVStructure::ExtractDirName(G4String name)
 
 //_____________________________________________________________________________
 void AliLVStructure::AddNewVolume(G4LogicalVolume* lv, 
-                      G4String treeStructure)
+                                  const G4String& treeStructure)
 {
 // Adds new logical volume to the structure.
 // ---
@@ -157,7 +157,7 @@ void AliLVStructure::AddNewVolume(G4LogicalVolume* lv,
 }
 
 //_____________________________________________________________________________
-G4LogicalVolume* AliLVStructure::GetVolume(G4String lvName)
+G4LogicalVolume* AliLVStructure::GetVolume(const G4String& lvName) const
 {
 // Returns logical volume of lvName if present in the structure,
 // returns 0 otherwise.
@@ -171,7 +171,7 @@ G4LogicalVolume* AliLVStructure::GetVolume(G4String lvName)
 }
 
 //_____________________________________________________________________________
-G4LogicalVolume* AliLVStructure::FindVolume(G4String name)
+G4LogicalVolume* AliLVStructure::FindVolume(const G4String& name) const
 {
 // Finds logical volume of given name in all structure tree.
 // ---
@@ -279,7 +279,7 @@ void AliLVStructure::SetTreeVisibility(G4bool visibility)
 }
 
 //_____________________________________________________________________________
-void AliLVStructure::SetTreeColour(G4String colName)
+void AliLVStructure::SetTreeColour(const G4String& colName)
 {
 // Sets colour specified  by name to all logical volumes
 // in the structure tree.
index a1273c0b7fcc2aef02eed48dfdcaf99d2949ff99..c8b14c2c7c14cbabcaaeb655c19d61f07a9c5001 100644 (file)
@@ -30,7 +30,7 @@ class AliLVStructure
     G4int operator==(const AliLVStructure &right) const;
 
     // methods
-    void AddNewVolume(G4LogicalVolume* lv, G4String treeStructure);
+    void AddNewVolume(G4LogicalVolume* lv, const G4String& treeStructure);
     void ListTree() const;
     void ListTreeLong() const;
 
@@ -38,20 +38,20 @@ class AliLVStructure
     void SetVerboseLevel(G4int verbose); 
 #ifdef ALICE_VISUALIZE
     void SetTreeVisibility(G4bool visibility);       
-    void SetTreeColour(G4String colName);
+    void SetTreeColour(const G4String& colName);
 #endif             
 
     // get methods
-    G4LogicalVolume* GetVolume(G4String name);
-    G4LogicalVolume* FindVolume(G4String name);
+    G4LogicalVolume* GetVolume(const G4String& name) const;
+    G4LogicalVolume* FindVolume(const G4String& name) const;
 
   protected:
     AliLVStructure(); 
 
   private:
     // methods
-    AliLVStructure* FindSubDirectory(G4String subDir);
-    G4String ExtractDirName(G4String path);
+    AliLVStructure* FindSubDirectory(const G4String& subDir) const;
+    G4String ExtractDirName(const G4String& path) const;
 
     // data members
     G4RWTPtrOrderedVector<AliLVStructure>   fStructures;                     //.
index 7385be70cf4d6a425951a5022f7ad0666a263977..f81dd9b067d885110749d71b9b7917f009ffca89 100644 (file)
@@ -97,7 +97,7 @@ void AliMagneticField::SetFieldValue(G4ThreeVector fieldVector)
 }
 
 //_____________________________________________________________________________
-G4FieldManager*  AliMagneticField::GetGlobalFieldManager()
+G4FieldManager*  AliMagneticField::GetGlobalFieldManager() const
 {
 // Utility method
 // ---
index 84525264baef10ed5240d28e2678088ab7ed437a..8adaa8b65b3ef1f0301dcd118d0a0b976c88fc84 100644 (file)
@@ -33,12 +33,9 @@ class AliMagneticField: public G4UniformMagField
     void SetFieldValue(G4double      fieldValue);
               // Set the field to (0, 0, fieldValue)
 
-    // get methods
-    G4ThreeVector GetConstantFieldValue();
-
   protected:
     // Find the global Field Manager
-    G4FieldManager* GetGlobalFieldManager(); 
+    G4FieldManager* GetGlobalFieldManager() const
 };
 
 #endif //ALI_MAGNETIC_FIELD_H
index 919ccdb96eb1cd79ca4cff01fb973d3813c12735..91fff39b7e280fc6513b5956066bfe76d1b5cfd1 100644 (file)
@@ -109,8 +109,9 @@ AliModuleConstruction::operator!=(const AliModuleConstruction& right) const
 // protected methods
 
 //_____________________________________________________________________________
-void AliModuleConstruction::RegisterLogicalVolume(G4LogicalVolume* lv,
-       G4String path, AliLVStructure& lvStructure)
+void AliModuleConstruction::RegisterLogicalVolume(
+                                    G4LogicalVolume* lv, const G4String& path,
+                                   AliLVStructure& lvStructure) const
 {
 // Registers logical volume lv in the structure.
 // ---        
@@ -154,7 +155,7 @@ void AliModuleConstruction::SetDetFrame(G4bool warn)
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::SetDetFrame(G4String frameName, G4bool warn)
+void AliModuleConstruction::SetDetFrame(const G4String& frameName, G4bool warn)
 { 
 // The logical volume with frameName
 // is retrieved from G4LogicalVolumeStore.
@@ -165,7 +166,7 @@ void AliModuleConstruction::SetDetFrame(G4String frameName, G4bool warn)
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::ListAllLVTree()
+void AliModuleConstruction::ListAllLVTree() const
 {
 // Lists all logical volumes tree if the frame logical volume 
 // is defined.
@@ -181,7 +182,7 @@ void AliModuleConstruction::ListAllLVTree()
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::ListAllLVTreeLong()
+void AliModuleConstruction::ListAllLVTreeLong() const
 {
 // Lists all logical volume tree if the frame logical volume 
 // is defined with numbers of daughters (physical volumes).
@@ -197,7 +198,7 @@ void AliModuleConstruction::ListAllLVTreeLong()
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::ListLVTree(G4String lvName)
+void AliModuleConstruction::ListLVTree(const G4String& lvName) const
 {
 // Lists logical volumes tree (daughters) of the logical volume 
 // with specified lvName.
@@ -216,7 +217,7 @@ void AliModuleConstruction::ListLVTree(G4String lvName)
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::ListLVTreeLong(G4String lvName)
+void AliModuleConstruction::ListLVTreeLong(const G4String& lvName) const
 {
 // Lists logical volumes tree (daughters) of the logical volume 
 // with specified lvName with numbers of daughters (physical volumes).
@@ -236,7 +237,7 @@ void AliModuleConstruction::ListLVTreeLong(G4String lvName)
 #ifdef ALICE_VISUALIZE
 
 //_____________________________________________________________________________
-void AliModuleConstruction::SetDetVisibility(G4bool visibility)
+void AliModuleConstruction::SetDetVisibility(G4bool visibility) const
 {
 // Sets visibility to all detector logical volumes if
 // frame logical volume is defined.
@@ -254,7 +255,7 @@ void AliModuleConstruction::SetDetVisibility(G4bool visibility)
 
 //_____________________________________________________________________________
 void AliModuleConstruction::SetLVTreeVisibility(G4LogicalVolume* lv, 
-                             G4bool visibility)
+                                                G4bool visibility) const
 { 
 // Sets visibility to the logical volumes tree (daughters) of 
 // the logical volume lv.
@@ -270,7 +271,7 @@ void AliModuleConstruction::SetLVTreeVisibility(G4LogicalVolume* lv,
 
 //_____________________________________________________________________________
 void AliModuleConstruction::SetVolumeVisibility(G4LogicalVolume* lv, 
-                             G4bool visibility)
+                                                G4bool visibility) const
 { 
 // Sets visibility to the specified logical volume.
 // ---
@@ -293,7 +294,7 @@ void AliModuleConstruction::SetVolumeVisibility(G4LogicalVolume* lv,
 }
 
 //_____________________________________________________________________________
-void AliModuleConstruction::SetDetColour(G4String colName)
+void AliModuleConstruction::SetDetColour(G4String colName) const
 {
 // Sets colour to all detector logical volumes if
 // frame logical volume is defined.
@@ -310,7 +311,7 @@ void AliModuleConstruction::SetDetColour(G4String colName)
 
 //_____________________________________________________________________________
 void AliModuleConstruction::SetLVTreeColour(G4LogicalVolume* lv, 
-                             G4String colName)
+                                            const G4String& colName) const
 { 
 // Sets colour to the logical volumes tree (daughters) of 
 // the logical volume lv.
@@ -327,7 +328,7 @@ void AliModuleConstruction::SetLVTreeColour(G4LogicalVolume* lv,
 
 //_____________________________________________________________________________
 void AliModuleConstruction::SetVolumeColour(G4LogicalVolume* lv,
-                             G4String colName)
+                                            const G4String& colName) const
 {
 // Sets colour to the specified logical volume.
 // ---
index f827b864c95a0849193ee10b2da074f4d9e2bcd9..cf439226ab9bf1e818c4db9253bea74b046c8e7d 100644 (file)
@@ -41,23 +41,23 @@ class AliModuleConstruction
 
     // methods
     virtual void Construct() = 0;
-    void ListAllLVTree();
-    void ListAllLVTreeLong();
-    void ListLVTree(G4String lvName);
-    void ListLVTreeLong(G4String lvName);
+    void ListAllLVTree() const;
+    void ListAllLVTreeLong() const;
+    void ListLVTree(const G4String& lvName) const;
+    void ListLVTreeLong(const G4String& lvName) const;
 
     // set methods
     void SetDetFrame(G4bool warn = true);
-    void SetDetFrame(G4String frameName, G4bool warn = true);
+    void SetDetFrame(const G4String& frameName, G4bool warn = true);
     void SetReadGeometry(G4bool readGeometry);
     void SetWriteGeometry(G4bool writeGeometry);
 #ifdef ALICE_VISUALIZE
-    void SetDetVisibility(G4bool visibility);
-    void SetLVTreeVisibility(G4LogicalVolume* lv, G4bool visibility);
-    void SetVolumeVisibility(G4LogicalVolume* lv, G4bool visibility);
-    void SetDetColour(G4String colName);
-    void SetLVTreeColour(G4LogicalVolume* lv, G4String colName);
-    void SetVolumeColour(G4LogicalVolume* lv, G4String colName);     
+    void SetDetVisibility(G4bool visibility) const;
+    void SetLVTreeVisibility(G4LogicalVolume* lv, G4bool visibility) const;
+    void SetVolumeVisibility(G4LogicalVolume* lv, G4bool visibility) const;
+    void SetDetColour(G4String colName) const;
+    void SetLVTreeColour(G4LogicalVolume* lv, const G4String& colName) const;
+    void SetVolumeColour(G4LogicalVolume* lv, const G4String& colName) const;     
 #endif
 
     // get methods
@@ -87,8 +87,8 @@ class AliModuleConstruction
 
   private:
     // methods
-    void RegisterLogicalVolume(G4LogicalVolume* lv, G4String path, 
-           AliLVStructure& lvStructure);
+    void RegisterLogicalVolume(G4LogicalVolume* lv, const G4String& path, 
+                               AliLVStructure& lvStructure) const;
 
     // data members
     AliModuleConstructionMessenger  fMessenger; //messenger     
index 1641635bb7bf6802de8f61ffb3838e2dfdb98fae..b9919ddd06be5b23b13bc77d31689361a3143d7a 100644 (file)
@@ -148,12 +148,13 @@ void AliModulesComposition::ConstructModules()
 }  
 
 //_____________________________________________________________________________
-AliDetSwitch* AliModulesComposition::GetDetSwitch(const G4String& moduleName)
+AliDetSwitch* AliModulesComposition::GetDetSwitch(
+                                        const G4String& moduleName) const
 {
 // Returns the detector switch with given detector name.
 // ---
 
-  DetSwitchIterator it;
+  DetSwitchConstIterator it;
   for (it = fDetSwitchVector.begin(); it != fDetSwitchVector.end(); it++)
     if ((*it)->GetDetName() == moduleName) return *it; 
 
index c3ac549322abe584e9d4dcf3d144ff83a3f180e8..ca90b8d2a5fa8880767b9d23edf87e556e031a06 100644 (file)
@@ -81,7 +81,7 @@ class AliModulesComposition : public G4VUserDetectorConstruction
     void ConstructModules();
 
     // get methods
-    AliDetSwitch* GetDetSwitch(const G4String& moduleName);
+    AliDetSwitch* GetDetSwitch(const G4String& moduleName) const;
 
     // data members
     DetSwitchVector  fDetSwitchVector; //vector of AliDetSwitch