CMS 3D CMS Logo

pat::HistoMET Class Reference

#include <PhysicsTools/StarterKit/interface/HistoMET.h>

Inheritance diagram for pat::HistoMET:

pat::HistoGroup< PHYS_OBJECT >

List of all members.

Public Member Functions

void clearVec ()
 clearVec: resets PhysVarHisto ntuple cache
virtual void fill (const reco::ShallowClonePtrCandidate &met, uint iPart=1, double weight=1.0)
virtual void fill (const reco::ShallowClonePtrCandidate *met, uint iPart=1, double weight=1.0)
 Fill all histograms for one Physics Object.
virtual void fill (const MET &met, uint iPart=1, double weight=1.0)
virtual void fill (const MET *met, uint iPart=1, double weight=1.0)
virtual void fillCollection (const std::vector< MET > &coll, double weight=1.0)
 HistoMET (std::string dir="met", std::string group="MET", std::string pre="met", double pt1=0, double pt2=200, double m1=0, double m2=200, TFileDirectory *parentDir=0)
virtual ~HistoMET ()

Protected Attributes

PhysVarHistoh_eLongitudinal_
PhysVarHistoh_emEtFraction_
PhysVarHistoh_emEtInEB_
PhysVarHistoh_emEtInEE_
PhysVarHistoh_emEtInHF_
PhysVarHistoh_etFractionHadronic_
PhysVarHistoh_hadEtInHB_
PhysVarHistoh_hadEtInHE_
PhysVarHistoh_hadEtInHF_
PhysVarHistoh_hadEtInHO_
PhysVarHistoh_maxEtInEmTowers_
PhysVarHistoh_maxEtInHadTowers_
PhysVarHistoh_mEtSig_
PhysVarHistoh_sumEt_
PhysVarHistohCaloEz_
PhysVarHistohCaloHadEtInEB_
PhysVarHistohCaloHadEtInEE_
PhysVarHistohCaloMET_
PhysVarHistohCaloMETPhi_
PhysVarHistohCaloMEx_
PhysVarHistohCaloMEy_
PhysVarHistohNevents_
PhysVarHistojetME_


Detailed Description

Definition at line 50 of file HistoMET.h.


Constructor & Destructor Documentation

HistoMET::HistoMET ( std::string  dir = "met",
std::string  group = "MET",
std::string  pre = "met",
double  pt1 = 0,
double  pt2 = 200,
double  m1 = 0,
double  m2 = 200,
TFileDirectory parentDir = 0 
)

Definition at line 14 of file HistoMET.cc.

References pat::HistoGroup< PHYS_OBJECT >::addHisto(), pat::HistoGroup< PHYS_OBJECT >::currDir_, h_eLongitudinal_, h_emEtFraction_, h_emEtInEB_, h_emEtInEE_, h_emEtInHF_, h_etFractionHadronic_, h_hadEtInHB_, h_hadEtInHE_, h_hadEtInHF_, h_hadEtInHO_, h_maxEtInEmTowers_, h_maxEtInHadTowers_, h_mEtSig_, h_sumEt_, hCaloEz_, hCaloMET_, hCaloMETPhi_, hCaloMEx_, hCaloMEy_, and jetME_.

00017   : HistoGroup<MET>( dir, group, pre, pt1, pt2, m1, m2, parentDir)
00018 {
00019 
00020 
00021 
00022   // book relevant MET histograms 
00023   addHisto( h_sumEt_              =
00024             new PhysVarHisto( pre + "SumEt",              "MET sumEt",               20, 0, 1000, currDir_, "", "vD")  );
00025   addHisto( h_mEtSig_             =
00026             new PhysVarHisto( pre + "MEtSig",             "MET mEtSig",              20, 0, 20, currDir_, "", "vD")  );
00027   addHisto( h_eLongitudinal_      =
00028             new PhysVarHisto( pre + "ELongitudinal",      "MET eLongitudinal",       20, 0, 20, currDir_, "", "vD")  );
00029   addHisto( h_maxEtInEmTowers_    =
00030             new PhysVarHisto( pre + "MaxEtInEmTowers",    "MET maxEtInEmTowers",     20, 0, 20, currDir_, "", "vD")  );
00031   addHisto( h_maxEtInHadTowers_   =
00032             new PhysVarHisto( pre + "MaxEtInHadTowers",   "MET maxEtInHadTowers",    20, 0, 20, currDir_, "", "vD")  );
00033   addHisto( h_etFractionHadronic_ =
00034             new PhysVarHisto( pre + "EtFractionHadronic", "MET etFractionHadronic",  20, 0, 1,  currDir_, "", "vD")  );
00035   addHisto( h_emEtFraction_       =
00036             new PhysVarHisto( pre + "EmEtFraction",       "MET emEtFraction",        20, 0, 1,  currDir_, "", "vD")  );
00037   addHisto( h_hadEtInHB_          =
00038             new PhysVarHisto( pre + "HadEtInHB",          "MET hadEtInHB",           20, pt1, pt2, currDir_, "", "vD")  );
00039   addHisto( h_hadEtInHO_          =
00040             new PhysVarHisto( pre + "HadEtInHO",          "MET hadEtInHO",           20, pt1, pt2, currDir_, "", "vD")  );
00041   addHisto( h_hadEtInHE_          =
00042             new PhysVarHisto( pre + "HadEtInHE",          "MET hadEtInHE",           20, pt1, pt2, currDir_, "", "vD")  );
00043   addHisto( h_hadEtInHF_          =
00044             new PhysVarHisto( pre + "HadEtInHF",          "MET hadEtInHF",           20, pt1, pt2, currDir_, "", "vD")  );
00045   addHisto( h_emEtInEB_           =
00046             new PhysVarHisto( pre + "EmEtInEB",           "MET emEtInEB",            20, pt1, pt2, currDir_, "", "vD")  );
00047   addHisto( h_emEtInEE_           =
00048             new PhysVarHisto( pre + "EmEtInEE",           "MET emEtInEE",            20, pt1, pt2, currDir_, "", "vD")  );
00049   addHisto( h_emEtInHF_           =
00050             new PhysVarHisto( pre + "EmEtInHF",           "MET emEtInHF",            20, pt1, pt2, currDir_, "", "vD")  );
00051 
00052 
00053   addHisto( jetME_           =
00054             new PhysVarHisto( pre + "caloMETReco", "caloMETReco", 3, 1, 4, currDir_, "", "vD")  );
00055 /*
00056   addHisto( hNevents_           =
00057             new PhysVarHisto( pre + "METTaskNevents","METTask_Nevents",1,0,1, currDir_, "", "vD")  );
00058 */
00059   addHisto( hCaloMEx_           =
00060             new PhysVarHisto( pre + "METTaskCaloMEx","METTask_CaloMEx",2001,-500,501, currDir_, "", "vD")  );
00061   addHisto( hCaloMEy_           =
00062             new PhysVarHisto( pre + "METTaskCaloMEy","METTask_CaloMEy",2001,-500,501, currDir_, "", "vD")  );
00063   addHisto( hCaloEz_           =
00064             new PhysVarHisto( pre + "METTaskCaloEz","METTask_CaloEz",2001,-500,501, currDir_, "", "vD")  );
00065   addHisto( hCaloMET_           =
00066             new PhysVarHisto( pre + "METTaskCaloMET","METTask_CaloMET",2001,0,2001, currDir_, "", "vD")  );
00067   addHisto( hCaloMETPhi_           =
00068             new PhysVarHisto( pre + "METTaskCaloMETPhi","METTask_CaloMETPhi",80,-4,4, currDir_, "", "vD")  );
00069 /*
00070   addHisto( hCaloHadEtInEB_           =
00071             new PhysVarHisto( pre + "METTaskCaloHadEtInEB","METTask_CaloHadEtInEB",4001,0,4001, currDir_, "", "vD")  );
00072   addHisto( hCaloHadEtInEE_           =
00073             new PhysVarHisto( pre + "METTaskCaloHadEtInEE","METTask_CaloHadEtInEE",4001,0,4001, currDir_, "", "vD")  );
00074 */
00075 
00076 }

HistoMET::~HistoMET (  )  [virtual]

Definition at line 78 of file HistoMET.cc.

00079 {
00080   // Root deletes histograms, not us
00081 }


Member Function Documentation

void HistoMET::clearVec (  )  [virtual]

clearVec: resets PhysVarHisto ntuple cache

Reimplemented from pat::HistoGroup< PHYS_OBJECT >.

Definition at line 183 of file HistoMET.cc.

References pat::PhysVarHisto::clearVec(), h_eLongitudinal_, h_emEtFraction_, h_emEtInEB_, h_emEtInEE_, h_emEtInHF_, h_etFractionHadronic_, h_hadEtInHB_, h_hadEtInHE_, h_hadEtInHF_, h_hadEtInHO_, h_maxEtInEmTowers_, h_maxEtInHadTowers_, h_mEtSig_, h_sumEt_, hCaloEz_, hCaloMET_, hCaloMETPhi_, hCaloMEx_, hCaloMEy_, and jetME_.

Referenced by PhysicsHistograms::clearVec().

00184 {
00185   HistoGroup<MET>::clearVec();
00186   h_sumEt_->clearVec();
00187   h_mEtSig_->clearVec();
00188   h_eLongitudinal_->clearVec();
00189 
00190   h_maxEtInEmTowers_->clearVec();
00191   h_maxEtInHadTowers_->clearVec();
00192   h_etFractionHadronic_->clearVec();
00193   h_emEtFraction_->clearVec();
00194   h_hadEtInHB_->clearVec();
00195   h_hadEtInHO_->clearVec();
00196   h_hadEtInHE_->clearVec();
00197   h_hadEtInHF_->clearVec();
00198   h_emEtInEB_->clearVec();
00199   h_emEtInEE_->clearVec();
00200   h_emEtInHF_->clearVec();
00201   jetME_->clearVec();
00202   hCaloMEx_->clearVec();
00203 //  hNevents_->clearVec();
00204   hCaloMEy_->clearVec();
00205   hCaloEz_->clearVec();
00206   hCaloMET_->clearVec();
00207   hCaloMETPhi_->clearVec();
00208 //  hCaloHadEtInEB_->clearVec();
00209 //  hCaloHadEtInEE_->clearVec();
00210 
00211 }

virtual void pat::HistoMET::fill ( const reco::ShallowClonePtrCandidate met,
uint  iPart = 1,
double  weight = 1.0 
) [inline, virtual]

Reimplemented from pat::HistoGroup< PHYS_OBJECT >.

Definition at line 66 of file HistoMET.h.

References fill(), and weight.

00067     { fill(&met, iPart,weight); }

void HistoMET::fill ( const reco::ShallowClonePtrCandidate obj,
uint  imulti = 1,
double  weight = 1.0 
) [virtual]

Fill all histograms for one Physics Object.

Fill the reco::Cand basic histograms: pt, eta, phi.

This is done for shallow clones

Reimplemented from pat::HistoGroup< PHYS_OBJECT >.

Definition at line 120 of file HistoMET.cc.

References GenMuonPlsPt100GeV_cfg::cout, pat::MET::emEtFraction(), pat::MET::emEtInEB(), pat::MET::emEtInEE(), pat::MET::emEtInHF(), lat::endl(), pat::MET::etFractionHadronic(), edm::pset::fill(), pat::PhysVarHisto::fill(), h_eLongitudinal_, h_emEtFraction_, h_emEtInEB_, h_emEtInEE_, h_emEtInHF_, h_etFractionHadronic_, h_hadEtInHB_, h_hadEtInHE_, h_hadEtInHF_, h_hadEtInHO_, h_maxEtInEmTowers_, h_maxEtInHadTowers_, h_mEtSig_, h_sumEt_, pat::MET::hadEtInHB(), pat::MET::hadEtInHE(), pat::MET::hadEtInHF(), pat::MET::hadEtInHO(), hCaloEz_, hCaloMET_, hCaloMETPhi_, hCaloMEx_, hCaloMEy_, jetME_, pat::MET::maxEtInEmTowers(), pat::MET::maxEtInHadTowers(), and CaloMET_cfi::met.

00121 {
00122 
00123   // Get the underlying object that the shallow clone represents
00124   const pat::MET * met = dynamic_cast<const pat::MET*>(pshallow);
00125 
00126   if ( met == 0 ) {
00127     cout << "Error! Was passed a shallow clone that is not at heart a met" << endl;
00128     return;
00129   }
00130 
00131   
00132 
00133   // First fill common 4-vector histograms from shallow clone
00134 
00135   HistoGroup<MET>::fill( pshallow, iPart, weight);
00136 
00137   // fill relevant MET histograms
00138   h_sumEt_              ->fill( met->sumEt()               , iPart , weight );
00139   h_mEtSig_             ->fill( met->mEtSig()              , iPart , weight );
00140   h_eLongitudinal_      ->fill( met->e_longitudinal()      , iPart , weight );
00141   h_maxEtInEmTowers_    ->fill( met->maxEtInEmTowers()     , iPart , weight );     
00142   h_maxEtInHadTowers_   ->fill( met->maxEtInHadTowers()    , iPart , weight );    
00143   h_etFractionHadronic_ ->fill( met->etFractionHadronic () , iPart , weight ); 
00144   h_emEtFraction_       ->fill( met->emEtFraction()        , iPart , weight );        
00145   h_hadEtInHB_          ->fill( met->hadEtInHB()           , iPart , weight );           
00146   h_hadEtInHO_          ->fill( met->hadEtInHO()           , iPart , weight );           
00147   h_hadEtInHE_          ->fill( met->hadEtInHE()           , iPart , weight );           
00148   h_hadEtInHF_          ->fill( met->hadEtInHF()           , iPart , weight );           
00149   h_emEtInEB_           ->fill( met->emEtInEB()            , iPart , weight );            
00150   h_emEtInEE_           ->fill( met->emEtInEE()            , iPart , weight );            
00151   h_emEtInHF_           ->fill( met->emEtInHF()            , iPart , weight );            
00152 
00153 
00154   jetME_          ->fill(  1     , iPart , weight );
00155 //  hNevents_          ->fill( met->      , iPart , weight );
00156   hCaloMEx_          ->fill( met->px()      , iPart , weight );
00157   hCaloMEy_          ->fill( met->py()      , iPart , weight );
00158   hCaloEz_          ->fill(  met->pz()     , iPart , weight );
00159   hCaloMET_          ->fill( met->pt()      , iPart , weight );
00160   hCaloMETPhi_          ->fill(met->phi()       , iPart , weight );
00161 //  hCaloHadEtInEB_          ->fill( met->      , iPart , weight );
00162 //  hCaloHadEtInEE_          ->fill( met->      , iPart , weight );
00163 
00164 
00165 }

virtual void pat::HistoMET::fill ( const MET met,
uint  iPart = 1,
double  weight = 1.0 
) [inline, virtual]

Definition at line 61 of file HistoMET.h.

References fill(), and weight.

00061 { fill(&met, iPart, weight); }

void HistoMET::fill ( const MET met,
uint  iPart = 1,
double  weight = 1.0 
) [virtual]

Definition at line 84 of file HistoMET.cc.

References pat::MET::emEtFraction(), pat::MET::emEtInEB(), pat::MET::emEtInEE(), pat::MET::emEtInHF(), pat::MET::etFractionHadronic(), edm::pset::fill(), pat::PhysVarHisto::fill(), h_eLongitudinal_, h_emEtFraction_, h_emEtInEB_, h_emEtInEE_, h_emEtInHF_, h_etFractionHadronic_, h_hadEtInHB_, h_hadEtInHE_, h_hadEtInHF_, h_hadEtInHO_, h_maxEtInEmTowers_, h_maxEtInHadTowers_, h_mEtSig_, h_sumEt_, pat::MET::hadEtInHB(), pat::MET::hadEtInHE(), pat::MET::hadEtInHF(), pat::MET::hadEtInHO(), hCaloEz_, hCaloMET_, hCaloMETPhi_, hCaloMEx_, hCaloMEy_, jetME_, pat::MET::maxEtInEmTowers(), and pat::MET::maxEtInHadTowers().

Referenced by fill(), and fillCollection().

00085 {
00086 
00087   // First fill common 4-vector histograms
00088   HistoGroup<MET>::fill( met, iPart, weight );
00089 
00090   // fill relevant MET histograms
00091   h_sumEt_              ->fill( met->sumEt()               , iPart , weight );
00092   h_mEtSig_             ->fill( met->mEtSig()              , iPart , weight );
00093   h_eLongitudinal_      ->fill( met->e_longitudinal()      , iPart , weight );
00094   h_maxEtInEmTowers_    ->fill( met->maxEtInEmTowers()     , iPart , weight );     
00095   h_maxEtInHadTowers_   ->fill( met->maxEtInHadTowers()    , iPart , weight );    
00096   h_etFractionHadronic_ ->fill( met->etFractionHadronic () , iPart , weight ); 
00097   h_emEtFraction_       ->fill( met->emEtFraction()        , iPart , weight );        
00098   h_hadEtInHB_          ->fill( met->hadEtInHB()           , iPart , weight );           
00099   h_hadEtInHO_          ->fill( met->hadEtInHO()           , iPart , weight );           
00100   h_hadEtInHE_          ->fill( met->hadEtInHE()           , iPart , weight );           
00101   h_hadEtInHF_          ->fill( met->hadEtInHF()           , iPart , weight );           
00102   h_emEtInEB_           ->fill( met->emEtInEB()            , iPart , weight );            
00103   h_emEtInEE_           ->fill( met->emEtInEE()            , iPart , weight );            
00104   h_emEtInHF_           ->fill( met->emEtInHF()            , iPart , weight );            
00105 
00106   jetME_          ->fill(  1     , iPart , weight );
00107 //  hNevents_          ->fill( met->      , iPart , weight );
00108   hCaloMEx_          ->fill( met->px()      , iPart , weight );
00109   hCaloMEy_          ->fill( met->py()      , iPart , weight );
00110   hCaloEz_          ->fill(  met->pz()     , iPart , weight );
00111   hCaloMET_          ->fill( met->pt()      , iPart , weight );
00112   hCaloMETPhi_          ->fill(met->phi()       , iPart , weight );
00113 //  hCaloHadEtInEB_          ->fill( met->      , iPart , weight );
00114 //  hCaloHadEtInEE_          ->fill( met->      , iPart , weight );
00115 
00116 
00117 }

void HistoMET::fillCollection ( const std::vector< MET > &  coll,
double  weight = 1.0 
) [virtual]

Save the size of the collection.

Fortran-style indexing

&*iobj dereferences to the pointer to a PHYS_OBJ*

Definition at line 168 of file HistoMET.cc.

References fill(), pat::PhysVarHisto::fill(), pat::HistoGroup< PHYS_OBJECT >::h_size_, and i.

Referenced by PhysicsHistograms::fillCollection().

00169 {
00170  
00171   h_size_->fill( coll.size(), 1, weight );     
00172 
00173   std::vector<MET>::const_iterator
00174     iobj = coll.begin(),
00175     iend = coll.end();
00176 
00177   uint i = 1;              
00178   for ( ; iobj != iend; ++iobj, ++i ) {
00179     fill( &*iobj, i, weight);      
00180   } 
00181 }


Member Data Documentation

PhysVarHisto* pat::HistoMET::h_eLongitudinal_ [protected]

Definition at line 78 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_emEtFraction_ [protected]

Definition at line 83 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_emEtInEB_ [protected]

Definition at line 88 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_emEtInEE_ [protected]

Definition at line 89 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_emEtInHF_ [protected]

Definition at line 90 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_etFractionHadronic_ [protected]

Definition at line 82 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_hadEtInHB_ [protected]

Definition at line 84 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_hadEtInHE_ [protected]

Definition at line 86 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_hadEtInHF_ [protected]

Definition at line 87 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_hadEtInHO_ [protected]

Definition at line 85 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_maxEtInEmTowers_ [protected]

Definition at line 80 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_maxEtInHadTowers_ [protected]

Definition at line 81 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_mEtSig_ [protected]

Definition at line 77 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::h_sumEt_ [protected]

Definition at line 76 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hCaloEz_ [protected]

Definition at line 97 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hCaloHadEtInEB_ [protected]

Definition at line 100 of file HistoMET.h.

PhysVarHisto* pat::HistoMET::hCaloHadEtInEE_ [protected]

Definition at line 101 of file HistoMET.h.

PhysVarHisto* pat::HistoMET::hCaloMET_ [protected]

Definition at line 98 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hCaloMETPhi_ [protected]

Definition at line 99 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hCaloMEx_ [protected]

Definition at line 95 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hCaloMEy_ [protected]

Definition at line 96 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().

PhysVarHisto* pat::HistoMET::hNevents_ [protected]

Definition at line 94 of file HistoMET.h.

PhysVarHisto* pat::HistoMET::jetME_ [protected]

Definition at line 92 of file HistoMET.h.

Referenced by clearVec(), fill(), and HistoMET().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:40 2009 for CMSSW by  doxygen 1.5.4