FMS Run11 Trigger Simulator

This is to document the status of Run11 FMS trigger simulator and instructions on how to use the addtional functionalities for QA purpose.

Most of the work was done by Saroj. A short summary of his work can be found here and here. Since then, some bugs in the code

has been fixed (mostly related to QT crate mapping and North/South definitions) and some other functions were introduced to produce

trigger QA plots and interface with simulation. The code to run trigger simulator is attached at the bottom and there are also some

macros to illustrate how to run it.

 

Here I summarize the essential part of the simulator.

TrigQt.h/TrigQt.cxx is the class that performs the actual simulating procedure, it takes a concrete Qt object during initialization in order

to access the ADC of each channel. The three member functions L0dsm2011, L1dsm2011 and L2dsm2011 are meant to be called sequentially

to simulate the logic of Layer0/1/2 DSM boards. The final result is L2_TrigBits2011 which is the 12 bit output of L2 DSM FP201.

 

One thing to notice is that currently there is a switch in TrigQt -- "sim", to choose if the simulator is working with data or simulation. If "sim" is

set to"false", the simulator would read the input of each layer of DSM directly from trigger data file( e.g. QT daughter card sum, Board sum, etc).

If "sim" is set to "true", the simulator would calculate the input of each DSM board from QT read out since there is no DSM data in simulation.

 

Also a new dsm decoding function in the Qt class need to be implemented. It's called Qt::decodeDSM_R11. It interprets the FMS related DSM branch

in the trigger data file.

 

SimTrigger.h/SimTrigger.cxx is the utility class to provide interface between real and/or simulated data to the trigger simulator, and produce

related QA plots. The function SimulateTriggerOnData works with real data, it takes as its argument the trigger file name and number of events

to process. Then it will compare the input of each layer of DSM board as directly read out from data with that calculated from previous layer of DSM,

or the QT in case of Layer-0. The macro SimTrigger_myR11.C shows how to run the simulator with real data.

The other function SimulateTriggerOnSim is to be called with the reconstruction routine where a QT object has been instantiated. The macro

SimReconCluster_Trigger.C is a simplified version of the reconstruction procedure just to illustrate how the simulator works with simulated data

from GSTAR.

 

Both of these two funtions will generate a .root file which has all the QA histogram stored. The macro PlotTrigQA.C will read the .root file generated

by SimTrigger::SimulateTriggerOnData and print all the histogram to a .ps file. The histograms are almost the same as those in Pibero's L0 Trigger

monitoring page (in FMS related sections of course). The other macro PlotSimTrigQA.C will read the .root file generated by SimTrigger::SimulateTriggerOnSim

and produce the same plots except those which are comparing DSM input with simulated DSM input.

 

The file TrigQA_run12096005.1.pdf is an example of the trigger QA plots generated by SimTrigger_myR11.C and PlotTrigQA.C. It can be compared with

DSM_run12096005.1.ps which is generated by Pibero's L0 code on the same data. There are some disagreement, most notably on cluster bits as input

to layer-2 dsm, where I have less discrepancy between DSM read out and simulated. And the result of comparing L2 DSM outputs with simulation also shows

some minor differences between our codes.

 

SimTrigQA_run12000001.pdf is the plot produced by SimReconCluster_Trigger.C and  PlotSimTrigQA.C, it shows the input of each layer of DSM from simulated 

data as well as the final trigger bits. Since there is no DSM data in simulations. All the simulated DSM inputs are calculated from ADCs on the QT channels, and there

is no comparison between the simulated inputs and the real DSM inputs.

 

Finally, Qt, TrigQt and SimTrigger should be added to FpdRoot directory and compiled with the rest of the FMS code for the simulator to work. 

 

For a working version of PSU code with trigger simulator, please look at /star/u/yuxip/fmssim/FpdRoot/Trig2011/

 

p.s. drupal always gives me a corrupted file when I try to upload the source and macros. I've put them in my protected area. Here are the links

source files

macros