1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
bendavid |
1.2 |
// $Id: StableData.h,v 1.1 2008/09/30 12:52:52 bendavid Exp $
|
3 |
bendavid |
1.1 |
//
|
4 |
|
|
// StableData
|
5 |
|
|
//
|
6 |
|
|
// Additional information on a stable daughter which is specific to a particular decay
|
7 |
|
|
//
|
8 |
|
|
//
|
9 |
|
|
// Authors: J.Bendavid
|
10 |
|
|
//--------------------------------------------------------------------------------------------------
|
11 |
|
|
|
12 |
|
|
#ifndef MITANA_DATATREE_STABLEDATA_H
|
13 |
|
|
#define MITANA_DATATREE_STABLEDATA_H
|
14 |
|
|
|
15 |
|
|
#include "MitAna/DataTree/interface/StableParticle.h"
|
16 |
|
|
#include "MitAna/DataTree/interface/DaughterData.h"
|
17 |
bendavid |
1.2 |
#include "MitAna/DataTree/interface/Track.h"
|
18 |
|
|
#include "MitAna/DataTree/interface/BitMask.h"
|
19 |
bendavid |
1.1 |
#include "MitAna/DataTree/interface/Types.h"
|
20 |
|
|
|
21 |
|
|
namespace mithep
|
22 |
|
|
{
|
23 |
|
|
class StableData : public DaughterData
|
24 |
|
|
{
|
25 |
|
|
public:
|
26 |
|
|
StableData() {}
|
27 |
|
|
StableData(Particle* p, const ThreeVector &mom) :
|
28 |
|
|
DaughterData(p),
|
29 |
|
|
fMomAtVertex(mom) {}
|
30 |
|
|
StableData(Particle* p, Double_t px, Double_t py, Double_t pz) :
|
31 |
|
|
DaughterData(p),
|
32 |
|
|
fMomAtVertex(px,py,pz) {}
|
33 |
|
|
virtual ~StableData() {}
|
34 |
|
|
|
35 |
|
|
Double_t Px() const { return fMomAtVertex.X(); }
|
36 |
|
|
Double_t Py() const { return fMomAtVertex.Y(); }
|
37 |
|
|
Double_t Pz() const { return fMomAtVertex.Z(); }
|
38 |
|
|
Double_t P() const { return fMomAtVertex.R(); }
|
39 |
|
|
Double_t E() const { return TMath::Sqrt(P()*P()+Mass()*Mass()); }
|
40 |
bendavid |
1.2 |
Bool_t Layer(Track::EHitLayer l) const { return fLayers.TestBit(l); }
|
41 |
|
|
const BitMask64 &Layers() const { return fLayers; }
|
42 |
bendavid |
1.1 |
Double_t Mass() const { return Original()->Mass(); }
|
43 |
bendavid |
1.2 |
const BitMask64 MissedHits() const;
|
44 |
bendavid |
1.1 |
FourVector Mom() const;
|
45 |
bendavid |
1.2 |
UInt_t NLayers() const { return fLayers.NBitsSet(); }
|
46 |
|
|
UInt_t NMissedHits() const { return MissedHits().NBitsSet(); }
|
47 |
|
|
UInt_t NWrongHits() const { return WrongHits().NBitsSet(); }
|
48 |
|
|
void SetLayer(Track::EHitLayer l) { fLayers.SetBit(l); }
|
49 |
bendavid |
1.1 |
void SetThreeMom(Double_t px, Double_t y, Double_t z);
|
50 |
|
|
void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; }
|
51 |
|
|
const ThreeVector &ThreeMom() const { return fMomAtVertex; }
|
52 |
bendavid |
1.2 |
const BitMask64 WrongHits() const;
|
53 |
bendavid |
1.1 |
|
54 |
|
|
protected:
|
55 |
|
|
ThreeVector fMomAtVertex; //fitted momentum at vertex
|
56 |
bendavid |
1.2 |
BitMask64 fLayers; //layer mask for crossed good layers
|
57 |
|
|
//using same bit-layer mapping as mithep::Track
|
58 |
bendavid |
1.1 |
|
59 |
bendavid |
1.2 |
ClassDef(StableData, 2) // Stable daughter class
|
60 |
bendavid |
1.1 |
};
|
61 |
|
|
}
|
62 |
|
|
//-------------------------------------------------------------------------------------------------
|
63 |
|
|
inline mithep::FourVector mithep::StableData::Mom() const
|
64 |
|
|
{
|
65 |
|
|
// Return Momentum
|
66 |
|
|
|
67 |
|
|
return FourVector(Px(), Py(), Pz(), E());
|
68 |
|
|
}
|
69 |
|
|
|
70 |
|
|
//--------------------------------------------------------------------------------------------------
|
71 |
|
|
inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
|
72 |
|
|
{
|
73 |
|
|
// Set four momentum.
|
74 |
|
|
|
75 |
|
|
fMomAtVertex.SetXYZ(px, py, pz);
|
76 |
|
|
}
|
77 |
|
|
#endif
|