Newer
Older
- [ROOT](https://root.cern/)
- [edep-sim](https://github.com/ClarkMcGrew/edep-sim)
### Get the code
```console
$ git clone https://baltig.infn.it/dune/sand-reco.git
### Build the binaries
```console
$ cd sand-reco
In the `bin` folder, there will be five executables:
- **Digitize** will perform digitization,
- **Reconstruct** will reconstruct tracks in STT and clusters in ECAL
- **Analyze** will identify particles and assign them a momentum
- **FastCheck** will produce a lot of plots to check everything is ok
- **Display** displays events
In the `lib` folder, there will be two libraries:
- **libUtils.so** for utilities
- **libStruct.so** for i/o
### Setup
```console
- Track find and fit of STT track
- Clustering of calorimeter cells
```console
$ Reconstruct <MC file> <digiti file> <reco file>
- Evaluate parameters of particles
- Evaluate neutrino energy
```console
$ Analyze <MC file> <reco file>
```
### FastCheck
- Produce several plots to check everything is ok
```console
$ FastCheck <root file> <pdf file>
### Display
- Display an event
```console
$ Display <event number> <MC file> <input file> [show trajectories] [show fits] [show digits]
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
<details><summary>Run production using batch system at CNAF</summary>
The batch system at CNAF is [HTCondor](https://htcondor.org/) (Documentation [here](https://htcondor.readthedocs.io/en/latest/)). To submit jobs, do:
```console
$ condor_submit -name sn-02.cr.cnaf.infn.it -spool submit.sub
```
The submit file is:
```
# Unix submit description file
# sleep.sub -- simple sleep job
executable = submit.sh
arguments = $(Item)
transfer_input_files = /usr/lib64/libLHAPDF-6.2.1.so,macro.template.mac
log = $(ClusterId).$(Process).$(Item).log
output = $(ClusterId).$(Process).$(Item).out
error = $(ClusterId).$(Process).$(Item).err
should_transfer_files = Yes
when_to_transfer_output = ON_EXIT
queue in 0, 21, 308
#queue from seq 300 399 |
```
The instruction `queue in 0, 21, 308` will generate three jobs with $Item equals to 0, 21 and 308 respectively, while the instruction `queue from seq 300 400 |` will generate 100 jobs with $Item from 300 to 399. The variable $Item is then passed as [argument](https://baltig.infn.it/dune/nuev-generator/-/edit/master/README.md#L179) to the [script](https://baltig.infn.it/dune/nuev-generator/-/edit/master/README.md#L178) that will run on the node.
The script `submit.sh` is:
```
#!/bin/bash
# setup environment (i.e. ROOT and edep-sim)
source /opt/exp_software/neutrino/env.sh
# setup sand-reco
source /storage/gpfs_data/neutrino/users/mt/check_chain/sand-reco/setup.sh
# Output folder
# genie, edep-sim, digi and reco subfolders will
# be created and output files will be stored there
OUT=/storage/gpfs_data/neutrino/users/mt/check_chain/files
if [ ! -d ${OUT}/genie ]; then
mkdir -p ${OUT}/genie
fi
if [ ! -d ${OUT}/edep-sim ]; then
mkdir -p ${OUT}/edep-sim
fi
if [ ! -d ${OUT}/digi ]; then
mkdir -p ${OUT}/digi
fi
if [ ! -d ${OUT}/reco ]; then
mkdir -p ${OUT}/reco
fi
# NUEV-GENERATOR to be used
GEN=/storage/gpfs_data/neutrino/users/mt/check_chain/nuev-generator/bin/generate
# TOP VOLUME where neutrino interactions will be simulated
VOL=sand_inner_volume
# GDML geometry
GEO=/storage/gpfs_data/neutrino/SAND/GDML-GEO/SAND_opt2.gdml
# Neutrino FLUX
FLX=/storage/gpfs_data/neutrino/SAND/LBNF-NUBEAM-FLUX/
histos_g4lbne_v3r5p4_QGSP_BERT_OptimizedEngineeredNov2017_neutrino_LBNEND_fastmc.root
# GENIE tune
TUN=G18_02a_00_000
# XML cross-sections file
XSC=/storage/gpfs_data/neutrino/SAND/GENIE-XC/v3_00_06/NULL/G1802a00000-k250-e1000/data/gxspl-FNALbigger.xml
# Run number. It will be passed as argument
RUN=$1
# neutrino type
NUL=14
# number of simulated events (per job)
NEV=100
# Output file prefix
PREFIX=100-numu-InnerVol
# Output GENIE file prefix
# and edep-sim, Digitize, Reconstruct
# output files
GENIE_OUT=${OUT}/genie/${PREFIX}
EDEP_OUT=${OUT}/edep-sim/${PREFIX}.${RUN}.edep-sim.root
DIGI_OUT=${OUT}/digi/${PREFIX}.${RUN}.digi.root
RECO_OUT=${OUT}/reco/${PREFIX}.${RUN}.reco.root
## NUEV-GENERATOR
${GEN} \
-f histo:${FLX} \
-g ${GEO} \
-n ${NEV} \
-o ${GENIE_OUT} \
-p ${NUL} \
-r ${RUN} \
-t ${VOL} \
--cross-sections ${XSC} \
--tune ${TUN}
## GNTPC
if [ -f ${GENIE_OUT}.${RUN}.ghep.root ]; then
gntpc \
-f t2k_rootracker \
-i ${GENIE_OUT}.${RUN}.ghep.root \
-o ${GENIE_OUT}.${RUN}.gtrac.root
fi
## PREPARE MACRO FOR EDEP-SIM
sed -e "s:__NEV__:${NEV}:g" -e "s:__INPUT__:${GENIE_OUT}.${RUN}.gtrac.root:g" macro.template.mac > macro.${RUN}.mac
## EDEP-SIM
if [ -f ${GENIE_OUT}.${RUN}.gtrac.root ]; then
edep-sim -C \
-g ${GEO} \
-o ${EDEP_OUT} \
macro.${RUN}.mac
fi
## DIGITIZATION
if [ -f ${EDEP_OUT} ]; then
Digitize \
${EDEP_OUT} \
${DIGI_OUT}
fi
## RECONSTRUCTION
if [ -f ${DIGI_OUT} ]; then
Reconstruct \
${EDEP_OUT} \
${DIGI_OUT} \
${RECO_OUT}
fi
## ANALISYS
if [ -f ${RECO_OUT} ]; then
Analyze \
${EDEP_OUT} \
${RECO_OUT}
fi
```
The edep-sim macro template is:
```
################################
# Add the GENIE events
################################
## Replace this with the name of a GENIE rooTracker file
/generator/kinematics/rooTracker/input __INPUT__
## Use the T2K rooTracker input format. This is directly supported by GENIE.
/generator/kinematics/set rooTracker
## Distribute the events based on the density of the material. When done
## this way, the composition of the detector is ignored, so it's not
## a good way for physics, but it's OK for an example since you don't
## need to syncronize the GENIE and EDEPSIM geometries.
#/generator/position/density/sample DetEnclosure_lv
#/generator/position/set density
#/generator/count/fixed/number 1000
#/generator/count/set fixed
#/generator/time/spill/start 0.0 ns
#/generator/time/spill/bunchCount 1000
#/generator/time/spill/bunchSep 10.0 ns
#/generator/time/spill/bunchLength 5.0 ns
## Make sure EDEPSIM updates the kinematics generator.
/generator/add
/run/initialize
/run/beamOn __NEV__
```
</details>
The description of the data format can be found [here](https://github.com/DUNE-ND-SAND/sand-stt/wiki/Data-Model)
- The code format can be find [here](https://github.com/DUNE-ND-SAND/sand-stt/wiki/Code-Formatting)
- The developing scheme is described [HowToDevelop.pdf](https://baltig.infn.it/dune/sand-reco/-/wikis/uploads/8b897fb0ea753ef767b96312bdf9ccac/HowToDevelop.pdf)
# Support
For any communication, please refer to [DUNE-ND-SAND-SOFTWARE@fnal.gov](mailto:DUNE-ND-SAND-SOFTWARE@fnal.gov)