Atlfast::FillHistograms Class Reference

Runs on each set of selectors to make histograms from selected GenParticles. More...

#include <FinalStateParticleHistogramMaker.h>

Collaboration diagram for Atlfast::FillHistograms:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 FillHistograms (TesIO *tesIOPtr, MsgStream &log, map< string, vector< IHistogram1D * > > &histContainer)
void operator() (pair< string, HepMC_helper::MCselectorWrapper * > &pairPtr)

Private Member Functions

void Fill (MCparticleCollection &, string &)

Private Attributes

TesIOm_tesIO
MsgStream & m_log
map< string, vector< IHistogram1D * > > & m_histogramContainer

Detailed Description

Runs on each set of selectors to make histograms from selected GenParticles.

This is a unary function class

Definition at line 73 of file FinalStateParticleHistogramMaker.h.


Constructor & Destructor Documentation

Atlfast::FillHistograms::FillHistograms ( TesIO tesIOPtr,
MsgStream &  log,
map< string, vector< IHistogram1D * > > &  histContainer 
) [inline]

Definition at line 76 of file FinalStateParticleHistogramMaker.h.

00078                                                                        :
00079       m_tesIO(tesIOPtr), 
00080       m_log(log), 
00081       m_histogramContainer(histContainer){}
    void operator()(pair< string, HepMC_helper::MCselectorWrapper*> &pairPtr);


Member Function Documentation

void Atlfast::FillHistograms::operator() ( pair< string, HepMC_helper::MCselectorWrapper * > &  pairPtr  ) 

Definition at line 37 of file FinalStateParticleHistogramMaker.cxx.

00037                                                                                        {
00038 
00039     // Called once per MCselectorWrapper, to make plots corresponding
00040     // to one particular set of selectors
00041     
00042     string identifier = pairPtr.first;
00043     HepMC_helper::MCselectorWrapper* wrapperPtr = pairPtr.second;
00044 
00045     MCparticleCollection mcParticles;
00046     const HepMC_helper::IMCselector* imcSelector = 
00047       wrapperPtr->asIMCselector();
00048     TesIoStat stat = m_tesIO->getMC( mcParticles, imcSelector) ;
00049     if (!stat){
00050       // Problem getting the GenParticles
00051       m_log << MSG::DEBUG << "Problem in getMC using " << identifier << " selectors" << endreq;
00052     }
00053     
00054     m_log << MSG::DEBUG << mcParticles.size() << " GenParticles selected with " 
00055           << identifier << " selectors" << endreq;
00056 
00057     Fill(mcParticles,identifier);
00058 
00059   }

void Atlfast::FillHistograms::Fill ( MCparticleCollection ,
string &   
) [private]

Definition at line 61 of file FinalStateParticleHistogramMaker.cxx.

00061                                                                                 {
00062     
00063     // Fill histograms
00064     
00065     // Histograms have a prescribed order from 
00066     // FinalStateParticleHistogramMaker::BookHistograms
00067     
00068     // Histogram 0 - Multiplicity
00069     m_histogramContainer[identifier].at(0)->fill(float(mcParticles.size()),1.0);
00070     
00071     float sumE = 0., sumPx = 0., sumPy = 0., sumPz = 0.;
00072     
00073     MCparticleCollection::const_iterator genItr = mcParticles.begin();
00074     for (;genItr!=mcParticles.end();++genItr){
00075 
00076       // Histograms 1-4 - GenParticle energy, px, py and pz
00077       m_histogramContainer[identifier].at(1)->fill((*genItr)->momentum().e(),1.0);
00078       m_histogramContainer[identifier].at(2)->fill((*genItr)->momentum().px(),1.0);
00079       m_histogramContainer[identifier].at(3)->fill((*genItr)->momentum().py(),1.0);
00080       m_histogramContainer[identifier].at(4)->fill((*genItr)->momentum().pz(),1.0);
00081 
00082       // Add to sums
00083       sumE += (*genItr)->momentum().e();
00084       sumPx += (*genItr)->momentum().px();
00085       sumPy += (*genItr)->momentum().py();
00086       sumPz += (*genItr)->momentum().pz();
00087 
00088     }
00089     
00090     // Histograms 5-8 - E, px, py and pz sums of all selected GenParticles
00091     m_histogramContainer[identifier].at(5)->fill(sumE,1.0);
00092     m_histogramContainer[identifier].at(6)->fill(sumPx,1.0);
00093     m_histogramContainer[identifier].at(7)->fill(sumPy,1.0);
00094     m_histogramContainer[identifier].at(8)->fill(sumPz,1.0);
00095     
00096     return;
00097 
00098   }


Member Data Documentation

TesIO* Atlfast::FillHistograms::m_tesIO [private]

Definition at line 88 of file FinalStateParticleHistogramMaker.h.

MsgStream& Atlfast::FillHistograms::m_log [private]

Definition at line 89 of file FinalStateParticleHistogramMaker.h.

map< string, vector<IHistogram1D*> >& Atlfast::FillHistograms::m_histogramContainer [private]

Definition at line 90 of file FinalStateParticleHistogramMaker.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:39 2007 for AtlfastAlgs by  doxygen 1.5.1