G4TrajectoryFilterFactories.cc

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 //
00027 // GEANT4 tag $Name: not supported by cvs2svn $
00028 //
00029 //
00030 // Trajectory filter model factories creating filters
00031 // and associated messengers.
00032 //
00033 // Jane Tinslay March 2006
00034 //
00035 #include "G4AttributeFilterT.hh"
00036 #include "G4ModelCommandsT.hh"
00037 #include "G4TrajectoryFilterFactories.hh"
00038 #include "G4TrajectoryChargeFilter.hh"
00039 #include "G4TrajectoryParticleFilter.hh"
00040 #include "G4TrajectoryOriginVolumeFilter.hh"
00041 
00042 // Attribute filter
00043 G4TrajectoryAttributeFilterFactory::G4TrajectoryAttributeFilterFactory()
00044   :G4VModelFactory< G4VFilter<G4VTrajectory> >("attributeFilter") 
00045 {}
00046 
00047 G4TrajectoryAttributeFilterFactory::~G4TrajectoryAttributeFilterFactory() {}
00048 
00049 G4TrajectoryAttributeFilterFactory::ModelAndMessengers
00050 G4TrajectoryAttributeFilterFactory::Create(const G4String& placement, const G4String& name)
00051 {
00052   typedef G4AttributeFilterT<G4VTrajectory> G4TrajectoryAttributeFilter;
00053   // Create model
00054   G4TrajectoryAttributeFilter* model = new G4TrajectoryAttributeFilter(name);
00055   
00056   // Create associated messengers
00057   Messengers messengers;
00058   
00059   messengers.push_back(new G4ModelCmdSetString<G4TrajectoryAttributeFilter>(model, placement, "setAttribute"));
00060   messengers.push_back(new G4ModelCmdInvert<G4TrajectoryAttributeFilter>(model, placement));
00061   messengers.push_back(new G4ModelCmdActive<G4TrajectoryAttributeFilter>(model, placement));
00062   messengers.push_back(new G4ModelCmdVerbose<G4TrajectoryAttributeFilter>(model, placement));
00063   messengers.push_back(new G4ModelCmdReset<G4TrajectoryAttributeFilter>(model, placement));
00064   messengers.push_back(new G4ModelCmdAddInterval<G4TrajectoryAttributeFilter>(model, placement, "addInterval"));
00065   messengers.push_back(new G4ModelCmdAddValue<G4TrajectoryAttributeFilter>(model, placement, "addValue"));
00066  
00067   return ModelAndMessengers(model, messengers);
00068 }
00069 
00070 // Charge filter
00071 G4TrajectoryChargeFilterFactory::G4TrajectoryChargeFilterFactory()
00072   :G4VModelFactory< G4VFilter<G4VTrajectory> >("chargeFilter") 
00073 {}
00074 
00075 G4TrajectoryChargeFilterFactory::~G4TrajectoryChargeFilterFactory() {}
00076 
00077 G4TrajectoryChargeFilterFactory::ModelAndMessengers
00078 G4TrajectoryChargeFilterFactory::Create(const G4String& placement, const G4String& name)
00079 {
00080   // Create model
00081   G4TrajectoryChargeFilter* model = new G4TrajectoryChargeFilter(name);
00082   
00083   // Create associated messengers
00084   Messengers messengers;
00085   
00086   messengers.push_back(new G4ModelCmdAddString<G4TrajectoryChargeFilter>(model, placement));
00087   messengers.push_back(new G4ModelCmdInvert<G4TrajectoryChargeFilter>(model, placement));
00088   messengers.push_back(new G4ModelCmdActive<G4TrajectoryChargeFilter>(model, placement));
00089   messengers.push_back(new G4ModelCmdVerbose<G4TrajectoryChargeFilter>(model, placement));
00090   messengers.push_back(new G4ModelCmdReset<G4TrajectoryChargeFilter>(model, placement));
00091   
00092   return ModelAndMessengers(model, messengers);
00093 }
00094 
00095 // Particle type filter
00096 G4TrajectoryParticleFilterFactory::G4TrajectoryParticleFilterFactory()
00097   :G4VModelFactory< G4VFilter<G4VTrajectory> >("particleFilter") 
00098 {}
00099 
00100 G4TrajectoryParticleFilterFactory::~G4TrajectoryParticleFilterFactory() {}
00101 
00102 G4TrajectoryParticleFilterFactory::ModelAndMessengers
00103 G4TrajectoryParticleFilterFactory::Create(const G4String& placement, const G4String& name)
00104 {
00105   // Create model
00106   G4TrajectoryParticleFilter* model = new G4TrajectoryParticleFilter(name);
00107   
00108   // Create associated messengers
00109   Messengers messengers;
00110   
00111   messengers.push_back(new G4ModelCmdAddString<G4TrajectoryParticleFilter>(model, placement));
00112   messengers.push_back(new G4ModelCmdInvert<G4TrajectoryParticleFilter>(model, placement));
00113   messengers.push_back(new G4ModelCmdActive<G4TrajectoryParticleFilter>(model, placement));
00114   messengers.push_back(new G4ModelCmdVerbose<G4TrajectoryParticleFilter>(model, placement));
00115   messengers.push_back(new G4ModelCmdReset<G4TrajectoryParticleFilter>(model, placement));
00116   
00117   return ModelAndMessengers(model, messengers);
00118 }
00119 
00120 
00121 // Origin volume filter
00122 G4TrajectoryOriginVolumeFilterFactory::G4TrajectoryOriginVolumeFilterFactory()
00123   :G4VModelFactory< G4VFilter<G4VTrajectory> >("originVolumeFilter") 
00124 {}
00125 
00126 G4TrajectoryOriginVolumeFilterFactory::~G4TrajectoryOriginVolumeFilterFactory() {}
00127 
00128 G4TrajectoryOriginVolumeFilterFactory::ModelAndMessengers
00129 G4TrajectoryOriginVolumeFilterFactory::Create(const G4String& placement, const G4String& name)
00130 {
00131   // Create model
00132   G4TrajectoryOriginVolumeFilter* model = new G4TrajectoryOriginVolumeFilter(name);
00133   
00134   // Create associated messengers
00135   Messengers messengers;
00136   
00137   messengers.push_back(new G4ModelCmdAddString<G4TrajectoryOriginVolumeFilter>(model, placement));
00138   messengers.push_back(new G4ModelCmdInvert<G4TrajectoryOriginVolumeFilter>(model, placement));
00139   messengers.push_back(new G4ModelCmdActive<G4TrajectoryOriginVolumeFilter>(model, placement));
00140   messengers.push_back(new G4ModelCmdVerbose<G4TrajectoryOriginVolumeFilter>(model, placement));
00141   messengers.push_back(new G4ModelCmdReset<G4TrajectoryOriginVolumeFilter>(model, placement));
00142   
00143   return ModelAndMessengers(model, messengers);
00144 }
00145 
00146 

Generated on Mon May 27 17:50:02 2013 for Geant4 by  doxygen 1.4.7