-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexample.cc
More file actions
74 lines (45 loc) · 1.36 KB
/
example.cc
File metadata and controls
74 lines (45 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <iostream>
#include "SolGeom.h"
#include "SolGridCov.h"
#include "ObsTrk.h"
#include "TVector3.h"
#include "TLorentzVector.h"
using namespace std;
// needed input:
// - input Covariance Matrix in root file form
//
// - provide vector position at origin, and vector momentum
int main() {
// initialize Geometry
SolGeom *G = new SolGeom();
Double_t Bfield = G->B();
cout<<Bfield<<endl;
// initialize tracking resolution
SolGridCov *GC = new SolGridCov();
GC->Write("test.root",G);
GC->Read("test.root");
GC->GetCov(20.33, 11.111);
// takes a while to write geometry file
// GC->Write("test.root",G);
// reads covariance array
//GC->Read("CovIDEA-BASE.root");
// apply track Resolution
/*
TVector3 tX(0., 0., 0.);
TLorentzVector p4;
Double_t pt = 10.;
Double_t m = 0.1;
Double_t e = TMath::Sqrt(pt*pt + m*m);
p4.SetPtEtaPhiM(pt,0.,0.,e);
TVector3 tP1 = p4.Vect();
Double_t Q1 = 1; // charge
ObsTrk *Tr = new ObsTrk(tX, tP1, Q1, Bfield, GC);
TVector3 obsP1 = Tr->GetObsP();
TVector3 obsX1 = Tr->GetObsX();
Double_t Eobs = TMath::Sqrt(m*m + obsP1.Mag2());
TLorentzVector p4obs;
p4obs.SetPxPyPzE(obsP1.Px(), obsP1.Py(), obsP1.Pz(), e);
cout<<p4.Pt()<<","<<p4.Eta() <<","<<p4.Phi() <<","<<p4.E() <<endl;
cout<<p4obs.Pt()<<","<<p4obs.Eta() <<","<<p4obs.Phi() <<","<<p4obs.E() <<endl;
*/
}