Ejemplo n.º 1
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

ecalDigis = ldmxcfg.Producer("ecalDigis", "ldmx::EcalDigiProducer")

# Set the noise (in electrons) when the capacitance is 0.
ecalDigis.parameters["noiseIntercept"] = 900.

# Set the capacitative noise slope (electrons/pF)
ecalDigis.parameters["noiseSlope"] = 22.

# Set the capacitance per cell pad (pF)
ecalDigis.parameters["padCapacitance"] = 27.56

# set the readout threshold in multiples of RMS noise
ecalDigis.parameters["readoutThreshold"] = 4.
Ejemplo n.º 2
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

trackFiltExample = ldmxcfg.Producer("trackFiltExample", "ldmx::Simulator")

trackFiltExample.parameters[
    "description"] = "Example on how to run simulation with track filtering plugin"
trackFiltExample.parameters["postInitCommands"] = [
    # basic upstream electron gun
    "/gun/particle e-",
    "/gun/energy 4 GeV",
    "/gun/position -27.926 5 -700 mm",
    "/gun/direction 0.3138 0 3.9877 GeV",
    # Bias PN reactions really high so they actually happen so you can see the track filtering working
    "/ldmx/plugins/load PhotonuclearXsecBiasingPlugin",
    "/ldmx/plugins/PhotonuclearXsecBiasingPlugin/xsecFactor 1000.",
    # enable track filtering
    "/ldmx/plugins/load TrackFilterPlugin",
    "/ldmx/plugins/TrackFilterPlugin/verbose 2",
    # save neutrons above 5 MeV KE from PN interactions
    "/ldmx/plugins/TrackFilterPlugin/threshold 5 MeV",
    "/ldmx/plugins/TrackFilterPlugin/pdgid 2112",
    "/ldmx/plugins/TrackFilterPlugin/process photonNuclear true",
    "/ldmx/plugins/TrackFilterPlugin/CalorimeterRegion true",
    "/ldmx/plugins/TrackFilterPlugin/create KeepNeutrons",
    # save all parents of PN secondaries
    "/ldmx/plugins/TrackFilterPlugin/parent photonNuclear true",
    "/ldmx/plugins/TrackFilterPlugin/CalorimeterRegion true",
    "/ldmx/plugins/TrackFilterPlugin/create PNParentFilter",
]
Ejemplo n.º 3
0
tsDigisTag = TrigScintDigiProducer.tagger()
tsDigisDown = TrigScintDigiProducer.down()

#set the PE response to 100 (default is 10, too low)
tsDigisUp.pe_per_mip = 100.
tsDigisTag.pe_per_mip = tsDigisUp.pe_per_mip
tsDigisDown.pe_per_mip = tsDigisUp.pe_per_mip

from LDMX.Ecal import digi
from LDMX.Ecal import vetos
from LDMX.EventProc import hcal
from LDMX.EventProc.simpleTrigger import simpleTrigger
from LDMX.EventProc.trackerHitKiller import trackerHitKiller
p.sequence = [
    sim,
    digi.EcalDigiProducer(),
    digi.EcalRecProducer(),
    vetos.EcalVetoProcessor(),
    hcal.HcalDigiProducer(),
    hcal.HcalVetoProcessor(), tsDigisUp, tsDigisTag, tsDigisDown,
    trackerHitKiller, simpleTrigger,
    ldmxcfg.Producer('finableTrack', 'ldmx::FindableTrackProcessor',
                     'EventProc'),
    ldmxcfg.Producer('trackerVeto', 'ldmx::TrackerVetoProcessor', 'EventProc')
]

p.outputFiles = ["/tmp/simoutput.root"]
p.maxEvents = 1000
with open('/tmp/parameterDump.json', 'w') as outfile:
    json.dump(p.parameterDump(), outfile, indent=4)
Ejemplo n.º 4
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

basicOneElectron = ldmxcfg.Producer( "basicOneElectron", "ldmx::Simulator")

basicOneElectron.parameters[ "description" ] = "One e- fired far upstream without any plugins or modifications to the physics"
basicOneElectron.parameters[ "mpgNparticles" ] = 1
basicOneElectron.parameters[ "mpgPdgId"      ] = 11
basicOneElectron.parameters[ "mpgVertex"     ] = [ -27.926, 5, -700 ]
basicOneElectron.parameters[ "mpgMomentum"   ] = [ 313.8, 0, 3987.7 ]
Ejemplo n.º 5
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

ecalVeto = ldmxcfg.Producer("EcalVeto", "ldmx::EcalVetoProcessor")
ecalVeto.parameters["num_ecal_layers"] = 34
ecalVeto.parameters["do_bdt"] = 1
ecalVeto.parameters["bdt_file"] = "cal_bdt.pkl"
ecalVeto.parameters["disc_cut"] = 0.999672
Ejemplo n.º 6
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

hcalDigis = ldmxcfg.Producer("hcalDigis", "ldmx::HcalDigiProducer")

# set the mean noise in PE units
hcalDigis.parameters["meanNoise"] = 2.0

Ejemplo n.º 7
0
#!/usr/bin/python

import sys
import os

# We need the ldmx configuration package to construct the processor objects
from LDMX.Framework import ldmxcfg

# Define the process, which must have a name which identifies this
# processing pass ("pass name").
p = ldmxcfg.Process("recon")

# Currently, we need to explicitly identify plugin libraries which should be
# loaded.  In future, we do not expect this be necessary
p.libraries.append("libEventProc.so")

# Create a processor
myProcess = ldmxcfg.Producer("myProcessor", "ldmx::MyProcessor")

# Define the sequence of event processor to be run
p.sequence = [myProcess]

# Determine the input file from the first argument to this script.
p.inputFiles = [sys.argv[1]]

# Provide the list of output files to produce, either one to contain the results of all input files or one output file name per input file name
p.outputFiles = ["my_processor_results.root"]

# Utility function to interpret and print out the configuration to the screen
p.printMe()
Ejemplo n.º 8
0
from LDMX.EventProc.ecalVeto import ecalVeto
from LDMX.EventProc.hcalDigis import hcalDigis
from LDMX.EventProc.hcalVeto import hcalVeto
from LDMX.EventProc.simpleTrigger import simpleTrigger
from LDMX.EventProc.trackerHitKiller import trackerHitKiller

# Define the process, which must have a name which identifies this
# processing pass ("pass name").
p = ldmxcfg.Process("recon")

# Currently, we need to explicitly identify plugin libraries which should be
# loaded.  In future, we do not expect this be necessary
p.libraries.append("libEventProc.so")

# Create a processor to determine how many findable tracks are in an event.
findableTrack = ldmxcfg.Producer("findable", "ldmx::FindableTrackProcessor")

# Create a processor to veto events with that don't have a single track with
# momentum < 1.2 GeV.
trackerVeto = ldmxcfg.Producer("trackerVeto", "ldmx::TrackerVetoProcessor")

# Define the sequence of event processor to be run
p.sequence = [
    ecalDigis, hcalDigis, ecalVeto, hcalVeto, simpleTrigger, trackerHitKiller,
    findableTrack, trackerVeto
]

# Default to dropping all events
p.skimDefaultIsDrop()

# Use output of trigger module to decide what to keep
Ejemplo n.º 9
0
#!/usr/bin/python

import sys
import os
from LDMX.Framework import ldmxcfg

ecalSimHitSort = ldmxcfg.Producer("ecalSimHitSort",
                                  "ldmx::SimHitSortProcessor")
ecalSimHitSort.parameters["simHitCollection"] = "EcalSimHits"
ecalSimHitSort.parameters["outputCollection"] = "SortedEcalSimHits"
hcalSimHitSort = ldmxcfg.Producer("hcalSimHitSort",
                                  "ldmx::SimHitSortProcessor")
hcalSimHitSort.parameters["simHitCollection"] = "HcalSimHits"
hcalSimHitSort.parameters["outputCollection"] = "SortedHcalSimHits"

p = ldmxcfg.Process("sort")
p.libraries.append("ldmx-sw-install/lib/libEventProc.so")

p.sequence = [ecalSimHitSort, hcalSimHitSort]

p.inputFiles = [
    "/nfs/slac/g/ldmx/data/mc/v2/4pt0_gev_electrons_ecal_photonuc_v2_fieldmap/4pt0_gev_electrons_ecal_photonuc_v2_fieldmap_10to6_04752.root"
]
p.outputFiles = ["recon_test.root"]
Ejemplo n.º 10
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

simpleTrigger = ldmxcfg.Producer("simpleTrigger", "ldmx::TriggerProcessor")

# set the mean noise in PE units

simpleTrigger.parameters["threshold"] = 12.0
simpleTrigger.parameters["mode"] = 0
simpleTrigger.parameters["start_layer"] = 1
simpleTrigger.parameters["end_layer"] = 16
Ejemplo n.º 11
0
#!/usr/bin/python

import sys
import os

# we need the ldmx configuration package to construct the object
from LDMX.Framework import ldmxcfg

ecalClusters = ldmxcfg.Producer("ecalClusters", "ldmx::EcalClusterProducer")

# Cluster weight cutoff in appropriate units
ecalClusters.parameters["cutoff"] = 10.0

# Seed threshold for clustering
ecalClusters.parameters["seedThreshold"] = 100.0  # MeV

# Pass name for ecal digis
ecalClusters.parameters["digisPassName"] = "recon"

# Name of the algo to save to the root file
ecalClusters.parameters["algoName"] = "MyClusterAlgo"

# Name of the cluster collection to make
ecalClusters.parameters["clusterCollName"] = "ecalClusters"

# Name of the cluster algo collection to make
ecalClusters.parameters["algoCollName"] = "ClusterAlgoResult"
Ejemplo n.º 12
0
import os

# we need the ldmx configuration package to construct the object
from LDMX.Framework import ldmxcfg

# Setup producers with default templates
from LDMX.EventProc.ecalDigis import ecalDigis
from LDMX.EventProc.hcalDigis import hcalDigis
from LDMX.EventProc.simpleTrigger import simpleTrigger
from LDMX.EventProc.trackerHitKiller import trackerHitKiller

p = ldmxcfg.Process("recon")
p.libraries.append("libEventProc.so")

# Load the PN re-weighting processor
pnWeight = ldmxcfg.Producer("pn_reweight", "ldmx::PnWeightProcessor")
pnWeight.parameters["w_threshold"] = 1150.
pnWeight.parameters["theta_threshold"] = 100.

ecalVeto = ldmxcfg.Producer("ecalVeto", "ldmx::EcalVetoProcessor")
ecalVeto.parameters["num_ecal_layers"] = 34
ecalVeto.parameters["do_bdt"] = 1
ecalVeto.parameters["bdt_file"] = "fid_bdt.pkl"
ecalVeto.parameters["cellxy_file"] = "cellxy.txt"
ecalVeto.parameters["disc_cut"] = 0.95

NonFidecalVeto = ldmxcfg.Producer("NonFidecalVeto",
                                  "ldmx::NonFidEcalVetoProcessor")
NonFidecalVeto.parameters["num_ecal_layers"] = 34
NonFidecalVeto.parameters["do_bdt"] = 1
#Files in order of increasing mass
Ejemplo n.º 13
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

ecalPNBias = ldmxcfg.Producer("ecalPNBias", "ldmx::Simulator")

ecalPNBias.parameters[
    "description"] = "Sample of events where 4GeV undergoes hard brem in target and PN in ecal"
ecalPNBias.parameters["preInitCommands"] = [
    "/ldmx/biasing/enable", "/ldmx/biasing/particle gamma",
    "/ldmx/biasing/process photonNuclear", "/ldmx/biasing/volume ecal",
    "/ldmx/biasing/xsec 1000", "/ldmx/biasing/threshold 2500"
]
ecalPNBias.parameters["postInitCommands"] = [
    # skip events that don't have a hard brem in the target
    #   sets minimum recoil energy at 1500MeV and brem energy at 2500MeV
    "/ldmx/plugins/load TargetBremFilter libBiasing.so",
    "/ldmx/plugins/TargetBremFilter/volume target_PV",
    "/ldmx/plugins/TargetBremFilter/recoil_threshold 1500",
    "/ldmx/plugins/TargetBremFilter/brem_threshold 2500",
    # filters for PN processes in ecal
    "/ldmx/plugins/load EcalProcessFilter libBiasing.so"
    "/ldmx/plugins/EcalProcessFilter/volume ecal",
    # normal upstream 4GeV electron gun
    "/gun/particle e-",
    "/gun/energy 4 GeV",
    "/gun/position -27.926 5 -700 mm",
    "/gun/direction 0.3138 0 3.9877 GeV",
]
Ejemplo n.º 14
0
from LDMX.Framework import ldmxcfg

# Create a process with pass name "vetoana"
p = ldmxcfg.Process('ecalMultiElecAna')

# Append the library that contains the analyzer below to the list of libraries
# that the framework will load.
# change the next line to point to your own ldmx-sw install directory!
#p.libraries.append("/nfs/slac/g/ldmx/users/vdutta/ldmx-analysis-2.1/install/lib/libAnalysis.so")
# Should now be done automatically when declaring module below

# Create an instance of the ECal veto analyzer.  This analyzer is used to create
# an ntuple out of ECal BDT variables. The analyzer requires that the
# veto collection name be set.
ecal_veto_ana = ldmxcfg.Producer("ecalMulti", "ldmx::ECalMultiElecAnalyzer",
                                 "Analysis")
ecal_veto_ana.ecal_simhit_collection = "EcalSimHits"

from LDMX.DetDescr import EcalHexReadout
ecal_veto_ana.hexReadout = EcalHexReadout.EcalHexReadout()

# Define the order in which the analyzers will be executed.
p.sequence = [ecal_veto_ana]

p.keep = ["keep .*"]

# Specify the list of input files.
p.inputFiles = ["$inputEventFile"]

# Specify the output file.  When creating ntuples or saving histograms, the
# output file name is specified by setting the attribute histogramFile.
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

genParticleSourceExample = ldmxcfg.Producer("genParticleSourceExample",
                                            "ldmx::Simulator")

genParticleSourceExample.parameters[
    "description"] = "Example of a General Particle Source"
genParticleSourceExample.parameters["postInitCommands"] = [
    "/ldmx/generators/gps/enable", "/gps/particle pi-",
    "/gps/direction 0 0 4.0", "/gps/energy 4.0 GeV", "/gps/position 0 0 -1 mm"
]
Ejemplo n.º 16
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

ecalMuPair = ldmxcfg.Producer("ecalMuPair", "ldmx::Simulator")

ecalMuPair.parameters[
    "description"] = "Generation of gamma -> 2mu pairs within ECal"
ecalMuPair.parameters["preInitCommands"] = [
    "/ldmx/biasing/enable",
    "/ldmx/biasing/particle gamma",
    "/ldmx/biasing/process GammaToMuPair",  #make gamma -> 2mu pretty much certain in ECal
    "/ldmx/biasing/volume Ecal",
    "/ldmx/biasing/xsec 10000000",
    "/ldmx/biasing/threshold 0"
]
ecalMuPair.parameters["postInitCommands"] = [
    "/gun/particle e-",
    "/gun/energy 4 GeV",
    "/gun/position -27.926 5 -700 mm",
    "/gun/direction 0.3138 0 3.9877 GeV",
    "/ldmx/plugins/TargetBremFilter libBiasing.so",  #filters for hard brem
    "/ldmx/plugins/load EcalProcessFilter libBiasing.so"  # filters for process specified in ECal in biasing
]
Ejemplo n.º 17
0
#!/usr/bin/python

import sys

# Load the configuration package
from LDMX.Framework import ldmxcfg

# Set the process name
p=ldmxcfg.Process("recon")

# Load the library that contains the Ecal veto processor
p.libraries.append("libEventProc.so")

# Configure the Ecal veto processor
ecalVeto = ldmxcfg.Producer("ecalVeto", "ldmx::EcalVetoProcessor")
ecalVeto.parameters["num_ecal_layers"] = 34
ecalVeto.parameters["do_bdt"] = 1
ecalVeto.parameters["bdt_file"] = "fid_bdt.pkl"
ecalVeto.parameters["cellxy_file"] = "cellxy.txt"
ecalVeto.parameters["disc_cut"] = 0.95

# Configure the Non-Fiducial Ecal veto processor
NonFidecalVeto = ldmxcfg.Producer("NonFidecalVeto", "ldmx::NonFidEcalVetoProcessor")
NonFidecalVeto.parameters["num_ecal_layers"] = 34
NonFidecalVeto.parameters["do_bdt"] = 1
#Files in order of increasing mass
NonFidecalVeto.parameters["nf_bdt_files"] = ["p001_nf_bdt.pkl", "p01_nf_bdt.pkl", "p1_nf_bdt.pkl", "p0_nf_bdt.pkl"]
NonFidecalVeto.parameters["cellxy_file"] = "cellxy.txt"
#Disc cuts in order of increasing mass
NonFidecalVeto.parameters["disc_cut"] = [0.99, 0.95, 0.94, 0.94]
Ejemplo n.º 18
0
import sys

# we need the ldmx configuration package to construct the object
from LDMX.Framework import ldmxcfg

# first, we define the process, which must have a name which identifies this
# processing pass ("pass name").  Usually, this is set to recon.
p = ldmxcfg.Process("recon")

# Currently, we need to explicitly identify plugin libraries which should be
# loaded.  In future, we do not expect this be necessary
p.libraries.append("libEventProc.so")

# Load the PN re-weighting processor
pn_reweight = ldmxcfg.Producer("pn_reweight", "ldmx::PnWeightProcessor")

# Set the W_p threshold above which an event will be re-weighted.  For the
# definition of W_p, see the processor.
pn_reweight.parameters["wp_threshold"] = 1500.

# Define the sequence of event processors to be run
p.sequence = [pn_reweight]

# Provide the list of input files to run on
p.inputFiles = ["ldmx_sim_events.root"]

# Provide the list of output files to produce, either one to contain the results of all input files or one output file name per input file name
p.outputFiles = ["ldmx_digi_events.root"]

# Utility function to interpret and print out the configuration to the screen
Ejemplo n.º 19
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

trackerHitKiller = ldmxcfg.Producer("trackerHitKiller",
                                    "ldmx::TrackerHitKiller")

# Configure
trackerHitKiller.parameters['hitEfficiency'] = 99.0
Ejemplo n.º 20
0
import sys
from LDMX.Framework import ldmxcfg
from LDMX.EventProc.ecalDigis import ecalDigis
from LDMX.EventProc.simpleTrigger import simpleTrigger
from LDMX.EventProc.hcalDigis import hcalDigis
from LDMX.EventProc.trackerHitKiller import trackerHitKiller
p = ldmxcfg.Process("recon")
p.libraries.append("libEventProc.so")
ecalVeto = ldmxcfg.Producer("ecalVeto", "ldmx::EcalVetoProcessor")
ecalVeto.parameters["num_ecal_layers"] = 34
ecalVeto.parameters["do_bdt"] = 1
ecalVeto.parameters["bdt_file"] = "fid_bdt.pkl"
ecalVeto.parameters["disc_cut"] = 0.94
ecalVeto.parameters["cellxy_file"] = "cellxy.txt"
ecalVeto.parameters["collection_name"] = "ecalVeto.dockertest"
hcalVeto = ldmxcfg.Producer("hcalVeto", "ldmx::HcalVetoProcessor")
hcalVeto.parameters["pe_threshold"] = 8.0
hcalVeto.parameters["collection_name"] = "hcalVeto.dockertest"
simpleTrigger.parameters["threshold"] = 1500.0
simpleTrigger.parameters["end_layer"] = 20
findable_track = ldmxcfg.Producer("findable", "ldmx::FindableTrackProcessor")
p.sequence = [
    ecalDigis, hcalDigis, ecalVeto, simpleTrigger, trackerHitKiller,
    findable_track
]
p.inputFiles = ["output.root"]
p.outputFiles = ["file_tskim_recon.root"]
p.printMe()
p.histogramFile = "histo.root"
Ejemplo n.º 21
0
#!/usr/bin/python

from LDMX.Framework import ldmxcfg

targetENBias = ldmxcfg.Producer("targetENBias", "ldmx::Simulator")

targetENBias.parameters[
    "description"] = "Sample of events where 4GeV undergoes EN reaction in target"
targetENBias.parameters["preInitCommands"] = [
    "/ldmx/biasing/enable", "/ldmx/biasing/particle e-",
    "/ldmx/biasing/process electronNuclear", "/ldmx/biasing/volume target",
    "/ldmx/biasing/threshold 0"
]
targetENBias.parameters["postInitCommands"] = [
    "/ldmx/biasing/xsec/bias_incident",  #only bias incident particle
    "/ldmx/biasing/xsec/particle e-",
    "/ldmx/biasing/xsec/process electronNuclear",
    "/ldmx/biasing/xsec/threshold 0",
    "/ldmx/biasing/xsec/factor 100000",
    "/gun/particle e-",
    "/gun/energy 4 GeV",
    "/gun/position -27.926 5 -700 mm",
    "/gun/direction 0.3138 0 3.9877 GeV",
    "/ldmx/plugins/load TargetProcessFilter libBiasing.so"  # filters for process specified in target in biasing
]
Ejemplo n.º 22
0
from LDMX.Framework import ldmxcfg

# Create a process with pass name "vetoana"
p = ldmxcfg.Process('vetoana')

# Append the library that contains the analyzer below to the list of libraries
# that the framework will load.
# change the next line to point to your own ldmx-sw install directory!
#p.libraries.append("/nfs/slac/g/ldmx/users/vdutta/ldmx-analysis-2.1/install/lib/libAnalysis.so")
# Should now be done automatically when declaring module below

# Create an instance of the ECal veto analyzer.  This analyzer is used to create
# an ntuple out of ECal BDT variables. The analyzer requires that the
# veto collection name be set.
ecal_veto_ana = ldmxcfg.Producer("ecal", "ldmx::ECalVetoAnalyzer", "Analysis")
ecal_veto_ana.ecal_veto_collection = "EcalVeto"
ecal_veto_ana.hcal_veto_collection = "HcalVeto"
ecal_veto_ana.tracker_veto_collection = "TrackerVeto"
ecal_veto_ana.trig_result_collection = "Trigger"
ecal_veto_ana.ecal_simhit_collection = "EcalSimHits"
ecal_veto_ana.ecal_rechit_collection = "EcalRecHits"
ecal_veto_ana.sim_particle_collection = "SimParticles"

import LDMX.Ecal.EcalGeometry
#from LDMX.DetDescr import EcalHexReadout
#ecal_veto_ana.hexReadout = EcalHexReadout.EcalHexReadout()
# Should now be done automatically upon import LDMX.Ecal.EcalGeometry

# Define the order in which the analyzers will be executed.
p.sequence = [ecal_veto_ana]
Ejemplo n.º 23
0
from LDMX.Framework import ldmxcfg

hcalVeto = ldmxcfg.Producer("HcalVeto", "ldmx::HcalVetoProcessor")
hcalVeto.parameters['pe_threshold'] = 5.0
hcalVeto.parameters['max_time'] = 50.0
hcalVeto.parameters['max_depth'] = 4000.0
hcalVeto.parameters['back_min_pe'] = 1.