19 #include "FairRootManager.h"
20 #include "FairRunAna.h"
21 #include "FairRuntimeDb.h"
23 #include "TClonesArray.h"
60 hptfit =
new TH1F(
"hptfit",
"pt fit: reco - mc", 100, -0.3, 0.3);
61 hplfit =
new TH1F(
"hplfit",
"pl fit: reco - mc", 100, -0.4, 0.4);
62 hptotfit =
new TH1F(
"hptotfit",
"ptot fit: reco - mc", 100, -0.3, 0.3);
64 hptfit_perc =
new TH1F(
"hptfit_perc",
"pt fit: (reco - mc) / mc", 100, -0.3, 0.3);
65 hplfit_perc =
new TH1F(
"hplfit_perc",
"pl fit: (reco - mc) / mc", 100, -0.4, 0.4);
66 hptotfit_perc =
new TH1F(
"hptotfit_perc",
"ptot fit: (reco - mc) / mc", 100, -0.3, 0.3);
68 hDist =
new TH1F(
"hDist",
"Dist fit: reco - mc", 100, -1., 1.);
69 hRad =
new TH1F(
"hRad",
"Rad fit: reco - mc", 100, -15., 15.);
70 hPhi =
new TH1F(
"hPhi",
"Phi fit: reco - mc", 100, -0.1, 0.1);
71 hTanL =
new TH1F(
"hTanL",
"TanL fit: reco - mc", 100, -0.2, 0.2);
72 hZ =
new TH1F(
"hZ",
"Z fit: reco - mc", 100, -0.3, 0.3);
74 hQ =
new TH1F(
"hQ",
"Q fit: mc + reco", 6, -3, 3);
76 hptfound =
new TH1F(
"hptfound",
"pt found: reco - mc", 100, -0.3, 0.3);
77 hplfound =
new TH1F(
"hplfound",
"pl found: reco - mc", 100, -0.4, 0.4);
78 hptotfound =
new TH1F(
"hptotfound",
"ptot found: reco - mc", 100, -0.3, 0.3);
80 hptfound_perc =
new TH1F(
"hptfound_perc",
"pt found: (reco - mc) / mc", 100, -0.3, 0.3);
81 hplfound_perc =
new TH1F(
"hplfound_perc",
"pl found: (reco - mc) / mc", 100, -0.4, 0.4);
82 hptotfound_perc =
new TH1F(
"hptotfound_perc",
"ptot found: (reco - mc) / mc", 100, -0.3, 0.3);
84 hpxfit =
new TH1F(
"hpxfit",
"px fit: reco - mc", 100, -0.3, 0.3);
85 hpyfit =
new TH1F(
"hpyfit",
"py fit: reco - mc", 100, -0.3, 0.3);
86 hpzfit =
new TH1F(
"hpzfit",
"pz fit: reco - mc", 100, -0.4, 0.4);
88 hresx =
new TH1F(
"hresx",
"x: reco - mc", 100, -0.2, 0.2);
89 hresy =
new TH1F(
"hresy",
"y: reco - mc", 100, -0.2, 0.2);
90 hresz =
new TH1F(
"hresz",
"z: reco - mc", 100, -3, 3);
92 hx =
new TH1F(
"hx",
"x no skewed: reco - mc", 100, -0.2, 0.2);
93 hy =
new TH1F(
"hy",
"y no skewed: reco - mc", 100, -0.2, 0.2);
94 hz =
new TH1F(
"hz",
"z no skewed: reco - mc", 100, -3, 3);
96 hxs =
new TH1F(
"hxs",
"x skewed: reco - mc", 100, -0.2, 0.2);
97 hys =
new TH1F(
"hys",
"y skewed: reco - mc", 100, -0.2, 0.2);
98 hzs =
new TH1F(
"hzs",
"z skewed: reco - mc", 100, -3, 3);
101 FairRootManager* ioman = FairRootManager::Instance();
103 cout <<
"-E- PndSttHelixHitProducer::Init: "
104 <<
"RootManager not instantiated!" << endl;
112 cout <<
"-E- PndSttTrackFitterQATask::Init: No MCTrack array!"
118 fTrackArray = (TClonesArray*) ioman->GetObject(
"STTTrack");
121 cout <<
"-E- PndSttTrackFitterQATask::Init: No SttTrack array!"
130 cout <<
"-E- PndSttTrackFitterQATask::Init: No SttFoundTrack array!"
140 cout <<
"-E- PndSttTrackFitterQATask::Init: No SttTrack Cand array!"
146 fPointArray = (TClonesArray*) ioman->GetObject(
"STTPoint");
148 cout <<
"-W- PndSttTrackFitterQATask::Init: "
149 <<
"No STTPoint array!" << endl;
154 fHitArray = (TClonesArray*) ioman->GetObject(
"STTHit");
156 cout <<
"-W- PndSttTrackFitterQATask::Init: "
157 <<
"No STTHit array!" << endl;
164 cout <<
"-W- PndSttTrackFitterQATask::Init: "
165 <<
"No SttHelixHit array!" << endl;
173 cout <<
"-I- PndSttTrackFitterQATask: Intialization successfull" << endl;
182 FairRuntimeDb*
rtdb = FairRunAna::Instance()->GetRuntimeDb();
195 if ( !
fTrackArray ) Fatal(
"Exec",
"No fTrackArray");
200 for (Int_t j = 0; j < nTracks; j++) {
202 if(!pTrack)
continue;
205 if(!pTrackCand)
continue;
207 bool foundtrack =
false;
210 if(!pFoundTrack)
continue;
216 if(foundtrack ==
false)
continue;
219 if(pTrack->
GetFlag() < 3)
continue;
231 TVector2
vec((d0+Rad)*
cos(phi0), (d0+Rad)*
sin(phi0));
239 TVector3 foundMom = pFoundTrack->
GetParamFirst().GetMomentum();
246 if(!mcTrack)
continue;
251 int mcQ = (int)((TDatabasePDG::Instance())->GetParticle(mcTrack->
GetPdgCode())->Charge()/3.);
255 hptfit->Fill(ptran - mcmom.Perp());
256 hplfit->Fill(plong - mcmom.Z());
259 hptfound->Fill(foundMom.Perp() - mcmom.Perp());
260 hplfound->Fill(foundMom.Z() - mcmom.Z());
261 hptotfound->Fill(foundMom.Mag() - mcmom.Mag());
263 hptfit_perc->Fill((ptran - mcmom.Perp())/ mcmom.Perp());
267 hptfound_perc->Fill((foundMom.Perp() - mcmom.Perp())/ mcmom.Perp());
269 hptotfound->Fill((foundMom.Mag() - mcmom.Mag()) / mcmom.Mag());
282 hpxfit->Fill(fitmom.X() - mcmom.X());
283 hpyfit->Fill(fitmom.Y() - mcmom.Y());
284 hpzfit->Fill(fitmom.Z() - mcmom.Z());
288 double mcRad = mcmom.Perp()/0.006;
299 mcX0 = vertex.X() + mcRad *
TMath::Cos(alpha);
300 mcY0 = vertex.Y() - mcRad *
TMath::Sin(alpha);
303 mcX0 = vertex.X() - mcRad *
TMath::Cos(alpha);
304 mcY0 = vertex.Y() + mcRad *
TMath::Sin(alpha);
309 mcDist =
TMath::Sqrt(mcX0 * mcX0 + mcY0 * mcY0) - mcRad;
310 mcPhi =
atan2(mcY0, mcX0);
313 mcTanL = mcmom.Z()/mcmom.Perp();
318 if(pTrack->
GetFlag() >= 2)
hRad->Fill(Rad - mcRad);
319 if(pTrack->
GetFlag() >= 2)
hPhi->Fill(phi0 - mcPhi);
320 if(pTrack->
GetFlag() >= 3)
hTanL->Fill(zslope - mcTanL);
328 for (Int_t k = 0; k < hitcounter; k++) {
340 hresx->Fill(helixhit->GetX() - mcpoint->GetX());
341 hresy->Fill(helixhit->GetY() - mcpoint->GetY());
342 hresz->Fill(helixhit->GetZ() - mcpoint->GetZ());
345 hx->Fill(helixhit->GetX() - mcpoint->GetX());
346 hy->Fill(helixhit->GetY() - mcpoint->GetY());
347 hz->Fill(helixhit->GetZ() - mcpoint->GetZ());
350 hxs->Fill(helixhit->GetX() - mcpoint->GetX());
351 hys->Fill(helixhit->GetY() - mcpoint->GetY());
352 hzs->Fill(helixhit->GetZ() - mcpoint->GetZ());
363 TFile*
file = FairRootManager::Instance()->GetOutFile();
365 file->mkdir(
"SttFitterQATask");
366 file->cd(
"SttFitterQATask");
virtual void Exec(Option_t *opt)
~PndSttTrackFitterQATask()
friend F32vec4 cos(const F32vec4 &a)
Int_t GetNofHelixHits() const
friend F32vec4 sqrt(const F32vec4 &a)
Int_t GetTrackCandIndex()
static T Sqrt(const T &x)
PndSttTrackFitterQATask()
PndGeoSttPar * fSttParameters
friend F32vec4 sin(const F32vec4 &a)
TVector3 GetMomentum() const
TClonesArray * fTrackCandArray
TClonesArray * fHelixHitArray
TClonesArray * fTrackArray
TClonesArray * fPointArray
virtual InitStatus Init()
static T ATan2(const T &y, const T &x)
TClonesArray * FillTubeArray()
TClonesArray * fFoundTrackArray
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
Int_t GetHelixHitIndex(Int_t iHit) const
TClonesArray * fTubeArray
Int_t GetRefIndex() const
TVector3 GetStartVertex() const
TVector3 GetWireDirection()
FairTrackParP GetParamFirst()
TClonesArray * fMCTrackArray