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)
8 # This job runs only the first part of the photon library creation, where many
9 # scintillation photons are generated in each voxel.
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.
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).
24 # This configuration reuses existing code, and as such some additional log
25 # analysis is necessary to draw conclusions after running the job.
27 # Example code to get how many voxel slices are fully non-LAr at the border:
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
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))
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))
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))
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))
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))
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))
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
67 # The "excess" lines taught me that I consistently had, for example, 3 empty
68 # voxels at low x and 3 at high x.
87 physics.producers.generator.N: 1
88 physics.producers.generator.NMaxFactor: 100000
89 physics.producers.generator.FirstVoxel: 0
90 physics.producers.generator.LastVoxel: -1
92 source.maxEvents: 2765760 #
this needs to be
the total number of voxels
95 ################################################################################
96 ### service configuration
97 ################################################################################
100 services.DetectorClocksService: @erase
101 services.LArPropertiesService: @erase
102 services.DetectorPropertiesService: @erase
107 services.PhotonVisibilityService.LibraryBuildJob:
false
110 ################################################################################
111 ### workflow configuration
112 ################################################################################
114 physics.producers.largeant: @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
BEGIN_PROLOG sequence::SlidingWindowTriggerPatternsOppositeWindows END_PROLOG process_name