ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/PollackPrograms/src/TCMuon.cc
(Generate patch)

Comparing UserCode/PollackPrograms/src/TCMuon.cc (file contents):
Revision 1.1 by bpollack, Tue Jul 24 20:24:57 2012 UTC vs.
Revision 1.2 by bpollack, Wed Feb 20 21:39:43 2013 UTC

# Line 1 | Line 1
1   #include "TCMuon.h"
2 + #include <iostream>
3  
4   TCMuon::TCMuon() {
5   }
# Line 9 | Line 10 | TCMuon::~TCMuon() {
10   // "get" methods -------------------------------------
11  
12  
13 < map<string, float> TCMuon::MuonMap() {
14 <  return _MuonTrueMap;
13 > float TCMuon::PtError() const {
14 >   return _ptError;
15   }
16  
17 < TVector2 TCMuon::P2() const {
18 <  TVector2 v2(this->Px(), this->Py());
19 <  return v2;
17 > bool TCMuon::IsGLB() const {
18 >   return _isGLB;
19 > }
20 > bool TCMuon::IsTRK() const {
21 >   return _isTRK;
22   }
23  
24 < float TCMuon::PtError() const {
25 <   return _ptError;
24 > bool TCMuon::IsPF() const {
25 >   return _isPF;
26 > }
27 >
28 > int TCMuon::NumberOfMatchedStations() const {
29 >  return _numberOfMatchedStations;
30 > }
31 >
32 > int TCMuon::TrackLayersWithMeasurement() const {
33 >  return _trackLayersWithMeasurement;
34 > }
35 >
36 > int TCMuon::NumberOfValidPixelHits() const {
37 >  return _numberOfValidPixelHits;
38   }
39  
40 < TVector3 TCMuon::Vtx() const {
41 <   return _vtx;
40 > int TCMuon::NumberOfValidTrackerHits() const {
41 >  return _numberOfValidTrackerHits;
42   }
43  
44 < int TCMuon::Charge() const {
45 <   return _charge;
44 > int TCMuon::NumberOfValidMuonHits() const {
45 >  return _numberOfValidMuonHits;
46 > }
47 >
48 > int TCMuon::NumberOfLostPixelHits() const {
49 >  return _numberOfLostPixelHits;
50 > }
51 >
52 > int TCMuon::NumberOfLostTrackerHits() const {
53 >  return _numberOfLostTrackerHits;
54 > }
55 >
56 > float TCMuon::NormalizedChi2() const {
57 >  return _normalizedChi2;
58 > }
59 >
60 > int TCMuon::NumberOfMatches() const {
61 >   return _numberOfMatches;
62   }
63  
64   float TCMuon::CaloComp() const {
# Line 38 | Line 69 | float TCMuon::SegComp() const {
69     return _segComp;
70   }
71  
41 float TCMuon::Dxy(TVector3 *primVtx) const {
42  //Calculating track dxy parameter wrt primary vertex                                                                                                      
43  //d0 = - dxy                                                                                                                                              
44  float vx = _vtx.X(), vy = _vtx.Y();
45  float px = this->Px(), py = this->Py(), pt = this->Pt();
46  float pvx = primVtx->X(), pvy = primVtx->Y();
47  float ret =  (-(vx-pvx)*py + (vy-pvy)*px)/pt;
48  return ret;
49 }
50
51 float TCMuon::Dz(TVector3 *primVtx) const {
52  //Calculating track dz parameter wrt primary vertex                                                                                                        
53  float vx = _vtx.X(), vy = _vtx.Y(), vz = _vtx.Z();
54  float px = this->Px(), py = this->Py();
55  float pz = this->Pz(), pt = this->Pt();
56  float pvx = primVtx->X(), pvy = primVtx->Y(), pvz = primVtx->Z();
57  float ret =  (vz-pvz)-((vx-pvx)*px +(vy-pvy)*py)/pt*(pz/pt);
58  return ret;
59 }
60
72   // "set" methods ---------------------------------------------
73 + void TCMuon::SetNumberOfMatchedStations(int n){
74 +  _numberOfMatchedStations = n;
75 + }
76  
77 <
78 < void TCMuon::LoadMap(vector<string> svec){
65 <  //Strings take a lot of memory, so call this to load the cut names into the muon class
66 <  //when you start running your analyzer, otherwise MuonMap will return an empty map
67 <    for (unsigned int i=0; i<_MuonIndexMap.size(); i++)
68 <    {
69 <    _MuonTrueMap[svec[i]] = _MuonIndexMap[i];
70 <    }
71 < }
72 <
73 < void TCMuon::SetMap(string s, float v, vector<string>* svec){
74 <  //set the index map internally and the name map externally, for memory saving
75 <  for (unsigned int i = 0; i<svec->size(); i++){
76 <    if (s.compare(svec->at(i)) ==0){
77 <      _MuonIndexMap[i] = v;
78 <      return;
79 <    }
80 <  }
81 <  svec->push_back(s);
82 <  _MuonIndexMap[svec->size()-1] = v;
83 < }
84 <
85 < void TCMuon::SetVtx(float vx, float vy, float vz) {
86 <   TVector3 v3(vx, vy, vz);
87 <   _vtx = v3;
77 > void TCMuon::SetTrackLayersWithMeasurement(int n) {
78 >  _trackLayersWithMeasurement = n;
79   }
80  
81   void TCMuon::SetPtError(float er){
82     _ptError = er;
83   }
84 < void TCMuon::SetCharge(int c){
85 <   _charge = c;
84 >
85 > void TCMuon::SetIsGLB(bool t){
86 >   _isGLB = t;
87 > }
88 >
89 > void TCMuon::SetIsTRK(bool t){
90 >   _isTRK = t;
91 > }
92 > void TCMuon::SetIsPF(bool t){
93 >   _isPF = t;
94 > }
95 >
96 > void TCMuon::SetNumberOfValidMuonHits(int n) {
97 >  _numberOfValidMuonHits = n;
98 > }
99 >
100 > void TCMuon::SetNumberOfValidPixelHits(int n) {
101 >  _numberOfValidPixelHits = n;
102 > }
103 >
104 > void TCMuon::SetNumberOfValidTrackerHits(int n) {
105 >  _numberOfValidTrackerHits = n;
106 > }
107 >
108 > void TCMuon::SetNumberOfLostPixelHits(int n) {
109 >  _numberOfLostPixelHits = n;
110 > }
111 >
112 > void TCMuon::SetNumberOfLostTrackerHits(int n) {
113 >  _numberOfLostTrackerHits = n;
114 > }
115 >
116 > void TCMuon::SetNormalizedChi2(float n) {
117 >  _normalizedChi2 = n;
118 > }
119 >
120 > void TCMuon::SetNumberOfMatches(int n) {
121 >  _numberOfMatches = n;
122   }
123  
124   void TCMuon::SetCaloComp(float c){
# Line 101 | Line 128 | void TCMuon::SetCaloComp(float c){
128   void TCMuon::SetSegComp(float s){
129     _segComp = s;
130   }
131 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines