ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/PFJet.h
Revision: 1.7
Committed: Wed Mar 28 12:15:34 2012 UTC (13 years, 1 month ago) by paus
Content type: text/plain
Branch: MAIN
Changes since 1.6: +14 -1 lines
Log Message:
Enable skimming.

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: PFJet.h,v 1.6 2010/02/21 23:42:00 bendavid Exp $
3 //
4 // PFJet
5 //
6 // This class holds information about reconstructed jet based on pf candidates.
7 //
8 // Authors: J.Bendavid
9 //--------------------------------------------------------------------------------------------------
10
11 #ifndef MITANA_DATATREE_PFJET_H
12 #define MITANA_DATATREE_PFJET_H
13
14 #include "MitAna/DataTree/interface/Jet.h"
15 #include "MitAna/DataCont/interface/RefArray.h"
16 #include "MitAna/DataTree/interface/PFCandidate.h"
17
18 namespace mithep
19 {
20 class PFJet : public Jet
21 {
22 public:
23 PFJet() : fChargedHadronEnergy(0), fNeutralHadronEnergy(0), fChargedEmEnergy(0),
24 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
25 fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
26 PFJet(Double_t px, Double_t py, Double_t pz, Double_t e) :
27 Jet(px,py,pz,e),
28 fChargedHadronEnergy(0), fNeutralHadronEnergy(0), fChargedEmEnergy(0),
29 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
30 fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
31
32 void AddPFCand(const PFCandidate *p) { fPFCands.Add(p); ClearCharge();}
33 Double_t ChargedEmEnergy() const { return fChargedEmEnergy; }
34 Double_t ChargedHadronEnergy() const { return fChargedHadronEnergy; }
35 Double_t MuonEnergy() const { return fMuonEnergy; }
36 UInt_t ChargedMultiplicity() const { return fChargedMultiplicity; }
37 Bool_t HasPFCand(const PFCandidate *p) const { return fPFCands.HasObject(p); }
38 Jet *MakeCopy() const { return new PFJet(*this); }
39 UInt_t NConstituents() const { return NPFCands(); }
40 Double_t NeutralEmEnergy() const { return fNeutralEmEnergy; }
41 Double_t NeutralHadronEnergy() const { return fNeutralHadronEnergy; }
42 UInt_t NeutralMultiplicity() const { return fNeutralMultiplicity; }
43 UInt_t NPFCands() const { return fPFCands.Entries(); }
44 UInt_t MuonMultiplicity() const { return fMuonMultiplicity; }
45 EObjType ObjType() const { return kPFJet; }
46 const PFCandidate *PFCand(UInt_t i) const { return fPFCands.At(i); }
47 void SetChargedEmEnergy(Double_t e) { fChargedEmEnergy = e; }
48 void SetChargedHadronEnergy(Double_t e) { fChargedHadronEnergy = e; }
49 void SetChargedMuEnergy(Double_t e) { fMuonEnergy = e; }
50 void SetChargedMultiplicity(UInt_t n) { fChargedMultiplicity = n; }
51 void SetMuonMultiplicity(UInt_t n) { fMuonMultiplicity = n; }
52 void SetNeutralEmEnergy(Double_t e) { fNeutralEmEnergy = e; }
53 void SetNeutralHadronEnergy(Double_t e) { fNeutralHadronEnergy = e; }
54 void SetNeutralMultiplicity(UInt_t n) { fNeutralMultiplicity = n; }
55
56 // Some structural tools
57 void Mark() const;
58
59 protected:
60 Double_t GetCharge() const;
61
62 Double32_t fChargedHadronEnergy; //[0,0,14]charged hadron energy
63 Double32_t fNeutralHadronEnergy; //[0,0,14]neutral hadron energy
64 Double32_t fChargedEmEnergy; //[0,0,14]charged em energy
65 Double32_t fNeutralEmEnergy; //[0,0,14]neutral em energy
66 Double32_t fMuonEnergy; //[0,0,14]muon energy
67 UInt_t fChargedMultiplicity; //number of charged constituents
68 UInt_t fNeutralMultiplicity; //number of neutral constituents
69 UInt_t fMuonMultiplicity; //number of muon constituents
70 RefArray<PFCandidate> fPFCands; //pf candidates in the jet
71
72 ClassDef(PFJet, 1) // PFJet class
73 };
74 }
75
76 //--------------------------------------------------------------------------------------------------
77 inline void mithep::PFJet::Mark() const
78 {
79 // mark myself
80 mithep::DataObject::Mark();
81 // mark my dependencies if they are there
82 for (UInt_t i=0; i<fPFCands.Entries(); i++)
83 fPFCands.At(i)->Mark();
84 }
85
86 //--------------------------------------------------------------------------------------------------
87 inline Double_t mithep::PFJet::GetCharge() const
88 {
89 // Return sum of charge of constituent PFCandidates.
90
91 Double_t charge = 0;
92 for (UInt_t i=0; i<NPFCands(); ++i)
93 charge += PFCand(i)->Charge();
94
95 return charge;
96 }
97 #endif