How to run MC_exam


Updated :April 2003  Major cleaning and added chapter H in complement of Chapter G for MC testing
This file can be found on /dist/packages/mc_exam/devel/doc/mc_exam.html
This is a description on how to run the histogram/Ntuple/Root-tuple maker.
 In case of problems/suggestions contact: Laurent Duflot and Armand Zylberstejn and Sarah Eno

  For users wanting to use mc_exam to certify the MC production go directly to chapter H-
  See also: tutorial_may_03.pdf

A-Introduction
B-Description of the packages
C-Building a working directory and getting the files
D-Important warning using mc_exam
E-Running the executable
F-Description of rcp files
G-Using the code: a few examples
H-More examples: how to run the code to test MC production
I-Liste of macros to run the jobs and analyze the root-tuples
J-Use the macros to run the jobs and analyze the root-tuples
K-Brief instructions to run and analyze a sim type file (written by Sarah- July 2003)
 

A-Introduction


    MC_exam , an histogram, ntuple or root-tuple maker was written  before most analyse packages were written. It was first designed to analyse and/or reconstruct data coming from D0gstar.
     Informations about HITS, DIGI and clusters for most subdetectors:SMT, CFT, CAL (DIGI only), CPS, FPS and MUON as well as informations on the generated particles were written in the histograms or Ntuple/Rootuple.
    Later on, blocks corresponding to reconstructed quantities (clusters in all the detectors, tracks) were added. In addition, the MCexam_x executable was compiled with em_analyze, jet_analyze, MuoIdAnalyze, VertexAnalysis_data allowing to get in the same Ntuples the blocks defined in these  packages.
    Since the d0reco package has somewhat stabilized since the early times when MC_exam was written,  the reco part of MC_exam is deprecated, although still doable.
    As of release t01.22.00 the old package MC_exam has been split in 3 different packages: Sim_exam, Reco_exam and MC_exam. Later on, the part for generated particles was put in a separate package: gene_exam.
     Since January 2003 (release p13.04.00) MC_exam as well as Sim_Exam and Reco_exam are not part of the releases and the devel versions have to be used.

B-Description of the packages


  What can be done in each of the package is driven by its own  two rcp files: framework.rcp and XX_exam.rcp
  In each package the quantities entering in the plots may be re-built using the appropriate keys in framework.rcp

Plots/Ntuple for quantities defined at the simulation  (MC ) and/or digi level (MC and data) for all detectors. Some relevant quantities can be rebuilt

    Hits : x,y,z,px,py,pz,dE/dx 
    Digits : channel address, ADC
    Generated particles and vertices (plot in package gene_exam)
    Hits cannot be rebuilt
    Digits can be rebuilt after dropping the relevant chunks before being plotted
    No reconstructed quantities (clusters, objects) can be plotted or rebuilt
Plots/Ntuple for quantities defined at the reconstruction level
    Clusters
    Jets (using jet_analyze)
    Tracks
    Generated particles and vertices
    EM- object (using em_analyze)
    Hits or digi cannot be rebuilt nor plotted;
   Clusters, jets, em objects can be rebuilt after dropping the relevant chunks prior to be plotted.
 
a combination of the above:
            Hits
            Digits
            Generated particles and vertices
            Clusters
            Jets (obsolete, replaced by call to jet_analyze)
            Tracks
Hits cannot be rebuilt;
Digits can be rebuilt after dropping the relevant chunks before being plotted;
clusters, jets, em objects can be rebuilt after dropping the relevant chunks prior to be plotted

 C-Building a working directory and getting the files


What a package does is controlled by the list of packages given in its own framework.rcp. The list of packages called is described below and may be modified by the user at execution time
Reco_exam and MC_exam are linked with d0reco and included are the Ntuples made by some analysis packages: em_analyze, jet_analyze, MuoIdAnalyze, VertexAnalysis_data
As these packages rely on most of the offline packages to compile and run smoothly, it sometimes happens (as for d0reco) that the xx_exam version on a given release is broken. Please have a look at the mc_exam news page for indications on which versions of xx_exam work with which release and for new features of the packages

Setting up a working directory (assuming one does not exist already)

D-Important warning using mc_exam:


      MC_exam.rcp is there for compatibility with the framework. The control parameters for the package are actually Sim_exam.rcp and Reco_exam.rcp. We highly recommend, if  you want to have the control of  what exactly goes on the Ntuple, to change in ../rcp/framework.rcp RCP sim_exam  = <sim_exam Sim_exam>  to      RCP sim_exam  = <mc_exam Sim_exam>
RCP reco_exam  = <reco_exam Reco_exam> RCP reco_exam  = <mc_exam Reco_exam>

E-Running the executable

F-Description of rcp files

 Default values for the control keys are shown. All the numbers at the right of the "=" sign can be (and in most cases must be) set by the user.

Sim_exam.rcp

Reco_exam.rcp

framework.rcp:

The main keys are:

G-Using the code: a few examples

 Easier to use procedures have been developped: see next chapter H. Here we give more general exemples.

Sim_exam:

  to plot geant hits, generated particles
 

Reco_exam:

to plot rconstructed quantities (clusters) and some physics objects
Although reco_exam has all the functionalities of d0reco (drop and rebuld digi chunks, drop and reconstruct physics objects,...), and some from d0reco_analyze we refer the reader to the proper doc for this part.
  Plot reconstructed quantities :
Re-do the tracking

MC_exam

H-More examples: how to run the code to test MC production

 In this chapter we give some recipes to run mc_exam to check MC production and analyze the root_tuples that are produced.
The following scripts in mc_exam/macros are used. They are copied in each of the xxx_exam/bin directory copied in each of the xxx_exam/bin directory
 These scripts use the following templates:
From now on let's assume you are in mcexm

I-Liste of macros

   to run the jobs and analyze the root-tuples macros are found in:
  running the root_tuples makers
  analysis of the root_tuple

J-Use the macros to run the jobs and analyze the root-tuples

K-Brief instructions to run and analyze a sim type file

When using macros to analyze root-tuples produced by mc-exam (or satellites) there is a makefile which requests the gcc compiler when on a linux machine. On clued0 the automated procedure works for release p15 and above but does not work for p14. The correction has to be made by hand.