EwpaAnalysis

EWAnalysis

This is a how to an earlier version of the Umass Ntuple Analysis Framework (UMAnalysis). It is still functional, and so may be of interest. For the newest version, see UmassNtupleAnalysis.

EWAnalysis is an Ntuple analysis framework framework. It can run over the ntuples produced by the EveryWhere Physics Analysis framework (EWPA), or over the Oxford Analysis Ntuple. However, it is designed to be easily adaptable to other ntuple formats. The next two sections will be a howto, describing how to start using the package, and then a more thorough description of the analysis package and its features.

How To Download and Use the Framework

The package can be downloaded from anywhere you have access to SVN, probably hal or lxplus. The SVN Group Area ($SVNGRP) is set when you setup athena, so you must do this first. If you are not at lxplus, you will also need to kinit. For more information on setting up cmt and you work area, see the WorkBook.

source ~/cmthome/setup.sh -tag=15.5.1
svn co $SVNGRP/Institutes/UMass/EWAnalysis/trunk EWAnalysis
cd EWAnalysis/run
cp ~ameade/public/EWPA.D3PD.root .
root -n -b -q loadAnalysis.C

When you check out the package, the last argument is the name of the directory you create. The loadAnalysis.C macro compiles and executes all classes necessary for the analysis, and by default runs 10 events on the included sample file, writing output histograms to testoutput.root. To checkout a specific version of the framework, and run on your own file, do:

svn co $SVNGRP/Institutes/UMass/EWAnalysis/tag/EWAnalysis-XX-YY-ZZ EWAnalysis
cd EWAnalysis/run
root -n -b -q 'loadAnalysis.C("/path/to/my/file/EWPA.D3PD.root","outputName.root", eventsToProcess)'

The option -n tell root not to load the log on script, this is necessary, because some log on scripts interfere with the framework.

Structure of the Analysis Package

The following are the files you will want to look at and alter, in order of importance:

  • myAnalysis.cxx: This is where the final analysis is done on internal particle classes (muons,jets,etc), which are accessed through m_data, for example m_data->preMuons gives you a pointer to the vector of muons before selection.

  • myConfig.cxx: Here is where the configuration of the analysis is done. So you can change for example the minimum p_T of muons you will select, or what jet algorithms to consider.

  • dataManager.cxx: This class stores the particle vectors in the struct particleData. It fills the internal particle classes from the branch information, and selects a subset of these particles that you actually want to use in your analysis (for example m_data->selMuons), based on a number of cuts on momentum, angular distribution and quality criteria (for example isolation).

  • particle.cxx: These classes define particles (muon, egamma, jet, etc). Each contains a momentum TLorenzVector and some amount of specific info such as vertex info and quality info. Each cxx file defines the ranges for all the cuts on that particle (though which cuts are actually used are defined in dataManager::selectParticles() ). Each particle has a method selectParticle() which returns a particleSelection object.

  • particleSelection.h: These classes define an integer in which each bit corresponds to a cut. There is an enumeration for each cut. So when selectParticle() is called, the particleSelection object contains which cuts the particle passes. This object also contains a number of methods to manipulate and evaluate these cuts, most important being passesCuts(bits), where bits is an integer specifying which cuts you want the particle to pass. If the particle passes all the cuts, it returns true. Examples are in dataManager::selectParticles(). Note that in the bitword, 0 specifies a bit that IS passed.

Advanced Features and Utilities

The above functionality should remain constant, however, new features and utilities are expected to be added as time goes on

  • HistoMgr: This class allows you to avoid having to declare, initialize, and fill histograms in different files. Instead, you just call its "fill" function, and it does the declaration/initialization for you. Because of its implementation (as a singleton) it can be used across any number of files, and is already setup in myAnalysis, dataManager, and WZanalyMod, using the following:
       HistoMgr * m_histoMgr = HistoMgr::Instance();
       //...
       m_histoMgr->fillHisto(histoName, histoTitle, nBins, xLow, xHigh, fillValue, weight);
       

  • analysisModules: These are classes to contain blocks of self-contained analysis code, that can be then included and called from myAnalysis. They only take particleData (m_data) as input. This allows us to save our own code to the EWAnalysis package without changing myAnalysis, and also allows us to easily turn-on/turn-off blocks of analysis code. Right now only the following exist: myModule.cxx, a dummy analyisis, and WZacceptMod.cxx, a module I wrote to look at systematics for W/Z studies.

  • CutflowMgr: This class keeps track of particle and event cuts you make in your analysis, and then prints a summary of the efficiencies of each of these cuts. It is configured automatically for particle selection cuts. For event level cuts, it is called using the following:
       m_cutMgr->applyCut("objectBeingCut","nameOfCut",passesCut);
       //... more cuts ...
       m_cutMgr->cutsDoneFor("objectBeingCut");
       
    This last command lets the tool know the event/particle/other-object is done being cut. After the analysis is over, myAnalysis calls m_cutMgr->printCuts(). A sample of the output is attached here: cutflowOutput.txt. The sequential efficiency is out of events passing the cuts up till that point, the raw efficiency is out of all events, and the exclusive efficiency is out of events where all other cuts are passed.

EWPA Ntuples to Use

Right now there are some old EWPA ntuples on hal, but these are not consistent with the head version of EWAnalysis, rather they are consistent with EWAnalysis-00-00-04. This is due to changes in the egamma framework. This framework can also process OxfordAnalysisNtuples, some of which I have been storing at:

lxatlasumass2:/data/atlas/data/oxNtuple

To use these, use oxLoadAnalysis.C, but otherwise the software used is the same...

Making your own EWPA Ntuples

This framework should ideally be used with EWPA ntuples made from AODs reconstructed with 15.2.0 or higher, because of changes to egamma.

makeD3PD_SMWZ.py was used to make these EWPA ntuples, and it was done with EWPA-00-03-48. EWPA is included in each athena release, but it is safest to download the framework when making ntuples, in order to know what you are getting. See here for information on downloading a particular release of EWPA. In addition, it was made with the following changes to jets, in order to make more jet algorithms available (and truth jets):

        #==========================================================
        # Jet(s) to be read
        #==========================================================
        insertJet("JetInserter",
                  { "JetCone4H1TW" : "Cone4H1TowerJets" ,
                    "JetCone4H1TP" : "Cone4H1TopoJets",
                    "JetAntiKt4H1TP" : "AntiKt4H1TopoJets",
                    "JetAntiKt4Truth": "AntiKt4TruthJets",
                    "JetAntiKt4H1TW" : "AntiKt4H1TowerAODJets"},
                  PtCut=1.0*GeV, EtaCut=5.0, doThin=False)

Please contact me if you need help getting some ntuples made/working! I plan to keep working on this analysis framework.

-- AndrewMeade - 18-Jan-2010

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2010-02-25 - AndrewMeade
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback