SND@LHC Software
Loading...
Searching...
No Matches
ShipParticle.cxx
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- ShipParticle source file -----
3// -------------------------------------------------------------------------
4#include "ShipParticle.h"
5
6#include "FairLogger.h" // for FairLogger, etc
7
8#include "TDatabasePDG.h" // for TDatabasePDG
9#include "TParticle.h" // for TParticle
10#include "TParticlePDG.h" // for TParticlePDG
11
12// ----- Default constructor -------------------------------------------
14 : TParticle()
15{
16}
17// -------------------------------------------------------------------------
18ShipParticle::ShipParticle(Int_t pdg, Int_t status,
19 Int_t mother1, Int_t mother2,
20 Int_t daughter1, Int_t daughter2,
21 Double_t px, Double_t py, Double_t pz, Double_t etot,
22 Double_t vx, Double_t vy, Double_t vz, Double_t time):TParticle(pdg, status,mother1,mother2,daughter1,daughter2,
23 px, py, pz, etot, vx, vy, vz, time),
24 fCovP(TMatrixDSym(4)),
25 fCovV(TMatrixDSym(3))
26 {
27 doca = 0.;
28 }
29
30ShipParticle::ShipParticle(Int_t pdg, Int_t status,
31 Int_t mother1, Int_t mother2,
32 Int_t daughter1, Int_t daughter2,
33 const TLorentzVector &p,
34 const TLorentzVector &v):TParticle(pdg, status,mother1,mother2,daughter1,daughter2,p,v),
35 fCovP(TMatrixDSym(4)),
36 fCovV(TMatrixDSym(3))
37 {
38 doca = 0.;
39 }
40
41// ----- Destructor ----------------------------------------------------
44// -------------------------------------------------------------------------
45
46
47// ----- Public method Set CovP CovV -----------------------------------------
48
49void ShipParticle::SetCovP(Double_t* covElements)
50{
51 fCovP(0,0) = covElements[0];
52 fCovP(0,1) = covElements[1];
53 fCovP(0,2) = covElements[2];
54 fCovP(0,3) = covElements[3];
55
56 fCovP(1,0) = covElements[1];
57 fCovP(1,1) = covElements[4];
58 fCovP(1,2) = covElements[5];
59 fCovP(1,3) = covElements[6];
60
61 fCovP(2,0) = covElements[2];
62 fCovP(2,1) = covElements[5];
63 fCovP(2,2) = covElements[7];
64 fCovP(2,3) = covElements[8];
65
66
67 fCovP(3,0) = covElements[3];
68 fCovP(3,1) = covElements[6];
69 fCovP(3,2) = covElements[8];
70 fCovP(3,3) = covElements[9];
71
72
73}
74// ----- Public method Set/GetCovV -----------------------------------------
75void ShipParticle::SetCovV(Double_t* covElements)
76{
77 fCovV(0,0) = covElements[0];
78 fCovV(0,1) = covElements[1];
79 fCovV(0,2) = covElements[2];
80 fCovV(1,1) = covElements[3];
81 fCovV(1,2) = covElements[4];
82 fCovV(2,2) = covElements[5];
83 fCovV(1,0) = covElements[1];
84 fCovV(2,0) = covElements[2];
85 fCovV(2,1) = covElements[4];
86}
87// -------------------------------------------------------------------------
88void ShipParticle::GetMomentum(TLorentzVector& momentum)
89{
90 momentum.SetPxPyPzE(fPx,fPy,fPz,fE);
91}
92void ShipParticle::GetVertex(TVector3& vx)
93{
94 vx.SetXYZ(fVx,fVy,fVz);
95}
97{
98 TLorentzVector momentum;
99 GetMomentum(momentum);
100 return momentum.M();
101}
virtual ~ShipParticle()
Double_t doca
void SetCovP(Double_t *x)
TMatrixDSym fCovP
void SetCovV(Double_t *x)
Double_t GetMass()
void GetMomentum(TLorentzVector &momentum)
TMatrixDSym fCovV
void GetVertex(TVector3 &vertex)
ClassImp(ecalContFact) ecalContFact