All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
photonlibrary_volumetest_icarus.fcl
Go to the documentation of this file.
1 #
2 # File: photonlibrary_volumetest_icarus.fcl
3 # Purpose: test the extent of the volume to be covered by the photon library.
4 # Author: Gianluca Petrillo (petrillo@slac.stanford.edu)
5 # Date: July 30, 2020
6 # Version: 1.0
7 #
8 # This job runs only the first part of the photon library creation, where many
9 # scintillation photons are generated in each voxel.
10 #
11 # The output log can be used to determine whether it is possible to trim the
12 # borders of the covered volume. For example, if all voxels at x = -417.5 cm
13 # have no generated scintillation photon, meaning that there is no liquid argon
14 # in them, the volume can be reduced by one voxel on that side.
15 #
16 # This is a sort of LAr volume Monte Carlo integration. We are content if we
17 # determine even just one location where a photon can be produced, i.e. just
18 # a single liquid argon point. We try NMaxFactor times to find that single
19 # point: this is the parameter that actually decides the precision of the
20 # "integration". Failing a 100'000 point search in a (5 cm)^3 volume means that
21 # there is a volume of LAr smaller than 1.25 mm^3 (and, of course,
22 # 0.001% = 1/100'000 of the volume).
23 #
24 # This configuration reuses existing code, and as such some additional log
25 # analysis is necessary to draw conclusions after running the job.
26 #
27 # Example code to get how many voxel slices are fully non-LAr at the border:
28 #
29 # lar -c photonlibrary_volumetest_icarus.fcl > photonlibrary_volumetest_icarus.log
30 # # ... wait for loooong time... it took me almost 4 hours for 2.76M voxels ...
31 # grep -F "Generated " photonlibrary_volumetest_icarus.log | cut -d' ' -f2 > VoxelMap.dat
32 # python <<EOC
33 # import numpy
34 # Dims = ( 80, 86, 402 )
35 # data = numpy.fromfile("VoxelMap.dat", dtype=int, sep=" ").reshape(Dims, order='F')
36 # assert Dims[0] * Dims[1] * Dims[2] == data.size
37 # for i in range(Dims[0]):
38 # if not data[i,:,:].any(): continue
39 # print("First x voxel non-empty: %d (excess: %d)" % (i, i))
40 # break
41 # for i in range(Dims[1]):
42 # if not data[:,i,:].any(): continue
43 # print("First y voxel non-empty: %d (excess: %d)" % (i, i))
44 # break
45 # for i in range(Dims[2]):
46 # if not data[:,:,i].any(): continue
47 # print("First z voxel non-empty: %d (excess: %d)" % (i, i))
48 # break
49 # for i in reversed(range(Dims[0])):
50 # if not data[i,:,:].any(): continue
51 # print("Last x voxel non-empty: %d (excess: %d)" % (i, Dims[0] - i - 1))
52 # break
53 # for i in reversed(range(Dims[1])):
54 # if not data[:,i,:].any(): continue
55 # print("Lasy y voxel non-empty: %d (excess: %d)" % (i, Dims[1] - i - 1))
56 # break
57 # for i in reversed(range(Dims[2])):
58 # if not data[:,:,i].any(): continue
59 # print("Last z voxel non-empty: %d (excess: %d)" % (i, Dims[2] - i - 1))
60 # break
61 # EOC
62 #
63 # This runs the configuration, parses the log for one entry per voxel, 0 or 1
64 # for no LAr and some LAr in that voxel, shove only the 0 and 1 into a file;
65 # then summon Python/numpy to read that file, treat it as a 3D array, and check
66 # the slice borders.
67 # The "excess" lines taught me that I consistently had, for example, 3 empty
68 # voxels at low x and 3 at high x.
69 #
70 
71 
72 
73 # services
75 
76 # modules
79 #include "emptyevent_icarus.fcl"
81 
82 # base configuration
84 
85 process_name: LibVolCheck
86 
87 physics.producers.generator.N: 1
88 physics.producers.generator.NMaxFactor: 100000
89 physics.producers.generator.FirstVoxel: 0
90 physics.producers.generator.LastVoxel: -1
91 
92 source.maxEvents: 2765760 # this needs to be the total number of voxels
93 
94 
95 ################################################################################
96 ### service configuration
97 ################################################################################
98 
99 services.TFileService: @erase
100 services.DetectorClocksService: @erase
101 services.LArPropertiesService: @erase
102 services.DetectorPropertiesService: @erase
103 services.LArG4Parameters: @erase
104 services.MagneticField: @erase
105 services.OpDetResponse: @erase
106 
107 services.PhotonVisibilityService.LibraryBuildJob: false
108 
109 
110 ################################################################################
111 ### workflow configuration
112 ################################################################################
113 
114 physics.producers.largeant: @erase
115 physics.analyzers: @erase
116 
117 physics.simulate: [ generator ]
118 physics.analyzeIt: @erase
BEGIN_PROLOG triggeremu_data_config_icarus settings PMTADCthresholds sequence::icarus_stage0_multiTPC_TPC physics sequence::icarus_stage0_EastHits_TPC physics sequence::icarus_stage0_WestHits_TPC physics producers purityana0 caloskimCalorimetryCryoE physics caloskimCalorimetryCryoW physics sequence::physics pathW services
process_name drop raw::OpDetWaveforms_DataApr2016RecoStage1_saturation_ * physics
do source
#define the
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name