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. Package names are cal_nada and cal_nada_analyze. Sophie Trincaz-Duvoid added some modifications and 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 the reco_analyze root-tuple.
Since NADA is now running in killing mode in D0reco, hot cells found by NADA  are suppressed from calorimeter  cells information used to determine jets and missing Et.
However, the killed cells are stored in the CalNadaChunk and can be restored by the user.

NADA has been updated !

If you just want a description of the NADA block (updated in march 2002) it's here.

A description of the CAL block (updated in march 2002) is here.

If you want to find the old NADA homepage click here.

If you just want to use NADA in root-tuple, click here.

If you want to run NADA in the D0 framework click here.
 

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>

* Inreco_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. A description of the block can be found here.

The second (JETS_C) is for the jets (c means cone). For each jet, you
have its energy (E_c), its electro-magnetic 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. A description of the block can
be found here.


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

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

If your root-tuple has another name than RecoAnalyze.root, you have to
change this name in two places in newnada.h.

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

page 2 :  Calorimeter cells parameters (in killing mode, energy of a hot cell is put at 1 MeV)
page 3 : Hot cells parameters for set 1 (default one)
page 4 :  Parameters of negative energy hot cells
page 5 :  Parameters of positive energy hot cells
page 6 :  Missing Et calculated with energy of calormimeter cells for different cuts on cells energy.
page 7 :  Missing Et calculated with energy of calormimeter cells including hot cells for different cuts on cells energy.
page 8 :  Scalar Et calculated with energy of calormimeter cells for different cuts on cells energy.
page 9 :  Scalar Et calculated with energy of calormimeter cells including hot cells for different cuts on cells energy.
page 10 :  Missing Et in x coordinate for different cuts on cells energy.
page 11 :  Missing Et in y coordinate for different cuts on cells energy.
page 12 :  Sqrt(Missing Et) divided by Scalar Et for different cuts on cells energy.
page 13 :  top : coordinates in phi/eta plane of jets
                    bottom : coordinates in Pt/eta plane of same jets
page 14 :  top : Pt of all jets
                   bottom : Pt of leading objects for each event

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

Be careful : With newnada.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 newnada.h without forgetting to replace mynewclass
by
newnada everywhere in the program.
 

                                                           Gregorio Bernardi, Bob Olivier  and Sophie Trincaz-Duvoid