CMS 3D CMS Logo

HistoTrack.h

Go to the documentation of this file.
00001 #ifndef StarterKit_HistoTrack_h
00002 #define StarterKit_HistoTrack_h
00003 
00004 //------------------------------------------------------------
00005 // Title: HistoTrack.h
00006 // Purpose: To histogram Tracks
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 //   HistoTrack ( TFile * file );
00018 //   Description: Constructor.
00019 //
00020 //   void fill( TK::Track * );
00021 //   Description: Fill object. Will fill relevant track variables
00022 //
00023 //   void write();
00024 //   Description: Write object to file in question.
00025 //
00026 //   ~HistoTrack
00027 //    Description: Destructor. Deallocates memory.
00028 //
00029 //------------------------------------------------------------
00030 //
00031 // Modification History:
00032 //
00033 //   -29Nov07: Sal Rappoccio: Creation of the object
00034 //------------------------------------------------------------
00035 
00036 // This package's include files
00037 #include "PhysicsTools/StarterKit/interface/HistoGroup.h"
00038 
00039 // CMSSW include files
00040 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
00041 
00042 
00043 // STL include files
00044 #include <string>
00045 #include <vector>
00046 
00047 // ROOT include files
00048 #include <TH1D.h>
00049 
00050 namespace pat {
00051 
00052   class HistoTrack : public HistoGroup<reco::RecoChargedCandidate> {
00053 
00054   public:
00055     HistoTrack(std::string dir = "track", std::string groupName = "Track", std::string groupLabel = "track",
00056                double pt1=0, double pt2=200, double m1=0, double m2=200,
00057                TFileDirectory * parentDir=0 );
00058     virtual ~HistoTrack() { } ;
00059 
00060 
00061     // fill a plain ol' track:
00062     virtual void fill( const reco::RecoChargedCandidate *track, uint iPart = 1, double weight = 1.0 );
00063     virtual void fill( const reco::RecoChargedCandidate &track, uint iPart = 1, double weight = 1.0 ) { fill(&track, iPart, weight); }
00064 
00065     // fill a track that is a shallow clone, and take kinematics from 
00066     // shallow clone but detector plots from the track itself
00067     virtual void fill( const reco::ShallowClonePtrCandidate *track, uint iPart = 1, double weight = 1.0 );
00068     virtual void fill( const reco::ShallowClonePtrCandidate &track, uint iPart = 1, double weight = 1.0 )
00069     { fill(&track, iPart, weight); }
00070 
00071     virtual void fillCollection( const std::vector<reco::RecoChargedCandidate> & coll, double weight = 1.0 );
00072 
00073     // Clear ntuple cache
00074     void clearVec();
00075 
00076   protected:
00077     PhysVarHisto * h_dxy_  ;    
00078     PhysVarHisto * h_dz_   ;    
00079     PhysVarHisto * h_nValid_;   
00080     PhysVarHisto * h_nLost_;    
00081   };
00082 }
00083 #endif

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