ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/PFJet.h
Revision: 1.6
Committed: Sun Feb 21 23:42:00 2010 UTC (15 years, 2 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_025c_branch2, Mit_025c_branch1, Mit_025c_branch0, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1
Branch point for: Mit_025c_branch
Changes since 1.5: +15 -2 lines
Log Message:
Add TrackJet

File Contents

# User Rev Content
1 bendavid 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.6 // $Id: PFJet.h,v 1.5 2009/09/09 03:38:26 bendavid Exp $
3 bendavid 1.1 //
4     // PFJet
5     //
6 loizides 1.3 // This class holds information about reconstructed jet based on pf candidates.
7 bendavid 1.1 //
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 loizides 1.3 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
25 bendavid 1.1 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 loizides 1.3 fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
30 bendavid 1.1 fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
31    
32 bendavid 1.6 void AddPFCand(const PFCandidate *p) { fPFCands.Add(p); ClearCharge();}
33 loizides 1.3 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 bendavid 1.5 Jet *MakeCopy() const { return new PFJet(*this); }
39 loizides 1.3 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 loizides 1.4 UInt_t NPFCands() const { return fPFCands.Entries(); }
44 loizides 1.3 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 bendavid 1.1
56     protected:
57 bendavid 1.6 Double_t GetCharge() const;
58 bendavid 1.1
59 loizides 1.3 Double32_t fChargedHadronEnergy; //[0,0,14]charged hadron energy
60     Double32_t fNeutralHadronEnergy; //[0,0,14]neutral hadron energy
61     Double32_t fChargedEmEnergy; //[0,0,14]charged em energy
62     Double32_t fNeutralEmEnergy; //[0,0,14]neutral em energy
63     Double32_t fMuonEnergy; //[0,0,14]muon energy
64     UInt_t fChargedMultiplicity; //number of charged constituents
65     UInt_t fNeutralMultiplicity; //number of neutral constituents
66     UInt_t fMuonMultiplicity; //number of muon constituents
67 bendavid 1.1 RefArray<PFCandidate> fPFCands; //pf candidates in the jet
68    
69     ClassDef(PFJet, 1) // PFJet class
70     };
71     }
72 bendavid 1.6
73     //--------------------------------------------------------------------------------------------------
74     inline Double_t mithep::PFJet::GetCharge() const
75     {
76     // Return sum of charge of constituent PFCandidates.
77    
78     Double_t charge = 0;
79     for (UInt_t i=0; i<NPFCands(); ++i)
80     charge += PFCand(i)->Charge();
81    
82     return charge;
83     }
84 bendavid 1.1 #endif