#include "services_dune.fcl"
#include "singles_dune.fcl"
#include "largeantmodules_dune.fcl"
#include "detsimmodules_dune.fcl"
#include "mccheatermodules.fcl"
#include "photpropservices_dune.fcl"
#include "opticaldetectormodules_dune.fcl"



process_name: SinglesGen

services:
{
  # Load the service that manages root files for histograms.
  TFileService: { fileName: "test_optical_sim_dune35t_hist.root" }
  TimeTracker:       {}
  RandomNumberGenerator: {} #ART native random number generator
                @table::dune35t_simulation_services_legacy
  message:      @local::standard_info
}





#Start each new event with an empty event.
source:
{
  module_type: EmptyEvent
  timestampPlugin: { plugin_type: "GeneratedEventTimestamp" }
  maxEvents:   1           # Number of events to create
  firstRun:    1           # Run number to use for this file
  firstEvent:  1           # number of first event in the file
}

# Define and configure some modules to do work on each event.
# First modules are defined; they are scheduled later.
# Modules are grouped by type.
physics:
{

 producers:
 {
   generator: @local::dune35t_singlep
   largeant:  @local::dune35t_largeant
   rns:       { module_type: "RandomNumberSaver" }
 }

 analyzers:
 {
 }


 #define the producer and filter modules for this path, order matters, 
 #filters reject all following items.  see lines starting physics.producers below
 simulate: [ generator, largeant, rns ] 
 analyzeIt:  [ ]
 
 #define the output stream, there could be more than one if using filters 
 stream1:  [ out1 ]

 #trigger_paths is a keyword and contains the paths that modify the art::event, 
 #ie filters and producers
 trigger_paths: [simulate] 

 #end_paths is a keyword and contains the paths that do not modify the art::Event, 
 #ie analyzers and output streams.  these all run simultaneously
 end_paths:     [analyzeIt, stream1]  
}

#block to define where the output goes.  if you defined a filter in the physics
#block and put it in the trigger_paths then you need to put a SelectEvents: {SelectEvents: [XXX]}
#entry in the output stream you want those to go to, where XXX is the label of the filter module(s)
outputs:
{
 out1:
 {
   module_type: RootOutput
   fileName:    "test_optical_sim_dune35t_gen.root" #default file name, can override from command line with -o or --output
 }
}




#
# Change the properties of the generated singles
#

#physics.producers.generator.Theta0XZ: [ 0 ]
#physics.producers.generator.Theta0YZ: [ 0 ]
#physics.producers.generator.SigmaThetaXZ: [ 0 ]
#physics.producers.generator.SigmaThetaYZ: [ 0 ]

#physics.producers.generator.X0:     [ 50.0 ] # Middle in X
#physics.producers.generator.SigmaX: [  1.0 ] # fraction with uniform
#physics.producers.generator.Y0:     [  1.0 ] # slight offset in y
#physics.producers.generator.SigmaY: [ 50.0 ] # fraction with uniform
#physics.producers.generator.Z0:     [  0.0 ]
#physics.producers.generator.SigmaZ: [  0.0 ]
#physics.producers.generator.PDist:     0 # uniform
#physics.producers.generator.PosDist:   0 # uniform
#physics.producers.generator.ThetaDist: 0 # uniform
