AnalysisExample.fcl
Go to the documentation of this file.
1 # A script to run an analysis module: AnalysisExample. You may want to
2 # compare this script with ${LARSIM_DIR}/job/prodsingle.fcl; in
3 # particular, in this script there are no output streams because the
4 # module doesn't write any events, just histograms or n-tuples.
5 
6 # See <https://cdcvs.fnal.gov/redmine/projects/larsoft/wiki/_Running_Jobs_>
7 # for more information on the structure of .fcl files.
8 
9 # The following line has to be changed to match your experiment; e.g.,
10 # "services_dune.fcl", "services_lariat.fcl". I'm using microboone
11 # solely because, as a MicroBooNE collaborator, it's easier for me to
12 # test this script to make sure it works.
13 
14 # Note that the following line loads many more services than we're
15 # going to use in this example. If we're clever enough, and we worked
16 # through the nested layers of fcl scripts, we could only include
17 # those services that we actually use, which would save some time and
18 # memory. For this example I'm going for simplicity (but scroll to the
19 # bottom of this script to see the price of simplicity).
20 
21 #include "services_microboone_simulation.fcl"
22 
23 process_name: AnalysisExample
24 
25 services:
26 {
27  # Load the service that manages root files for histograms.
28  # Any histograms or n-tuples that you create in the program will be
29  # written to this file. You can override the file name with the -T
30  # option on the command line; e.g.,
31  # lar -c AnalysisExample.fcl -T myhistograms.root -s myinput.root
32 
33  TFileService: { fileName: "AnalysisExample.root" }
34 
35  # This constrols the display in the output of how long each job step
36  # takes for each event. A lot of configuration can be added: details at
37  # https://cdcvs.fnal.gov/redmine/projects/art/wiki/TimeTracker#TimeTracker
38 
39  TimeTracker: {}
40 
41  # This parameter controls the level of descriptive output from
42  # various LArSoft modules. For a list of different message levels,
43  # see ${LARDATA_DIR}/job/messageservice.fcl. For most jobs this is
44  # set to standard_warning; here it is set to standard_info because I
45  # write some LogInfo messages in the analysis module for
46  # demonstration purposes.
47 
48  # Note that if you set this to standard_debug (to see the LOG_DEBUG
49  # messages in the analysis module) the job's messages will not
50  # appear on screen. They're written to a debug.log file instead.
51 
52  message: @local::standard_info
53 
54  # This following line defines many default LArSoft resources for
55  # this job. It's more than we'll need, but it's easier to include
56  # all of them than to pick and choose. We want "simulation" services
57  # because the example module accesses LArG4Parameters.
58  @table::microboone_simulation_services
59 
60 } # services
61 
62 >>>>>>> origin/feature/seligman_uptodateAnalysisExample
63 # The 'source' section tells the script to expect an input file with art::Event records.
64 # Note that the name of the input file is not included here. You specify that on the
65 # command line when you run this script; e.g.,
66 # lar -c AnalysisExample.fcl -s myinput.root
67 # The file "myinput.root" is assumed to have been created by a previous LArSoft job.
68 
69 source:
70 {
71  module_type: RootInput
72 
73  # Number of events to analyze; "-1" means all of the events in the input
74  # file. You can override this value with the "-n" option on the command line.
75  maxEvents: -1
76 
77  # I've commented this out, but if you want to include the name of
78  # an art::Event input file in a script, here's how you do it.
79  # fileNames: ["myinput.root"]
80 }
81 
82 # This is empty, because we're not writing an output file with
83 # art::Event objects.
84 outputs:{}
85 
86 # The 'physics' section defines and configures some modules to do work
87 # on each event. First modules are defined; they are scheduled
88 # later. Modules are grouped by type.
89 physics:
90 {
91  # Define the variables we'll need to read for this analysis program.
92  analyzers:
93  {
94  # This name defines a job step below, and will appear as a directory
95  # in the output histogram file.
96  AnalysisExample:
97  {
98  # The "module_type" tells us which module to run. The name here
99  # must match the name supplied to DEFINE_ART_MODULE near the end
100  # of AnalysisExample_module.cc.
101 
102  module_type: "AnalysisExample"
103 
104  # The input parameters for our AnalysisExample module. Compare
105  # the names you see here with the "struct Config" in
106  # AnalysisExample_module.cxx. You will want to add/remove/rename
107  # the example parameters below to suit your task.
108 
109  # If you are reading any objects created by the standard
110  # simulation scripts, then don't change the value of this
111  # parameter. This is the name of the 'producer' that ran the
112  # simulation module in a previous job. An example of a job file
113  # that runs the simulation is ${LARSIM_DIR}/job/prodsingle.fcl;
114  # look for "largeant:". It's unlikely that anyone would change
115  # the name of this producer.
116 
117  SimulationLabel: "largeant"
118 
119  # Hits can be created by more than one module in
120  # ${LARRECO_DIR}/source/larreco/HitFinder. For this example, I
121  # picked the one that's usually run first.
122 
123  HitLabel: "gaushit"
124 
125  # The same for clusters:
126 
127  ClusterLabel: "trajcluster"
128 
129  # In this example, which primary particle(s) we'll focus on in an event.
130  # PDG code 13 = mu-.
131  PDGcode: 13
132 
133  # dx used for the dE/dx calculation; units are cm.
134  BinSize: 0.3
135  }
136  }
137 
138  # Schedule job step(s) for execution by defining the analysis module
139  # for this job. An 'analysis' module (as opposed to a 'producer' or
140  # a 'filter') does not alter the contents of events in the input
141  # file, nor does it create any events as output. Any step names
142  # listed here must match a name in the 'analyzers' section above.
143 
144  analysis: [ AnalysisExample ]
145 
146  # "end_paths" is a keyword and contains the modules that do not modify the art::Event;
147  # i.e., analyzers and output streams.
148 
149  end_paths: [ analysis ]
150 }
151 
152 # In order to work with the reconstructed objects I use in
153 # AnalysisExample, I found I needed to add the following lines. For
154 # more details, see
155 # <https://cdcvs.fnal.gov/redmine/projects/uboonecode/wiki/Guide_to_Using_FCL_files_in_MicroBooNE>
156 # Note that this is a MicroBooNE-only requirement; your experiment may
157 # need different adjustments to handle the difference between
158 # simulation and reconstruction waveform times.
159 
160 services.DetectorClocksService.InheritClockConfig: false
161 services.DetectorClocksService.TriggerOffsetTPC: -400
162 services.DetectorPropertiesService.NumberTimeSamples: 6400
163 services.DetectorPropertiesService.ReadOutWindowSize: 6400