CMS 3D CMS Logo

HistoParticle.h

Go to the documentation of this file.
00001 #ifndef StarterKit_HistoParticle_h
00002 #define StarterKit_HistoParticle_h
00003 
00004 //------------------------------------------------------------
00005 // Title: HistoParticle.h
00006 // Purpose: To histogram Particles
00007 //
00008 // Authors:
00009 // Liz Sexton-Kennedy <sexton@fnal.gov>
00010 // Eric Vaandering <ewv@fnal.gov >
00011 // Petar Maksimovic <petar@jhu.edu>
00012 // Sal Rappoccio <rappocc@fnal.gov>
00013 //------------------------------------------------------------
00014 //
00015 // Interface:
00016 //
00017 //   HistoParticle ( TFile * file );
00018 //   Description: Constructor.
00019 //
00020 //   void fill( TK::Particle * );
00021 //   Description: Fill object. Will fill relevant jet variables
00022 //
00023 //   void write();
00024 //   Description: Write object to file in question.
00025 //
00026 //   ~HistoParticle
00027 //    Description: Destructor. Deallocates memory.
00028 //
00029 //------------------------------------------------------------
00030 //
00031 // Modification History:
00032 //
00033 //   -29Nov07: Sal Rappoccio: Creation of the object
00034 //------------------------------------------------------------
00035 
00036 
00037 // CMSSW include files
00038 #include "DataFormats/PatCandidates/interface/Particle.h"
00039 #include "PhysicsTools/StarterKit/interface/HistoGroup.h"
00040 
00041 // STL include files
00042 #include <string>
00043 
00044 // ROOT include files
00045 #include <TH1D.h>
00046 #include <TFile.h>
00047 
00048 namespace pat {
00049 
00050   class HistoParticle : public HistoGroup<Particle> {
00051 
00052   public:
00053     HistoParticle( std::string subDir );
00054     virtual ~HistoParticle();
00055 
00056     void fill( const Particle * part, double weight = 1.0 );
00057     void fill( const Particle & part, double weight = 1.0 ) { return fill(&part, weight); }
00058 
00059 
00060     // Clear ntuple cache
00061     void clearVec();
00062   };
00063 
00064 }
00065 #endif

Generated on Tue Jun 9 17:41:51 2009 for CMSSW by  doxygen 1.5.4