Esempio n. 1
0
def execute(evt_type=13104021, stereo=5):
    importOptions(
        "$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu7.6-HorExtAngle.py")

    importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
    importOptions("$APPCONFIGOPTS/Gauss/G4PL_FTFP_BERT_EmNoCuts.py")
    importOptions("$APPCONFIGOPTS/Conditions/Upgrade.py")
    importOptions("$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py")
    importOptions("$APPCONFIGOPTS/Gauss/Gauss-Upgrade-Baseline-20131029.py")

    outpath = "%s_%s" % ("Stereo", evt_type)
    Gauss().DataType = "Upgrade"

    set_tags(stereo)

    importOptions("$DECFILESROOT/options/%s.py" % (evt_type))

    GaussGen = GenInit("GaussGen")
    GaussGen.FirstEventNumber = 1
    GaussGen.RunNumber = 1082

    LHCbApp().EvtMax = 10

    HistogramPersistencySvc().OutputFile = outpath + '-GaussHistos.root'

    OutputStream(
        "GaussTape"
    ).Output = "DATAFILE='PFN:%s.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'" % outpath
def execute(evt_type=13104021, stereo=5):
    importOptions(
        "$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu7.6-HorExtAngle.py")

    importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
    importOptions("$APPCONFIGOPTS/Gauss/G4PL_FTFP_BERT_EmNoCuts.py")
    importOptions("$APPCONFIGOPTS/Conditions/Upgrade.py")
    importOptions("$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py")
    importOptions("$APPCONFIGOPTS/Gauss/Gauss-Upgrade-Baseline-20131029.py")

    outpath = "%s_%s" % ("Gun", evt_type)
    Gauss().DataType = "Upgrade"

    set_tags(stereo)

    importOptions('$LBPGUNSROOT/options/PGuns.py')
    from Configurables import ParticleGun
    #ParticleGun().EventType = 52210010

    # Set momentum
    from Configurables import MaterialEval
    ParticleGun().addTool(MaterialEval, name="MaterialEval")
    ParticleGun().ParticleGunTool = "MaterialEval"
    x_orig = 480
    y_orig = 500
    ParticleGun().MaterialEval.Xorig = x_orig
    ParticleGun().MaterialEval.Yorig = y_orig
    ParticleGun().MaterialEval.Zorig = 7620
    ParticleGun().MaterialEval.ModP = 150000  #150GeV

    ParticleGun().MaterialEval.ZPlane = 9439
    ParticleGun().MaterialEval.Xmin = x_orig - 20
    ParticleGun().MaterialEval.Xmax = x_orig + 20
    ParticleGun().MaterialEval.Ymin = y_orig - 5
    ParticleGun().MaterialEval.Ymax = y_orig + 5
    ParticleGun().MaterialEval.PdgCode = 211

    # Set min and max number of particles to produce in an event
    from Configurables import FlatNParticles
    ParticleGun().addTool(FlatNParticles, name="FlatNParticles")
    ParticleGun().NumberOfParticlesTool = "FlatNParticles"
    ParticleGun().FlatNParticles.MinNParticles = 2
    ParticleGun().FlatNParticles.MaxNParticles = 2

    GaussGen = GenInit("GaussGen")
    GaussGen.FirstEventNumber = 1
    GaussGen.RunNumber = 1082

    LHCbApp().EvtMax = 10

    HistogramPersistencySvc().OutputFile = outpath + '-GaussHistos.root'

    OutputStream(
        "GaussTape"
    ).Output = "DATAFILE='PFN:%s.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'" % outpath
Esempio n. 3
0
from Gaudi.Configuration import *
from Gauss.Configuration import *
from Configurables import CondDB, LHCbApp

#from Configurables import DDDBConf, CondDBAccessSvc
#DDDBConf(DbRoot = "myDDDB/lhcb.xml")

importOptions("$GAUSSROOT/options/Gauss-2011.py")
CondDB.LocalTags = { "DDDB" : [ "radlength-20141010", "radlength-20141003", "radlength-20140908" ] }

from Configurables import Gauss
from Gauss.Configuration import *
import sys

Gauss().Production = 'PGUN'
Gauss().DeltaRays = False

def scoringGeo():
     from Configurables import GiGaInputStream
     geo = GiGaInputStream('Geo')

     geo.StreamItems += [ "/dd/Structure/LHCb/MagnetRegion/Scoring_Plane2" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/MagnetRegion/Scoring_Plane3" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/AfterMagnetRegion/T/Scoring_Plane4" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/AfterMagnetRegion/T/Scoring_Plane5" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/AfterMagnetRegion/T/Scoring_Plane6" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/AfterMagnetRegion/Scoring_Plane7" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/DownstreamRegion/Scoring_Plane8" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/DownstreamRegion/Scoring_Plane9" ]
     geo.StreamItems += [ "/dd/Structure/LHCb/DownstreamRegion/Scoring_Plane10" ]
Esempio n. 4
0

DDDBConf().DbRoot = "/afs/cern.ch/user/z/zhangy/workdir/EcalUpgrade/GaussDev_v52r2/myDDDB-tutorial/lhcb.xml" 
CondDB().Tags['DDDB'] = 'HEAD'

#--Set database tags 
from Configurables import LHCbApp
LHCbApp().DDDBtag   = "dddb-20171030-3"
LHCbApp().CondDBtag = "sim-20170721-2-vc-md100"

#### $APPCONFIGOPTS/Gauss/Sim08-Beam4000GeV-mu100-2012-nu2.5.py
importOptions("$APPCONFIGOPTS/Gauss/Sim08-Beam4000GeV-mu100-2012-nu2.5.py")

#### $APPCONFIGOPTS/Gauss/DataType-2012.py
from Configurables import Gauss
Gauss().DataType  = "2012"

####Gauss-Job.py
from Gauss.Configuration import *

#--Generator phase, set random numbers
GaussGen = GenInit("GaussGen")
GaussGen.FirstEventNumber = 1
GaussGen.RunNumber        = 1082

#--Number of events
nEvts = 10
LHCbApp().EvtMax = nEvts

#Gauss().OutputType = 'NONE'
#Gauss().Histograms = 'NONE'
Esempio n. 5
0
## #
## # Upgrade Detectors: VL UT FT Rich2Pmt
## #
## # Syntax is:
## #   gaudirun.py Gauss-Upgrade-VL-UT-FT-noRich.py <someInputJobConfig>.py
## ############################################################################

from Gaudi.Configuration import *
from Configurables import CondDB

CondDB().Upgrade = True
CondDB().AllLocalTagsByDataType = ["VL+UT", "FT"]

from Configurables import Gauss

Gauss().DetectorGeo = {
    "Detectors": [
        'VL', 'UT', 'FT', 'Rich2Pmt', 'Spd', 'Prs', 'Ecal', 'Hcal', 'Muon',
        'Magnet'
    ]
}
Gauss().DetectorSim = {
    "Detectors": [
        'VL', 'UT', 'FT', 'Rich2Pmt', 'Spd', 'Prs', 'Ecal', 'Hcal', 'Muon',
        'Magnet'
    ]
}
Gauss().DetectorMoni = {
    "Detectors": [
        'VL', 'UT', 'FT', 'Rich2Pmt', 'Spd', 'Prs', 'Ecal', 'Hcal', 'Muon',
        'Magnet'
#GaussGen.FirstEventNumber = 0
GaussGen.RunNumber = 5277

from Configurables import CondDB, Gauss 
CondDB().Upgrade = True

from Configurables import LHCbApp
LHCbApp().DDDBtag    = "dddb-20171009"
LHCbApp().CondDBtag  = "sim-20170301-vc-md100" 


LHCbApp().Simulation = True
LHCbApp().EvtMax = 100


Gauss().DetectorGeo  = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon', 'Magnet' ] }
Gauss().DetectorSim  = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon', 'Magnet' ] }
Gauss().DetectorMoni = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon' ] }
Gauss().DetectorGeo  = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Magnet' ] }
Gauss().DetectorSim  = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Magnet' ] }
Gauss().DetectorMoni = { "Detectors": ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal' ] }

## speed-up it
Gauss().SpilloverPaths = [] 
#Gauss().Phases = [ 'Generator' , 'Simulation' ] 
Gauss().Phases = ["Generator","GenToMCTree"]


#smear primary vertices timing information
def CkvPVTimeSmearActivate():
    from Configurables import Generation
Esempio n. 7
0
CondDB().UseLatestTags = ["2012"]

# End of databases setup
# special beam conditions used for pp collisions at 7 TeV
importOptions("$APPCONFIGOPTS/Gauss/Beam3500GeV-uniformHeadOn-fix1.py")
#importOptions("$DECFILESROOT/options/30000000.py")
importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
importOptions("$GAUSSOPTS/GenStandAlone.py")
#importOptions("$DECFILESROOT/options/SwitchOffEvtGen.py")
importOptions("$GAUSSOPTS/Gauss-Job.py")

#GaussGen = GenInit("GaussGen")
#GaussGen.RunNumber = 1082
LHCbApp().EvtMax = 1000
LHCbApp().OutputLevel = INFO
Gauss().Histograms = "NONE"
Gauss().OutputType = "NONE"
Gauss().DatasetName = "myRivetGauss"
# force head on collisions:
#Gauss().BeamCrossingAngle = 0.0
# eliminate smearing of crossing angles
#Gauss().BeamBetaStar = 0.0

GenMonitor = GaudiSequencer( "GenMonitor" )
GenMonitor.Members += [ "RivetAnalysisHandler", ]
rivet = RivetAnalysisHandler()
# the filename of the .aida output (w/o extension!)
rivet.BaseFileName = "myRivetGaussMC"
# head of branch where histograms are stored in AIDA
rivet.RunName = "LHCbMBPy8"
rivet.Analyses = ["MC_LHCb_GENERIC",]
Esempio n. 8
0
def setup_Target_GaussJob(physList,
                          targetThick,
                          targetMat,
                          projEng,
                          projID,
                          nEvts=10000):

    from Configurables import LHCbApp
    from Configurables import DDDBConf
    from Configurables import CondDB
    from Configurables import Gauss

    target = 'Target_' + str(targetThick) + 'mm' + targetMat

    Gauss()

    DDDBConf().DbRoot = "conddb:/TargetsDet.xml"
    if 'v45' not in os.environ["GAUSSROOT"]:
        CondDB().LoadCALIBDB = "HLT1"
    CondDB().Upgrade = True
    LHCbApp().DDDBtag = "dddb-20140120"
    LHCbApp().CondDBtag = "sim-20131108-vc-md100"
    LHCbApp().Simulation = True

    # For testing only
    #DDDBConf(DbRoot = "/afs/cern.ch/user/s/seaso/public/Simulation/
    #upgrade/Gauss_Target/DB/myDDDB-Upgrade-TargetGeom-January2014/TargetsDet.xml")

    Gauss.DetectorGeo = {"Detectors": []}
    Gauss.DetectorSim = {"Detectors": []}
    Gauss.DetectorMoni = {"Detectors": []}

    Gauss.DataType = "Upgrade"
    Gauss.PhysicsList = {
        "Em": 'NoCuts',
        "Hadron": physList,
        "GeneralPhys": True,
        "LHCbPhys": True
    }

    # --- activate special targets geometry
    appendPostConfigAction(targetGeo)

    # --- Switch off delta rays
    Gauss.DeltaRays = False

    # --- activate GaussTargetMultiplicity tool
    appendPostConfigAction(addMyTool)

    # --- Configure the tool
    from Configurables import GiGa, GiGaTrackActionSequence, GaussTargetMultiplicity
    giga = GiGa()
    giga.addTool(GiGaTrackActionSequence("TrackSeq"), name="TrackSeq")
    giga.TrackSeq.addTool(GaussTargetMultiplicity)
    giga.TrackSeq.GaussTargetMultiplicity.InteractionVolumeName = [
        "/dd/Structure/TargetDet/" + target + "#pv" +
        target.replace('Target', 'Targ')
    ]
    giga.TrackSeq.GaussTargetMultiplicity.InteractionVolumeString = [target]
    giga.TrackSeq.GaussTargetMultiplicity.TargetMaterial = [targetMat]
    giga.TrackSeq.GaussTargetMultiplicity.TargetThickness = [targetThick]
    giga.TrackSeq.GaussTargetMultiplicity.PhysicsList = [physList]
    giga.TrackSeq.GaussTargetMultiplicity.ProjectileEnergy = [projEng]
    giga.TrackSeq.GaussTargetMultiplicity.ProjectilePdgID = [particles[projID]]

    #giga.TrackSeq.GaussTargetMultiplicity.OutputLevel = DEBUG

    from Configurables import CondDB, LHCbApp, DDDBConf, CondDBAccessSvc
    from Configurables import Gauss

    Gauss().Production = 'PGUN'

    #--Generator phase, set random numbers
    GaussGen = GenInit("GaussGen")
    GaussGen.FirstEventNumber = 1
    GaussGen.RunNumber = 1082

    #--Number of events
    LHCbApp().EvtMax = nEvts

    Gauss().Production = 'PGUN'

    Gauss().OutputType = 'NONE'
    Gauss().Histograms = 'NONE'

    #--- Save ntuple with hadronic cross section information
    ApplicationMgr().ExtSvc += ["NTupleSvc"]
    NTupleSvc().Output = [
        "FILE1 DATAFILE='Multi_{particle}_in{material}.root' TYP='ROOT' OPT='NEW'"
        .format(particle=projID, material=targetMat)
    ]
Esempio n. 9
0
from Configurables import LHCbApp

##############################################################################

#-----------------------------------------------------------------------------
# Generator phase
#-----------------------------------------------------------------------------
GaussGen = GenInit("GaussGen")
#
# Set the random numbers - these fix the random seed.
#
GaussGen.FirstEventNumber = FIRST_EVENT_NUMBER
GaussGen.RunNumber = RUN_NUMBER

# The output is managed below, so we disable the standard Gauss output.
Gauss().OutputType = 'NONE'
Gauss().Histograms = 'NONE'

############################################################################
## Set properties of particles to be generated

## momentum properties
ParticleGun().addTool(MomentumRange)
ParticleGun().ParticleGunTool = "MomentumRange"

## number of particles (default=1)
ParticleGun().addTool(FlatNParticles)
ParticleGun().NumberOfParticlesTool = "FlatNParticles"
ParticleGun().EventType = 52210001

############################################################################
Esempio n. 10
0
from Gaudi.Configuration import *
from Gauss.Configuration import *
from Configurables import CondDB, LHCbApp

#from Configurables import DDDBConf, CondDBAccessSvc
#DDDBConf(DbRoot = "myDDDB/lhcb.xml")

importOptions("$GAUSSROOT/options/Gauss-2011.py")
CondDB.LocalTags = { "DDDB" : [ "radlength-20141010", "radlength-20141003", "radlength-20140908" ] }

from Configurables import Gauss
from Gauss.Configuration import *
import sys

Gauss().Production = 'PGUN'
Gauss().DeltaRays = False

Gauss().DetectorGeo = { "Detectors": [ 'PuVeto', 'Velo', 'Rich1', 'Rich2' ] }
Gauss().DetectorSim = { "Detectors": [ 'PuVeto', 'Velo', 'Rich1', 'Rich2' ] }
Gauss().DetectorMoni = { "Detectors": [ 'PuVeto', 'Velo', 'Rich1', 'Rich2' ] }

importOptions("$GAUSSOPTS/RICHesOff.py")

def scoringGeo():
     from Configurables import GiGaInputStream
     geo = GiGaInputStream('Geo')

     geo.StreamItems += ["/dd/Structure/LHCb/BeforeMagnetRegion/Scoring_Plane1"]
    
appendPostConfigAction(scoringGeo)
Esempio n. 11
0
from Configurables import Gauss, GiGa, GiGaRunManager

### Activate the visualization
GiGa().VisManager = "GiGaVisManager/GiGaVis"

### Activate the Geant4 user interactive control (switch off to run in
### "batch", i.e. to have G4 UI prompt)
GiGa().UIsession = "GiGaUIsession/GiGaUI"

### setting visualization attributes
GiGa().addTool(GiGaRunManager("GiGaMgr"), name="GiGaMgr")
GiGa().GiGaMgr.RunTools += ["GiGaSetVisAttributes"]

### When using DAWN swith off some detectors
Gauss().DetectorGeo = {
    'Detectors':
    ['Velo', 'PuVeto', 'Muon', 'TT', 'IT', 'OT', 'Rich1', 'Rich2', 'Magnet']
}
Gauss().DetectorSim = {
    'Detectors':
    ['Velo', 'PuVeto', 'Muon', 'TT', 'IT', 'OT', 'Rich1', 'Rich2', 'Magnet']
}
Gauss().DetectorMoni = {
    'Detectors':
    ['Velo', 'PuVeto', 'Muon', 'TT', 'IT', 'OT', 'Rich1', 'Rich2', 'Magnet']
}

## When Switiching off the Rich siwth off also its physics
#Gauss().PhysicsList = {"Em":'NoCuts', "Hadron":'LHEP', "GeneralPhys":True, "LHCbPhys":False}

### To control level of drawing of track while traveling through detector
Esempio n. 12
0
##  It can be passed as additional argument to gaudirun.py directly
##   > gaudirun.py $APPCONFIGOPTS/Gauss/MC09-b5TeV-md100.py \
##                 $APPCONFIGOPTS/Conditions/MC09-20090602-vc-md100.py \
##                 $DECFILESROOT/options/EVENTTYPE.opts \
##                 $LBPYTHIAROOT/options/Pythia.opts \
##                 $GAUSSOPTS/GenStandAlone.py \
##                 $GAUSSOPTS/Gauss-Job.py
##  or you can set the property in your Gauss-Job.py
##  Port to python of GenStandAlone.opts
##

from Configurables import Gauss
from Gaudi.Configuration import *
import os

Gauss().Phases = ["Generator"]


def delphesForGauss():
    from Configurables import (GaudiSequencer, SimInit, DelphesAlg,
                               ApplicationMgr, DelphesHist, DelphesTuple,
                               DelphesProto, DelphesCaloProto, BooleInit,
                               PGPrimaryVertex)

    from Configurables import (DelphesRecoSummary, DelphesParticleId,
                               ChargedProtoCombineDLLsAlg,
                               ChargedProtoParticleAddRichInfo,
                               ChargedProtoParticleAddMuonInfo)

    DelphesPID = DelphesParticleId(
        "DelphesParticleId",
Esempio n. 13
0
##############################################################################
# File for running Gauss with latest tags, using the default configuration
#
# Syntax is:
#   gaudirun.py Gauss-DEV.py <someInputJobConfiguration>.py
##############################################################################

from Configurables import Gauss
theApp = Gauss()

#--Use latest database tags
from Configurables import DDDBConf, CondDB, LHCbApp

LHCbApp().DDDBtag = "dddb-20150724"  # Must be set for selecting VELO
# geometry list in Gauss()

Gauss().DataType = "2015"
DDDBConf(DataType="2015")
CondDB().UseLatestTags = ["2015"]
def execute(pos="c", angle=0, eng=180, part=211):
    importOptions(
        "$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu7.6-HorExtAngle.py")

    importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
    importOptions("$APPCONFIGOPTS/Gauss/G4PL_FTFP_BERT_EmNoCuts.py")
    importOptions("$APPCONFIGOPTS/Conditions/Upgrade.py")
    importOptions("$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py")

    # FTv5
    importOptions('$APPCONFIGOPTS/Gauss/Gauss-Upgrade-Baseline-20150522.py')

    outpath = "testbeam_simulation_position_" + pos + '_at_' + str(
        angle) + 'deg'

    Gauss().DataType = "Upgrade"

    LHCbApp().DDDBtag = "dddb-20160304"
    LHCbApp().CondDBtag = "sim-20150716-vc-md100"
    CondDB().addLayer(
        dbFile=
        "/eos/lhcb/wg/SciFi/Custom_Geoms_Upgrade/databases/DDDB_FT61_noEndplug.db",
        dbName="DDDB")
    CondDB.LocalTags = {"SIMCOND": ["magnet-off"]}

    Gauss().DetectorGeo = {"Detectors": ['VP', 'FT']}
    Gauss().DetectorSim = {"Detectors": ['FT']}
    Gauss().DetectorMoni = {"Detectors": ['FT']}

    importOptions('$LBPGUNSROOT/options/PGuns.py')
    from Configurables import ParticleGun
    #ParticleGun().EventType = 52210010

    # Set momentum
    from Configurables import MaterialEval
    ParticleGun().addTool(MaterialEval, name="MaterialEval")
    ParticleGun().ParticleGunTool = "MaterialEval"

    # test beam position jargon
    #position a: 225.5 cm (near mirror) ~5 cm distance from mirror
    #position b: 125.5 cm
    #position c: 30.5 cm (near sipm) ~ 5 cm distance from sipm
    #default y table position: 72.4 cm

    posA = {
        #"x": 2600.55,  ## Far from beam
        "x": 138.8,  ## Close to the beam: importan when using irradiated mats
        "y": 63.378,
        "z": 7783.228
    }
    posC = {
        #"x" : 2600.55, ## Far from beam
        "x": 138.8,  ## Close to the beam: importan when using irradiated mats
        "y": 2363.363,
        "z": 7791.510
    }

    hit_pos = {}
    if pos == "a":
        hit_pos = posA
    elif pos == "c":
        hit_pos = posC
    else:
        exit()

    # origin point
    orig_delta_z = 7000.
    orig_x = hit_pos["x"] + orig_delta_z * tan(radians(angle))
    orig_y = hit_pos["y"]
    orig_z = hit_pos["z"] - orig_delta_z

    # beam spread parameter
    # see http://cds.cern.ch/record/2108337/files/LHCb-PUB-2015-025.pdf, Fig. 1.8
    beam_width_x = 13.
    beam_width_y = 5.

    ParticleGun().MaterialEval.Xorig = orig_x
    ParticleGun().MaterialEval.Yorig = orig_y
    ParticleGun().MaterialEval.Zorig = orig_z

    # target point
    target_delta_z = 300.
    target_x = hit_pos["x"] - target_delta_z * tan(radians(angle))
    target_y = hit_pos["y"]
    target_z = hit_pos["z"] + target_delta_z

    ParticleGun().MaterialEval.ZPlane = target_z
    ParticleGun().MaterialEval.Xmin = target_x - beam_width_x / 2.
    ParticleGun().MaterialEval.Xmax = target_x + beam_width_x / 2.
    ParticleGun().MaterialEval.Ymin = target_y - beam_width_y / 2.
    ParticleGun().MaterialEval.Ymax = target_y + beam_width_y / 2.

    # particle options
    ParticleGun().MaterialEval.PdgCode = part
    ParticleGun().MaterialEval.ModP = eng * units.GeV

    # Set min and max number of particles to produce in an event
    from Configurables import FlatNParticles
    ParticleGun().addTool(FlatNParticles, name="FlatNParticles")
    ParticleGun().NumberOfParticlesTool = "FlatNParticles"
    ParticleGun().FlatNParticles.MinNParticles = 1
    ParticleGun().FlatNParticles.MaxNParticles = 1

    GaussGen = GenInit("GaussGen")
    GaussGen.FirstEventNumber = 1
    GaussGen.RunNumber = 1082

    LHCbApp().EvtMax = 10000

    HistogramPersistencySvc().OutputFile = outpath + '-GaussHistos.root'

    OutputStream(
        "GaussTape"
    ).Output = "DATAFILE='PFN:%s.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'" % outpath
Esempio n. 15
0
## Options to switch off all geometry (and related simulation)
## save that of calorimeters area.
##
## Author: P.Szczypka
## Date:   2012-12-12
##

from Gaudi.Configuration import *

from Configurables import Gauss
Gauss().DetectorGeo = {"Detectors": ['Spd', 'Prs', 'Ecal', 'Hcal', 'Magnet']}
Gauss().DetectorSim = {"Detectors": ['Spd', 'Prs', 'Ecal', 'Hcal', 'Magnet']}
Gauss().DetectorMoni = {"Detectors": ['Spd', 'Prs', 'Ecal', 'Hcal', 'Magnet']}
Gauss().BeamPipe = "BeamPipeInDet"


# Remove RICH cuts
def switchOffRICHCuts():
    from Configurables import SimulationSvc
    SimulationSvc(
    ).SimulationDbLocation = "$GAUSSROOT/xml/SimulationRICHesOff.xml"


appendPostConfigAction(switchOffRICHCuts)
def execute(pos="c", angle=0):
    importOptions(
        "$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu7.6-HorExtAngle.py")

    importOptions("$LBPYTHIA8ROOT/options/Pythia8.py")
    importOptions("$APPCONFIGOPTS/Gauss/G4PL_FTFP_BERT_EmNoCuts.py")
    importOptions("$APPCONFIGOPTS/Conditions/Upgrade.py")
    importOptions("$APPCONFIGOPTS/Persistency/Compression-ZLIB-1.py")

    #importOptions("$APPCONFIGOPTS/Gauss/Gauss-Upgrade-Baseline-20131029.py")
    # FTv5
    importOptions('$APPCONFIGOPTS/Gauss/Gauss-Upgrade-Baseline-20150522.py')

    outpath = "testbeam_simulation_position_" + pos + '_at_' + str(
        angle) + 'deg'

    Gauss().DataType = "Upgrade"

    #LHCbApp().DDDBtag = "dddb-20150424"
    #LHCbApp().CondDBtag = "sim-20140204-vc-md100"

    #LHCbApp().DDDBtag = "dddb-20150424"
    #LHCbApp().CondDBtag = "sim-20140204-vc-md100"

    # FTv5 from Luigi
    LHCbApp().DDDBtag = "dddb-20150424"
    LHCbApp().CondDBtag = "sim-20140204-vc-md100"
    #DDDBConf().DbRoot = "/home/ttekampe/SciFi/FTv5/DDDB_FTv5_20150424_s20140204_lhcbv38r6/lhcb.xml"

    #work around for bug in DB
    CondDB().LoadCALIBDB = 'HLT1'
    CondDB().addLayer(dbFile="DDDB_FTv5_20150424_s20140204_lhcbv38r6.db",
                      dbName="DDDB")

    importOptions('$LBPGUNSROOT/options/PGuns.py')
    from Configurables import ParticleGun
    #ParticleGun().EventType = 52210010

    # Set momentum
    from Configurables import MaterialEval
    ParticleGun().addTool(MaterialEval, name="MaterialEval")
    ParticleGun().ParticleGunTool = "MaterialEval"

    # test beam position jargon
    #position a: 225.5 cm (near mirror) ~5 cm distance from mirror
    #position b: 125.5 cm
    #position c: 30.5 cm (near sipm) ~ 5 cm distance from sipm
    #default y table position: 72.4 cm

    moduleWidth = 552.4 + 3  # 3 = modul gap
    z_orig = 7834.  # 7620
    z_target = 9439.
    x_orig = 4. * moduleWidth + 65.3  # centre of the innermost fibre mat of the second module from left when looking into beam direction (neglected half a gap)
    #y_orig = 2417.5
    if pos == "a":
        y_orig = 50  # 5 cm from mirror
    elif pos == "c":
        y_orig = 2417.5 - 50.  # 5 cm from SiPM
    elif pos.isdigit():
        y_orig = float(pos)
    else:
        exit()

    ParticleGun().MaterialEval.Xorig = x_orig
    ParticleGun().MaterialEval.Yorig = y_orig
    #ParticleGun().MaterialEval.Zorig = 7620
    ParticleGun().MaterialEval.Zorig = z_orig
    ParticleGun().MaterialEval.ModP = 150000  #150GeV

    ParticleGun().MaterialEval.ZPlane = z_target
    ParticleGun().MaterialEval.Xmin = x_orig - 1.7 + (z_target - z_orig) / tan(
        radians(90 - angle))
    ParticleGun().MaterialEval.Xmax = x_orig + 1.7 + (z_target - z_orig) / tan(
        radians(90 - angle))
    ParticleGun().MaterialEval.Ymin = y_orig - 1.7
    ParticleGun().MaterialEval.Ymax = y_orig + 1.7
    ParticleGun().MaterialEval.PdgCode = 211

    # Set min and max number of particles to produce in an event
    from Configurables import FlatNParticles
    ParticleGun().addTool(FlatNParticles, name="FlatNParticles")
    ParticleGun().NumberOfParticlesTool = "FlatNParticles"
    ParticleGun().FlatNParticles.MinNParticles = 1
    ParticleGun().FlatNParticles.MaxNParticles = 1

    GaussGen = GenInit("GaussGen")
    GaussGen.FirstEventNumber = 1
    GaussGen.RunNumber = 1082

    LHCbApp().EvtMax = 10

    HistogramPersistencySvc().OutputFile = outpath + '-GaussHistos.root'

    OutputStream(
        "GaussTape"
    ).Output = "DATAFILE='PFN:%s.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'" % outpath
Esempio n. 17
0
#--Set the bunch spacing to 50 ns, hence spill-over for the following slots
from Configurables import Gauss
Gauss().SpilloverPaths = ['PrevPrev', 'NextNext']
Esempio n. 18
0
    pgun.FlatNParticles.MinNParticles = 1
    pgun.FlatNParticles.MaxNParticles = 1
    pgun.MomentumRange.PdgCodes = [-11]
    pgun.MomentumRange.MomentumMin = 2.0 * GeV
    pgun.MomentumRange.MomentumMax = 100.0 * GeV
    pgun.MomentumRange.ThetaMin = 0.015 * rad
    pgun.MomentumRange.ThetaMax = 0.300 * rad
    seq += [pgun]


GenPhase.configure_pgun = my_configure_pgun
from Configurables import GiGaMT

GiGaMT().NumberOfWorkerThreads = nthreads
nskip = 2 + nthreads
Gauss().EvtMax = 1000
Gauss().EnableHive = True
Gauss().ThreadPoolSize = nthreads
Gauss().EventSlots = nthreads
# from Configurables import GenReDecayInit
from Configurables import GenRndInit

GenRndInit().FirstEventNumber = 3000
from Configurables import GenRndInit
from Configurables import ReDecaySvc
from Gauss.Geometry import LHCbGeo

LHCbGeo().Debug = True
LHCbGeo().DetectorGeo = {"Detectors": ['VP']}
LHCbGeo().DetectorSim = {"Detectors": ['VP']}
LHCbGeo().DetectorMoni = {"Detectors": ['VP']}
Esempio n. 19
0
from Configurables import MonopoleTupleAlg, GenTupleAlg

##############################################################################

#-----------------------------------------------------------------------------
# Generator phase
#-----------------------------------------------------------------------------
GaussGen = GenInit("GaussGen")
#
# Set the random numbers - these fix the random seed.
#
GaussGen.FirstEventNumber = FIRST_EVENT_NUMBER
GaussGen.RunNumber = RUN_NUMBER

# The output is managed below, so we disable the standard Gauss output.
Gauss().OutputType = 'NONE'
Gauss().Histograms = 'NONE'

# Switch off pileup (recommended!).
Generation().addTool(FixedNInteractions, name="FixedNInteractions")
Generation().FixedNInteractions.NInteractions = 0
Generation().PileUpTool = "FixedNInteractions"

# Define "special" production.
Generation().addTool(Special, "Special")
Generation().SampleGenerationTool = "Special"

# No cuts.
Generation().Special.CutTool = ""

# Define the production tool
Esempio n. 20
0
from Gaudi.Configuration import *
from Configurables import Gauss

## # Here are beam settings as for various nu (i.e. mu and Lumi per bunch with
## # 25 ns spill-over are selected
## nu=2.9 (i.e. mu=2=(nu/0.699, Lumi/bunch=0.31451*(10**30), Lumi=0.88*(10**33)
importOptions("$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu2.9-25ns.py")
## nu=4.3 (i.e. mu=3, Lumi=1.32*(10**33)
#importOptions("$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu4.3-25ns.py")
## nu=5.7 (i.e. mu=4, Lumi=1.77*(10**33)
#importOptions("$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu5.7.2-25ns.py")
## nu=7.2 (i.e. mu=5, Lumi=2.21*(10**33)
#importOptions("$APPCONFIGOPTS/Gauss/Beam7000GeV-md100-nu7.2-25ns.py")

## # The spill-over is switched off for quick tests
Gauss().SpilloverPaths = []

# And the upgrade database is picked up
# How to select the baseline upgrade configuration or alternative
# configurations will be added in the future
from Configurables import LHCbApp
from Configurables import CondDB

Gauss().DataType = "Upgrade"
CondDB().Upgrade = True
LHCbApp().DDDBtag = "dddb-20121018"
LHCbApp().CondDBtag = "simcond-20121001-vc-md100"

## Choose the detector configuration to run selecting the appropriate file
# Existing detector with MapPMT in RICHes and no Aerogel
importOptions("$GAUSSOPTS/Gauss-Upgrade-Reference.py")
Esempio n. 21
0
from Configurables import CondDB, Gauss
CondDB().Upgrade = True
Gauss().DataType = "Upgrade"

from Configurables import LHCbApp
LHCbApp().EvtMax = 1
LHCbApp().DDDBtag = "dddb-20150729"
LHCbApp().CondDBtag = "sim-20150716-vc-md100"
Esempio n. 22
0
from Gauss.Configuration import *
from Configurables import CondDB, LHCbApp, DDDBConf, CondDBAccessSvc
from Configurables import Gauss
from EMstudy_config import config

#importOptions("EMstudy_config.py")
opts = config()

#saveSim = config()
#testType = config()
#nEvts = config()
saveSim = opts['saveSim']
testType = opts['testType']
nEvts = opts['nEvts']

Gauss().Production = 'PGUN'

#--Generator phase, set random numbers
GaussGen = GenInit("GaussGen")
GaussGen.FirstEventNumber = 1
GaussGen.RunNumber = 4585

LHCbApp().EvtMax = nEvts
Gauss().Production = 'PGUN'

Gauss().OutputType = 'NONE'

if (saveSim):
    tape = OutputStream("GaussTape")
    tape.Output = "DATAFILE='PFN:myOutputFile.sim' TYP='POOL_ROOTTREE' OPT='RECREATE'"
    ApplicationMgr(OutStream=[tape])
Esempio n. 23
0
##############################################################################
# File for running Gauss with Sim08 configuration and beam conditions as in
# production for 2011 data (3.5 TeV beams, nu=2, no spill-over)
#
# Syntax is:
#   gaudirun.py Gauss-2011.py <someInputJobConfiguration>.py
##############################################################################

#--Pick beam conditions as set in AppConfig
from Gaudi.Configuration import *
importOptions("$APPCONFIGOPTS/Gauss/Sim08-Beam3500GeV-md100-2011-nu2.py")

#--Set database tags using those for Sim08
from Configurables import LHCbApp
LHCbApp().DDDBtag = "dddb-20150522-1"
LHCbApp().CondDBtag = "sim-20150522-1-vc-md100"

#--Pick up new particle table until it is in a global tag
from Configurables import CondDB
CondDB().LocalTags = {"DDDB": ["particles-20150720"]}

#--Set datatype
from Configurables import Gauss
Gauss().DataType = "2011"
Esempio n. 24
0
##
##  File containing options to activate the Em Option3
##  Physics in Geant4 (the default for production is Em
##  Option1)
##

from Configurables import Gauss

Gauss().PhysicsList = {
    "Em": 'NoCuts',
    "Hadron": 'LHEP',
    "GeneralPhys": True,
    "LHCbPhys": True
}
Esempio n. 25
0
from Configurables import ToolSvc
from Configurables import EvtGenDecay
ToolSvc().addTool(EvtGenDecay)
ToolSvc(
).EvtGenDecay.UserDecayFile = "$DECFILESROOT/dkfiles/Dsst_ppbarpi=TightCut.dec"
ToolSvc().EvtGenDecay.DecayFile = "$DECFILESROOT/dkfiles/DECAY.DEC"

from Configurables import Gauss, Gaussino
Gaussino().ConvertEDM = True
nthreads = 4
from Configurables import GiGaMT
GiGaMT().NumberOfWorkerThreads = nthreads
nskip = 2 + nthreads

Gauss().EvtMax = 10
Gauss().EnableHive = True
from Gaussino.Generation import GenPhase

Gauss().ThreadPoolSize = nthreads
Gauss().EventSlots = nthreads

from Configurables import GenRndInit
GenRndInit().FirstEventNumber = 3000

from Gauss.Geometry import LHCbGeo
# LHCbGeo().Debug = True  # Comment this in if you want a lot of debug output
# Set the list of detectors / detector elements
LHCbGeo().DetectorGeo = {"Detectors": ['VP', 'Magnet', 'Bls']}
LHCbGeo().DetectorSim = {"Detectors": ['VP', 'Magnet', 'Bls']}
LHCbGeo().DetectorMoni = {"Detectors": ['VP', 'Magnet', 'Bls']}
Esempio n. 26
0
from Configurables import CondDB, Gauss
CondDB().Upgrade = True

from Configurables import LHCbApp
LHCbApp().DDDBtag = "dddb-20171009"
LHCbApp().CondDBtag = "sim-20170301-vc-md100"

#LHCbApp().DDDBtag = 'upgrade/master'
#LHCbApp().DDDBtag = 'upgrade/upgrade/test-upgradeDB-yanxi'
#LHCbApp().CondDBtag ='upgrade/sim-20171127-vc-md100'
LHCbApp().Simulation = True

LHCbApp().EvtMax = 100

Gauss().DetectorGeo = {
    "Detectors": [
        'VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon',
        'Magnet'
    ]
}
Gauss().DetectorSim = {
    "Detectors": [
        'VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon',
        'Magnet'
    ]
}
Gauss().DetectorMoni = {
    "Detectors":
    ['VP', 'UT', 'FT', 'Rich1Pmt', 'Rich2Pmt', 'Ecal', 'Hcal', 'Muon']
}
Esempio n. 27
0
##############################################################################
# File for running Gauss with default options
##############################################################################
# Syntax is:
#   gaudirun.py Gauss-Default.py <someInputForTheJob>.py
##############################################################################

from Configurables import Gauss, LHCbApp

###############################################################################
# Set here any steering options.
# Available steering options and defaults are documented in
# $GAUSSROOT/python/Gauss/Configuration.py
###############################################################################

theApp = Gauss()

# You MUST also set the tag of the conditions
#LHCbApp().DDDBtag = <yourChoice>
#LHCbApp().ConDBtag = <yourChoice>
Esempio n. 28
0
from Configurables import Gauss
from Configurables import Generation
from Configurables import Special
from GaudiKernel import SystemOfUnits
from Configurables import OniaPairsProduction

Generation().SampleGenerationTool = "Special"
Generation().addTool(Special)
Generation().Special.ProductionTool = "OniaPairsProduction"
Generation().Special.addTool(OniaPairsProduction)
Generation().Special.OniaPairsProduction.Ecm = 2 * Gauss(
).BeamMomentum / SystemOfUnits.GeV
Esempio n. 29
0
gen = Generation()
gen.addTool( Special )
gen.addTool( MinimumBias )
gen.addTool( Inclusive )
gen.addTool( SignalPlain )
gen.addTool( SignalRepeatedHadronization )

gen.Special.ProductionTool = "PythiaProduction"
gen.MinimumBias.ProductionTool = "PythiaProduction"
gen.Inclusive.ProductionTool = "PythiaProduction"
gen.SignalPlain.ProductionTool = "PythiaProduction"
gen.SignalRepeatedHadronization.ProductionTool = "PythiaProduction"

# Use same generator and configuration for spillover
from Configurables import Gauss
spillOverList = Gauss().getProp("SpilloverPaths")
for slot in spillOverList:
    genSlot = Generation("Generation"+slot)
    genSlot.addTool(MinimumBias, name = "MinimumBias")
    genSlot.MinimumBias.ProductionTool = "PythiaProduction"


# Do not set the default setting here yet as they already are in the code and
# may be reset by the event type which options are called before in production
## gen.Special.addTool( PythiaProduction )
## gen.MinimumBias.addTool( PythiaProduction )
## gen.Inclusive.addTool( PythiaProduction )
## gen.SignalPlain.addTool( PythiaProduction )
## gen.SignalRepeatedHadronization.addTool( PythiaProduction )

## gen.Special.PythiaProduction.Commands += pythiaCommands
# File for setting Beam conditions for February 2013 pA and Ap
# with magnet down.
# Beam xx TeV, beta* = x m , emittance(normalized) ~ x micron
#
# Requires Gauss v45r2 or higher.
#
from Configurables import Gauss
from Configurables import EventClockSvc, FakeEventTime
from GaudiKernel import SystemOfUnits

# give a lumi value to sore in the event (will not be used)
Gauss().Luminosity = 0.122 * (10**30) / (SystemOfUnits.cm2 * SystemOfUnits.s)
Gauss().TotalCrossSection = 93.2 * SystemOfUnits.millibarn

# Set a fix number of interaction to 1
from Configurables import Generation

gaussGen = Generation("Generation")
gaussGen.PileUpTool = "FixedNInteractions"

#--Set the luminous region for colliding beams and beam gas and configure
#--the corresponding vertex smearing tools, the choice of the tools is done
#--by the event type
Gauss().BunchRMS = 82.03 * SystemOfUnits.mm

Gauss().InteractionPosition = [
    0.0 * SystemOfUnits.mm, 0.0 * SystemOfUnits.mm, 20.0 * SystemOfUnits.mm
]

#--Set the energy of the beam,
#--the half effective crossing angle (in LHCb coordinate system),