User's guide to run NADA

(New Anomalous Deposit Algorithm):

This program  has been designed by  Gregorio Bernardi and Bob Olivier in LPNHE (Paris 6 and 7) group.
Documentation can be found in D0 Note Number 003687 :
"NADA: A New Event by Event Hot Cell Killer".
NADA was coded in a CVS package by Bob Olivier.
Sophie Trincaz Duvoid wrote this documentation as a basic user.

NADA  can be used with reco_analyze and its results  (informations on hot cells found) are put in a big root-tuple.
For the time being, it's in shadow mode (ie hot cells found by NADA  are not directly suppressed from calorimeter  cells information used to determine jets and missing Et).

1 ) Install a release

To do this  this, more help help can be found on the web at :
http://www-d0.fnal.gov/computing/professors_guide/d0cpp/

Here are general commands:

setup n32
setup d0cvs
setup D0RunII rel-version
setup cern

where rel-version is the release version that you want to use.

A list of avalaible releases can be found by typing  on d0mino :

 ls /d0dist/dist/releases

Now, the better is to run with release pxx where xx > = 10.06.00

Then install a release with :

newrel -t  rel-version myrel

This will make a test version based on version rel-version of
the code and place it in directory myrel where myrel
can be any name you want.

Go in directory myrel and type :

d0setwa

2 ) Add some packages :

addpkg cal_nada
addpkg cal_nada_analyze
addpkg reco_analyze

In package reco_analyze,  check that in files LIBDEPS and binSAM/LIBRARIES
(or  bin/LIBRARIES if you run without SAM) cal_nada and cal_nada_analyze are
listed.  If not, add them to the list.

And check also that in  binSAM/OBJECTS (or bin/OBJECTS)
RegCalNadaReco and CalNadaAnalyzeReg are listed.  If not add them to the list
(list of registered packages).

You can know what is the name that must be listed if you look in the directory src of your
package.  For exemple,  in cal_nada/src there is the file called RegCalNadaReco.cpp and in
cal_nada_analyze/src there is the file called CalNadaAnalyzeReg.cpp.

3 ) Compile and link :

gmake lib
gmake reco_analyze.bin

4)  Look at rcp files  :

* In reco_analyze/rcp/runRecoAnalyzeSAM.rcp if you run with SAM
(or reco_analyze/rcp/runReco.Analyze.rcp if you run without SAM)
there  is one line which should look like :

string Packages = "geo sam read ntplmgr nada reco_analyze"

(resp.   string Packages = "geo read ntplmgr nada reco_analyze" if you run without SAM)

You can notice that  nada must be called before reco_analyze and   is defined below in file by :
RCP nada = <cal_nada CalNada>

In this file there are other definitions like
RCP reco_analyze = <reco_analyze RecoAnalyze>
RCP read  = <reco_analyze RecoAReadEvent>
RCP ntplmgr= <reco_analyze RecoANtupleMgr>

* In reco_analyze/rcp/RecoAnalyze.rcp (the  file defining variable reco_analyze just above)
you have a line which must look like :

string Packages = "vtx ch em1 em2 muon jet1 jet2 jet3 jet4 jet5 jet6 jet7 jet8 jet9 jet10 jet11 jet12 jet13 jet14 met tau bcjet nada"

where nada is defined by :

RCP nada = <cal_nada_analyze CalNadaAnalyze>
 

         NB :  vtx is defined as :
                    RCP vtx = <vertex_analyze VertexAnalysis_data>

              but in release p10.06.00 it crashed because "L3Chunk is not found".
              So I addpkged vertex_analyze and in file vertex_analyze/rcp/VertexAnalysis_data.rcp
              I put the variable Block_Event at  false :

             bool   Block_Event = false // Fill event information
 

* The name of the ntuple  and the choice "root/PAW" are decided in file
Reco_analyze/rcp/RecoANtupleMgr.rcp (or in the file given in definition of
ntplmgr in runRecoAnalyze.rcp)

The number of events can be decided in Reco_analyze/rcp/RecoAReadEvent.rcp
(or in the file given in definition of  read in  runRecoAnalyze.rcp)  :

int NumEvents = xx      // Maximum number of events to read (0 = all)

(where xx is your number).

In this file you must also put your choice of running with SAM or not.

- If you run with SAM using a project (http://d0db.fnal.gov/sam_project_editor/ ) you put :

string InputFile = "SAMInput:" //SAM

- If you know the file you want to run on (ie running without SAM), you type :

string InputFile= "/sam/cache27/boo/reco_all_0000124640_054.raw_t01.51.00"

where /sam/cache27/boo/reco_all_0000124640_054.raw_t01.51.00
is the file you want to run on.

5 ) Run NADA :

* If you run with SAM, you have to configure reco_analyze/rcp/sam.bash
  (exemple can be found here) where you put the name of your project on the line :
    export PROJECT=project

      where project is the name of your project.

      Then you can run by typing in the directory reco_analyze/rcp :

      sam.bash

* If you run without SAM, you type :

    rm -f RecoAnalyze.root        \\ remove the old root file existing
    rm -f RecoAnalyze.x               \\ remove old link with the executable
    ln -sf ../../bin/$BFARCH/RecoAnalyze_x RecoAnalyze.x  \\ re-make a link with the executable
    RecoAnalyze.x   -rcp runRecoAnalyze.rcp

6 ) Study a ntuple

As an output of NADA, you have then a file called : RecoAnalyze.root
in directory reco_analyze/rcp

If you open it in root (with command  b=new TBrowser();  and then click in open and find
the file  RecoAnalyze.root) you can see a Tree called Global.
This is a "per event" tuple.
If you click on the tree, you can see all the reco_analyze blocks.

There are 3 blocks related to NADA :
CAL, NADA and JETS_c

The first block (CAL) is for the calorimeter cells. For each cell with at least -100 GeV
of energy,  you have the energy in the cell (e_cal),
transverse momentum (pt_cal) and coordinates of the cell
(detector coordinates in eta, phi and layer number) (ieta_cal,
iphi_cal and ilyr_cal).

The second (JETS_C) is for the jets (c means cone). For each jet, you
have its energy (E_c), its electro-magntic fraction (emE_c), coordinates
in eta and phi and the number of towers in the cone (eta_c, phi_c, nbTwr_c)
and informations on momentum (pt_c, px_c, py_c,pz_c).

The third (NADA)is for the hot cells detected by NADA.
Two sets of parameters have been used to test the algorithm.

Parameters of the selection are :
- the minimal transverse energy of a candidate cell (etmi_can),
- the minimal energy of a cell around a candidate cell (emin_cel)
 emin_cell must help to reject contribution of cells with energy due
 to electronic noise,
- the maximum energy of the cube (0.3*0.3 in eta-phi plane) (emax_cub)
around  a candidate cell. This cube energy is calculated by excluding the
candidate cell and cells with energy less than emin_cel.

Currently, the parameters are :

           etmi_can   emin_cel    emax_cub

set 1      1 GeV      100 MeV     100 MeV

set 2      1 GeV      300 MeV     300 MeV
 

For each set of parameters, there is the energy of the hot cell (e_nad),
its coordinates in eta, phi and layer number (ieta_nad, iphi_nad, ilyr_nad)
(detector coordinates) and the transverse momentum (pt_nad).
The total number of hot cells per event (nnada) is also given.

And for each event, you also have the greatest number of hot cells
(between set 1 and set 2) (nnadamax).

You can exec the root class file Nada_look.C  (Nada_look.h and Nada_look.C can be
found here and there)by typing in root framework :

 .L Nada_look.C
 Nada_look m
 m.Loop();

If your root-tuple has another name than RecoAnalyze.root, you have to
change this name twice in Nada_look.h.

At the end, this will make a ps file called nada_look.ps with the following figures :

page 1 : Number of hot cells for each set
page 2 : Hot cells parameters for set 1
page 3 : Hot cells parameters for set 2
page 4 : top : Missing Et calculated with energy of calormimeter cells (may include hot cells)
                bottom : Missing Et with hot cells suppressed (left : set 1 and right : set 2)
page 5 : top : jets coordinates in phi/eta plane and hot cells set 1 coordinates in this plane (in red)
                          =>  evidence of jets matching hot cells
               bottom : hot cells set 1 coordinates in this plane only (allow to distinguish them on
                               top figure)
page 6 : top : coordinates in phi/eta plane of jets matching hot cells (set 1) and of hot cells (in red).
                          There is matching if sqrt(d_eta² + d_phi²) < 0.2
                 bottom : coordinates in pt/eta plane of these hets matching a hot cell.
page 7 :  top left : Pt of all jets
                 top right : Pt of leading objetcs for each event
                 bottom left : Pt of jets matching a hot cell (see page 6)
                 bottom right : Pt of jets matching a hot cell and with this hot cell suppressed

ROOT detail if you want to get more in your analysis :

Be careful : With Nada_look.h you can read variables from 3 blocks I described.
I you want to look at other variables (for exemple EvtInfo_Nevt) you have to
re-create the .h file.  To do it, you can use MakeClass in ROOT :

TFile f("RecoAnalyze.root");
 TTree *t = (TTree*)f.Get("Global");
 Global->MakeClass("mynewclass");

You will have a  mynewclass.h and a mynewclass.C and what I suggest to do is to
re-name mynewclass.h  into Nada_look.h
Replace mynewclass by Nada_look everywhere in the file  add the line

  Float_t Ledr(Float_t&, Float_t&, Float_t&, Float_t&);

in public declaration of variables.
 
 
 

                                                             Bob Olivier and Sophie Trincaz-Duvoid