ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dhidas/OSUAnalysis/Tools/src/RecoObjects/PseudoParticle.cpp
Revision: 1.1
Committed: Thu Dec 1 16:28:48 2011 UTC (13 years, 5 months ago) by dhidas
Branch point for: dhidas, MAIN
Log Message:
Initial revision

File Contents

# User Rev Content
1 dhidas 1.1 /*
2     * PseudoParticle.cpp
3     *
4     * Created on: 28 Sep 2010
5     * Author: kreczko
6     */
7    
8     #include "../../interface/RecoObjects/PseudoParticle.h"
9    
10     namespace BAT {
11    
12     PseudoParticle::PseudoParticle() :
13     Phi(99999), Eta(-9999), Pt(0), Theta(0), D0(9999), Charge(-5555) {
14    
15     }
16    
17     PseudoParticle::PseudoParticle(float phi, float eta, float pt, float theta) :
18     Phi(phi), Eta(eta), Pt(pt), Theta(theta), D0(9999), Charge(-5555) {
19    
20     }
21    
22     PseudoParticle::~PseudoParticle() {
23     }
24    
25     void PseudoParticle::setPhi(float phi) {
26     Phi = phi;
27     }
28    
29     void PseudoParticle::setEta(float eta) {
30     Eta = eta;
31     }
32    
33     void PseudoParticle::setPt(float pt) {
34     Pt = pt;
35     }
36    
37     void PseudoParticle::setTheta(float theta) {
38     Theta = theta;
39     }
40    
41     void PseudoParticle::setD0(float d0) {
42     D0 = d0;
43     }
44    
45     void PseudoParticle::setCharge(float charge) {
46     Charge = charge;
47     }
48    
49     float PseudoParticle::phi() const {
50     return Phi;
51     }
52    
53     float PseudoParticle::eta() const {
54     return Eta;
55     }
56    
57     float PseudoParticle::pt() const {
58     return Pt;
59     }
60    
61     float PseudoParticle::theta() const {
62     return Theta;
63     }
64    
65     float PseudoParticle::d0() const {
66     return D0;
67     }
68    
69     float PseudoParticle::charge() const {
70     return Charge;
71     }
72    
73     float PseudoParticle::deltaR(const PseudoParticlePointer otherParticle) const {
74     return deltaR(Phi, Eta, otherParticle->phi(), otherParticle->eta());
75     }
76    
77     float PseudoParticle::deltaR(const ParticlePointer otherParticle) const {
78     return deltaR(Phi, Eta, otherParticle->phi(), otherParticle->eta());
79     }
80    
81     float PseudoParticle::deltaR(float phi1, float eta1, float phi2, float eta2) const {
82     return sqrt(pow(deltaPhi(phi1, phi2), 2) + pow(deltaEta(eta1, eta2), 2));
83     }
84    
85     float PseudoParticle::deltaPhi(float phi1, float phi2) const {
86     float delPhi(999.0);
87     delPhi = fabs(phi1 - phi2);
88     if (delPhi > TMath::Pi())
89     delPhi = 2.0 * TMath::Pi() - delPhi;
90     return delPhi;
91     }
92    
93     float PseudoParticle::deltaEta(float eta1, float eta2) const{
94     return eta1 - eta2;
95     }
96    
97     bool PseudoParticle::isWithinDeltaR(float delta_R, const PseudoParticlePointer particle) const{
98     return deltaR(particle) < delta_R;
99     }
100    
101     }