350 likes | 362 Views
R.A.T. is a versatile simulation and analysis tool used by multiple collaborations for studying particle propagation, detector optics, and data acquisition in various experiments. It features reusable code, integration with GEANT4, ROOT, GLG4sim, and SNOMAN, and provides a user-friendly interface and comprehensive documentation.
E N D
RAT Simulation and Analysis Tool (Most slides stolen from Stan Seibert)
Brief Happy Life • Created by Stan Seibert as first full `hit-level’ Monte Carlo for Braidwood • Quickly adopted by Collaboration as primary simulation and analysis tool • Many contributions from KSU, Oxford, Chicago, Columbia, MIT • Being used now for DEAP/CLEAN, SNO+, CLEAR, possibly other expts.
Design Goals • Complete simulation of particle propagation, detector optics, and DAQ across all energy regimes • Reuse as many ideas and as much code from others as possible. • Break down analysis into small tasks that can be implemented by many people. • Design for production analysis of both Monte Carlo and real data. • Provide easy, understandable documentation for users and programmers
Reuse is good! • GEANT4 - Monte Carlo simulation of detectors and physical processes • ROOT - Object I/O to disk or over network. • GLG4sim - Generic Liquid Scintillator GEANT4simulation, written and maintained by Glenn Horton-Smith from the KamLAND collaboration. • SNOMAN - SNOMonte Carlo and ANalysis. Provided design inspiration, but no code.
Monte Carlo Features • Generate single and multiparticle events, and interleave events of different types • Includes optical, EM, and hadronic processes. • Includes PMT and DAQ simulations (experiment-dependent) • Several event visualization options (they keep getting better)
Code Distribution • Distributed and running at ~20(?) Institutions, a few different collaborations • Development ongoing at nearly all • Various scientific linux versions, MAC-OS, BULinux… • `RatCage’ provides out-of-the-box installation Seibert
How it all fits together: RAT GLG4sim GEANT4 ROOT CLHEP
The Concept Event Data Structures Event Loop Gsim Trigger Fit To Disk . . . Processors Event Producer
User Interface • Command Line • Macro files to control settings: /glg4debug/glg4param omit_muon_processes 1.0 /glg4debug/glg4param omit_hadronic_processes 1.0 /run/initialize /rat/proc/simpledaq /rat/proc count /rat/procset update 5 /rat/proc outroot /rat/procset file "test.root" /generator/add combo gun:point /generator/gun gamma 0 0 0 1.022 /run/beamOn 100
Detector Geometry: Config SNOMAN GDML All C++ All Text Files • Using text files, you can: • Add arbitrary new volumes of predefined shapes • Control materials, dimensions • Repetition of volumes in simple ways • Must write some C++ to: • Make arbitrary new shapes • Repeated volumes with fancy layouts GLG4sim RAT
Detector Geometry • Detector materials and geometric construction loaded from RATDB • User-editable without writing new code (within limits) • Override parameters in macros J. Nikkel
The Event Data Structure RAT_DS RAT_MC RAT_MCParticle RAT_MCParticle RAT_MCTrigger RAT_MCTrigger RAT_MCPMT RAT_MCPMT RAT_MCPMT RAT_EV RAT_EV RAT_EV RAT_PMT RAT_PMT RAT_PMT RAT_PosFit RAT_PosFit RAT_EFit RAT_EFit (Abridged)
DAQ Simulation Generate PMT pulses from photoelectrons Decide if channel is above threshold Integrate and sample Front End Trigger Sum up “trigger pulses” from channels above threshold Compute NHIT triggers Event Builder Populate detector events with (eventually digitized) samples DEAP/CLEAN version has full Waveform digitization
Event Generators e+ • Single particle “gun” • Directed or isotropic • Inverse beta decay and ES electrons • Calibration sources (e.g. LEDs) • Arbitrary events from HEPEVT format text file e+ p n +many more
“User” Processors • Users can write new processors and link them into a custom version of RAT • No need for each user to have their own copy of RAT source • Turning a user processor into an “official” processor for inclusion in source tree is very easy. • See user/ directory in RAT tree for skeleton processor to edit.
Store entire events to ROOT files. Reload events from disk back into the event loop. Send events through the network between RAT processes. Prune unneeded parts to save space. I/O Options
Default Plane RATDB Time Plane DAQ: lockout: 390, nhit_width: 10, … • Parameters, material properties, other “constants” • Organize integers, floats/doubles, strings, and arrays into “tables of fields” • Validity ranges • Users can override the database in their macro files • Multiple backends possible (SQL?), only text file for now User Plane Table GEO[av]: type: “sphere”, mother: “buffer”, … Fields NOTE: RATDB now being updated to use MINOS-style database …
Infrastructure • Unit testing with CxxTest http://cxxtest.sourceforge.net/ • Website: • User-updatable manuals, howtos, FAQs • Browse syntax-highlighed source code • Timeline of source code changes with diffs • Bug tracking • Build testing results for Linux, Solaris, Mac OS X
Verification with SNO E.W. Beier
// A 100 kton light water Cherenkov detector // The centre of the inner vessel is at 0,0,0 in the world coordinate frame // Largely to blame: Andy Mastbaum, mastbaum@lanl.gov // -------- THE WORLD! :D { name: "GEO", index: "world", valid_begin: [0, 0], valid_end: [0, 0], mother: "", // world volume has no mother type: "box", size: [70000.0, 70000.0, 70000.0], // mm, half-length material: "rock", color: [0.67, 0.29, 0.0], invisible: 1, } A 100kTon H2O Detector {name: "GEO", index: "target_water", valid_begin: [0, 0], valid_end: [0, 0], optimize: 0, // toggle voxel optmization: fast start, slow per event mother: "vessel", type: "tube", r_max: 23500.0, size_z: 60000.0, position: [0.0, 0.0, 0.0], rotation: [0.0, 0.0, 0.0], material: "lightwater_sno", color: [0.6, 0.9, 1.0, 0.01], invisible: 1,}
// 50 kiloPMTs, 400 around, stacked uniformly 125 PMTs high. // Tons of clearance vertically, circumferentially, you get 14.2" arc length per PMT { name: "PMTlocations", valid_begin : [0, 0], valid_end : [0, 0], mother: "target_water", type: "pmtarray", optimize: 0, pmt_type: "r5912", sensitive_detector: "/mydet/pmt/inner", orientation: "point", orient_point: [0.0, 0.0, 0.0], x : [23033.94, 23030.10, 23021.58, 23007.37, 22987.49, 22961.94, 22930.72… y : [ 0.00, 361.79, 723.48, 1085.00, 1446.25, 1807.14, 2167.59… z : [-29523.84, -29523.84, -29523.84, -29523.84, -29523.84, -29523.84, -29523.84… } A 100kTon H2O Detector
Some example 5 MeV electron Cherenkov vertices A 100kTon H2O Detector A. Mastbaum
Considerations • Upsides • RAT is flexible and is nearly `fully functional’ simulation • Also has lots of data-ready infrastructure • Generic enough that could turn into our own package • Distribution and QC are already-solved problems • (Most `annoyances’ already taken care of) • Very nice set of simple analysis tools already exist • Very well set up to test detector geometries, DAQs • Very easy to get going quickly and add code, do analysis • Support from other collaborations would be very helpful
Considerations • Downsides • Currently no ~GeV simulations have been run • Still needs interface to NUANCE or similar xs simulation • And anything else beyond GEANT4 • No `high energy’ analysis tools (e.g., reconstruction) • Currently would be very slow: need to voxelize PMTs, etc. • Would have to support without much effort from Seibert unless LANL low E group gets involved
Considerations • Recommendations • Worth exploring now • More worthwhile to think as a long-term solution • Should ask Deap/Clean and/or SNO+ for code • Would jumpstart simulation/analysis development • But need some 50%+ people to work on it