Mixing and Resampling

From Mu2eWiki
Jump to navigation Jump to search

Construction.jpeg This page is a draft, please help complete it!

Introduction

In mu2e simulation, mixing is a procedure where different parts of an event are generated separately and written out, then, sometime later, mixed together to create the final event. It is an approximate, practical approach, driven by limitations on computing. It is helpful to be familiar with the the experiment, simulation, and staging before continuing.

In the real experiment, one event is 900 ns of time-dependent detector data recording the result of a one microbunch (40M protons on target or POT). In one event, there is always a lot of background activity (hits) in the detector and, sometimes, there will be one track of interest, such as a conversion electron, for example. If we were to naively simulate this event, we would find we find we spend thousands of hours generating the protons on target to simulate the background activity for one event, and then we add the one conversion electron to the event. When you need thousands or millions of conversion electrons to test resolutions or efficiencies, this approach becomes impossible.

There are two things we can do, and we take both these approaches depending on the needs of the study. The first approach is to forget the background activity and simply generate conversion electrons as they pop out of muons stopped in the target. This runs very fast and produces compact output files. The downside is that we do not have the background activity and we know this activity it is important if you are trying to make accurate estimates of efficiency or resolution.

The second approach is generate as many full microbunch events as we can. We then overlay conversion electrons on top of these microbunches to make realistic signal events. It turns out we can't generate more than one hundred or so microbunches, so that's how many realistic event we end up with. To generate high statistics, we perform one more step. We continue to generate more unique conversion electrons, and re-use or resample the background events over and over. Since each conversion electron passes through a different region of the detector, the effect of the background activity on the electron is statistically independent, even though we are using the same background activity event many times. The combination of the background event and the conversion electron event is the mixing.

In the next section we briefly discuss some simulation issues relevant to all mixing. There are many ways that parts of an event might be generated separately, then mixed, but we will focus only the highest, and most common, level of mixing in the following sections.

Simulation mixing

Events are mixed at the StepPointMC level. This is essentially overlapping lists of particles on the event. You can't mix after creating digis since you can no longer correctly add the charge depositions and include non-linear effects.

Background frames

In this section we mix many sources of physics together to make the event that represents the simulation of all standard model physics in a microbunch event. This is also called a "background event", a "background fame" or "detmix". Usually one expert prepares these frames for the collaboration.

At the end of stage 4 the staged production of protons on target we are left with the following datasets. At this point, each art event is based on one proton on target, and may be filtered, saving only events with particles in the detector region.

  • an ntuple containing the position of muons that stopped in the target (target stops)
  • art files containing the following particles species, produced using custom physics models, originating from target stops
    • DIO electrons
    • protons
    • neutrons
    • photons
    • deuterons
  • art files with all the particles caused by muons that stopped outside the target (oot)
  • art files with all the other particles caused by protons on target (flash)

At this point, we have all the standard model physics from protons on target. The five particle species represent all the products of muons stopped in the target, the OOT represents all muons stopped out the target, and the flash presents everything else. We only need to mix them together in the right proportions to make realistic events. The mixing factors will depend on the simulation of the POT, the number of stopped muons, the probability of a muon capture, the probability for a muon capture to produce a particle of a certain species.

Mixing signal

In this section we discuss how to mix a signal, such as a conversion electron, on top of a background frame.

There are generally two cases at this point

  • the conversion electrons have been generated previously and are stored, one per event, in an art file and this dataset is mixed with the background. In this case the input module will be readin conversion electrons one at a time, and adding in the background frame.
  • the conversion electron will be generated in the same job as it is mixed. In this case the input module is a generator and the background frame is mixing after the generation.

Mixing fcl