Difference between revisions of "Ttbar analysis skeleton"

From Atlas Wiki
Jump to navigation Jump to search
 
(61 intermediate revisions by the same user not shown)
Line 1: Line 1:
The analysis of the Ntuples for the Rome data was done in ROOT. On this page  
+
The analysis of the Ntuples for the Rome data is done using ROOT. On this page  
 
the Analysis Skeleton is presented and instructions on how to use it.
 
the Analysis Skeleton is presented and instructions on how to use it.
  
== The 3 files that make up the Analysis Skeleton ==
+
= The 3 files that make up the Analysis Skeleton =
  
 
The Analysis of the Root ntuple proceeds in a very straightforward way.  
 
The Analysis of the Root ntuple proceeds in a very straightforward way.  
 
Inside ROOT we used MakeClass() to get the .h and .C files. These were
 
Inside ROOT we used MakeClass() to get the .h and .C files. These were
extended to our needs and together the following three files form the  
+
extended and together with an additional steering file these three  
analysis skeleton:
+
files form the TTbar analysis skeleton:
  
1) [http://www.nikhef.nl/~ivov/Analysis_Skeleton_TTbar/simpleTTbarAnalysis.h simpleTTbarAnalysis.h]
+
1) <b>simpleTTbarAnalysis.h</b>
  
:The standard header file extended with the implementation of a few routines the user is not expected to change often. Also a new class is introduced: TLorentzVectorWIdx, which is a TLorentzVector that has an additional index that points back to it's position in the original list so we can access it's additional characteristics if we wish to do so.
+
:The standard header file extended with the implementation of a few routines the user is not expected to change often. Also a new class is introduced: TLorentzVectorWIdx, which is a TLorentzVector with an additional index that points back to it's position in the original list so we can access it's additional characteristics if we wish to do so.
  
2) [http://www.nikhef.nl/~ivov/Analysis_Skeleton_TTbar/simpleTTbarAnalysis.C simpleTTbarAnalysis.C]
+
2) <b>simpleTTbarAnalysis.C</b>
  
 
:The user analysis-file where the user:
 
:The user analysis-file where the user:
  
 
:: o reads in the event   
 
:: o reads in the event   
:: o fills vectors with 'good' physics objects (leptons, jets, photons etc. passing the user's quality requirements)
+
:: o decides what (b-)jet algorith he wants to use
 +
:: o fills vectors with pseudo-particles (leptons, jets, photons etc.)
 +
:: . Here actually two vectors are filled: one for 'all' and one for 'good' pseudo-particles that pass the user's quality requirements
 
:: o performs the top-analysis. The resulting histograms will be written out in a separate root file
 
:: o performs the top-analysis. The resulting histograms will be written out in a separate root file
  
3) [http://www.nikhef.nl/~ivov/Analysis_Skeleton_TTbar/simpleNtupleTTbarAnalysis.C simpleNtupleTTbarAnalysis.C]
+
3) <b>simpleNtupleTTbarAnalysis.C</b>
  
 
:The small steering-file containing the location of the ntuples and a function that decides:
 
:The small steering-file containing the location of the ntuples and a function that decides:
Line 28: Line 30:
 
:: o name of the output file
 
:: o name of the output file
  
== How to run the Analysis Skeleton in ROOT ==
+
= The code itself & How to run the Analysis Skeleton =
 +
 
 +
The skeleton analysis (compiling and running) can be done completely in ROOT or standalone using a Makefile. The code to follow these two lines is presented below and it is left to the user which path he would like to follow.
 +
 
 +
=== 1) Compile and run Analysis in Root ===
 +
 
 +
The code to do the analysis completely in ROOT can be found in:
 +
[http://www.nikhef.nl/pub/experiments/atlas/public/Rome/Skeleton/SkeletonV6/RootBased/ Analysis Skeleton Code (RootBased, Version 6)]
  
 
The first step is to correctly set the location of your ntuples in the file  
 
The first step is to correctly set the location of your ntuples in the file  
Line 38: Line 47:
 
<font color=blue>
 
<font color=blue>
 
<pre>
 
<pre>
   Root>  .L simpleTTbarAnalysis.C++;
+
   Root>  .L simpleTTbarAnalysis.C++
 
+
   Root>  .x  simpleNtupleTTbarAnalysis.C(1,100,"test")
   Root>  .x  simpleNtupleTTbarAnalysis.C(1,100,"test");
 
 
</pre>
 
</pre>
 
</font>
 
</font>
Line 46: Line 54:
 
When setting the number of events to "-1", all events are processed.
 
When setting the number of events to "-1", all events are processed.
 
If you want to analyze all events in ntuple-set 2 (W+4jets background) and to store the  
 
If you want to analyze all events in ntuple-set 2 (W+4jets background) and to store the  
output histograms in a file called <font color=blue>summary_wjets_full_test.root</font>  
+
output histograms in a file called <font color=blue>summary_wjets_full_allevents.root</font>  
 
simly execute the following line:
 
simly execute the following line:
 
<font color=blue>
 
<font color=blue>
 
<pre>
 
<pre>
   Root>  .x  simpleNtupleTTbarAnalysis.C(2,-1,"test");
+
   Root>  .x  simpleNtupleTTbarAnalysis.C(2,-1,"allevents")
 
</pre>
 
</pre>
 
</font>
 
</font>
  
== Location of the Ntuples ==
+
=== 2) Compile and run Analysis StandAlone ===
  
The Ntuples were produced from the AOD as was explained before: [[wouter_aod_example| "producing the
+
You can of course also compile the code and run the analysis outside root. The code and the additional Makefile (from SACLAY) can
Ntuple from the AOD"]]. We will produce as soon as possible a web-page which will give the top group
+
be found in
access to <font color=red>ALL</font> files related to the Rome data challenge. This will include input
+
[http://www.nikhef.nl/pub/experiments/atlas/public/Rome/Skeleton/SkeletonV6/StandAlone/ Analysis Skeleton Code (StandAlone, Version 6)]
files from the generation step (MCatNLO input-, event-, POOL- and log-files) as well as the files at
 
reconstructionoutput both the CBNT files (thanks to SACLAY for collecting them all off the grid) and
 
the AOD and Wouter- Ntuple files. For the moment we have only the Wouter-Ntuples on disk.
 
  
A short description of the sample necessary for the Rome tt analysis:
+
The first step is to correctly set the location of your ntuples in the file
 +
simpleNtupleTTbarAnalysis.C. Then, to analyse the first 100 events in ntuple-set
 +
1 (full simulation) and to store the output histograms in a file called
 +
<font color=blue>summary_ttbar_full_test.root</font> type on the command line:
  
<font color=blue>T1 (4100):</font> tt events. Fully hadronic events have been rejected.
+
<font color=blue>
 +
<pre>
 +
  your_pc>  gmake;
  
<font color=blue>A7:</font> (W + 4 jets)-events. The dominant background for the tt analysis.
+
  your_pc>  ./simpleTTbarAnalysis 1 100 test
 +
</pre>
 +
</font>
  
{| border="1" cellpadding="2" cellspacing="0"
+
When setting the number of events to "-1", all events are processed.
|-
+
If you want to analyze all events in ntuple-set 2 (W+4jets background) and to store the
| style ="background:#3399ff;" | Sample
+
output histograms in a file called <font color=blue>summary_wjets_full_allevents.root</font>
| style ="background:#3399ff;" | Type
+
simly execute the following line:
| style ="background:#3399ff;" | Location
+
<font color=blue>
| style ="background:#3399ff;" | Statistics
+
<pre>
|-
+
  your_pc>  ./simpleTTbarAnalysis 2 -1 allevents
|rowspan=2 valign="center" align = "center"| T1
+
</pre>
| Wouter-Ntuple (Full)
+
</font>
| loctation1
 
| (xxx)
 
|-
 
| Wouter Ntuple (AtlFast)
 
| location 2
 
| (xxx)
 
|-
 
  
|rowspan=1 valign="center" align = "center"| A7
+
= Structure of the program =
| Wouter Ntuple (Full)
 
| location2
 
| (xxx)
 
|-
 
  
|}
+
The '.C'-file is documented and should speak for itself. Nevertheless it is always nice to get a little bit more information on the logic behind the program:
 +
 +
<font color=blue>USER CONTROL FLAGS)</font>
 +
At the top of the routine the user can provide some of the flags to steer the analysis itself.
  
== Structure of the program ==
+
<b>jetAlgo:</b> By default jets from R=0.4 are used
 +
<b>BjetAlgo:</b> In absence of the R=0.4 btag for the W+jets sample the default btag will be based on R=0.7 jets  b-tag although the user can change that to R=0.4 jets for the T1 sample thanks to the work from Eric.
 +
<b>Print_info:</b> If set to 1, most event information is printed to screen.
  
The '.C'-file is documented and should speak for itself. Nevertheless it is always nice to get a little bit more information on the logic behind the program:
 
 
 
<font color=blue>Step 1)</font>  
 
<font color=blue>Step 1)</font>  
 
Reading the full event information into memory
 
Reading the full event information into memory
  
 
<font color=blue>Step 2)</font>  
 
<font color=blue>Step 2)</font>  
<font color=red>fillAllVectors()</font>: This routine fills for each type of 'pseudo particle' (electrons, muons, photons, jets) a vector of TLorentzvectors-with-index to make the analysis more abstract and easily readable.
+
<font color=red>fillAllVectors()</font>: This routine fills for each type of 'pseudo particle' (electrons, muons, photons, jets) a vector of TLorentzvectorsWIdx (TLorentzVector with additional index) to make the analysis more abstract and easily readable.
There are actually TWO vectors filled, one for 'all' and one for 'good' pseudo-particles. For electrons we have  
+
There are actually TWO vectors filled, one for 'all' and one for 'good' pseudo-particles.  
for example ElectronVec and GoodElectronVec and it is up to the user to decide for each electron if it is good enough to be included in the 'good' electron list.  
+
For electrons for example we have ElectronVec and GoodElectronVec and it is up to the user to decide for each electron if it is good enough to be included in the 'good' electron list.  
  
The routine that decides that is also contained in this file and is called <font color=red>isGoodElec</font>. For muons, photons and jets we have similar routines. In these routines the 'all'-verctors are filled and for muons you can ask for example that it is isolated from all jets thay you have selected.
 
  
Standard quality plots: Finally some standard plots are produced for the various pseudo particles. These are the routines you can use to compute efficiencies or simply check what are the characteristics of the objects you have  
+
<u>Quality/Selection routines for pseudo-particles</u>
selected. For electrons we have <font color=red> electronQA(i_event)</font>, with smiilar routines for other psudo-particles.
+
The routine that decides that is also contained in this file and is called <font color=red>isGoodElec</font>. For muons, photons and jets we have similar routines. In these routines the 'all'-vectors are filled and for muons for example you can require them to be isolated from all jets thay you have selected.
 +
 
 +
<u>Standard Characteristics plots:</u> Finally some standard plots are produced for the various pseudo particles. These are the routines you can use to compute efficiencies or check the characteristics of the objects you have selected. For electrons we have <font color=red> electronQA(i_event)</font>, with smiilar routines for other psudo-particles.
 +
 
 +
If Print_Info is set to 1, information on the MC truth record and the characteristics of ALL jets before selection is print to screen.
  
 
<font color=blue>Step 3)</font>  
 
<font color=blue>Step 3)</font>  
Line 115: Line 122:
  
 
<font color=blue>Step 4)</font>  
 
<font color=blue>Step 4)</font>  
The event selection. At this moment at lease one good lepton, exactly 4 good jets and large missing transverse energy.
+
The event selection. In this example we require: at lease one good lepton, exactly 4 good jets and large missing transverse energy.
 +
 
 +
If Print_Info is set to 1, information on the characteristics of good electrons and muons after selection will be printed to screen.
  
 
<font color=blue>Step 5)</font>
 
<font color=blue>Step 5)</font>
Line 127: Line 136:
  
 
:<font color=blue>c)</font> Decide on the W combination and plot the both 1) W mass in top signal and sideband window ands 2) the top mass in the W signal and side-band region.
 
:<font color=blue>c)</font> Decide on the W combination and plot the both 1) W mass in top signal and sideband window ands 2) the top mass in the W signal and side-band region.
 
  
 
<font color=blue>Step 6)</font>
 
<font color=blue>Step 6)</font>
 
Write all histograms to a file.
 
Write all histograms to a file.
 +
 +
 +
<b><font color="red">Note:</font></b> Make sure you enter events in histograms with it's correct weight since MCatNLO has events with positive and negative weights.
 +
 +
= Location of the Ntuples & AOD content=
 +
 +
The location of the Ntuples for all samples can be found at the:
 +
[[AtlasTopPhysicsSamples | Overview Rome Monte Carlo data samples]]
 +
 +
For information on the content of the AOD (Ntuple) read: [[aod_ntuple | AOD (Ntuple) content]]  (Marcello Barisonzi)
 +
 +
A prescription on how to producing the Ntuple from the AOD: [[producing_Woutuple_from_AOD| producing TopNtuples (v6) from the AOD]].
 +
 +
 +
== Questions or remarks ?==
 +
 +
If you have questions or remarks please let us know.
 +
 +
<b>Wouter Verkerke & Ivo van Vulpen</b>

Latest revision as of 11:20, 31 May 2006

The analysis of the Ntuples for the Rome data is done using ROOT. On this page the Analysis Skeleton is presented and instructions on how to use it.

The 3 files that make up the Analysis Skeleton

The Analysis of the Root ntuple proceeds in a very straightforward way. Inside ROOT we used MakeClass() to get the .h and .C files. These were extended and together with an additional steering file these three files form the TTbar analysis skeleton:

1) simpleTTbarAnalysis.h

The standard header file extended with the implementation of a few routines the user is not expected to change often. Also a new class is introduced: TLorentzVectorWIdx, which is a TLorentzVector with an additional index that points back to it's position in the original list so we can access it's additional characteristics if we wish to do so.

2) simpleTTbarAnalysis.C

The user analysis-file where the user:
o reads in the event
o decides what (b-)jet algorith he wants to use
o fills vectors with pseudo-particles (leptons, jets, photons etc.)
. Here actually two vectors are filled: one for 'all' and one for 'good' pseudo-particles that pass the user's quality requirements
o performs the top-analysis. The resulting histograms will be written out in a separate root file

3) simpleNtupleTTbarAnalysis.C

The small steering-file containing the location of the ntuples and a function that decides:
o what ntuples to process (fast/full/background simulation)
o how many events to process
o name of the output file

The code itself & How to run the Analysis Skeleton

The skeleton analysis (compiling and running) can be done completely in ROOT or standalone using a Makefile. The code to follow these two lines is presented below and it is left to the user which path he would like to follow.

1) Compile and run Analysis in Root

The code to do the analysis completely in ROOT can be found in: Analysis Skeleton Code (RootBased, Version 6)

The first step is to correctly set the location of your ntuples in the file simpleNtupleTTbarAnalysis.C. Then, to analyse the first 100 events in ntuple-set 1 (full simulation) and to store the output histograms in a file called summary_ttbar_full_test.root simply open a root session and type:

  Root>  .L simpleTTbarAnalysis.C++
  Root>  .x  simpleNtupleTTbarAnalysis.C(1,100,"test")

When setting the number of events to "-1", all events are processed. If you want to analyze all events in ntuple-set 2 (W+4jets background) and to store the output histograms in a file called summary_wjets_full_allevents.root simly execute the following line:

  Root>  .x  simpleNtupleTTbarAnalysis.C(2,-1,"allevents")

2) Compile and run Analysis StandAlone

You can of course also compile the code and run the analysis outside root. The code and the additional Makefile (from SACLAY) can be found in Analysis Skeleton Code (StandAlone, Version 6)

The first step is to correctly set the location of your ntuples in the file simpleNtupleTTbarAnalysis.C. Then, to analyse the first 100 events in ntuple-set 1 (full simulation) and to store the output histograms in a file called summary_ttbar_full_test.root type on the command line:

  your_pc>  gmake;

  your_pc>  ./simpleTTbarAnalysis 1 100 test

When setting the number of events to "-1", all events are processed. If you want to analyze all events in ntuple-set 2 (W+4jets background) and to store the output histograms in a file called summary_wjets_full_allevents.root simly execute the following line:

  your_pc>  ./simpleTTbarAnalysis 2 -1 allevents

Structure of the program

The '.C'-file is documented and should speak for itself. Nevertheless it is always nice to get a little bit more information on the logic behind the program:

USER CONTROL FLAGS) At the top of the routine the user can provide some of the flags to steer the analysis itself.

jetAlgo: By default jets from R=0.4 are used BjetAlgo: In absence of the R=0.4 btag for the W+jets sample the default btag will be based on R=0.7 jets b-tag although the user can change that to R=0.4 jets for the T1 sample thanks to the work from Eric. Print_info: If set to 1, most event information is printed to screen.

Step 1) Reading the full event information into memory

Step 2) fillAllVectors(): This routine fills for each type of 'pseudo particle' (electrons, muons, photons, jets) a vector of TLorentzvectorsWIdx (TLorentzVector with additional index) to make the analysis more abstract and easily readable. There are actually TWO vectors filled, one for 'all' and one for 'good' pseudo-particles. For electrons for example we have ElectronVec and GoodElectronVec and it is up to the user to decide for each electron if it is good enough to be included in the 'good' electron list.


Quality/Selection routines for pseudo-particles The routine that decides that is also contained in this file and is called isGoodElec. For muons, photons and jets we have similar routines. In these routines the 'all'-vectors are filled and for muons for example you can require them to be isolated from all jets thay you have selected.

Standard Characteristics plots: Finally some standard plots are produced for the various pseudo particles. These are the routines you can use to compute efficiencies or check the characteristics of the objects you have selected. For electrons we have electronQA(i_event), with smiilar routines for other psudo-particles.

If Print_Info is set to 1, information on the MC truth record and the characteristics of ALL jets before selection is print to screen.

Step 3) Computes the missing transverse energy. Used both in the event selection and estimation of the leptonic top mass candidate.

Step 4) The event selection. In this example we require: at lease one good lepton, exactly 4 good jets and large missing transverse energy.

If Print_Info is set to 1, information on the characteristics of good electrons and muons after selection will be printed to screen.

Step 5) The selected events are treated as ttbar candidates. Here a few plots are produced that were also shown during the Rome meeting. The normalisation of the plots should be done by you of course (some numbers on this later here).

a) Plot the 3-jet mass for all combinations and the define the combination with the highest vector sum Pt as the top candidate. Millions of other algorithms are possible and we will investigate this to see if we can come up with something a bit more sophisticated.
b) For the top-candidate you have defined in a), plot the top mass if you (don't) find a 2-jet mass combination close to the W mass.
c) Decide on the W combination and plot the both 1) W mass in top signal and sideband window ands 2) the top mass in the W signal and side-band region.

Step 6) Write all histograms to a file.


Note: Make sure you enter events in histograms with it's correct weight since MCatNLO has events with positive and negative weights.

Location of the Ntuples & AOD content

The location of the Ntuples for all samples can be found at the: Overview Rome Monte Carlo data samples

For information on the content of the AOD (Ntuple) read: AOD (Ntuple) content (Marcello Barisonzi)

A prescription on how to producing the Ntuple from the AOD: producing TopNtuples (v6) from the AOD.


Questions or remarks ?

If you have questions or remarks please let us know.

Wouter Verkerke & Ivo van Vulpen