Event Mixing Rob Kutschke, Fermilab Software and Simulation Meeting October 5, 2011 Mu2e-doc-1874-v1.

Slides:



Advertisements
Similar presentations
A Case of Performance Tuning In a semi-realistic desktop app.
Advertisements

Computer Architecture and the Fetch-Execute Cycle
December 10, 2008 TJRParticle Refrigerator1 The Particle Refrigerator Tom Roberts Muons, Inc. A promising approach to using frictional cooling for reducing.
SciFi Tracker DAQ M. Yoshida (Osaka Univ.) MICE meeting at LBNL 10.Feb.2005 DAQ system for KEK test beam Hardware Software Processes Architecture SciFi.
1 EMCal & PID Rikard Sandström Universite de Geneve MICE collaboration meeting 26/6-05.
1 Processes and Pipes COS 217 Professor Jennifer Rexford.
Linda R. Coney – 24th September 2009 MOM Update End of Sept Run Linda R. Coney 05 October, 2009.
Reconstruction and Analysis on Demand: A Success Story Christopher D. Jones Cornell University, USA.
1 PID Detectors & Emittance Resolution Chris Rogers Rutherford Appleton Laboratory MICE CM17.
1 G4MICE studies of PID transverse acceptance MICE video conference Rikard Sandström.
Lecture 16: Basic CPU Design
Introducing JavaBeans Lesson 2A / Slide 1 of 30 JDBC and JavaBeans Pre-assessment Questions 1.Which of the given symbols is used as a placeholder for PreparedStatement.
Common Experiment Workbook Status Report Anne Heavey, Rob Kutschke May 22, 2013.
VSAM KSDS and COBOL Department of Computer Science Northern Illinois University August 2005 Some of the illustrations are from VSAM: Access Method Services.
Testing. Definition From the dictionary- the means by which the presence, quality, or genuineness of anything is determined; a means of trial. For software.
Update on Corsika Simulation 29 June 2015 Fabrizio Coccetti 1.
Input/ Output By Mohit Sehgal. What is Input/Output of a Computer? Connection with Machine Every machine has I/O (Like a function) In computing, input/output,
CS 470 Lab 5 Comment your code. Description of Lab5 Create Four projects – Driver – Producer – Filter – Consumer.
Interrupts and DMA CSCI The Role of the Operating System in Performing I/O Two main jobs of a computer are: –Processing –Performing I/O manage and.
User Documents and Examples I Sébastien Incerti Slides thanks to Dennis Wrigth, SLAC.
Storage Manager Overview L3 Review of SM Software, 28 Oct Storage Manager Functions Event data Filter Farm StorageManager DQM data Event data DQM.
FYP Final Presentation: Distributed Audio Mixing Daire O'Neill, Final Year Electronic Engineering Project Supervisor: Dr Peter Corcoran Co-Supervisor:
Implementing a dual readout calorimeter in SLIC and testing Geant4 Physics Hans Wenzel Fermilab Friday, 2 nd October 2009 ALCPG 2009.
NPDGamma: Data Acquisition System October 15th, 2010 NPDGamma Collaboration Meeting ORNL.
Chapter 7 File I/O 1. File, Record & Field 2 The file is just a chunk of disk space set aside for data and given a name. The computer has no idea what.
Suite zTPFGI Facilities. Suite Focus Three of zTPFGI’s facilities:  zAutomation  zTREX  Logger.
Event Data History David Adams BNL Atlas Software Week December 2001.
Indexed and Relative File Processing
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
Recent Software Issues L3 Review of SM Software, 28 Oct Recent Software Issues Occasional runs had large numbers of single-event files. INIT message.
G.Corti, P.Robbe LHCb Software Week - 19 June 2009 FSR in Gauss: Generator’s statistics - What type of object is going in the FSR ? - How are the objects.
Level 2 ID-tracking truth association Trigger AOD discussion 13 December 2006 Ricardo Gonçalo - RHUL.
A Technical Validation Module for the offline Auger-Lecce, 17 September 2009  Design  The SValidStore Module  Example  Scripting  Status.
Some Thoughts about Hits, Geometry etc Rob Kutschke, Hans Wenzel Fermilab March 13, 2007.
Experience With CBM Muon Simulation Partha Pratim Bhaduri.
An Introduction to Programming with C++ Sixth Edition Chapter 14 Sequential Access Files.
Π +  e + ν e Calibration: Corrected Results and Degrader vs. No Degrader James Mott Mu2e Software & Simulations Meeting 02/04/15.
Introduction to CMSSW Framework Concepts Simulation & Reconstruction Liz Sexton-Kennedy January 10, 2008.
1 Program Input Software Design Chapter 4. 2 You Will Want to Know... Prompting for and reading values into a program. Accessing data from a file. What.
The CMS Simulation Software Julia Yarba, Fermilab on behalf of CMS Collaboration 22 m long, 15 m in diameter Over a million geometrical volumes Many complex.
Electronic Analog Computer Dr. Amin Danial Asham by.
Online Reconstruction 1M.Ellis - CM th October 2008.
12 October 2001, M. LefebvreHEC-Athena Tutorial: HEC beam test primer1 HEC Beam Test Primer Production modules of the HEC have been tested in particle.
9/12/99R. Moore1 Level 2 Trigger Software Interface R. Moore, Michigan State University.
Top mass error predictions with variable JES for projected luminosities Joshua Qualls Centre College Mentor: Michael Wang.
COMET and DeeMe. Mu-e conversion search at J-PARC COMET Target sensitivity 10 C.L. using aluminum target – SINDRUM II 7x – MEG 2.4x
Mu2e and Project X, September 3, 2008 E Prebys Background: Proton Economics in Project X Era* Assume  9mA*1ms = 5.3x10 13 protons/linac “blast”  Main.
Software Tools for Layout Optimization (Fermilab) Software Tools for Layout Optimization Harry Cheung (Fermilab) For the Tracker Upgrade Simulations Working.
 A model of beam line built with G4Beamline (scripting tool for GEANT4)  Simulated performance downstream of the AC Dipole for core of beam using  x.
Time Management.  Time management is concerned with OS facilities and services which measure real time.  These services include:  Keeping track of.
ALICE Offline Week October 4 th 2006 Silvia Arcelli & Chiara Zampolli TOF Online Calibration - Strategy - TOF Detector Algorithm - TOF Preprocessor.
Mu to e Meeting BNL, June 2006 Extinction requirement relaxation (Kevin O’Sullivan) Stopping Target Geometry (Cenap Ozben, David Morse) Yannis Semertzidis.
Status report - Tracking code - T.Gogami 9/30/2010.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
M. Ellis - MICE Collaboration Meeting - Wednesday 27th October Sci-Fi Tracker Performance Software Status –RF background simulation –Beam simulation.
AliRoot survey: Reconstruction P.Hristov 11/06/2013.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
Analysis Model Zhengyun You University of California Irvine Mu2e Computing Review March 5-6, 2015 Mu2e-doc-5227.
Progress on Simulation Software Hai-Ping Peng(USTC) Xiao-Shuai Qin(IHEP) Xiao-Rong Zhou(USTC) Yu Hu(IHEP) 2014 STC Workshop (ITP) Hai-Ping Peng.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
MAUS Status A. Dobbs CM43 29 th October Contents MAUS Overview Infrastructure Geometry and CDB Detector Updates CKOV EMR KL TOF Tracker Global Tracking.
Simulation of Extinction Channel Eric Prebys Mu2e Extinction Technical Design Review 2 November 2015.
Fermilab Scientific Computing Division Fermi National Accelerator Laboratory, Batavia, Illinois, USA. Off-the-Shelf Hardware and Software DAQ Performance.
Skimming in Zztop Ricardo – SLT meeting.
Chapter 14: Sequential Access Files
Muon stopping target optimization
Global PID MICE CM43 29/10/15 Celeste Pidcott University of Warwick
Status of Full Simulation for Muon Trigger at SLHC
Issues with Simulating High Luminosities in ATLAS
Presentation transcript:

Event Mixing Rob Kutschke, Fermilab Software and Simulation Meeting October 5, 2011 Mu2e-doc-1874-v1

The Problem Per proton pulse ( Mu2e-doc-1174, Mu2e-doc-1865) –35,988 DIO –5,560 ejected protons –10,850,000 beam electrons –and lots more How do we simulate all of this in time with a single conversion electron? –CPU time required is huge, hours per event. –Memory limits, especially if we want to retain the full history of leading to all hits. The key to the answer: –Only a tiny fraction of background particles create any hits. 10/5/11Kutschke/Simulations&Software2

The Solution Generate large samples of each background process –One generated particle per event. –With one exception, use the full phase space: t > 500 ns –Send these events through G4. –Write out only events with a least one StepPointMC in the detector(s) of interest. When simulating signal events –Read in or generate one conversion electron –Overlay appropriate number of events from each of many background streams. 10/5/11Kutschke/Simulations&Software3

DIO Examples My jobs: /mu2e/data/outstage/kutschke/72785 –Single track events generated: 250,000,000 –Events with >0 hits in tracker: 129,060 – events with tracker hits per DIO From Gianni: –35,988 DIO per proton pulse (Mu2e-doc 1774-v2) –22,456 with t>500 ns (62.4%) 22,456 × = 11.6 –Draw 11.6 events per conversion electron from my DIO background files. 10/5/11Kutschke/Simulations&Software4

Ejected Proton examples My jobs: /mu2e/data/outstage/kutschke/72784 –Single track events generated: 70,000,000 –Events with >0 hits in tracker: 297,063 – events with hits in tracker per ejected proton From Gianni: Mu2e-doc 1774-v2 –5,560 ejected protons per proton pulse –3,513 with t>500 ns (62.4%) 5,560 × = 14.9 –Draw 14.9 ejected protons per conversion electron from my ejected proton background files. 10/5/11Kutschke/Simulations&Software5

The Data Product View 10/5/11Kutschke/Simulations&Software6

Data Products Related to StrawHits 10/5/11Kutschke/Simulations&Software7 GenParticles SimParticlesStepPointMCs (tracker)StatusG4 StrawHitsStrawHitMCTruthPtrStepPointMCVectors generate g4run makeSH art::Ptr<> module label Data like. Input to TrkPatRec Legend

Event Mixing 10/5/11Kutschke/Simulations&Software8 GensSimsStepsStatusG4 Event 1 Event 2 Event 3 Event 4 DIO Background File GenParticles Event 1 Event 2 Event 3 SimParticles Event 1 Event 2 Event 3 StepPoints Event 1 Event 2 Event 3 For each signal event, choose N events from the DIO background file, mix the N GenParticleCollections in the file into 1 in memory. And so on for other data products. Renumbers items for events 2, 3 … Therefore: reseat all art::Ptr objects. Data Products in memory

Example: StepPointMCs 10/5/11Kutschke/Simulations&Software9 GensSimsStepsStatusG4 Event 13 Event 22 Event 34 DIO Background File StepPointMCs 0 – (1,0) 1 – (1,1) 2 – (1,2) 3 – (2,0) 4 – (2,1) 5 – (3,0) 6 – (3,1) 7 – (3,2) 8 – (3,3) Size of StepPointMCCollection StepPointMCCollection in Memory (n,m) = ( event # in bg file, index into the collection )

Mixing: Signal, DIO, Ejected Protons 10/5/11Kutschke/Simulations&Software10 GenParticles SimParticlesStepPointMCs (tracker)StatusG4 GenParticles SimParticlesStepPointMCs (tracker)StatusG4 GenParticles SimParticlesStepPointMCs (tracker)StatusG4 1 conversion electron N1 Mixed-in DIO events N2 Mixed-in ejected proton events

StrawHits From Multiple StepPointMCs 10/5/11Kutschke/Simulations&Software11 Input to TrkPatRec StepPointMCs (signal) StepPointMCs (DIO) StepPointMCs (protons) StrawHitsStrawHitMCTruth PtrStepPointMCVectors SimParticles (signal)SimParticles (DIO)SimParticles (protons) I hope that TrkPatRec needs no changes!

Another View 10/5/11Kutschke/Simulations&Software12 Input to TrkPatRec StepPointMCs (signal) mixDIO makeSH source or g4run StepPointMCs (DIO BG) StepPointMCs (protons) mixProtons StrawHitsStrawHitMCTruth PtrStepPointMCVectors

Configuring a Mixing Module Mean –If positive, specifies mean of a Poisson distribution. –If negative, mix in exactly |mean| events per primary event. fileNames –Arbitrary number allowed. –The job shutsdown gracefully if inputs run out ( via a throw). 10/5/11Kutschke/Simulations&Software13 dioMixer: { module_type : MixMCEvents mean : 11.6 fileNames : [ ”dioFile1.root”, “dioFile2.root”, “dioFile3.root” ] readMode : sequential seed : [13579] }

Configuring a Mixing Module readMode: –sequential/random –I have not tried random. seed –Used to seed the Poisson distribution. –99% sure it is optional. 10/5/11Kutschke/Simulations&Software14

Example.fcl File Fragment 10/5/11Kutschke/Simulations&Software15 physics :{ producers:{ makeSH } filters: { dioMixer: { module_type : MixMCEvents mean : 11.6 fileNames : [ ”dioFile1.root”, “dioFile2.root”, “dioFile3.root” ] readMode : sequential seed : [13579] } protonMixer: { module_type : MixMCEvents mean : 14.9 fileNames : [ “protonFile1.root”, “protonFile2.root” ] readMode : sequential seed : [24680] } p1 : [ dioMixer, protonMixer, makeSH ] trigger_paths : [p1] e1 : [ outfile ] end_paths : [e1] } Suppose that source is a file of pure conversion electron events

Comments on Previous Slides Can mix-in arbitrary number of streams. Signal events can be: –Read from source –Generated in same job –Just another mixing stream ( with mean : -1 ). –No signal event, to get a pure BG sample. 10/5/11Kutschke/Simulations&Software16

Why 2 Instances of MixMCEvents? Why not just one instance of a mixing module that can read multiple input streams? The existing solution has a clean separation of responsibilities: –Code related to persistency (ROOT IO) that can be written by computer professionals who are unaware of the internal details of Mu2e data product classes. –Mu2e specific pieces that can be written by us. We can be entirely unaware of the details of persistency. Other solutions, which allowed multiple input streams within one mixing module, compromised this separation of responsibilities. 10/5/11Kutschke/Simulations&Software17

Separating Responsibilities See: EventMixing/src/MixMCEvents_module.cc Philosophy: –We write callback functions to do the Mu2e specific parts –We register the callbacks with an art-written module that does all of the art parts. –art does the rest of the work and calls our code as needed. –art also provides a toolkit to help us do our work. Our class: mu2e::MixMCEventsDetail –The callback functions are methods of this class. The mixing module class is: –art::MixFilter 10/5/11Kutschke/Simulations&Software18

Configuring a Mixing Module mean –Processed by mu2e code fileNames, readMode, seed –Processed by the art::MixFilter template I may add more arguments processed by our code. 10/5/11Kutschke/Simulations&Software19 dioMixer: { module_type : MixMCEvents mean : 11.6 fileNames : [ ”dioFile1.root”, “dioFile2.root”, “dioFile3.root” ] readMode : sequential seed : [13579] }

class MixMCEventsDetail { …. bool mixGenParticles ( …. ); …. private: …. std::vector genOffsets_; } bool mu2e::MixMCEventsDetail:: mixGenParticles( std::vector const& in, mu2e::GenParticleCollection& out, art::PtrRemapper const & ){ art::flattenCollections(in, out, genOffsets_); return true; } A Mixing Method 10/5/11Kutschke/Simulations&Software20

Comments on Previous Slide genOffsets_ records the boundaries, within the output collection, at which the new events begin. –Used in downstream code to update art::Ptr. 10/5/11Kutschke/Simulations&Software21

Summary and Conclusions Event mixing is working but still has a few rough edges. –Requires the art v0_7_16 –art v0_7_16 is available for mu2egpvm02 but not the SLF4 machines. Expect it to be ready for use in a few days. 10/5/11Kutschke/Simulations&Software22

Backup Slides 10/5/11Kutschke/Simulations&Software23

Steps 1 and 2 10/5/11Kutschke/Simulations&Software24 Step 1: protons on production target Save muons entering DS Step 2: output of step 1. Save time and position of muons stopping in foils

Generated Time Distribution 10/5/11Kutschke/Simulations&Software25 Muon stopping time convoluted with an exponential decay. … and with proton pulse shape if needed. Fold time into the first cycle of the muon beamline. Restart from the beginning if t < 500 ns. 62.4% t > 500 ns