ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/PFJet.h
(Generate patch)

Comparing UserCode/MitAna/DataTree/interface/PFJet.h (file contents):
Revision 1.5 by bendavid, Wed Sep 9 03:38:26 2009 UTC vs.
Revision 1.6 by bendavid, Sun Feb 21 23:42:00 2010 UTC

# Line 29 | Line 29 | namespace mithep
29                  fNeutralEmEnergy(0), fMuonEnergy(0), fChargedMultiplicity(0),
30                  fNeutralMultiplicity(0), fMuonMultiplicity(0) {}
31  
32 <      void                  AddPFCand(const PFCandidate *p)       { fPFCands.Add(p);               }
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;            }
# Line 54 | Line 54 | namespace mithep
54        void                  SetNeutralMultiplicity(UInt_t n)      { fNeutralMultiplicity = n;      }
55  
56      protected:
57 +      Double_t              GetCharge()                     const;
58  
59        Double32_t            fChargedHadronEnergy;  //[0,0,14]charged hadron energy
60        Double32_t            fNeutralHadronEnergy;  //[0,0,14]neutral hadron energy
# Line 68 | Line 69 | namespace mithep
69      ClassDef(PFJet, 1) // PFJet class
70    };
71   }
72 +
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   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines