DetSim and PhotonTransport: MINOS Detector and Front-End Simulation


June 2003
Last Modified: October 23, 2003
Nathaniel Tagg
University of Oxford

Description
Features
Failings / TODO
Installation / Preperation
Running DetSim
Contributing To DetSim

Description:

PhotonTransport is a package that simulates how energy depositions in the detector get transformed into light, and transports that light to the PMT photocathodes.

DetSim is a package to allow realistic Monte Carlo simulation of the MINOS front end, through the PMTs, electronics, and DAQ.  (The name "DetSim" is something of a misnomer; a mistake from SNO days where the 'detector' meant "PMTs and electronics". In proper MINOS parlance, it should probably be InstrumentSim, but that's too many letters for me.)


mc_diagram

The simulation proceeds by several stages:

1)  libRerootExodus.so provides the RerootToTruth module. This builds the DigiScintHits: energy deposits in the scintillator.

2) libPhotonTransport.so provides the ScintHitToDigiPE module, which creates blue photons in the scintillator, simulates their capture on the wavelength shifting fibre, simulates the transport of the photons down the fibre, and simulates the conversion to photoelectrons (DigiPE).

3) libDetSim.so provides DigiPEtoRawDataModule, which performs the instrumentation simulation (PMTs, electronics, and DAQ) to create a RawDigitDataBlock.

In addition to these libraries, database tables are provided.
    PHOTON* tables contain data used for the photon simulation: emmision spectra, absoption spectra, reflectivity, etc.

    SIM* tables contain data used by the front-end simulation. Currently this consists only of PMT crosstalk.

Other important calibration tables are the UGLI and CAL tables. In particular, the CALADCTOPE table and CALMUONCALIBRATION tables are important to get the right strip-to-strip and channel-to-channel variances.

Features:

PhotonTransport


PhotonTransport currently has two modes to calculate the number of photons to be simulated.

Default:
No strip-to-strip variation
MuonComputer: Strip-to-strip variation is computed by CALMUONCALIBRATION/CALADCTOPE
Both methods use Birk's law for scintillator saturation.

PhotonTransport currently has several transport algorithms available. Although they can be mix-n-matched to the user's preference, there are three modes of operation recommended:

Full: (Slow but good)
- Blue photons are created along the particle's track with the correct emmission spectrum.  They are bounced around the strip using wavelength-dependent absoption in the scintillator and wavelength-dependent diffuse reflection off of the TiO2 co-extrusion. 
- Blue photons, if they hit the fibre, are reflected off or refracted into the core of the fibre.  They are absorbed along the chord of their transit with the wavelength-dependent absoption spectrum of the WLS fibre material
- Green photons are created at the blue photon absorption points and emitted isotropically.  The photons are refracted or reflected off the double-cladding of the WLS fibre.
- Green photons are carried to the PMT photocathode (using the wavelength-dependent absoption spectrum of the WLS and clear fibres) and are converted to photoelectrons using the (you guessed it) wavelength-dependent photocathode quantum efficiency.

Simple: (Easy to understand, pretty fast)
- Blue photons are created along the particle track, and are bounced around until they are absorbed on the walls or in the scintillator or until they hit the green fibre.  The attenuation length and reflectivity are assumed to be single numbers.
- Blue photons can reflect off the fibre. If not, they are assumed to be absorbed at a random (volume-weighted) radius.
- Green photons are emitted isotropically. Photons are refracted or reflected off the double cladding.
- Green photons are transmitted to the PMT photocathode. Absoption in the green and clear fibres is computed using a double-exponential. Conversion in the PMT is assumed to be a simple probability

Fast: (recommended for production work)
- Green photons are created near the particle track using a PDF of blue photon absoption positions and times.
- Green photons are created isotropically and homogeneously in the WLS fibre cross-section.
- Green photons are transmitted to the PMT photocathode. Absoption in the green and clear fibres is computed using a double-exponential. Conversion in the PMT is assumed to be a simple probability

DetSim

DetSim simulates the PMTs, the electronics, and the DAQ for both the near and far detectors.
Specifically:

PMTs:
General features:
- Hooks for different PMT models
- Can track effects in time bucket-by-bucket
- Gain calibration applied from database
- Tracks from PE to charge on anodes

M16 Model: Provided by Mike Korodosky.
- Whole-PMT dynode simulation
- 1-pe shape
- Data-verified crosstalk, electrical and optical
-Simple dynode simulation

M64 Model: From Oxford
- pixel-by-pixel simulation
- 1-pe shape
- Crosstalk from test stand data, electrical and optical
- Simple dynode simulation
- Full pulse shaping

Electronics:
- Both VA and QIE. Both models are generic models, with all channels identical.
- Hooks for different electronics models

VA:
- fC->ADC
- Dynode trigger thresholds as real detector
- Sparsification
- Noise
- VARC pre-trigger, 2/6 of 2/36

QIE:
- QIE time bucket simulation!
- Converts charge to QIE range/ADC
- Calculation simulates a look-up table: range/ADC -> DAC counts
- Noise, digital pedestal, analog pedestal
- Sparsification
- Assumes spill mode
- Correctly deals with muliplexed bases

DAQ:
- Digit bursts found by gap finding or by sliding window
- Dynamically pluggable triggers for easy expansion.
- Plane trigger, energy trigger, and multiplicity triggers all avaliable
- Multiple snarls produced, each with correctly-filled TriggerSrc word and trigger time.

Output:
- Snarl output: VA and QIE data words fully implimented with parity bits, error bits, etc.
- Truth output: DigiSignals
- Allows for back-tracking RawDigits to DigiSignals
- DigiSignals -> DigiPe -> DigiScintHits


Failings / Inherent Limitations / To Do:

ALL:
- Needs validation.

PHOTON TRANSPORT:
- No single-pe "noise" from WLS fibres.
- No MIP calibration applied
- No Mapper de-calibration is available.

PMTs:
- No nonlinearity
- No dark noise
- No drift point correction
- Electrical crosstalk does not record the guilty party.

Electronics:
Assumes M16<->VA and M64<->QIE, no exceptions!

VA: 
- no dead time
- no channel nonuniformity.
- no dynode noise
- no nonlinearity (Do we need it?)
- VARC pre-trigger has no timing
- no pedestal

QIE:
- no dynode trigger mode! (Assumes spill mode!)
    -> No dead time. No dynode triggering.
- no channel nonuniformity
- no true lookup table
- no analog nonlinearity
 
DAQ:
- DAQ simulation is complete and stress-tested, but not validated.
- Multiple snarls output from a single physics event is not well handled by the reconstruction.

Output:
- Does not yet convert SimFlag from kMC to kReroot
- Does not add truth info to data stream yet


Installation and Preparation

DetSim used to need a lot of this. Now it should all work "out of the can".  DetSim, Digitization, and PhotonTransport should all be built by default by SRT.

Plex and UgliGeometry no longer need any hacks to use the Near Detector.

Running The Simulation

The macro file PhotonTransport/macros/mc.C shows how to run the whole MC framework. all configurable parameters are shown, along with their default values.  (Most of this can simply be cut out; the file is intended to document the availble options).

This file has a lot of options, but to make the MC work, you really only need to include a few modules in your path:

"RerootToTruth::Get "
"ScintHitToDigiPE::Get "
"DigiPEtoRawDataModule::Get "

(The now-depricated macro file DetSim/macros/detsim.C shows all the configurable options for DetSim alone, all set to their default values. This file illustrates how to run ONLY DetSim, using the PE values from GMINOS instead of those computed by PhotonTransport.)

If you wish to use real gains, you will need to load the gain tables. This is optional: the gain tables in the default database will be used, but at the time of this writing those tables are not filled with meaningful values. (i.e. all gains are set to exactly 60 ADC counts).  If you want to use the gain tables, you must incuclude either
LoadDetSimFarGainsDB();
or
LoadDetSimNearGainsDB();


Both together will NOT work, as the cascader can only do one temporary database of each type.  To do this, you must ensure that your ENV_TSQL_URL environment variable has a temporary, writable database listed first.

Contributing

The PhotonTransport library allows dynamic plugabble classes. Simply make a subclass of PhotonTransportModule to make a new plugin, and register it with the PhotonTransportMaker with a Proxy.  A good example is PhotonDefaultModule.  For the design of the PhotonTransport, see this early presentation.


The PMT and Electronics models allow for new classes to be plugged in.

To make a new PMT model, you need to make a subclass of SimPmt.  For a simple example, see SimPmtM16, which is a rather stupid M16 model (not the full UT model).  At the start of the file, you need to register the class with the SimPmtMaker, the dynamic pluggable factory, with:
     SimPmtMakerProxy<MyClass> gSimPmtProxy_MyClass("MyClass");

Similarly, there is a SimElecMaker which can generate the electronics classes.

Similarly again, there is a SimDaqTrigMaker which generates the trigger classes. For an example of how to make or tune a new trigger, see SimDaqPlaneTrigger.cxx for a simple example, or SimDaqMultTrigger for a slightly more complex example.

For a description of the classes and how the DetSim works, see the presentation for the Sim group in the DetSim/doc directory.


Nathaniel Tagg        n.tagg1@physics.ox.ac.uk