Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:58

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4ProcTblElement inline methods implementation
0027 //
0028 // Author: H.Kurashige, 04.08.1998
0029 // --------------------------------------------------------------------
0030 
0031 inline 
0032 G4bool G4ProcTblElement::Contains(const G4ProcessManager* pManager) const
0033 {
0034   for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
0035   {
0036     if (*i==pManager) return true;
0037   }
0038   return false;
0039 }
0040 
0041 // --------------------------------------------------------------------
0042 inline 
0043 G4int G4ProcTblElement::GetIndex(const G4ProcessManager* pManager) const
0044 {
0045   G4int index = 0;
0046   for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
0047   {
0048     if (*i==pManager) return index;
0049     index +=1;
0050   }
0051   return -1;
0052 }
0053 
0054 // --------------------------------------------------------------------
0055 inline 
0056 G4int G4ProcTblElement::Length() const
0057 {
0058   return G4int(pProcMgrVector->size());
0059 } 
0060 
0061 // --------------------------------------------------------------------
0062 inline 
0063 G4ProcessManager* G4ProcTblElement::GetProcessManager(G4int index) const
0064 {
0065   if ((index < G4int(pProcMgrVector->size())) && (index>=0))
0066   {
0067     return (*pProcMgrVector)[index];
0068   }
0069   else
0070   {
0071     return nullptr;
0072   }
0073 }
0074 
0075 // --------------------------------------------------------------------
0076 inline 
0077 G4VProcess* G4ProcTblElement::GetProcess() const
0078 {
0079   return pProcess;
0080 }
0081 
0082 // --------------------------------------------------------------------
0083 inline 
0084 void  G4ProcTblElement::Insert(G4ProcessManager* aProcMgr)
0085 {
0086   pProcMgrVector->push_back(aProcMgr);
0087 } 
0088 
0089 // --------------------------------------------------------------------
0090 inline 
0091 void G4ProcTblElement::Remove(G4ProcessManager* aProcMgr)
0092 {
0093   for (auto i = pProcMgrVector->cbegin(); i!= pProcMgrVector->cend(); ++i)
0094   {
0095     if (*i==aProcMgr)
0096     {
0097       pProcMgrVector->erase(i); 
0098       break;
0099     } 
0100   }
0101 } 
0102 
0103 // --------------------------------------------------------------------
0104 inline 
0105 const G4String& G4ProcTblElement::GetProcessName() const
0106 {
0107   return  pProcess->GetProcessName();
0108 }
0109 
0110 // --------------------------------------------------------------------
0111 inline const std::vector<G4ProcessManager*>*
0112 G4ProcTblElement::GetProcMgrVector() const
0113 {
0114   return pProcMgrVector;
0115 }