Presentation is loading. Please wait.

Presentation is loading. Please wait.

New DetSim module David Adams BNL January 14, 2016 DUNE collaboration Far detector simulation and reconstruction.

Similar presentations


Presentation on theme: "New DetSim module David Adams BNL January 14, 2016 DUNE collaboration Far detector simulation and reconstruction."— Presentation transcript:

1 New DetSim module David Adams BNL January 14, 2016 DUNE collaboration Far detector simulation and reconstruction

2 Introduction Motivation I wanted to add simulation of the 35-ton ZS to our simulation o ZS = zero suppression Found the DetSim module code to be rather convoluted o 1500 lines, many different actions and options o Many corresponding fcl parameters Code duplicated between 35-ton and FD modules Also wanted to be able to use the new ZS code in other contexts o E.g. apply to data from real detector either to save space or to test the online algorithm o Or even in studies outside the art framework My effort Wrote new ZS as an art service Moved existing module code into services o Different services for different actions (add noise, ZS, compress, …) Wrote new module that carries out each action via a service interface o So new action (e.g. my ZS) can be plugged in at the fcl level D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20162

3 Goals Goals for the new code Comprehensibility (make SW easy to understand) o Non-expert user should be able to look at job configuration and understand what is done and what parameters are used – And then modify actions or parameters for a subsequent run o Easy to find the code corresponding to a give action in the configuration – And then easy to understand what that code is doing Modularity o Make it easy to replace an action with an alternative implementation – At natural and fine granularity so user does not have to cut and paste a lot of irrelevant code – Ideal development environment would not require user to check out and build code other than his or her own Portability (use SW in other frameworks) o Convenient if code and configuration can be used in other frameworks – Standalone main or root scripts for analysis – Other full frameworks to allow for future migration of the production FW D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20163

4 Art framework primer DUNE and many other experiments use the art framework Modularity provided by modules and services o Both configured at initialization time by art from fcl Module is a class o art loops over events and calls each module once for each event o Module has means to retrieve data from the current event o And (if it is a Producer) to write data to that event – art Analyzer is similar but does not write to the event o Probably not easy or sensible to use a module outside the art FW – One would just be duplicating art Service is a class o Called by producers or other services o Accessed with handle specifying type (either interface or full type) – Only one instance is available for each type o It is possible to use services and (service handles) outside the art FW – Still depend on art libraries for configuration and handle – See https://github.com/dladams/art_extensionshttps://github.com/dladams/art_extensions D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20164

5 Old DetSim module fcl parameters daq: { CollectionCalibPed: 500 CollectionCalibPedRMS: 0.01 CollectionPed: 500 CollectionPedRMS: 0.01 CompressionType: "ZeroSuppression" DriftEModuleLabel: "largeant" FractHorizGapUCollect: 0.1 FractHorizGapUMiss: 0.8 FractHorizGapVCollect: 0.1 FractHorizGapVMiss: 0.8 FractHorizGapZMiss: 0.8 FractUUCollect: 0.5 FractUUMiss: 0.2 FractUVCollect: 0.1 FractUVMiss: 0.2 FractVUCollect: 0.5 FractVUMiss: 0.2 FractVVCollect: 0.1 FractVVMiss: 0.2 FractVertGapUCollect: 0.1 FractVertGapUMiss: 0.8 FractVertGapVCollect: 0.1 FractVertGapVMiss: 0.8 FractVertGapZMiss: 0.8 FractZUMiss: 0.2 FractZVMiss: 0.2 InductionCalibPed: 1800 InductionCalibPedRMS: 0.01 InductionPed: 1800 InductionPedRMS: 0.01 LowCutoffU: 7.5 LowCutoffV: 7.5 LowCutoffZ: 7.5 NearestNeighbor: 25 NeighboringChannels: 3 NoiseArrayPoints: 1000 NoiseFactU: 0.05 NoiseFactV: 0.05 NoiseFactZ: 0.05 NoiseModel: 1 NoiseWidthU: 2000 NoiseWidthV: 2000 NoiseWidthZ: 2000 PedestalOn: "false" SaveEmptyChannel: "true" SimCombs: "false" SimStuckBits: "false" StuckBitsOverflowProbHistoName: "pCorrFracOverflowVsInputLsbCell" StuckBitsProbabilitiesFname: "ADCStuckCodeProbabilities35t/output_produceDcScanSummar yPlots_20150827_coldTest_0p1to1p4_step0p0010.root" StuckBitsUnderflowProbHistoName: "pCorrFracUnderflowVsInputLsbCell" ZeroThreshold: 5 module_type: "SimWireDUNE” } D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20165

6 DetSim module flow The old module is DetSimDUNE35t Input is SimChannel data product o GEANT energy deposit for each channel, tick and particle o Includes drift attenuation and diffusion Output is raw data product in LArSoft format o ADC count fore each tick and bin o Assigned threshold for each channel o Flag indicating if and how the ADC data is zero-suppressed and/or compressed Calculations take place in loop over channels Output product is constructed The new module is DetSimDUNE Same except code inside loop over channels is moved to services And a few minor mods D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20166

7 Old DetSim module channel loop Calculations in loop over channels: ADC signal is extracted from SimChannel for the channel o There is an option to create extra signal for the “combs” o Rather complicated; 35 ton specific SignalShapingServiceDUNE35t adds electronics response o Separate call uses collection response for extra signal Noise is calculated Combined and converted from floating signal to 12-bit integer count Pedestal and pedestal fluctuations are added o Pedestals and RMS (for fluctuations) are fcl parameters Conversion from floating signal to 12-bit integer count is repeated Zero suppression, compression and stuck bits are applied o Some of the code is in raw.cxx o Complicated ring buffers to allow ZS to take nearby channels into account D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20167 Denotes service imp.

8 New DetSim module channel loop Service calls in loop over channels SimChannelExtractService extracts signals from SimChannel o Signal shaping is included in this service o Extract signal from combs is handled in the service ChannelNoiseService is used to add noise to the signal PedestalAdditionService adds pedestal and pedestal noise o Pedestal values and RMS taken from IDetPedestalProvider Conversion from floating signal to 12-bit integer count AdcDistortionService called to distort ADC signal o E.g. to add stuck bits AdcSuppressService used to generate vectors of retained ticks AdcCompressService uses ADC vector and retention vectors to build the compressed data vector for each channel Notation In the above, green (XXX) denotes an art service interface D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20168 Denotes service interface

9 High-level fcl The module is included as usual in the list of producers: Override default service fcl parameters: D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 20169 producers: { generator: @local::dune35t_singlep largeant: @local::dune35t_largeant daq: @local::dune_detsim rns: { module_type: "RandomNumberSaver" } } physics.producers.daq.NoiseOn: true physics.producers.daq.PedestalOn: true physics.producers.daq.SuppressOn: true physics.producers.daq.DistortOn: false

10 High-level fcl (2) Map service interface names to services: The module and service names are defined in the fcl prolog I.e. everything prefixed with “ @local:: ” These are defined in dunetpc/dune/DetSim/detsimmodules_dune.fcl o Included before all the above with Following slides show these definitions D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201610 services.SimChannelExtractService: @local::scxgeneric services.ChannelNoiseService: @local::chnoiseold services.IDetPedestalService: @local::pedlegacy services.PedestalAdditionService: @local::padprovided services.AdcSuppressService: @local::zsonline services.AdcCompressService: @local::cmpreplace services.AdcDistortService: @local::stuckbits #include "detsimmodules_dune.fcl"

11 Module default fcl Following is the default configuration for the new module Much simpler than the old version Old fcl parameters aremoved to the new services o Choice of service for each service interface o Options for each chosen service Examples on following pages D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201611 dune_detsim: { module_type: "SimWireDUNE" SimChannelLabel: "largeant" NoiseOn: false PedestalOn: false SuppressOn: false DistortOn: false } Module class name Input data product name Action flags

12 SimChannel extraction service fcl SimChannel extraction services produce the initial wire signal I.e. convert the SimChannel into electrons collected for for each tick on each wire There is a generic implementation that should work for any detector: And a more-sophisticated version that includes charge collected on the combs but only works for the 35-ton detector: D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201612 scxgeneric: { service_provider: GenericSimChannelExtractService } FractVertGapUCollect: 0.1 FractVertGapUMiss: 0.8 FractVertGapVCollect: 0.1 FractVertGapVMiss: 0.8 FractVertGapZMiss: 0.8 FractZUMiss: 0.2 FractZVMiss: 0.2 } scx35t: { service_provider: Dune35tSimChannelExtractService FractHorizGapUCollect: 0.1 FractHorizGapUMiss: 0.8 FractHorizGapVCollect: 0.1 FractHorizGapVMiss: 0.8 FractHorizGapZMiss: 0.8 FractUUCollect: 0.5 FractUUMiss: 0.2 FractUVCollect: 0.1 FractUVMiss: 0.2 FractVUCollect: 0.5 FractVUMiss: 0.2 FractVVCollect: 0.1 FractVVMiss: 0.2

13 Noise service fcl The noise services add noise to signals What was previously noise option 1 is now And noise option 2 is D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201613 chnoiseold: { service_provider: ExponentialChannelNoiseService NoiseFactU: 0.05 NoiseFactV: 0.05 NoiseFactZ: 0.05 NoiseWidthU: 2000 NoiseWidthV: 2000 NoiseWidthZ: 2000 LowCutoffU: 7.5 LowCutoffV: 7.5 LowCutoffZ: 7.5 NoiseArrayPoints: 1000 OldNoiseIndex: true } chnoisewhite: { service_provider: WhiteChannelNoiseService }

14 Pedestal addition service fcl There is a new service to add pedestal to the signal Pedestal and RMS is obtained from IDetPedestalService It also adds pedestal noise scaling the RMS for each channel o Parameter NoiseScale can be set to zero to turn off the noise D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201614 padprovided: { service_provider: ProvidedPedestalAdditionService NoiseScale: 1.0 }

15 ADC distortion service fcl ADC distortion services can change the digitized signal At present, the only option is to add stuck bits: D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201615 stuckbits: { service_provider: StuckBitAdcDistortionService StuckBitsOverflowProbHistoName: "pCorrFracOverflowVsInputLsbCell" StuckBitsProbabilitiesFname: "ADCStuckCodeProbabilities35t/ output_produceDcScanSummaryPlots_20150827_ coldTest_0p1to1p4_step0p0010.root" StuckBitsUnderflowProbHistoName: "pCorrFracUnderflowVsInputLsbCell" }

16 ZS service fcl There are a few default options for zero suppression The ZS from the old module is (almost) reproduced by: New ZS for default noise (2.5 ADC counts, left) and two options for twice that level (center, right): D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201616 zslegacy: { service_provider: Legacy35tZeroSuppressService AdcThreshold: 10.0 TickRange: 10 MinTickGap: 2 SuppressStickyBits: true } zsonline: { service_provider: Dune35tZeroSuppressService NS: 5 NL: 15 ND: 5 NT: 3 TS: 3 TL: 7 TD: 5 }... NS: 5 NL: 15 ND: 5 NT: 3 TS: 6 TL: 14 TD: 10 }... NS: 5 NL: 15 ND: 5 NT: 3 TS: 6 TL: 10 TD: 10 } Gives inefficiency

17 Compression service fcl Finally, a compression service is applied Using the vector of accepted channels generated by ZS The only option at present replaces suppressed values with zero o Value of “zero” is configurable Plan to add another implementation that uses the old compression format D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201617 cmpreplace: { service_provider: ReplaceCompressService Zero: 0 }

18 Production with the new module Proposal for future production Switch to the new module Keep options almost the same as present production o No combs o Noise model 1 with the same parameters o Same fixed pedestals and RMS o No distortion (stuck bits) o Switch to new ZS o Switch to reimplementation of old compression when available Following pages use the above and compare Old module New module with old ZS New module with new ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201618

19 Muon in z-plane: old module D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201619

20 Muon in z-plane: new module, old ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201620

21 Muon in z-plane: new module, new ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201621

22 Muon in v-plane: old module D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201622

23 Muon in v-plane: new module, old ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201623

24 Muon in v-plane: new module, new ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201624

25 Electron in z-plane: old module D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201625

26 Electron in z-plane: new module, old ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201626

27 Electron in z-plane: new module, new ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201627

28 Electron in v-plane: old module D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201628

29 Electron in v-plane: new module, old ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201629

30 Electron in v-plane: new module, new ZS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201630

31 Summary of comparison of old and new Compare old module with new module Done by eye o Using preceding plots and others for five events Central part (i.e. peak) of signals are nearly identical Almost all differences near the edges come from different acceptances of the ZS algorithms o Different algorithms should give different results o Default tuning of the new ZS has greater acceptance o Re-implementation of the old ZS does not give identical results – Small defect in old alg is fixed in the new implementation – Different handling of sticky bits (off in new)? There are (very) few bins where the old and new have different non- suppressed values o Could be because old algorithm integerized twice D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201631

32 Release status The new DetSim module is in dunetpc release First appeared in v04_31_00_01 Bugs fixed in v04_32_00 (current release) Physical layout Service interfaces are in dune/DuneInterface Utilities, default fcl and old modules are in dune/DetSim Services are in dune/DetSim/Service New module is in dune/DetSim/Module D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201632

33 Future developments Services should obtain random seeds from SeedService Four services now need random numbers At present seeds are hardwired in Have requested this functionality be added to LArSoft Demonstrate the new DetSim service can be used for FD Simulation of comb signal is missing latest improvements Lost in an update of DetSim module before I started Restore these in the dedicated service (Tom) New organization should ensure this problem does not happen again Add service to implement the old compression format Move service and module tests from dunezs to dunetpc Add ZS option to also save neighboring channels Best to do by iterating over ROPs before channels in DetSim module Need ROP iterator from larsoft Fix noise dependence on readout window size (old defect) And make normalization parameter equal to RMS D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201633

34 Far future developments Enable use of DetSim module outside of art Move remaining module code to a service/tool that runs outside art o With art module wrapper so we can continue to run in art Need to understand how to read and write event data outside art Switch from services to tools Tools would have names with scope beyond the fcl prolog o Name could be used in data provenance record Tools could have multiple instances in one job o E.g. use (slightly) different pedestals for simulation and reconstruction DetSim module (and other tool users) could be configured with the names of the tools it uses o Instead of depending on high-level mapping of interface to service D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201634

35 Summary/conclusions New DetSim module has been released More modular than the old version o And thus comprehensible and extensible o New option for ZS has been added – Use for accurate simulation of 35-ton DAQ – And starting point for FD studies Should be able to use new module for both 35-ton and FD simulation o And so discard the existing code duplication Results are similar to old o With improvement in more accurate ZS description Need a couple additions to recover full functionality old module o Add compression module to reproduce old data format o Enable ZS to save for neighboring channels D. Adams, BNL New Detsim module DUNE collaboration: FD sim/reco January 14, 201635


Download ppt "New DetSim module David Adams BNL January 14, 2016 DUNE collaboration Far detector simulation and reconstruction."

Similar presentations


Ads by Google