Histograms - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Histograms

Description:

... TDS and saved at end of job. Athena Tutorial: Introductory Level ... Add plotting of pT (needless to say after double pT assignment) m_hist_pT- fill(pT, 1.0) ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 18
Provided by: markus59
Category:
Tags: histograms | job | quitting | say | to | what | when

less

Transcript and Presenter's Notes

Title: Histograms


1
Histograms
2
Objectives
  • After completing this lesson, you should be able
    to
  • Book and fill histograms.

3
Histograms
  • One of they key tools in HEP
  • Wheel not being reinvented
  • Usage and function closely matching HBOOK
  • book fill
  • Kept in TDS in their own areas
  • /stat
  • managed by HistogramSvc
  • Persistency
  • HBOOK
  • ROOT

4
Histograms - Good To Know...
  • Histograms are kept in special TDS area
  • unlike the event, it is not cleared with each new
    event
  • same access mechanism as other objects in TDS
  • If not saved - they are lost
  • histograms are kept in memory
  • must be registered with the TDS and saved at end
    of job

5
Booking 1-d Histograms
  • Through the Histogram service
  • IHistogram1D multiplicityH1D
  • histoSvc()-gtbook("/stat/myhist/,1,
  • "Visible chargedMultiplicty",
  • 100,
  • 0,
  • 1000.0)

6
Booking 2-d Histograms
  • Through the Histogram service
  • IHistogram2D multiplicityVsEnergyH2D
  • histoSvc()-gtbook(/stat/myhist/,2,
  • "MultiplictyvsEnergy(GeV)",
  • 100,
  • 0.0,
  • 1000.0,
  • 50,
  • 0.0,
  • 500.0)

7
Filling Histograms
Calls similar to HBOOK HF1 HF2
8
Generic Histogram Access
  • Its just another data store object
  • const DataHandleltIHistogram1Dgt h1d
  • m_sgSvc?retrieve(h1d , /stat/my1Dhist/3)
  • h1d-gtfill( value, weight)
  • Or book on the fly
  • IHistogram1D h1d histoSvc()-gtbook(
  • /stat/my1Dhist,
  • lthistgt,
  • Title,
  • ltbinsgt,
  • ltlowegdegt,
  • lthighedgegt)

9
Histogram Persistency
  • In jobOptions file
  • Load the relevant shared library
  • ApplicationMgr.DLLs HbookCnv/
    RootHistCnv
  • Specify persistency (accordingly to shared lib)
  • ApplicationMgr.HistogramPersistency
  • HBOOK / ROOT / NONE (default)
  • Specify name of output file, e.g.,
  • HistogramPeristencyService.OutputFile
    atlfast.hbook / atlfast.rt

Already done in your jobOptions.txt
10
Hands On Histograms
  • In AnalysisSkeleton.h
  • Add forward declaration
  • class IHistogram1D
  • class IHistogram2D
  • Add start number for histograms ID
  • int m_histStart
  • Declare histograms
  • IHistogram1D m_hist_pT
  • IHistogram1D m_hist_isolation
  • IHistogram2D m_hist_cellFlow
  • IHistogram2D m_hist_clusterFlow

11
Hands On Histograms
  • in AnalysisSkeleton.cxx
  • Include header files
  • include "GaudiKernel/IHistogramSvc.h"
  • include "GaudiKernel/IHistogram1D.h
  • include "GaudiKernel/IHistogram2D.h"
  • Declare histogram ID start number
  • declareProperty(HistStart, m_histStart)
  • In the jobOptions, specify it
  • e.g.
  • AnalysisSkeleton.HistStart 1000

12
Hands On Histograms
  • In initialize( )
  • Book histograms
  • m_hist_pT histoSvc()-gtbook(/stat/athena/",
  • m_histStart, pT, 40, 0.0, 500.0)
  • m_hist_isolation histoSvc()-gtbook(/stat/athena/
    ", m_histStart, Isolation eT, 40, 0.0,
    100.0)
  • m_hist_clusterFlow histoSvc()-gtbook(/stat/athen
    a/", m_histStart, Cluster E flow",40, -3.0,
    3.0,
  • 40, -3.14159, 3.14159)
  • m_hist_cellFlow histoSvc()-gtbook(/stat/athena/"
    , m_histStart, Cell E flow",40, -3.0, 3.0,
  • 40, -3.14159, 3.14159)

13
Hands On Histograms
  • In particle iteration of dumpParticles( ), fill
    pT hist
  • Add plotting of pT (needless to say after double
    pT assignment)
  • m_hist_pT-gtfill(pT, 1.0)
  • Add new private member functions
  • Include collection typedefs (in
    AnalysisSkeleton.h)
  • include AtlfastCode/CellCollection.h
  • include AtlfastCode/ClusterCollection.h
  • void plotIsolation(MsgStream,
  • ReconstructedParticleCollection,
  • CellCollection)
  • void plotEnergyFlow(MsgStream,
  • ClusterCollection,
  • CellCollection)

We might had instead const DataHandleltReconstruct
edParticleCollectiongt or const
DataHandleltObjectVectorltReconstructedParticlegt gt
14
Hands On Histograms
  • In execute( ), after the call to dumpParticles( )
  • Plot isolation from Cells
  • if (particles-gtsize( ) cells-gtsize( ))
    plotIsolation(log, particles, cells)
  • Plot E-flow for Clusters Cells in a single
    event
  • if (clusters-gtsize( ) cells-gtsize( ))
    plotEnergyFlow(log, clusters, cells)

15
Hands On Histograms
  • In plotIsolation( ), calculate energy in a cone
    around each particle, and plot it. We will use
    Atlfast machinery provided by the IKinematic
    interface.
  • Inside an iteration on particles
  • double esum m_kinehelp.sumETInCone(
  • cells-gtbegin(),
  • cells-gtend(),
  • theParticle,
  • m_rCellIsolation)
  • Subtract the eT of the particle itself
  • esum - (theParticle)-gteT()
  • and fill histogram
  • m_hist_isolation-gtfill(esum, 1.0)

16
Hands On Histograms
  • In plotEnergyFlow( ), for one event only.
  • (dumb way to select count events, set here to
    3rd)
  • static int nevent nevent
  • if (3 ! nevent) return
  • log ltlt MSGINFO ltlt Energy flow for event ltlt
    nevent ltlt endreq
  • //Plot Cell energy flow
  • CellCollectioniterator cell
  • for(cell cells-gtbegin( ) cell lt cells-gtend( )
    cell)
  • m_hist_cellFlow-gtfill( (cell)-gteta( ),
  • (cell)-gtphi( ),
  • (cell)-gteT( ) )
  • //Plot Cluster energy flow
  • ClusterCollectioniterator cluster
  • for(cluster clusters-gtbegin( )cluster lt
    clusters-gtend( ) cluster)
  • m_hist_clusterFlow-gtfill( (cluster)-gteta( ),
  • (cluster)-gtphi( ),
  • (cluster)-gteT( ) )

17
Hands On Histograms
  • Compile, link and run athena
  • See histograms with PAW
  • paw

PAWgt hi/file 1 atlfast.hbook PAWgt cd athena PAWgt
hi/list PAWgt hi/pl 1000 PAWgt hi/pl 1001 PAWgt
hi/pl 1002 PAWgt hi/pl 1003 PAWgt quit
Write a Comment
User Comments (0)
About PowerShow.com