Tags:
create new tag
view all tags

Analysis of the 'Ntuples'

This page describes the setup and some tools for analyzing the 'ntuples'.

Quick and dirty plots directly from the ntuple

setenv LD_LIBRARY_PATH /swshare/glite/d-cache/dcap/lib/:${LD_LIBRARY_PATH}
root
gSystem->Load("..../lib/slc4_ia32_gcc345/libAna00.so");
TFile f("Bu2JpsiKp.root")
T1->Draw("fCandidates.fMass", "abs(fCandidates.fType)==521443")
T1->Draw("fCandidates.fMass", "abs(fCandidates.fType)==521&&fCandidates.fVertex.fChi2<2")
Please note that you should find the proper relative path (replace .... with something appropriate above)

Setup

Login to t3ui02
kinit user@CERN.CH
cmsrel CMSSW_3_5_6 
cd  CMSSW_3_5_6/src 
cmsenv
setenv LD_LIBRARY_PATH /swshare/glite/d-cache/dcap/lib/:${LD_LIBRARY_PATH}
cvs co HeavyFlavorAnalysis/Bs2MuMu 
cvs co AnalysisDataFormats/HeavyFlavorObjects 
cd AnalysisDataFormats/HeavyFlavorObjects/ 
make 
cd ../../HeavyFlavorAnalysis/Bs2MuMu/macros/ 
make 
bin/runTreeReaders -r bmmReader -c chains/100407.mc -C cuts/bmmReader.default.cuts   (for MinBias MC)
bin/runTreeReaders -r bmmReader -c chains/100407.data -C cuts/bmmReader.default.cuts (for prompt reco data)

You can redirect the output rootfile with -D ~/somewhere/.

If you are using a bash, you'll need to translate the 'setenv LD_LIBRART_PATH ...' command appropriately.

runTreeReaders.cc is a wrapper executable that instantiates tree classes to be run and provides some command line parsing and other setup utilities.

The class bmmReader is just an example for an analysis class. It inherits from treeReader01 (some of the stuff which needs virtually no editing is in treeReader01.icc).

treeReader01::goodRun() returns true if the run is in a list of good runs as defined in the runregistry. Lumisections are not yet included.

When you produce a class (presumably derived from treeReader01 or even from bmmReader), and if it is needed for the final analysis (validation, normalization, whatever), please add it to runTreeReaders.cc.

Running in batch

When your chains are very large, it is much better to split them into chunks and run in parallel over all chunks in batch
cd chains/batch1
run -c ../../tree.csh  -t ../../../../../grid-100427.tar.gz  
-m batch -x 'bin/runTreeReaders -n 900 -r muCharmReader -C cuts/muCharm.default.cuts' 
-r 'STORAGE1 srm://t3se01.psi.ch:8443/srm/managerv2\?SFN=/pnfs/psi.ch/cms/trivcat/store/user/ursl/root/trees/batch1' chain*

Note: The output filename is determined by the chain name. If you want to submit batches with different cut files, you have two options:

  • store the output into different SE locations
  • name the chain files according to the different cut scenarios

Other useful stuff for splitting chains and then combining the results:

  • you can split the chains with
     split -d -l 10 100414.v05.data b100414.v05.data- 
  • you can combine the split output files with
     $ROOTSYS/bin/hadd combined.root  \
     dcap://t3se01.psi.ch:22125/pnfs/psi.ch/cms/trivcat/store/user/starodumov/d0/b100414.v05.data-00.root \
     dcap://t3se01.psi.ch:22125/pnfs/psi.ch/cms/trivcat/store/user/starodumov/d0/b100414.v05.data-01.root \

Skimming the large ntuples

If you want to 'skim' the very large ntuples (e.g. because you are looking at candidates that only appear in a small fraction of all events), have a look at HeavyFlavorAnalysis/Bs2MuMu/macros/copyReader.cc. It will copy the ENTIRE event, given the selection in eventProcessing(). Please modify that according to your needs.

-- UrsLangenegger - 2010-06-30

Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2010-06-30 - UrsLangenegger
 
This site is powered by the TWiki collaboration platform Powered by Perl This site is powered by the TWiki collaboration platformCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback