Test Beam Detector fcl parameters

The purpose of this page is to summarize all parameter tables for the Test Beam Detector simulation. Most of these have been copied from the FarDet or NearDet parameter tables, and will need tuning for Test Beam. We can keep track of any tuning here.

Running simulation jobs

To access the gain_setting table in the database, the following is required for most TestBeam jobs:

services.RunHistory.DetGainTag: "" 

To specify TestBeam geometry, you will also want to include:

services.Geometry: @local::tb_geo
services.Geometry.ForceUseFCLOnly: true
services.Geometry.GDML: "Geometry/gdml/testbeam-2x2-2block-xtru-vacuum-stagger.gdml" 


Values copied from ND. Probably no tuning required.

    BigBoxUsed: false
    BigBoxRange: 1500   #in cm
    FiducialVolumeXHi: 20
    FiducialVolumeXLo: 20
    FiducialVolumeYHi: 20
    FiducialVolumeYLo: 20
    FiducialVolumeZHi: 20
    FiducialVolumeZLo: 20

Photon Transport

Values copied from ND.

 #These values still need tuning for TestBeam (copied from ND).
  PhotonsPerMeV:          3159.07         #number of blue photons created/MeV of deposited energy (2/100 eV for anthracene; BC-517P = 21% of that; ours, 80% of BC-517P)
  CerenkovEff:            0.470838     #Absorption and re-emisssion efficiency for Cerenkov light
  XViewFactor:            1.07461      #scale factor for the x-view
  YViewFactor:            1.04805      #scale factor for the y-view
  QuantumEff:             0.85        #APD quantum efficiency QE*CE*PhotonsPerMeV sets light level
  FiberIndexOfRefraction: 1.59        #core, cladding is n=1.49 and n=1.42
  EmissionTau:            9.0        #time constant of fluor de-excitation in ns
  AttenPars:              [0.2667,  254.0, 0.2139, 860.0] #parameters for fiber transmission function. Derived from DocDB-10150
  TimeClustering:         2.0         #group equivalent photons into clusters this many ns wide
  Step:                   2.0         #step size for walking along each segment 
  WriteEmptySignals:      false       #whether to write a photon signal for an FLSHit if the PE would be zero. Required for fully accurate tracking of PoissonLambda
  ApplyBirks:             true        #use Birks suppressed energy stored in FLSHits
  MessageLevel:           0           #0:fatal, 10:error, 20: info, 30: debug
  CollectionRateFile:     "PhotonTransport/dT_dZ_CollectionRate.root" 
  ApplyFiberSmearing:     true       #use time smearing due to bouncing down the fiber
  SmearingHistoFile:      "PhotonTransport/Dt_per_z_distribution.root" 
  BrightnessMode:         "None"      #Correcting to the fiber brightness measured at the factory. Either "ByCell", "ByModule", "ByPlane", "ByBin", or "None" 
  BrightnessMapName:      "BrightnessByBin" 
  BrightnessValueName:    "BrightnessValue" 
  BrightnessValueMapName:    "BrightnessByCell" 
  BrightnessFile:         "PhotonTransport/ndBrightnessFromCosmics.root" 
  ApplyTweak:             false
  TweakFile:              ""          #A data driven correction of the attenuation profile in each view


birksmodB_photrans.tb.XViewFactor: 0.129
birksmodB_photrans.tb.YViewFactor: 0.109


birksmodC_photrans.tb.XViewFactor: 0.125
birksmodC_photrans.tb.YViewFactor: 0.105


Base values copied from ND. FEB version-dependent values copied from appropriate detector (v4:FD, v5:ND).
ReadoutSim is run twice (once for each FEB version) and then a merging module is run to combine the RawDigits from each list dependent on location in detector.

  #TestBeam - These values still need tuning for TestBeam (copied from ND).
    # TDC and ADC scales
    Clocktick:            62.5      # ns, 1/16 MHz
    NumClockticksInSpill: 8800      # total length of simulated spill window
    NumClockticksPerDigitization: 2 # How many ticks between each ADC
    ADCMaxE:              170500    # ADCMaxE/(gain*(4096-1)) is the PE/count conversion factor.

    # ASIC parameters
    UseLegacyShaper:              false
    ASICBaselineInADCCounts:      250 # Baseline output level of ASIC given no input, in ADC counts.
    ASICRiseLegacy:               136    # ns Rise time for the legacy pulse shaper
    ASICFallLegacy:               4500   # ns Fall time for the legacy pulse shaper
    ASICRiseTime:                 107    # ns updated 9/15 to reflect rise-time seen in data
    ASICFallInt:                  6728   # ns these parameters are not measured at the ND yet
    ASICFallSlope:                0.9    # ns
    ASICPreAmpTime:               119278 # ns    
    ASICMaxStep:                  125    # ns

    #The baseline distribution derived from DSO scans
    VaryBaseline:                 true
    BaselineMean:                 593.7
    BaselineSigma:                77.27

    # FPGA parameters
    FPGAAlgorithm: "DualCorrelatedSampling" #DualCorrelatedSampling, MatchedFiltering or DumpASICOutput

    # DCS parameters
    FPGA_DCS_ThresholdADC:       53.5
    FPGA_DCS_LookbackSamples:    3      # How many samples back to do bkg subraction
    FPGA_DCS_RetriggerThreshold: 0.5    # How far must fall before can retrigger
    FPGA_DCS_NanosliceVersion:   3      # Zero for DCS readout, 2 or 3 for multipoint readout (fine timing)

    # MatchedFiltering parameters
    FPGA_MatchedFiltering_BaselineTime:        -500 # ns
    FPGA_MatchedFiltering_EndTime:             2500 # ns
    FPGA_MatchedFiltering_ThresholdMatchValue: 18.7 # tuned for ~12.5 PE
    ForceGain:          0  #0 uses RunHistory to select the gain
                                  #An integer value selects the corresponding gain parameter set
      Gain:                    100
      LeakageCurrent:          0.0968
      VoltageNoiseDensity:     2.06
      UseNewEmptyCellNoise:    true
      EmptyCellNoiseFile:      "ReadoutSim/emptycellnoise_nd_v3.root" 
      GainFile:                "ReadoutSim/nd_gainDist.root" 

    ScaleEmptyCellNoiseRate: 1.0 # Arbitrary factor to make slicer behave
    UseRandomGains:          true
    GeneratePhysicsCellNoise: true   

    UseNewExcessNoise:           true  #model excess noise based on APD theory
    APDExcessNoiseFigure:        0.2   #raise gain to this power to get the variance of the APD's output in units of the shot noise variance
    DetectorCapacitance:         10     #pF, see docdb-4401
    NumNormSamples:              100000 #noise samples to use to determine on the fly normalization

    UseDBThresholds:         false
    UseRandomThresholds:     true
    ThresholdFile:           "ReadoutSim/nd_thresholdDist.root" 

    VaryNoiseByThreshold:    true
    ThresholdSigma:          5.0

    # Read: docdbs 7992, 12802, 12917, 12918, 12924, 12937
    Sag:                     true
    SagFrac:                 0.0186 # docdb 7992
    FEBFlashThreshold:       5000 # simulate sag on all channels in an FEB if any channel has a deposit greater than this in ADC units 


tbv4_rsim:                                 @local::standard_rsim
tbv4_rsim.tb.NumClockticksPerDigitization: 8
tbv4_rsim.tb.ADCMaxE:                      180700
tbv4_rsim.tb.ASICRiseTime:                 420
tbv4_rsim.tb.ASICFallInt:                  10373
tbv4_rsim.tb.ASICFallSlope:                2.4
tbv4_rsim.tb.ASICPreAmpTime:               112557
tbv4_rsim.tb.ASICMaxStep:                  500

tbv4_rsim.tb.BaselineMean:                 411.5
tbv4_rsim.tb.BaselineSigma:                88.40
tbv4_rsim.tb.FPGA_DCS_ThresholdADC:        24.5
tbv4_rsim.tb.FPGA_MatchedFiltering_BaslineTime: -1500
tbv4_rsim.tb.FPGA_MatchedFiltering_EndTime:     10000

tbv5_rsim:                                 @local::standard_rsim
tbv5_rsim.tb.NumClockticksPerDigitization: 2
tbv5_rsim.tb.ADCMaxE:                      170500
tbv5_rsim.tb.ASICRiseTime:                 107
tbv5_rsim.tb.ASICFallInt:                  6728
tbv5_rsim.tb.ASICFallSlope:                0.9
tbv5_rsim.tb.ASICPreAmpTime:               119278
tbv5_rsim.tb.ASICMaxStep:                  125

tbv5_rsim.tb.BaselineMean:                 593.7
tbv5_rsim.tb.BaselineSigma:                77.27
tbv5_rsim.tb.FPGA_DCS_ThresholdADC:        53.5
tbv5_rsim.tb.FPGA_MatchedFiltering_BaslineTime: -500
tbv5_rsim.tb.FPGA_MatchedFiltering_EndTime:     2500

Your job fcl will need to include:

physics.producers.daqv4.tb.ForceGain: 100
physics.producers.daqv5.tb.ForceGain: 100

MergeTBDaqCollections (in NovaSimMixer)

These values should not need changing - just adding here for completeness.

  module_type:                 "MergeTBDaqCollections" 
  FirstDaqCollection:          "daqv4" 
  SecondDaqCollection:         "daqv5" 
  InstanceLabel:               "" 


Uses default values. FEB-dependent parameters are not tuned at the fcl level for Calibrator.
For now, to run Calibrator, set all database-dependent fcl parameters to false:

  UseAttenEpochs:  false
  UseTimingEpochs: false 
  UseAbsEpochs:    false
  UseDriftEpochs:  false


  UseTimingOffsets: false


Values copied from FD (at Michael's suggestion) since the electronics are mostly FEBv4 (i.e. same timing resolution as FD).

  # Paramters for TestBeam - These values still need tuning for TestBeam (copied from FD).
    Epsilon:            2.0        # minimum causal separation value squared for neighbors
    MinPts:             4          # minimum number of causally related points within Epsilon to be a core point in a cluster
    UseLowPEPen:        false      # add penalty term for low PE
    PEPen:              0.0        # PE value for which the low PE penalty will be 1
    DistPen:            100.0       # distance in cm for which the distance penalty will be 1 - roughly one strong interaction length
    OppViewPlanePen:    4.0        # allowed plane gap for hits in opposite views for which the distance penalty will be 1 - this number need not be an integer
    MinHitsPerView:     3          # minimum number of hits per view to make a cluster


Values copied from ND (at Junting's suggestion).


      CalcDT2D:      false      # calculate time differences just based on number of planes ( false) or 2D metric of planes and slices (true)
      TimeScale:     16         # scaling factor for timing separation - value taken from ND, not tuned for TB
      CellScale:     16         # scaling factor for cell separation
      PlaneScale:    12         # scaling factor for plane separation
      MinDens:       3          # threshold for local timing density - value taken from ND, not tuned for TB
      MinIsol:       8          # threshold for minimun timing separation to a higher threshold timing density hit - value taken from ND, not tuned for TB
      TimeThreshold: 10         # threshold for attaching hits to timing centroids
      MinPrimDist:   5          # threshold for cutting the minimun spanning tree - value taken from ND, not tuned for TB
      MinCell:       2          # minimum cell hit count in X or Y view - value taken from ND, not tuned for TB
      MaxEventHits:  100000     # Don't slice Events with more hits. -1 to disable


   # Values copied from ND. Needs tuning for TB.
      MinCell:   2              # minimum number of hits in each view
      ZScale:    200            # scaling factor for slice start/end difference in Z between X and Y views
      TScale:    6              # scaling factor for slice timing difference between X and Y views
      Tolerance: 6              # threshold for merging

CosmicVeto (in Preselection)

Values copied from NDOS.

  # Parameters for Test Beam (copied from ndos - still need tuning)
    DoTrackAngleCut: false  # Cut on the longest Track and its angle wrt beam
    DoNCellLowCut:   false  # Cut on low number of cells in slice
    DoNCellHighCut:  false  # Cut on high number of cells in slice
    DoContainment:   false
    DoSlicePlanesCut:false  # Apply cut on the number of planes the slice passes through    
    UseBetterCut:    false
    DoOutsideCut:    false
    DoMinPCut:       false
    NCellLow:        0      # Number of cells (low; cut will reject <= this value)
    NCellHigh:       0      # Number of cells (high; cut will reject > this value)
    FwdCut:          0      # Projected distance from track to wall, forward from track end
    BakCut:          0      # Projected distance from track to wall, backward from track start point
    MinPZ:           0      # Minimum slice coordinate in Z (cm)
    Ratio:           -1   # Ratio of track cellhits to slice cellhits
    AngVarCutValue:  0.2
    KeepNuMIInTime:  false  # Don't apply veto to slices in the NuMI time window?

KalmanTrack (in TrackFit)

Parameters defined in KalmanGeoHelper.cxx (some basic tuning done by Andrew S., otherwise copied from ND):

    // not sure how the effpars are defined so for test beam just use nd setup
    else if(tb){
      fclipperLength = 1.5;
      fwlow = -130;
      fwhigh = 130;
      flengthmax = 6.0;
      effpar0 = TF1("par0","pol4",fwlow,fwhigh);
      effpar1 = TF1("par1","pol4",fwlow,fwhigh);
      effpar2 = TF1("par2","pol5",fwlow,fwhigh);
      effpar3 = TF1("par3","pol4",fwlow,fwhigh);

      // low threshold tuning this produces a dist with relatively flat efficiencies as a fn of W
      effpar0.SetParameters(0.139861,   -5.05093E-5,  2.66785E-7, -3.65295E-10, -1.46979E-11);
      effpar1.SetParameters(0.525903,    2.00583E-4, -4.07681E-7,  5.28495E-10,  2.01945E-11);
      effpar2.SetParameters(0.0239177,  -6.04344E-5, -1.08969E-7, -3.69116E-10,  2.01116E-11, 5.79678E-14);
      effpar3.SetParameters(-1.03056E-3, 1.7984E-5,  -3.04568E-7, -7.85076E-10,  3.55217E-12);