Import Geant4 8.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:44:26 +02:00
parent 8a51e0bc40
commit 216a75eeb1
8717 changed files with 360418 additions and 141343 deletions
@@ -0,0 +1,43 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonDumpStyle.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonDumpStyle.hh,v 1.3 2006/06/29 16:14:17 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Define dump widths
//
#ifndef RADMONDUMPSTYLE_HH
#define RADMONDUMPSTYLE_HH
#define RADMONDUMP_INDENT_WIDTH 25
#define RADMONDUMP_DOUBLE_PRECISION 5
#define RADMONDUMP_DOUBLE_WIDTH 7
#endif /* RADMONDUMPSTYLE_HH */
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonLayoutEntityWithAttributes.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonLayoutEntityWithAttributes.hh,v 1.3.2.2 2006/06/29 16:14:19 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Provides attributes to other detector classes
//
#ifndef RADMONLAYOUTENTITYWITHATTRIBUTES_HH
#define RADMONLAYOUTENTITYWITHATTRIBUTES_HH
// Include files
#include "G4String.hh"
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4RotationMatrix.hh"
#include <vector>
#include <utility>
class RadmonLayoutEntityWithAttributes
{
public:
G4int GetNAttributes(void) const;
const G4String & GetAttributeName(G4int index) const;
G4String GetAttribute(const G4String & attributeName, const G4String & defaultValue = G4String("")) const;
G4bool ExistsAttribute(const G4String & attributeName) const;
void SetAttribute(const G4String & attributeName, const G4String & value);
void ClearAttribute(const G4String & attributeName);
void ClearAllAttributes(void);
G4double GetAttributeAsDouble(const G4String & attributeName, double defaultValue) const;
G4double GetAttributeAsMeasure(const G4String & attributeName, const char * category, double defaultValue) const;
G4int GetAttributeAsInteger(const G4String & attributeName, G4int defaultValue) const;
G4ThreeVector GetAttributeAsThreeVector(const G4String & attributeName, const G4ThreeVector & defaultValue) const;
G4ThreeVector GetAttributeAsThreeVectorWithMeasure(const G4String & attributeName, const char * category, const G4ThreeVector & defaultValue) const;
G4ThreeVector GetAttributeAsDirection(const G4String & attributeName, const G4ThreeVector & defaultValue) const;
G4RotationMatrix GetAttributeAsRotationMatrix(const G4String & attributeName, const G4RotationMatrix & defaultValue) const;
protected:
inline RadmonLayoutEntityWithAttributes();
inline RadmonLayoutEntityWithAttributes(const RadmonLayoutEntityWithAttributes & copy);
inline ~RadmonLayoutEntityWithAttributes();
void DumpAttributesLayout(std::ostream & out, const G4String & indent=G4String()) const;
inline RadmonLayoutEntityWithAttributes & operator=(const RadmonLayoutEntityWithAttributes & copy);
private:
// Private methods
void CopyFrom(const RadmonLayoutEntityWithAttributes & copy);
// Private attributes
typedef std::pair<G4String, G4String> AttributeItem;
typedef std::vector<AttributeItem> AttributesVector;
AttributesVector attributesVector;
};
// Inline implementations
#include "RadmonLayoutEntityWithAttributes.icc"
#endif /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonLayoutEntityWithAttributes.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonLayoutEntityWithAttributes.icc,v 1.3 2006/06/29 16:14:21 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONLAYOUTENTITYWITHATTRIBUTES_HH
#error "RadmonLayoutEntityWithAttributes.icc cannot be included directly. Please use RadmonLayoutEntityWithAttributes.hh"
#else /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
inline RadmonLayoutEntityWithAttributes :: RadmonLayoutEntityWithAttributes()
{
}
inline RadmonLayoutEntityWithAttributes :: RadmonLayoutEntityWithAttributes(const RadmonLayoutEntityWithAttributes & copy)
{
CopyFrom(copy);
}
inline RadmonLayoutEntityWithAttributes :: ~RadmonLayoutEntityWithAttributes()
{
}
inline RadmonLayoutEntityWithAttributes & RadmonLayoutEntityWithAttributes :: operator=(const RadmonLayoutEntityWithAttributes & copy)
{
CopyFrom(copy);
return (*this);
}
#endif /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */
@@ -0,0 +1,70 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonMessenger.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonMessenger.hh,v 1.3 2006/06/29 16:14:23 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: UI commands for managing a layout
//
#ifndef RADMONMESSENGER_HH
#define RADMONMESSENGER_HH
// Include files
#include "G4UImessenger.hh"
#include "G4UIdirectory.hh"
#include "RadmonMessengersSupport.hh"
class RadmonMessenger : public G4UImessenger
{
public:
static G4bool ProcessArguments(const G4String & rawArguments, G4int nArgs, G4String * arguments);
static G4double GetUnit(const G4String & unitStr, const char * cathegory);
protected:
RadmonMessenger(const char * path, const char * guidance=0);
inline ~RadmonMessenger();
std::istream * OpenForInput(const G4String & fileName) const;
std::ostream * OpenForOutput(const G4String & fileName) const;
private:
// Hidden constructors and operators
RadmonMessenger();
RadmonMessenger(const RadmonMessenger & copy);
RadmonMessenger & operator=(const RadmonMessenger & copy);
// Private Attributes
G4UIdirectory * directory;
};
// Inline implementation
#include "RadmonMessenger.icc"
#endif /* RADMONMESSENGER_HH */
@@ -0,0 +1,43 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonMessenger.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonMessenger.icc,v 1.3 2006/06/29 16:14:25 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONMESSENGER_HH
#error "RadmonMessenger.icc cannot be included directly. Please use RadmonMessenger.hh"
#else /* RADMONMESSENGER_HH */
inline RadmonMessenger :: ~RadmonMessenger()
{
if (directory)
delete directory;
}
#endif /* RADMONMESSENGER_HH */
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonMessengersSupport.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonMessengersSupport.hh,v 1.3 2006/06/29 16:14:27 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Define macros useful to maintain the code of messengers
//
#ifndef RADMONMESSENGERSSUPPORT_HH
#define RADMONMESSENGERSSUPPORT_HH
#include "G4UIcommand.hh"
#define RADMON_DECLARE_COMMAND(command) private: \
void On ## command (const G4String & value); \
G4UIcommand * cmd ## command
#define RADMON_INITIALIZE_COMMAND(command) cmd ## command (0)
#define _CREATE_COMMAND(command, guidance) cmd ## command = new G4UIcommand(COMMANDS_PATH #command , this); \
\
if (! cmd ## command ) \
{ \
G4cout << "RadmonDetectorMessenger::RadmonDetectorMessenger: Command \"" #command "\" not allocated."<< G4endl; \
return; \
} \
\
cmd ## command ->SetGuidance(guidance)
#define _ADD_ARG(command, argName) cmd ## command ->SetParameter(new G4UIparameter(argName, 's', false))
#define RADMON_CREATE_COMMAND_0ARGS(command, guidance) \
_CREATE_COMMAND(command, guidance);
#define RADMON_CREATE_COMMAND_1ARG(command, guidance, argName0) \
RADMON_CREATE_COMMAND_0ARGS(command, guidance); \
_ADD_ARG(command, argName0)
#define RADMON_CREATE_COMMAND_2ARGS(command, guidance, argName0, argName1) \
RADMON_CREATE_COMMAND_1ARG(command, guidance, argName0); \
_ADD_ARG(command, argName1)
#define RADMON_CREATE_COMMAND_3ARGS(command, guidance, argName0, argName1, argName2) \
RADMON_CREATE_COMMAND_2ARGS(command, guidance, argName0, argName1); \
_ADD_ARG(command, argName2)
#define RADMON_CREATE_COMMAND_4ARGS(command, guidance, argName0, argName1, argName2, argName3) \
RADMON_CREATE_COMMAND_3ARGS(command, guidance, argName0, argName1, argName2); \
_ADD_ARG(command, argName3)
#define RADMON_CREATE_COMMAND_5ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4) \
RADMON_CREATE_COMMAND_4ARGS(command, guidance, argName0, argName1, argName2, argName3); \
_ADD_ARG(command, argName4)
#define RADMON_CREATE_COMMAND_6ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4, argName5) \
RADMON_CREATE_COMMAND_5ARGS(command, guidance, argName0, argName1, argName2, argName3, argName4); \
_ADD_ARG(command, argName5)
#define RADMON_DESTROY_COMMAND(command) if ( cmd ## command ) \
delete cmd ## command;
#define RADMON_BEGIN_LIST_SET_COMMANDS if (!command) \
G4cout << "RadmonDetectorMessenger::SetNewValue: command==0." << G4endl; \
else
#define RADMON_SET_COMMAND(name) if ( cmd ## name == command) \
On ## name (newValue); \
else
#define RADMON_END_LIST_SET_COMMANDS G4cout << "RadmonDetectorMessenger::SetNewValue: Command \"" << command->GetCommandPath() << "\" not supported." << G4endl;
#endif /* RADMONMESSENGERSSUPPORT_HH */
@@ -0,0 +1,92 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonTLabelledCollection.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonTLabelledCollection.hh,v 1.4 2006/06/29 16:14:29 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Container for objects with the following methods
// - Constructor
// - Copy-constructor
// - Destructor
// - Copy operation
// - const G4String & GetLabel(void) const
//
#ifndef RADMONTLABELLEDCOLLECTION_HH
#define RADMONTLABELLEDCOLLECTION_HH
// Include files
#include "globals.hh"
#include <vector>
// Forward declarations
class G4String;
template <typename LabelledObject>
class RadmonTLabelledCollection
{
public:
RadmonTLabelledCollection();
RadmonTLabelledCollection(const RadmonTLabelledCollection<LabelledObject> & copy);
~RadmonTLabelledCollection();
RadmonTLabelledCollection<LabelledObject> & operator=(const RadmonTLabelledCollection<LabelledObject> & copy);
G4int GetNItems() const;
G4bool Empty() const;
G4bool ExistsItemByLabel(const G4String & label) const;
G4int MultiplicityItemByLabel(const G4String & label) const;
const LabelledObject & GetItem(G4int index) const;
LabelledObject & GetItem(G4int index);
const LabelledObject & FindItemByLabel(const G4String & label, G4int count = 0) const;
LabelledObject & FindItemByLabel(const G4String & label, G4int count = 0);
LabelledObject & InsertItemAfter(G4int index);
LabelledObject & InsertItemBefore(G4int index);
LabelledObject & AppendItem(void);
LabelledObject & PrependItem(void);
void RemoveItemByLabel(const G4String & label, G4int count = 0);
void RemoveItemsByLabel(const G4String & label);
void RemoveItem(G4int index);
void RemoveItemsByRange(G4int first, G4int last);
void RemoveAllItems();
private:
typedef std::vector<LabelledObject> Collection;
Collection collection;
};
// Inline implementations
#include "RadmonTLabelledCollection.icc"
#endif /* RADMONTLABELLEDCOLLECTION_HH */
@@ -0,0 +1,298 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonTLabelledCollection.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonTLabelledCollection.icc,v 1.6 2006/06/29 16:14:31 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONTLABELLEDCOLLECTION_HH
#error "RadmonTLabelledCollection.icc cannot be included directly. Please use RadmonTLabelledCollection.hh"
#else /* RADMONTLABELLEDCOLLECTION_HH */
template <typename LabelledObject>
RadmonTLabelledCollection<LabelledObject> :: RadmonTLabelledCollection()
{
}
template <typename LabelledObject>
RadmonTLabelledCollection<LabelledObject> :: RadmonTLabelledCollection(const RadmonTLabelledCollection<LabelledObject> & copy)
{
collection=copy.collection;
}
template <typename LabelledObject>
RadmonTLabelledCollection<LabelledObject> :: ~RadmonTLabelledCollection()
{
}
template <typename LabelledObject>
RadmonTLabelledCollection<LabelledObject> & RadmonTLabelledCollection<LabelledObject> :: operator=(const RadmonTLabelledCollection<LabelledObject> & copy)
{
collection=copy.collection;
return (*this);
}
template <typename LabelledObject>
G4int RadmonTLabelledCollection<LabelledObject> :: GetNItems() const
{
return collection.size();
}
template <typename LabelledObject>
G4bool RadmonTLabelledCollection<LabelledObject> :: Empty() const
{
return collection.empty();
}
template <typename LabelledObject>
G4bool RadmonTLabelledCollection<LabelledObject> :: ExistsItemByLabel(const G4String & label) const
{
size_t i(collection.size());
while (i>0)
{
i--;
if (collection[i].GetLabel()==label)
return true;
}
return false;
}
template <typename LabelledObject>
G4int RadmonTLabelledCollection<LabelledObject> :: MultiplicityItemByLabel(const G4String & label) const
{
G4int count(0);
size_t i(collection.size());
while (i>0)
{
i--;
if (collection[i].GetLabel()==label)
count++;
}
return count;
}
template <typename LabelledObject>
const LabelledObject & RadmonTLabelledCollection<LabelledObject> :: GetItem(G4int index) const
{
return collection[index];
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: GetItem(G4int index)
{
return collection[index];
}
template <typename LabelledObject>
const LabelledObject & RadmonTLabelledCollection<LabelledObject> :: FindItemByLabel(const G4String & label, G4int count) const
{
return const_cast<RadmonTLabelledCollection *>(this)->FindItemByLabel(label, count);
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: FindItemByLabel(const G4String & label, G4int count)
{
typename Collection::iterator i(collection.begin());
typename Collection::iterator const end(collection.end());
while (i<end)
{
if (i->GetLabel()==label)
{
if (count==0)
return (*i);
count--;
}
i++;
}
G4String text("RadmonTLabelledCollection::FindItemByLabel: Label \"");
text+=label;
text+="\" not found.";
G4Exception(text);
return collection.front();
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: InsertItemAfter(G4int index)
{
return InsertBefore(index+1);
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: InsertItemBefore(G4int index)
{
typename Collection::iterator i(collection.begin());
i+=index;
collection.insert(i, LabelledObject());
return collection[index];
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: AppendItem(void)
{
collection.push_back(LabelledObject());
return collection.back();
}
template <typename LabelledObject>
LabelledObject & RadmonTLabelledCollection<LabelledObject> :: PrependItem(void)
{
collection.insert(collection.begin(), LabelledObject());
return collection.front();
}
template <typename LabelledObject>
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemByLabel(const G4String & label, G4int count)
{
typename Collection::iterator i(collection.begin());
typename Collection::iterator const end(collection.end());
while (i<end)
{
if (i->GetLabel()==label)
{
if (count==0)
{
collection.erase(i);
return;
}
count--;
}
i++;
}
}
template <typename LabelledObject>
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemsByLabel(const G4String & label)
{
typename Collection::iterator i(collection.begin());
typename Collection::iterator const end(collection.end());
while (i<end)
{
if (i->GetLabel()==label)
i=collection.erase(i);
else
i++;
}
}
template <typename LabelledObject>
void RadmonTLabelledCollection<LabelledObject> :: RemoveItem(G4int index)
{
typename Collection::iterator i(collection.begin());
i+=index;
collection.erase(i);
}
template <typename LabelledObject>
void RadmonTLabelledCollection<LabelledObject> :: RemoveItemsByRange(G4int first, G4int last)
{
typename Collection::iterator i(collection.begin());
typename Collection::iterator j(i);
i+=first;
j+=last;
collection.erase(i, j);
}
template <typename LabelledObject>
void RadmonTLabelledCollection<LabelledObject> :: RemoveAllItems()
{
collection.clear();
}
#endif /* RADMONTLABELLEDCOLLECTION_HH */
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonTokenizer.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonTokenizer.hh,v 1.3 2006/06/29 16:14:33 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Reads single tokens of a string
//
#ifndef RADMONTOKENIZER_HH
#define RADMONTOKENIZER_HH
// Include files
#include "globals.hh"
#include "G4String.hh"
class RadmonTokenizer
{
public:
inline RadmonTokenizer(const G4String & str);
inline ~RadmonTokenizer();
inline void rewind(void);
G4String operator()(const char * separators=" \t\n", const char * quotations="'\"");
inline G4bool eos(void) const;
private:
// Hidden constructors and operators
RadmonTokenizer();
RadmonTokenizer(const RadmonTokenizer & copy);
RadmonTokenizer & operator=(const RadmonTokenizer & copy);
// Private attributes
str_size position;
G4String data;
};
// Inline implementations
#include "RadmonTokenizer.icc"
#endif /* RADMONTOKENIZER_HH */
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonTokenizer.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonTokenizer.icc,v 1.3 2006/06/29 16:14:35 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONTOKENIZER_HH
#error "RadmonTokenizer.icc cannot be included directly. Please use RadmonTokenizer.hh"
#else /* RADMONTOKENIZER_HH */
inline RadmonTokenizer :: RadmonTokenizer(const G4String & str)
:
position(0),
data(str)
{
}
inline RadmonTokenizer :: ~RadmonTokenizer()
{
}
inline void RadmonTokenizer :: rewind(void)
{
position=0;
}
inline G4bool RadmonTokenizer :: eos(void) const
{
return position>=data.size();
}
#endif /* RADMONTOKENIZER_HH */
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonVLayoutObserver.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonVLayoutObserver.hh,v 1.3 2006/06/29 16:14:37 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Observer class of the observer-subjectmodel for the detector
// layout
//
#ifndef RADMONVLAYOUTOBSERVER_HH
#define RADMONVLAYOUTOBSERVER_HH
class RadmonVLayoutSubject;
class RadmonVLayoutObserver
{
public:
virtual void OnLayoutChange(void) = 0;
protected:
inline RadmonVLayoutObserver();
inline ~RadmonVLayoutObserver();
private:
// Hidden constructors and operators
RadmonVLayoutObserver(const RadmonVLayoutObserver & copy);
RadmonVLayoutObserver & operator=(const RadmonVLayoutObserver & copy);
};
// Inline implementations
#include "RadmonVLayoutObserver.icc"
#endif /* RADMONVLAYOUTOBSERVER_HH */
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonVLayoutObserver.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonVLayoutObserver.icc,v 1.3 2006/06/29 16:14:39 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONVLAYOUTOBSERVER_HH
#error "RadmonVLayoutObserver.icc cannot be included directly. Please use RadmonVLayoutObserver.hh"
#else /* RADMONVLAYOUTOBSERVER_HH */
inline RadmonVLayoutObserver :: RadmonVLayoutObserver()
{
}
inline RadmonVLayoutObserver :: ~RadmonVLayoutObserver()
{
}
#endif /* RADMONVLAYOUTOBSERVER_HH */
@@ -0,0 +1,71 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonVLayoutSubject.hh
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonVLayoutSubject.hh,v 1.2.2.2 2006/06/29 16:14:41 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
// Description: Subject class of the observer-subjectmodel for the detector
// layout
//
#ifndef RADMONVLAYOUTSUBJECT_HH
#define RADMONVLAYOUTSUBJECT_HH
// Include files
#include <set>
// Forward declarations
class RadmonVLayoutObserver;
class RadmonVLayoutSubject
{
public:
void AttachObserver(RadmonVLayoutObserver * observer);
void DetachObserver(RadmonVLayoutObserver * observer);
protected:
inline RadmonVLayoutSubject();
inline ~RadmonVLayoutSubject();
void NotifyChange(void);
private:
// Hidden constructors and operators
RadmonVLayoutSubject(const RadmonVLayoutSubject & copy);
RadmonVLayoutSubject & operator=(const RadmonVLayoutSubject & copy);
// Private attributes
typedef std::set<RadmonVLayoutObserver *> ObserversSet;
ObserversSet observersSet;
};
// Inline implementations
#include "RadmonVLayoutSubject.icc"
#endif /* RADMONVLAYOUTSUBJECT_HH */
@@ -0,0 +1,47 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// File name: RadmonVLayoutSubject.icc
// Creation date: Sep 2005
// Main author: Riccardo Capra <capra@ge.infn.it>
//
// Id: $Id: RadmonVLayoutSubject.icc,v 1.3 2006/06/29 16:14:43 gunter Exp $
// Tag: $Name: geant4-08-01 $
//
#ifndef RADMONVLAYOUTSUBJECT_HH
#error "RadmonVLayoutSubject.icc cannot be included directly. Please use RadmonVLayoutSubject.hh"
#else /* RADMONVLAYOUTSUBJECT_HH */
inline RadmonVLayoutSubject :: RadmonVLayoutSubject()
{
}
inline RadmonVLayoutSubject :: ~RadmonVLayoutSubject()
{
}
#endif /* RADMONVLAYOUTSUBJECT_HH */