|
7 | 7 | #ifndef KAPPA_TRACK_H
|
8 | 8 | #define KAPPA_TRACK_H
|
9 | 9 |
|
10 |
| -#include <Math/GenVector/VectorUtil.h> |
11 | 10 | #include "KBasic.h"
|
12 | 11 |
|
13 |
| -enum KTrackQuality |
| 12 | +#include <Math/GenVector/VectorUtil.h> |
| 13 | + |
| 14 | +/** Data format definition for KTracks and KLeptons |
| 15 | + |
| 16 | + */ |
| 17 | + |
| 18 | +/// TrackBase::TrackQuality |
| 19 | +/// from DataFormats/TrackReco/interface/TrackBase.h |
| 20 | +namespace KTrackQuality { |
| 21 | + |
| 22 | +enum KTrackQualityType |
14 | 23 | {
|
15 |
| - TQ_Loose = 1 << 0, TQ_Tight = 1 << 1, TQ_HighPurity = 1 << 2, TQ_Confirmed = 1 << 3, TQ_GoodIterative = 1 << 4 |
| 24 | + undefQuality = -1, loose = 0, tight = 1, highPurity = 2, confirmed = 3, goodIterative = 4, |
| 25 | + looseSetWithPV = 5, highPuritySetWithPV = 6, qualitySize = 7 |
16 | 26 | };
|
| 27 | +} |
17 | 28 |
|
| 29 | +/// Kappa Track data format |
| 30 | +/** copy from DataFormats/TrackReco/interface/TrackBase.h |
| 31 | + copy from DataFormats/TrackReco/interface/Track.h */ |
18 | 32 | struct KTrack : public KLV
|
19 | 33 | {
|
20 |
| - RMPoint ref; // reference point ("vertex") |
| 34 | + /// reference point (formerly known as "vertex", not the PV) |
| 35 | + RMPoint ref; |
| 36 | + |
| 37 | + /// charge and fit quality |
21 | 38 | char charge;
|
22 | 39 | float chi2, nDOF;
|
23 | 40 | float errPt, errEta, errPhi, errDxy, errDz;
|
24 |
| - unsigned short nPixelLayers, nStripLayers; |
25 |
| - unsigned short nValidPixelHits, nValidStripHits; |
26 |
| - unsigned short nValidMuonHits, nLostMuonHits, nBadMuonHits; |
27 |
| - unsigned short nValidHits, nLostHits; |
28 |
| - unsigned short nInnerHits, nLostInnerHits; |
29 |
| - int quality; |
30 |
| - |
31 |
| - double getTrackIsolation(std::vector<KTrack> *tracks, double isoCone = 0.3, double vetoCone = 0.01, double minPt = 1.5) |
| 41 | + |
| 42 | + /// number of hits or tracker layers in detector components (used for lepton IDs) |
| 43 | + /// DataFormats/TrackReco/interface/HitPattern.h (numberOf...) |
| 44 | + /// layers and hits for pixel, strip tracker and muon system |
| 45 | + unsigned short nValidPixelHits; //< number of valid hits in the pixel detector (for tight muID) |
| 46 | + unsigned short nValidStripHits; //< number of valid hits in the strip detector |
| 47 | + unsigned short nValidMuonHits; //< number of valid hits in the muon system (for tight muID) |
| 48 | + |
| 49 | + unsigned short nLostHits; |
| 50 | + unsigned short nPixelLayers, nStripLayers; // for soft/tight muID as trackerLayers |
| 51 | + /// functions for combinations |
| 52 | + inline unsigned short nValidHits() const { return nValidPixelHits + nValidStripHits + nValidMuonHits; }; |
| 53 | + inline unsigned short nValidTrackerHits() const { return nValidPixelHits + nValidStripHits; }; |
| 54 | + inline unsigned short nTrackerLayers() const { return nPixelLayers + nStripLayers; }; |
| 55 | + |
| 56 | + /// quality bitset |
| 57 | + unsigned char qualityBits; // for soft muID |
| 58 | + inline bool quality(KTrackQuality::KTrackQualityType bit) const |
32 | 59 | {
|
33 |
| - double sum = 0.; |
34 |
| - for (std::vector<KTrack>::iterator it = tracks->begin(); it != tracks->end(); it++) |
35 |
| - { |
36 |
| - if (it->p4.pt() > minPt && ROOT::Math::VectorUtil::DeltaR(it->p4, p4) > vetoCone && ROOT::Math::VectorUtil::DeltaR(it->p4, p4) < isoCone) |
37 |
| - { |
38 |
| - // "real" track isolation takes only tracks near the studied track into account |
39 |
| - // (but there is even more magic why one needs isodeposits) |
40 |
| - //if ( std::abs(it->ref.z() - ref.z()) > 0.2 || sqrt( (it->ref.x() - ref.x() )*(it->ref.x() - ref.x() ) + (it->ref.y() - ref.y())*(it->ref.y() - ref.y()) + (it->ref.z() - ref.z())*(it->ref.z() - ref.z()) ) > 0.1 ) |
41 |
| - // continue; |
42 |
| - sum += it->p4.pt(); |
43 |
| - } |
44 |
| - } |
45 |
| - return sum; |
46 |
| - } |
| 60 | + if (bit < 0) return false; |
| 61 | + return (qualityBits & (1 << bit)); |
| 62 | + }; |
47 | 63 |
|
| 64 | + /// distances to primary vertex, beamspot and interaction point |
48 | 65 | double getDxy(const KVertex * pv) const
|
49 | 66 | {
|
50 | 67 | if (!pv)
|
@@ -157,7 +174,6 @@ struct KMuonTriggerCandidate : public KTrack
|
157 | 174 | bool isoDecision;
|
158 | 175 | float isoQuantity;
|
159 | 176 | };
|
160 |
| - |
161 | 177 | typedef std::vector<KMuonTriggerCandidate> KMuonTriggerCandidates;
|
162 | 178 |
|
163 | 179 | const unsigned char KLeptonFlavourMask = 3;
|
|
0 commit comments