ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/dhidas/OSUAnalysis/Tools/src/RecoObjects/Track.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     * Track.cpp
3     *
4     * Created on: Jun 25, 2010
5     * Author: lkreczko
6     */
7    
8     #include "../../interface/RecoObjects/Track.h"
9    
10     namespace BAT {
11     const double Track::BFIELD = 3.8;
12    
13     Track::Track() :
14     PseudoParticle(), highPurity(false) {
15    
16     }
17    
18     Track::Track(const Track& track) :
19     PseudoParticle((PseudoParticle) track), highPurity(track.highPurity) {
20    
21     }
22    
23     Track::Track(float phi, float eta, float pt, float theta) :
24     PseudoParticle(phi, eta, pt, theta), highPurity(false) {
25    
26     }
27    
28     Track::~Track() {
29     }
30    
31     double Track::curvature(double BField) const {
32     return -0.3 * BField * charge() / pt() / 100.;
33     }
34    
35     double Track::radius(double Bfield) const {
36     return fabs(1 / curvature(Bfield));
37     }
38    
39     double Track::x(double Bfield) const {
40     return (1/curvature(Bfield) - d0()) * cos(phi());
41     }
42    
43     double Track::y(double Bfield) const {
44     return (1/curvature(Bfield) - d0()) * sin(phi());
45     }
46    
47     double Track::deltaCotTheta(const TrackPointer otherTrack) const {
48     return fabs(1 / tan(theta()) - 1 / tan(otherTrack->theta()));
49     }
50    
51     double Track::distance(const TrackPointer otherTrack, double BField) const {
52     double dx = x(BField) - otherTrack->x(BField);
53     double dy = y(BField) - otherTrack->y(BField);
54     double dist = sqrt(pow(dx, 2) + pow(dy, 2));
55     return fabs(dist - (radius(BField) + otherTrack->radius(BField)));
56     }
57    
58     void Track::setHighPurity(bool isPure) {
59     highPurity = isPure;
60     }
61    
62     bool Track::isHighPurity() const {
63     return highPurity;
64     }
65    
66     }