#include "services_dune.fcl"
#include "textfilegen.fcl"

process_name: TextGen

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


#Start each new event with an empty event.
source:
{
  module_type: EmptyEvent
  timestampPlugin: { plugin_type: "GeneratedEventTimestamp" }
  maxEvents:   10           # 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::standard_textfilegen	  
   rns:       { module_type: "RandomNumberSaver" }
 }

 #define the producer and filter modules for this path, order matters, 
 #filters reject all following items.  see lines starting physics.producers below
 simulate: [ rns, generator ] 
 
 #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:     [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:    "AntiMuonCutEvents_LSU_v2_dune35t_%tc_gen.root" #default file name, can override from command line with -o or --output
   dataTier:    "generated"
   compressionLevel: 1
   fastCloning: false
 }
}

#Name of text file input
physics.producers.generator.InputFileName: "AntiMuonCutEvents_1000.txt"
physics.producers.generator.MoveY: 900 #new y postion for all particles
