| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

TupleEx3::TupleEx3 Class Reference

Simple algorithm for advanced N-Tuple columns. More...

Inheritance diagram for TupleEx3::TupleEx3:

[legend]
Collaboration diagram for TupleEx3::TupleEx3:
[legend]
List of all members.

Public Member Functions

def __init__
 standard constructor
def execute
 the main execution method

Detailed Description

Simple algorithm for advanced N-Tuple columns.

Simple algorithm for advanced (matrix&array) N-Tuple columns 

Definition at line 52 of file TupleEx3.py.


Member Function Documentation

def TupleEx3::TupleEx3::__init__ (   self,
  name = 'TupleEx3' 
)

standard constructor

Constructor 

Definition at line 56 of file TupleEx3.py.

00058                                               :
00059         """ Constructor """
        TupleAlgo.__init__( self , name )

def TupleEx3::TupleEx3::execute (   self  ) 

the main execution method

The major method 'execute', it is invoked for each event 

Definition at line 61 of file TupleEx3.py.

00063                         :
00064         """ The major method 'execute', it is invoked for each event """
00065 
00066         gauss = Rndm.Numbers ( self.randSvc() , Rndm.Gauss ( 0.0 , 1.0 ) )
00067         flat  = Rndm.Numbers ( self.randSvc() , Rndm.Flat  ( -10 , 10  ) )
00068         breit = Rndm.Numbers ( self.randSvc() , Rndm.BreitWigner  ( 0.0 , 1.0  ) )
00069 
00070         ## N-tuple with farrays
00071         tup = self.nTuple('farrays', 'N-tuple with farrays')
00072         
00073         for i in range(0,20) :
00074 
00075             # std::vector<double>
00076             
00077             # prepare some data array (std::vector<double>)
00078             v1=vct1()
00079             n=long(50+2*flat())
00080             # fill it with some random data 
00081             for j in range(0,n) : v1.push_back( gauss() )
00082             #fill N-tuple 
00083             tup.farray('gauss',v1,'len1',150)
00084 
00085             # prepare some data array (CLHEP::HepVector<double>)
00086             n=long(50+2*flat())
00087             v2=vct2(n)
00088             #fill N-tuple 
00089             tup.farray('breit',v2,'len2',150)
00090 
00091             # commit the row 
00092             tup.write() 
00093 
00094         ## N-tuple with arrays
00095         tup = self.nTuple('arrays', 'N-tuple with arrays')
00096         for i in range(0,20) :
00097 
00098             # std::vector<double>
00099             
00100             # prepare some data array (std::vector<double>)
00101             v1=vct1(30,1.0)
00102             #fill N-tuple 
00103             tup.array('gauss',v1)
00104             
00105             # use CLHEP::HepVector
00106             v2=vct2( 30 )
00107             tup.array('breit',v2)
00108 
00109             # use Gaudi::Vector2
00110             v= Gaudi.Vector2()
00111             tup.array ( 'v2' , v ) ;
00112 
00113             # use Gaudi::Vector3
00114             v= Gaudi.Vector3()
00115             tup.array ( 'v3' , v ) ;
00116 
00117             # use Gaudi::Vector4
00118             v= Gaudi.Vector4()
00119             tup.array ( 'v4' , v ) ;
00120 
00121             # use Gaudi::Vector5
00122             v= Gaudi.Vector5()
00123             tup.array ( 'v5' , v ) ;
00124 
00125             # use Gaudi::Vector6
00126             v= Gaudi.Vector6()
00127             tup.array ( 'v6' , v ) ;
00128 
00129             # use Gaudi::Vector7
00130             v= Gaudi.Vector7()
00131             tup.array ( 'v7' , v ) ;
00132 
00133             # use Gaudi::Vector8
00134             v= Gaudi.Vector8()
00135             tup.array ( 'v8' , v ) ;
00136 
00137             # use Gaudi::Vector9
00138             v= Gaudi.Vector9()
00139             tup.array ( 'v9' , v ) ;
00140 
00141             # commit the row 
00142             tup.write() 
00143 
00144         ## N-tuple with fixed square matrices 
00145         tup = self.nTuple('square', 'N-tuple with square matrices')
00146         for i in range(0,20) :
00147 
00148             # make a matrice 
00149             m=Gaudi.Matrix2x2()
00150             tup.matrix ( "m2" , m )
00151 
00152             # make a matrice 
00153             m=Gaudi.Matrix3x3()
00154             tup.matrix ( "m3" , m )
00155 
00156             # make a matrice 
00157             m=Gaudi.Matrix4x4()
00158             tup.matrix ( "m4" , m )
00159 
00160             # make a matrice 
00161             m=Gaudi.Matrix5x5()
00162             # fill n-tuple 
00163             tup.matrix ( "m5" , m )
00164 
00165             # make a matrice 
00166             m=Gaudi.Matrix6x6()
00167             # fill n-tuple 
00168             tup.matrix ( "m6" , m )
00169 
00170             # make a matrice 
00171             m=Gaudi.Matrix7x7()
00172             tup.matrix ( "m7" , m )
00173 
00174             # make a matrice 
00175             m=Gaudi.Matrix8x8()
00176             # fill n-tuple 
00177             tup.matrix ( "m8" , m )
00178 
00179             # make a matrice 
00180             m=Gaudi.Matrix9x9()
00181             tup.matrix ( "m9" , m )
00182 
00183             # commit the row 
00184             tup.write()
00185 
00186         return SUCCESS                
                


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:59:39 2011 for GaudiExamples by doxygen 1.4.7