1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
loizides |
1.9 |
// $Id: StableData.h,v 1.8 2009/03/08 12:09:59 loizides Exp $
|
3 |
bendavid |
1.1 |
//
|
4 |
|
|
// StableData
|
5 |
|
|
//
|
6 |
loizides |
1.9 |
// Additional information on a stable daughter which is specific to a particular decay.
|
7 |
bendavid |
1.1 |
//
|
8 |
|
|
// Authors: J.Bendavid
|
9 |
|
|
//--------------------------------------------------------------------------------------------------
|
10 |
|
|
|
11 |
|
|
#ifndef MITANA_DATATREE_STABLEDATA_H
|
12 |
|
|
#define MITANA_DATATREE_STABLEDATA_H
|
13 |
|
|
|
14 |
loizides |
1.8 |
#include "MitAna/DataCont/interface/BitMask.h"
|
15 |
bendavid |
1.1 |
#include "MitAna/DataTree/interface/StableParticle.h"
|
16 |
|
|
#include "MitAna/DataTree/interface/DaughterData.h"
|
17 |
bendavid |
1.2 |
#include "MitAna/DataTree/interface/Track.h"
|
18 |
bendavid |
1.1 |
#include "MitAna/DataTree/interface/Types.h"
|
19 |
loizides |
1.9 |
#include "MitCommon/DataFormats/interface/Vect3C.h"
|
20 |
bendavid |
1.1 |
|
21 |
|
|
namespace mithep
|
22 |
|
|
{
|
23 |
|
|
class StableData : public DaughterData
|
24 |
|
|
{
|
25 |
|
|
public:
|
26 |
|
|
StableData() {}
|
27 |
loizides |
1.9 |
StableData(const Particle *p, const ThreeVector &mom) :
|
28 |
|
|
DaughterData(p), fMomAtVertex(mom) {}
|
29 |
|
|
StableData(const Particle *p, const ThreeVectorC &mom) :
|
30 |
loizides |
1.6 |
DaughterData(p), fMomAtVertex(mom) {}
|
31 |
loizides |
1.9 |
StableData(const Particle *p, Double_t px, Double_t py, Double_t pz) :
|
32 |
|
|
DaughterData(p), fMomAtVertex(ThreeVector(px,py,pz)) {}
|
33 |
bendavid |
1.1 |
|
34 |
loizides |
1.9 |
Bool_t BadLayer(Track::EHitLayer l) const { return fBadLayers.TestBit(l); }
|
35 |
|
|
const BitMask48 &BadLayers() const { return fBadLayers; }
|
36 |
loizides |
1.6 |
const BitMask48 MissedHits() const;
|
37 |
loizides |
1.9 |
UInt_t NMissedHits() const { return MissedHits().NBitsSet(); }
|
38 |
|
|
UInt_t NWrongHits() const { return WrongHits().NBitsSet(); }
|
39 |
|
|
UInt_t NWrongOrMissingHits() const { return fBadLayers.NBitsSet(); }
|
40 |
|
|
EObjType ObjType() const { return kStableData; }
|
41 |
|
|
ThreeVectorC ThreeMom() const { return fMomAtVertex.V(); }
|
42 |
loizides |
1.6 |
const BitMask48 WrongHits() const;
|
43 |
loizides |
1.9 |
void SetBadLayer(Track::EHitLayer l) { fBadLayers.SetBit(l); }
|
44 |
|
|
void SetBadLayers(const BitMask48 &layers) { fBadLayers = layers; }
|
45 |
bendavid |
1.1 |
void SetThreeMom(Double_t px, Double_t y, Double_t z);
|
46 |
bendavid |
1.7 |
void SetThreeMom(const ThreeVector &mom) { fMomAtVertex = mom; ClearMom(); }
|
47 |
bendavid |
1.1 |
|
48 |
|
|
protected:
|
49 |
loizides |
1.6 |
Double_t GetMass() const { return Original()->Mass(); }
|
50 |
|
|
void GetMom() const;
|
51 |
|
|
|
52 |
loizides |
1.9 |
Vect3C fMomAtVertex; //fitted momentum at vertex
|
53 |
bendavid |
1.4 |
BitMask48 fBadLayers; //layer mask for incorrect or missing hits from
|
54 |
bendavid |
1.3 |
//before or after the decay vertex
|
55 |
|
|
//using same bit-layer mapping as mithep::Track
|
56 |
bendavid |
1.1 |
|
57 |
loizides |
1.9 |
ClassDef(StableData, 1) // Stable data class
|
58 |
bendavid |
1.1 |
};
|
59 |
|
|
}
|
60 |
loizides |
1.6 |
|
61 |
|
|
//--------------------------------------------------------------------------------------------------
|
62 |
|
|
inline void mithep::StableData::GetMom() const
|
63 |
bendavid |
1.1 |
{
|
64 |
loizides |
1.6 |
// Get momentum values from stored values.
|
65 |
bendavid |
1.1 |
|
66 |
loizides |
1.9 |
fCachedMom.SetCoordinates(fMomAtVertex.Rho(),fMomAtVertex.Eta(),fMomAtVertex.Phi(),GetMass());
|
67 |
bendavid |
1.1 |
}
|
68 |
|
|
|
69 |
|
|
//--------------------------------------------------------------------------------------------------
|
70 |
|
|
inline void mithep::StableData::SetThreeMom(Double_t px, Double_t py, Double_t pz)
|
71 |
|
|
{
|
72 |
|
|
// Set four momentum.
|
73 |
|
|
|
74 |
|
|
fMomAtVertex.SetXYZ(px, py, pz);
|
75 |
bendavid |
1.7 |
ClearMom();
|
76 |
bendavid |
1.1 |
}
|
77 |
|
|
#endif
|