"Trg/TrgMonitor" Package
 
Purpose

Package to monitor the basic properties of primary vertices.

It can monitor both Level-1 Trigger (L1) 2D and High Level Trigger (HLT) 3D vertices:

Contents of the package
 
"TrgVertexMonit" algorithm: TrgVertexMonit.h / TrgVertexMonit.cpp
Package's versions
Version Release date Comments
v2r0 09 / 06 / 2004 - to analyse DC'04 data
- improvements in the handling of the statistics calculations
v1r0 19 / 03 / 2004 - first release
 
Options

The "TrgVertexMonit" algorithm has several user-defined options (here set to their default values):

   TrgVertexMonit.Vertices3D      = true;    : boolean flag to choose 2D (L1) or 3D (HLT) vertices
   TrgVertexMonit.HistogramFlag   = true;    : boolean flag to produce histograms
   TrgVertexMonit.Histogram2DFlag = false;   : boolean flag to produce the big 2D histogram
   TrgVertexMonit.NtupleFlag      = false;   : boolean flag to produce an ntuple
   TrgVertexMonit.NtupleName      = "";      : string for the ntuple name
                                               (reminder: has to be a number if using HBOOK persistency!)
   TrgVertexMonit.OutputLevel     = 3;       : integer specifying the level of printout
                                               (according to Gaudi's definitions)
Here is an example for debugging purposes:
   //---------------------------------------------------
   // Options of "TrgVertexMonit" for debugging purposes
   //---------------------------------------------------
   TrgVertexMonit.Vertices3D      = true;     // true -> 3D (HLT) vertices , false -> 2D (L1) vertices

   TrgVertexMonit.HistogramFlag   = true;
   TrgVertexMonit.Histogram2DFlag = true;
   TrgVertexMonit.NtupleFlag      = true;
   TrgVertexMonit.NtupleName      = "1"

   TrgVertexMonit.OutputLevel     = 2;        // printout in DEBUG level

A copy of TrgMonitor.opts is available for the latest version, version v1r0.

How to get and build the algorithm

Direct link to the CVS repository.

First check out the package:
   cd ~/newmycmt
   getpack Trg/TrgMonitor v2r0
This will get version v2r0 ... To build the package
   cd ~/newmycmt/Trg/TrgMonitor/v2r0/cmt
   cmt config
   source setup.(c)sh 
   gmake
How to run the algorithm

Several lines of code are needed to run the package:

In the requirements file:
   use    TrgMonitor  v2r0   Trg
In the options file:

The simplest way might be to include in the DaVinci options file a "TrgMonitor.opts" options file containing all the necessary settings - that can be changed according to the needs. The following line is then enough:

   #include "$DAVINCIROOT/options/TrgMonitor.opts"
after inserting "TrgMonitor.opts" in the DaVinci options directory. In any case the mandatory smallest set of options is
   ApplicationMgr.DLLs    += { "TrgMonitor" };
   ApplicationMgr.TopAlg  += { "TrgVertexMonit" };
which will monitor as default the 3D HLT primary vertices.

To produce histograms make sure that the options file contains similar code to

   //--------------------------------------------------------------
   // Cards for the histogram persistency
   // Hbook or Root are available, uncomment the one you want to use
   //--------------------------------------------------------------
   #include "$STDOPTS/Hbook.opts"
   HistogramPersistencySvc.OutputFile = "TrgMonitor_histos.hbook";
   //#include "$STDOPTS/RootHist.opts"
   //HistogramPersistencySvc.OutputFile = "TrgMonitor_histos.root";
To produce ntuples make sure that the options file contains similar code to
   //--------------------------------------------------------------
   // Ntuples available by default. Comment to switch off
   // Hbook or Root are available, uncomment the one you want to use
   //--------------------------------------------------------------
   ApplicationMgr.ExtSvc += { "NTupleSvc" };
   NTupleSvc.Output={"FILE1 DATAFILE='TrgMonitor_ntuples.hbook' TYP='HBOOK' OPT='NEW'"};
   //NTupleSvc.Output={"FILE1 DATAFILE='TrgMonitor_ntuples.root' TYP='ROOT' OPT='NEW'"};
Description of the output

There are 3 types of output:

  1. A "TrgVertexMonit summary" with all rates is printed out at the end of the job. An example output is:
       HltVertexMonit         INFO ========== 3D Primary Vertices Summary ==========
       HltVertexMonit         INFO   Total # of events            :          10
       HltVertexMonit         INFO   Total # of primary vertices  :           7
       HltVertexMonit         INFO -------------------------------------------------
       HltVertexMonit         INFO                           Mean    |    RMS  
       HltVertexMonit         INFO -------------------------------------------------
       HltVertexMonit         INFO   # vertices         :      0.70        0.78
       HltVertexMonit         INFO   x_vtx (mm)         :   -0.0068      0.0327
       HltVertexMonit         INFO   y_vtx (mm)         :   -0.0271      0.0485
       HltVertexMonit         INFO   z_vtx (mm)         :  -45.1905     53.6671
       HltVertexMonit         INFO   chi2_vtx           :    0.3170      0.1333
       HltVertexMonit         INFO   # tracks / vertex  :     32.71       17.22
       HltVertexMonit         INFO =================================================
    

    This summary table contains all the quantities listed in the "purpose" paragraph. (Note that the algorithm name is here "HltVertexMonit" simply because this is the instantiation name.)

  2. By default the "TrgVertexMonit" algorithm produces histograms of the most relevant L0 information. All histograms are booked in directory "Trg/TrgVertexMonit2D/" or "Trg/TrgVertexMonit3D/" depending on the user's configuration. For the latest version v2r0 the list of histograms is:
    
       LIST OF HISTOGRAMS
    
       "Vertex x"          : x-position of primary vertex
       "Vertex y"          : y-position of primary vertex
       "Vertex z"          : z-position of primary vertex
       "Vertex χ2"         : χ2 of the primary vertex fit
       "Vertex Nr Tracks"  : number of tracks per primary vertex
       "Nr Vertices"       : number of primary vertices
       "Chi2 Vs Nr Tracks" : χ2 of the primary vertex fit
                             versus the number of tracks per primary vertex
    
  3. The "TrgVertexMonit" algorithm can also produce an ntuple if configured accordingly. The ntuple is then booked in location "/NTUPLES/FILE1/Trg/TrgVertexMonit2D/<NtupleName>" or "/NTUPLES/FILE1/Trg/TrgVertexMonit3D/<NtupleName>". For the latest version v2r0 the ntuple definition is as follows:
    
       LIST OF NTUPLE ENTRIES
    
       Run     : run number
       Evt     : event number
       nVtx    : number of primary vertices
       xVtx    : x-position of the primary vertex (vector of size 'nVtx')
       yVtx    : y-position of the primary vertex (vector of size 'nVtx')
       zVtx    : z-position of the primary vertex (vector of size 'nVtx')
       chi2Vtx : χ2 of the primary vertex fit (vector of size 'nVtx')
       nTrks   : number of tracks per primary vertex (vector of size 'nVtx')
    
    
    The ntuple variables use the units:
    - positions in mm
Testing the algorithm