-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
469 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,21 @@ | ||
__all__ = ["Pythia8"] | ||
|
||
from GaugiKernel import Logger | ||
from GaugiKernel import Cpp | ||
from GaugiKernel.macros import * | ||
from G4Kernel import treatPropertyValue | ||
from ROOT import generator | ||
|
||
|
||
class Pythia8( Logger ): | ||
class Pythia8( Cpp ): | ||
|
||
__allow_keys = [ | ||
"File", | ||
"Seed", | ||
"OutputLevel", | ||
"EventNumber", | ||
] | ||
|
||
def __init__( self, name, **kw ): | ||
def __init__( self, name, | ||
File : str="", | ||
Seed : int=512, | ||
OutputLevel : int=0, | ||
EventNumber : int=-1, | ||
): | ||
|
||
Logger.__init__(self) | ||
import ROOT | ||
ROOT.gSystem.Load('liblorenzetti') | ||
from ROOT import generator | ||
# Create the algorithm | ||
self.__core = generator.Pythia8Gen() | ||
for key, value in kw.items(): | ||
self.setProperty( key,value ) | ||
|
||
|
||
def core(self): | ||
return self.__core | ||
|
||
|
||
def setProperty( self, key, value ): | ||
if key in self.__allow_keys: | ||
setattr( self, '__' + key , value ) | ||
self.core().setProperty( key, treatPropertyValue(value) ) | ||
else: | ||
MSG_FATAL( self, "Property with name %s is not allow for %s object", key, self.__class__.__name__) | ||
|
||
|
||
def getProperty( self, key ): | ||
if key in self.__allow_keys: | ||
return getattr( self, '__' + key ) | ||
else: | ||
MSG_FATAL( self, "Property with name %s is not allow for %s object", key, self.__class__.__name__) | ||
Cpp.__init__(self, generator.Pythia8Gen()) | ||
self.setProperty( "Seed" , Seed ) | ||
self.setProperty( "EventNumber" , EventNumber ) | ||
#self.setProperty( "OutputLevel" , OutputLevel ) | ||
self.setProperty( "File" , File ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,20 @@ | ||
__all__ = ["P8Gun"] | ||
|
||
from GaugiKernel import Logger | ||
from GaugiKernel import Cpp | ||
from GaugiKernel.macros import * | ||
from G4Kernel import treatPropertyValue | ||
from ROOT import generator | ||
|
||
|
||
class P8Gun( Logger ): | ||
class P8Gun( Cpp ): | ||
|
||
__allow_keys = [ | ||
"File", | ||
"Seed", | ||
"OutputLevel", | ||
] | ||
def __init__( self, name, | ||
File : str="", | ||
Seed : int=512, | ||
OutputLevel : int=0 | ||
): | ||
|
||
def __init__( self, name, **kw ): | ||
|
||
Logger.__init__(self) | ||
import ROOT | ||
ROOT.gSystem.Load('liblorenzetti') | ||
from ROOT import generator | ||
# Create the algorithm | ||
self.__core = generator.P8Gun() | ||
for key, value in kw.items(): | ||
self.setProperty( key,value ) | ||
Cpp.__init__(self, generator.P8Gun()) | ||
self.setProperty( "File" , File ) | ||
self.setProperty( "Seed" , Seed ) | ||
self.setProperty( "OutputLevel" , OutputLevel ) | ||
|
||
|
||
def core(self): | ||
return self.__core | ||
|
||
|
||
def setProperty( self, key, value ): | ||
if key in self.__allow_keys: | ||
setattr( self, '__' + key , value ) | ||
self.core().setProperty( key, treatPropertyValue(value) ) | ||
else: | ||
MSG_FATAL( self, "Property with name %s is not allow for %s object", key, self.__class__.__name__) | ||
|
||
|
||
def getProperty( self, key ): | ||
if key in self.__allow_keys: | ||
return getattr( self, '__' + key ) | ||
else: | ||
MSG_FATAL( self, "Property with name %s is not allow for %s object", key, self.__class__.__name__) |
Oops, something went wrong.