コード例 #1
0
ファイル: test3.py プロジェクト: newtrino/vertigo
#!/usr/bin/python

print "Tests kalman, avf, and mvf against one event. Checks if output changes."

from vertigo import RaveVertexFactory, EventFactory, LoopSettings, VertexMetaFactory_Instance

def printVertex ( vertex ):
  print "pos=( %(x).4f, %(y).4f, %(z).4f ) chi2=%(chi2).1f ndf=%(n).1f" % \
    { "x": vertex.position().x(), "y": vertex.position().y(), "z": vertex.position().z(), \
      "chi2": vertex.chiSquared(), "n": vertex.ndf()  }

LoopSettings.Instance().setVerbosity(0)

ravefactory=VertexMetaFactory_Instance().get ("dummy" )

eventfactory=EventFactory ( "input3.txt" )

# methods = [ "linpt" ]
methods = [ "kalman", "avf-smoothing:0", "avf-smoothing:1", "avr-primcut:2.0-seccut:6.0-smoothing:0-weightthreshold:0.001", "avr-primcut:2.0-seccut:6.0-smoothing:0-weightthreshold:0.01", "tkf" ]
spotmethods= [ "avr", "tkf" ]
# methods = [ "linpt", "kalman", "avf-smoother:none", "avf-smoother:kalman", "mvf", "avr" ]

for event in eventfactory:
  for method in methods:
    print method+" no beamspot:"
    vertices=ravefactory.create ( event.tracks(), method, False )
    for vertex in vertices:
      printVertex ( vertex )

  for method in spotmethods:
    print method+" beamspot:"
コード例 #2
0
ファイル: test1.py プロジェクト: newtrino/vertigo
#!/usr/bin/python

print "Tests kalman, avf, and mvf against one event. Checks if output changes."

from vertigo import RaveVertexFactory, EventFactory, RaveConstantMagneticField, RaveVacuumPropagator, LoopSettings, RaveTrackContainer, RavePoint3D
from vertigo import ObserverManager_Instance, VertigoHarvest_close, VertexMetaFactory_Instance

LoopSettings.Instance().setVerbosity(0)

# ravefactory=RaveVertexFactory ( RaveConstantMagneticField(4.0,0.,0.), RaveVacuumPropagator() )
ravefactory=VertexMetaFactory_Instance().get ("ship" )
p=RavePoint3D(0.,0.,0.)
print "p=",p
print "field",ravefactory.getMagneticField().inTesla( p )

def printVertex ( vertex ):
  print "pos=( %(x).4f, %(y).4f, %(z).4f ) chi2=%(chi2).3f ntrks=%(n)d" % \
    { "x": vertex.position().x(), "y": vertex.position().y(), "z": vertex.position().z(), \
      "chi2": vertex.chiSquared(), "n": len (vertex.tracks())  }

eventfactory=EventFactory ( "input1.txt" )

# methods = [ "kalman", "avf", "mvf" ]
methods = [ "kalman", "avf-smoothing:0", "avf-smoothing:1", "avr", "tkf", "mvf" ]
methods = [ "avf" ]
    
vis=ObserverManager_Instance().get("VertexHistogrammer")

for event in eventfactory:
  for method in methods:
    print method+":"
コード例 #3
0
ファイル: test10.py プロジェクト: newtrino/vertigo
#!/usr/bin/python

print "Simple btagging test, but now with beamspot constraint!"

from vertigo import RaveVertexFactory, RaveFlavorTagFactory, RaveConstantMagneticField,\
                    RaveVacuumPropagator, EventFactory, VertigoToCmsObjects,\
                    RavePoint3D, LoopSettings, RaveTrackContainer, VertexMetaFactory_Instance, \
                    RaveEllipsoid3D, RaveCovariance3D, LoopSettings_Instance


LoopSettings_Instance().setVerbosity(255)
ravefactory=VertexMetaFactory_Instance().get("dummy")
method="avr-primcut:2.5-primT:4096-primr:0.125-secT:1024-secr:0.25-smoothing:0-weightthreshold:0.0-seccut:2.3"
ravefactory.setDefaultMethod ( method )
# beamspot=RaveEllipsoid3D()
beamspot=RaveEllipsoid3D( RavePoint3D(), RaveCovariance3D( .0015**2,0.,0.,.0015**2,0.,5.3**2 ) )
ravefactory.setBeamSpot ( beamspot )

if False:
  print "bs=",beamspot.isValid()
  print "Has Beamspot?",ravefactory.hasBeamspot()
  print "dzz",ravefactory.getBeamspot().covariance().dzz()
  print "mz=",ravefactory.getMagneticField().inTesla ( RavePoint3D() ).z()

btagfactory=RaveFlavorTagFactory ( ravefactory )

set=LoopSettings.Instance()

set.setVerbosity(0)

eventfactory=EventFactory ( "bb.1.txt" )