25 #include <TDatabasePDG.h>
26 #include <TEveManager.h>
27 #include <TGeoManager.h>
32 #include "TDatabasePDG.h"
47 new TGeoManager(
"Geometry",
"Geane geometry");
48 TGeoManager::Import(
"genfitGeom.root");
61 TClonesArray myDetectorHitArray(
"genfit::mySpacepointDetectorHit");
71 for (
unsigned int iEvent=0; iEvent<100; ++iEvent){
73 myDetectorHitArray.Clear();
79 TVector3
pos(0, 0, 0);
81 mom.SetPhi(gRandom->Uniform(0.,2*TMath::Pi()));
82 mom.SetTheta(gRandom->Uniform(0.4*TMath::Pi(),0.6*TMath::Pi()));
83 mom.SetMag(gRandom->Uniform(0.2, 1.));
88 const double charge = TDatabasePDG::Instance()->GetParticle(pdg)->Charge()/(3.);
93 unsigned int nMeasurements = gRandom->Uniform(5, 15);
96 double resolution = 0.01;
98 for (
int i = 0;
i < 3; ++
i)
99 cov(
i,
i) = resolution*resolution;
101 for (
unsigned int i=0;
i<nMeasurements; ++
i) {
103 TVector3 currentPos = helix->
getPos(
i*2.);
104 currentPos.SetX(gRandom->Gaus(currentPos.X(), resolution));
105 currentPos.SetY(gRandom->Gaus(currentPos.Y(), resolution));
106 currentPos.SetZ(gRandom->Gaus(currentPos.Z(), resolution));
117 const bool smearPosMom =
true;
118 const double posSmear = 0.1;
119 const double momSmear = 3. /180.*TMath::Pi();
120 const double momMagSmear = 0.1;
125 posM.SetX(gRandom->Gaus(posM.X(),posSmear));
126 posM.SetY(gRandom->Gaus(posM.Y(),posSmear));
127 posM.SetZ(gRandom->Gaus(posM.Z(),posSmear));
129 momM.SetPhi(gRandom->Gaus(mom.Phi(),momSmear));
130 momM.SetTheta(gRandom->Gaus(mom.Theta(),momSmear));
131 momM.SetMag(gRandom->Gaus(mom.Mag(), momMagSmear*mom.Mag()));
135 TMatrixDSym covSeed(6);
136 for (
int i = 0;
i < 3; ++
i)
137 covSeed(
i,
i) = resolution*resolution;
138 for (
int i = 3;
i < 6; ++
i)
139 covSeed(
i,
i) = pow(resolution / nMeasurements / sqrt(3), 2);
156 std::cerr << e.
what();
157 std::cerr <<
"Exception, next track" << std::endl;