9 #include "FairRootManager.h"
10 #include "FairRunAna.h"
11 #include "FairRuntimeDb.h"
12 #include "FairBaseParSet.h"
13 #include "FairTrackParam.h"
14 #include "FairRootManager.h"
23 #include "TClonesArray.h"
24 #include "TGeoManager.h"
25 #include "TMatrixFSym.h"
159 : FairTask(
"GEM Track Finder QA", iVerbose) {
284 FairRootManager* ioman = FairRootManager::Instance();
286 #if (ROOT_VERSION_CODE >= ROOT_VERSION(5,34,10))
287 ioman->SetUseFairLinks(kTRUE);
291 cout <<
"-E- "<< GetName() <<
"::Init: "
292 <<
"RootManager not instantised!" << endl;
297 FairRunAna* ana = FairRunAna::Instance();
299 cout <<
"-E- "<< GetName() <<
"::Init :"
300 <<
" no FairRunAna object!" << endl;
304 FairRuntimeDb*
rtdb = ana->GetRuntimeDb();
306 cout <<
"-E- "<< GetName() <<
"::Init :"
307 <<
" no runtime database!" << endl;
314 cout <<
"-E- "<< GetName() <<
"::Init: No MCTrack array!"
320 fMCPointArray = (TClonesArray*) ioman->GetObject(
"GEMPoint");
322 cout <<
"-E- "<< GetName() <<
"::Init: No MCPoint array!"
328 fGemHitArray = (TClonesArray*) ioman->GetObject(
"GEMHit");
330 cout <<
"-E- " << GetName() <<
"::Init: No PndGemHit array!" << endl;
337 cout <<
"-E- " << GetName() <<
"::Init: No PndGemTrack array!" << endl;
345 cout <<
"-I- " << fName.Data() <<
"::Init(). There are " <<
fDigiPar->
GetNStations() <<
" GEM stations." << endl;
346 cout <<
"-I- " << fName.Data() <<
"::Init(). Initialization succesfull." << endl;
348 TList* branchNames = FairRootManager::Instance()->GetBranchNameList();
350 Int_t nofGemBranches = 0;
352 for (
int i = 0;
i < branchNames->GetEntries();
i++){
353 TObjString* branchName = (TObjString*)branchNames->At(
i);
354 if ( !branchName->GetString().BeginsWith(
"GEM") )
continue;
356 fGemData[nofGemBranches] = (TClonesArray*) ioman->GetObject(branchName->GetString().Data());
358 cout <<
"GEM Data [" << nofGemBranches <<
"] = " << branchName->GetString().Data() <<
" referred to as " <<
i << (
fGemPointNumber==
i?
" ***":
"") << endl;
380 FairRunAna*
run = FairRunAna::Instance();
381 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
383 FairRuntimeDb* db = run->GetRuntimeDb();
384 if ( ! db ) Fatal(
"SetParContainers",
"No runtime database");
423 Int_t nofRecoAcc = 0;
424 Int_t nofRecoPrim = 0;
425 Int_t nofRecoSec = 0;
426 Int_t nofRecoRef = 0;
428 Int_t nofRecoClones = 0;
429 Int_t nofRecoGhosts = 0;
444 for ( Int_t imct = 0 ; imct < nofMCTracks ; imct++ ) {
454 Double_t mcMomThe = mcMomVec.Theta()*TMath::RadToDeg();
455 Double_t mcMomPhi = mcMomVec.Phi()*TMath::RadToDeg();
493 if ( isPrim && mcMomMag > 0.5 ) {
497 if ( isPrim && mcMomThe > 5. && mcMomThe < 20. ) {
501 if ( isRefP && isRefT ) {
507 Bool_t mcTrackReconstructed = kFALSE;
508 for ( Int_t irtr = 0 ; irtr < nofRecoTracks ; irtr++ ) {
510 mcTrackReconstructed = kTRUE;
513 TVector3 recoTrackMom = gemTrack->
GetParamFirst().GetMomentum();
514 Double_t recoMomMag = recoTrackMom.Mag();
522 fhMomResAccVsP->Fill(mcMomMag,100.*(mcMomMag-recoMomMag)/mcMomMag);
523 fhMomResAccVsT->Fill(mcMomThe,100.*(mcMomMag-recoMomMag)/mcMomMag);
524 fhMomResAccVsA->Fill(mcMomPhi,100.*(mcMomMag-recoMomMag)/mcMomMag);
528 fhMomResRefVsT->Fill(mcMomThe,100.*(mcMomMag-recoMomMag)/mcMomMag);
532 fhMomResRefVsP->Fill(mcMomMag,100.*(mcMomMag-recoMomMag)/mcMomMag);
534 if ( isRefP && isRefT ) {
550 fhRecoPrimT->Fill(recoTrackMom.Theta()*TMath::RadToDeg());
551 fhRecoPrimA->Fill(recoTrackMom.Phi()*TMath::RadToDeg());
559 fhMomResSecVsP->Fill(mcMomMag,100.*(mcMomMag-recoMomMag)/mcMomMag);
560 fhMomResSecVsT->Fill(mcMomThe,100.*(mcMomMag-recoMomMag)/mcMomMag);
561 fhMomResSecVsA->Fill(mcMomPhi,100.*(mcMomMag-recoMomMag)/mcMomMag);
564 fhRecoSecT->Fill(recoTrackMom.Theta()*TMath::RadToDeg());
565 fhRecoSecA->Fill(recoTrackMom.Phi()*TMath::RadToDeg());
569 if ( mcTrackReconstructed == kFALSE &&
fVerbose > 0 ) {
570 cout <<
"MC TRACK WAS NOT RECONSTRUCTED"
571 <<
" mom = " << mcMomMag
572 <<
" the = " << mcMomThe
573 <<
" phi = " << mcMomPhi
578 for ( Int_t irtr = 0 ; irtr < nofRecoTracks ; irtr++ ) {
590 Int_t nofCorrHits = 0;
591 Int_t nofOthTHits = 0;
592 Int_t nofNoTrHits = 0;
597 if ( bestPointIndex == -1 ) { nofNoTrHits++;
continue; }
606 for ( Int_t irtr2 = 0 ; irtr2 < nofRecoTracks ; irtr2++ ) {
607 if ( irtr == irtr2 )
continue;
636 if ( nofMCPrim ) effPrim = 100.*(
Double_t)nofRecoPrim/((
Double_t)nofMCPrim);
639 cout <<
"---- PndGemTrackFinderQA : Event " <<
fNofEvents <<
" summary -----" << endl;
640 cout <<
"MC Tracks: " << nofMCTracks << endl;
641 cout <<
" reconstruable: " << nofMCAcc <<
" reconstructed " << nofRecoAcc <<
" >>>> " << effAcc << endl;
642 cout <<
" primaries : " << nofMCPrim <<
" reconstructed " << nofRecoPrim <<
" >>>> " << effPrim << endl;
643 cout <<
" secondaries : " << nofMCSec <<
" reconstructed " << nofRecoSec <<
" >>>> " << effSec << endl;
644 cout <<
" reference : " << nofMCRef <<
" reconstructed " << nofRecoRef <<
" >>>> " << effRef << endl;
645 cout <<
" ghosts : " << nofRecoGhosts <<
" clones " << nofRecoClones << endl;
646 cout <<
"---------------------------------------------------------------" << endl;
664 Int_t nofPointsPerStation[nofMCTracks][nofGemStations];
665 for ( Int_t imct = 0 ; imct < nofMCTracks ; imct++ )
666 for ( Int_t
is = 0 ;
is < nofGemStations ;
is++ )
667 nofPointsPerStation[imct][
is] = 0;
670 for ( Int_t imcp = 0 ; imcp < nofGemPoints ; imcp++ ) {
675 nofPointsPerStation[mcPoint->GetTrackID()][stationNr-1] += 1;
681 for ( Int_t imct = 0 ; imct < nofMCTracks ; imct++ ) {
684 for ( Int_t
is = 0 ;
is < nofGemStations ;
is++ )
685 if ( nofPointsPerStation[imct][
is] > 0 )
701 FairMCPoint* mcPoint;
706 for ( Int_t irtr = 0 ; irtr < nofRecoTracks ; irtr++ ) {
708 vector<Int_t> nofTrMCId(500,0);
715 if ( bestPointIndex == -1 )
continue;
717 nofTrMCId[mcPoint->GetTrackID()] += 1;
720 Int_t largestNofMCId = 0;
721 for ( Int_t itm = 0 ; itm < 500 ; itm++ ) {
722 if ( nofTrMCId[itm] == largestNofMCId ) { bestMCId = -1; }
723 if ( nofTrMCId[itm] > largestNofMCId ) { bestMCId = itm; largestNofMCId = nofTrMCId[itm]; }
725 if ( bestMCId == -1 ) {
727 cout <<
"GHOST TRACK WITH"
728 <<
" mom = " << gemTrack->
GetParamFirst().GetMomentum().Mag()
729 <<
" the = " << gemTrack->
GetParamFirst().GetMomentum().Theta()*TMath::RadToDeg()
730 <<
" phi = " << gemTrack->
GetParamFirst().GetMomentum().Phi()*TMath::RadToDeg()
736 if ( largestNofMCId < fMinQuota*gemTrack->GetTrackCand().GetNHits() )
continue;
740 TVector3 recoTrackMom = gemTrack->
GetParamFirst().GetMomentum();
743 fhRecoAllT->Fill(recoTrackMom.Theta()*TMath::RadToDeg());
744 fhRecoAllA->Fill(recoTrackMom.Phi()*TMath::RadToDeg());
753 Bool_t printMCMatching = kFALSE;
756 if ( printMCMatching ) {
757 cout <<
"---> hit " << gemHitIndex <<
" has " << gemHit->GetNLinks() <<
" links" << endl;
758 for ( Int_t ilink = 0 ; ilink < gemHit->GetNLinks() ; ilink++) {
759 std::cout <<
" --> " << gemHit->GetLink(ilink).GetEntry()
760 <<
" --> " << gemHit->GetLink(ilink).GetType()
761 <<
" --> " << gemHit->GetLink(ilink).GetIndex()
767 Int_t bestPointIndex = -1;
770 for ( Int_t ilink = 0 ; ilink < gemHit->GetNLinks() ; ilink++) {
772 return gemHit->GetLink(ilink).GetIndex();
781 Int_t maxPnt0 = -1, maxPnt1 = -1;
782 std::vector<Int_t> pointVector0;
783 std::vector<Int_t> pointVector1;
784 GetPointVector(gemHit->GetLink(0).GetType(),gemHit->GetLink(0).GetIndex(),pointVector0,printMCMatching);
785 GetPointVector(gemHit->GetLink(1).GetType(),gemHit->GetLink(1).GetIndex(),pointVector1,printMCMatching);
786 if ( printMCMatching )
787 cout <<
"VECT0: (" << gemHit->GetLink(0).GetIndex() <<
") " << flush;
788 for (
size_t ipnt = 0 ; ipnt < pointVector0.size() ; ipnt++ ) {
789 if ( printMCMatching )
790 cout << pointVector0[ipnt] <<
" . " << flush;
791 if ( maxPnt0 < pointVector0[ipnt] ) {
792 maxPnt0 = pointVector0[ipnt];
795 if ( printMCMatching )
796 cout <<
"\b\b" << endl;
797 if ( printMCMatching )
798 cout <<
"VECT1: (" << gemHit->GetLink(1).GetIndex() <<
") " << flush;
799 for (
size_t ipnt = 0 ; ipnt < pointVector1.size() ; ipnt++ ) {
800 if ( printMCMatching )
801 cout << pointVector1[ipnt] <<
" . " << flush;
802 if ( maxPnt1 < pointVector1[ipnt] ) {
803 maxPnt1 = pointVector1[ipnt];
806 if ( printMCMatching )
807 cout <<
"\b\b" << endl;
808 if ( printMCMatching )
809 cout <<
"highest points are " << maxPnt0 <<
" , " << maxPnt1 << endl;
810 std::vector<Int_t> countPointV0(maxPnt0+1,0);
811 std::vector<Int_t> countPointV1(maxPnt1+1,0);
812 for (
size_t ipnt = 0 ; ipnt < pointVector0.size() ; ipnt++ ) {
813 ++countPointV0[pointVector0[ipnt]];
815 for (
size_t ipnt = 0 ; ipnt < pointVector1.size() ; ipnt++ ) {
816 ++countPointV1[pointVector1[ipnt]];
818 if ( maxPnt0 > maxPnt1 )
820 for ( Int_t ipnt = 0 ; ipnt < maxPnt0+1 ; ipnt++ ) {
821 if ( printMCMatching )
822 cout << ipnt <<
" - " << countPointV0[ipnt] <<
" ? " << countPointV1[ipnt] << endl;
823 if ( countPointV0[ipnt] > 0 ) {
824 if ( countPointV1[ipnt] > 0 ) {
825 Double_t tempMatch = 100.*
Double_t(countPointV0[ipnt]*countPointV1[ipnt])/(
Double_t(pointVector0.size()*pointVector1.size()));
826 if ( bestPointValue < tempMatch ) {
827 bestPointValue = tempMatch;
828 bestPointIndex = ipnt;
834 if ( printMCMatching ) {
835 cout <<
"RETURNING " << bestPointIndex <<
" (with probability " << bestPointValue <<
" %)" << endl;
837 return bestPointIndex;
844 for ( Int_t itemp = 0 ; itemp < 10 - arrayId ; itemp++ ) cout <<
" " << flush;
845 cout <<
"GetPointVector(" << arrayId <<
", " << entryId <<
")" << endl;
848 pointVector.push_back(entryId);
849 return pointVector.size();
851 if ( arrayId == 0 ) {
856 for ( Int_t ilink = 0 ; ilink < tempData->GetNLinks() ; ilink++ ) {
857 GetPointVector(tempData->GetLink(ilink).GetType(),tempData->GetLink(ilink).GetIndex(),pointVector,printInfo);
859 return pointVector.size();
870 fhMCAllVsP =
new TH1F(
"hMCAllVsP" ,
"all mc tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
871 fhMCAccVsP =
new TH1F(
"hMCAccVsP" ,
"reconstruable mc tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
872 fhMCPrimVsP =
new TH1F(
"hMCPrimVsP",
"primary mc tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
873 fhMCSecVsP =
new TH1F(
"hMCSecVsP" ,
"secondary mc tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
874 fhRecoAccVsP =
new TH1F(
"hRecoAccVsP" ,
"reconstructed tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
875 fhRecoPrimVsP =
new TH1F(
"hRecoPrimVsP",
"reco primary tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
876 fhRecoSecVsP =
new TH1F(
"hRecoSecVsP" ,
"reco secondary tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
877 fhEffAccVsP =
new TH1F(
"hEffAccVsP" ,
"eff all tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
878 fhEffPrimVsP =
new TH1F(
"hEffPrimVsP",
"eff primary tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
879 fhEffSecVsP =
new TH1F(
"hEffSecVsP" ,
"eff secondary tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
880 fhMCRefVsP =
new TH1F(
"hMCRefVsP" ,
"reference mc tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
881 fhRecoRefVsP =
new TH1F(
"hRecoRefVsP" ,
"reco reference tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
882 fhEffRefVsP =
new TH1F(
"hEffRefVsP" ,
"eff reference tracks;p [GeV/c];yield [a.u.]",momBins,minMom,maxMom);
902 fhMCAllVsT =
new TH1F(
"hMCAllVsT" ,
"all mc tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
903 fhMCAccVsT =
new TH1F(
"hMCAccVsT" ,
"reconstruable mc tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
904 fhMCPrimVsT =
new TH1F(
"hMCPrimVsT",
"primary mc tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
905 fhMCSecVsT =
new TH1F(
"hMCSecVsT" ,
"secondary mc tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
906 fhRecoAccVsT =
new TH1F(
"hRecoAccVsT" ,
"reconstructed tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
907 fhRecoPrimVsT =
new TH1F(
"hRecoPrimVsT",
"reco primary tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
908 fhRecoSecVsT =
new TH1F(
"hRecoSecVsT" ,
"reco secondary tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
909 fhEffAccVsT =
new TH1F(
"hEffAccVsT" ,
"eff all tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
910 fhEffPrimVsT =
new TH1F(
"hEffPrimVsT",
"eff primary tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
911 fhEffSecVsT =
new TH1F(
"hEffSecVsT" ,
"eff secondary tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
912 fhMCRefVsT =
new TH1F(
"hMCRefVsT" ,
"reference mc tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
913 fhRecoRefVsT =
new TH1F(
"hRecoRefVsT" ,
"reco reference tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
914 fhEffRefVsT =
new TH1F(
"hEffRefVsT" ,
"eff reference tracks;theta [deg];yield [a.u.]",theBins,minThe,maxThe);
934 fhMCAllVsA =
new TH1F(
"hMCAllVsA" ,
"all mc tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
935 fhMCAccVsA =
new TH1F(
"hMCAccVsA" ,
"reconstruable mc tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
936 fhMCPrimVsA =
new TH1F(
"hMCPrimVsA",
"primary mc tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
937 fhMCSecVsA =
new TH1F(
"hMCSecVsA" ,
"secondary mc tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
938 fhRecoAccVsA =
new TH1F(
"hRecoAccVsA" ,
"reconstructed tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
939 fhRecoPrimVsA =
new TH1F(
"hRecoPrimVsA",
"reco primary tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
940 fhRecoSecVsA =
new TH1F(
"hRecoSecVsA" ,
"reco secondary tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
941 fhEffAccVsA =
new TH1F(
"hEffAccVsA" ,
"eff all tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
942 fhEffPrimVsA =
new TH1F(
"hEffPrimVsA",
"eff primary tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
943 fhEffSecVsA =
new TH1F(
"hEffSecVsA" ,
"eff secondary tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
944 fhMCRefVsA =
new TH1F(
"hMCRefVsA" ,
"reference mc tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
945 fhRecoRefVsA =
new TH1F(
"hRecoRefVsA" ,
"reco reference tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
946 fhEffRefVsA =
new TH1F(
"hEffRefVsA" ,
"eff reference tracks;phi [deg];yield [a.u.]",phiBins,minPhi,maxPhi);
966 fhMCAllVsN =
new TH1F(
"hMCAllVsN" ,
"all mc tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
967 fhMCAccVsN =
new TH1F(
"hMCAccVsN" ,
"reconstruable mc tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
968 fhMCPrimVsN =
new TH1F(
"hMCPrimVsN",
"primary mc tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
969 fhMCSecVsN =
new TH1F(
"hMCSecVsN" ,
"secondary mc tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
970 fhRecoAccVsN =
new TH1F(
"hRecoAccVsN" ,
"reconstructed tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
971 fhRecoPrimVsN =
new TH1F(
"hRecoPrimVsN",
"reco primary tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
972 fhRecoSecVsN =
new TH1F(
"hRecoSecVsN" ,
"reco secondary tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
973 fhEffAccVsN =
new TH1F(
"hEffAccVsN" ,
"eff all tracks;# points;efficiency [%]",pntBins,minPnt,maxPnt);
974 fhEffPrimVsN =
new TH1F(
"hEffPrimVsN",
"eff primary tracks;# points;efficiency [%]",pntBins,minPnt,maxPnt);
975 fhEffSecVsN =
new TH1F(
"hEffSecVsN" ,
"eff secondary tracks;# points;efficiency [%]",pntBins,minPnt,maxPnt);
976 fhMCRefVsN =
new TH1F(
"hMCRefVsN" ,
"reference mc tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
977 fhRecoRefVsN =
new TH1F(
"hRecoRefVsN" ,
"reco reference tracks;# points;yield [a.u.]",pntBins,minPnt,maxPnt);
978 fhEffRefVsN =
new TH1F(
"hEffRefVsN" ,
"eff reference tracks;# points;efficiency [%]",pntBins,minPnt,maxPnt);
995 fhMomResAccVsP =
new TH2F(
"hMomResAccVsP" ,
"momentum resolution for all tracks;p [GeV/c];#delta{p}/p [%]",momBins,minMom,maxMom,400,-20.,20.);
996 fhMomResPrimVsP =
new TH2F(
"hMomResPrimVsP",
"momentum resolution for primary tracks;p [GeV/c];#delta{p}/p [%]",momBins,minMom,maxMom,400,-20.,20.);
997 fhMomResSecVsP =
new TH2F(
"hMomResSecVsP" ,
"momentum resolution for secondary tracks;p [GeV/c];#delta{p}/p [%]",momBins,minMom,maxMom,400,-20.,20.);
998 fhMomResRefVsP =
new TH2F(
"hMomResRefVsP" ,
"momentum resolution for reference tracks;p [GeV/c];#delta{p}/p [%]",momBins,minMom,maxMom,400,-20.,20.);
1004 fhMomResAccVsT =
new TH2F(
"hMomResAccVsT" ,
"momentum resolution for all tracks;theta [deg];#delta{p}/p [%]",theBins,minThe,maxThe,400,-20.,20.);
1005 fhMomResPrimVsT =
new TH2F(
"hMomResPrimVsT",
"momentum resolution for primary tracks;theta [deg];#delta{p}/p [%]",theBins,minThe,maxThe,400,-20.,20.);
1006 fhMomResSecVsT =
new TH2F(
"hMomResSecVsT" ,
"momentum resolution for secondary tracks;theta [deg];#delta{p}/p [%]",theBins,minThe,maxThe,400,-20.,20.);
1007 fhMomResRefVsT =
new TH2F(
"hMomResRefVsT" ,
"momentum resolution for reference tracks;theta [deg];#delta{p}/p [%]",theBins,minThe,maxThe,400,-20.,20.);
1013 fhMomResAccVsA =
new TH2F(
"hMomResAccVsA" ,
"momentum resolution for all tracks;phi [deg];#delta{p}/p [%]",phiBins,minPhi,maxPhi,400,-20.,20.);
1014 fhMomResPrimVsA =
new TH2F(
"hMomResPrimVsA",
"momentum resolution for primary tracks;phi [deg];#delta{p}/p [%]",phiBins,minPhi,maxPhi,400,-20.,20.);
1015 fhMomResSecVsA =
new TH2F(
"hMomResSecVsA" ,
"momentum resolution for secondary tracks;phi [deg];#delta{p}/p [%]",phiBins,minPhi,maxPhi,400,-20.,20.);
1016 fhMomResRefVsA =
new TH2F(
"hMomResRefVsA" ,
"momentum resolution for reference tracks;phi [deg];#delta{p}/p [%]",phiBins,minPhi,maxPhi,400,-20.,20.);
1022 fhRecoAllP =
new TH1F(
"hRecoAllP" ,
"reconstructed track momentum for all",2000,0.,20.);
1023 fhRecoPrimP =
new TH1F(
"hRecoPrimP",
"reconstructed track momentum for primaries",2000,0.,20.);
1024 fhRecoSecP =
new TH1F(
"hRecoSecP" ,
"reconstructed track momentum for secondaries",2000,0.,20.);
1025 fhRecoAllT =
new TH1F(
"hRecoAllT" ,
"reconstructed track theta for all",400,0.,40.);
1026 fhRecoPrimT =
new TH1F(
"hRecoPrimT",
"reconstructed track theta for primaries",400,0.,40.);
1027 fhRecoSecT =
new TH1F(
"hRecoSecT" ,
"reconstructed track theta for secondaries",400,0.,40.);
1028 fhRecoAllA =
new TH1F(
"hRecoAllA" ,
"reconstructed track phi for all",360,-180.,180.);
1029 fhRecoPrimA =
new TH1F(
"hRecoPrimA",
"reconstructed track phi for primaries",360,-180.,180.);
1030 fhRecoSecA =
new TH1F(
"hRecoSecA" ,
"reconstructed track phi for secondaries",360,-180.,180.);
1041 fhNofHitsPerTrack =
new TH1F(
"hNofHitsPerTrack",
"nof hits per track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1042 fhNofHitsPerRecoTrack =
new TH1F(
"hNofHitsPerRecoTrack",
"nof hits per reco track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1043 fhNofHitsPerGhost =
new TH1F(
"hNofHitsPerGhost",
"nof hits per ghost track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1044 fhNofHitsPerClone =
new TH1F(
"hNofHitsPerClone",
"nof hits per clone track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1050 fhNofCorrHitsPerRecoTrack =
new TH1F(
"hNofCorrHitsPerRecoTrack",
"nof hits with correct MCId per track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1051 fhNofOthTHitsPerRecoTrack =
new TH1F(
"hNofOthTHitsPerRecoTrack",
"nof hits with different MCId per track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1052 fhNofNoTrHitsPerRecoTrack =
new TH1F(
"hNofNoTrHitsPerRecoTrack",
"nof hits without any MCId per track;# hits;yield [a.u.]",pntBins,minPnt,maxPnt);
1058 fhNofMCTracksPerEvent =
new TH1F(
"hNofMCTracksPerEvent",
"nof MC tracks per event;event no;nof mc tracks",100001,-0.5,100000.5);
1059 fhNofRecoTracksPerEvent =
new TH1F(
"hNofRecoTracksPerEvent",
"nof reco tracks per event;event no;nof mc tracks",100001,-0.5,100000.5);
1069 hist3->Divide(hist1,hist2,1,1,
"B");
1093 cout <<
"-------------------- PndGemTrackFinderQA : Summary ------------------" << endl;
1094 cout <<
" Events: " << setw(10) <<
fNofEvents << endl;
1095 cout <<
" MC Tracks: " << setw(10) <<
fNofMCAll << endl;
1096 cout <<
" reconstruable: " << setw(10) <<
fNofMCAcc <<
" reconstructed: " << setw(10) <<
fNofRecoAcc <<
" >>>> " << effAcc <<
"%" << endl;
1097 cout <<
" primaries : " << setw(10) <<
fNofMCPrim <<
" reconstructed: " << setw(10) <<
fNofRecoPrim <<
" >>>> " << effPrim <<
"%" << endl;
1098 cout <<
" reference : " << setw(10) <<
fNofMCRef <<
" reconstructed: " << setw(10) <<
fNofRecoRef <<
" >>>> " << effRef <<
"%" << endl;
1099 cout <<
" secondaries : " << setw(10) <<
fNofMCSec <<
" reconstructed: " << setw(10) <<
fNofRecoSec <<
" >>>> " << effSec <<
"%" << endl;
1100 cout <<
" ghosts : " << setw(10) <<
fNofRecoGhosts <<
" >>> " << setw(10) << ghPerEv <<
" per event >>> " << setw(10) << ghPerTr <<
" per MC Track" << endl;
1101 cout <<
" clones : " << setw(10) <<
fNofRecoClones <<
" >>> " << setw(10) << clPerEv <<
" per event >>> " << setw(10) << clPerTr <<
" per MC Track" << endl;
1102 cout <<
"---------------------------------------------------------------------" << endl;
1139 TFile* temp = gFile;
1140 FairRootManager* ioman = FairRootManager::Instance();
1141 gFile = ioman->GetOutFile();
1142 gDirectory = (TDirectory*)gFile;
1144 gDirectory->mkdir(
"GemTrackFinderQA");
1145 gDirectory->cd(
"GemTrackFinderQA");
1147 while ( TH1* histo = ((TH1*)
next()) ) histo->Write();
1148 gDirectory->cd(
"..");
std::vector< Int_t > fMCTrackNofGemPoints
TH1F * fhNofMCTracksPerEvent
TH1F * fhNofHitsPerRecoTrack
virtual void SetParContainers()
TH1F * fhNofOthTHitsPerRecoTrack
TClonesArray * fMCPointArray
Int_t GetNPoints(DetectorId detId) const
PndTrackCandHit GetSortedHit(UInt_t i)
void DivideHistos(TH1 *hist1, TH1 *hist2, TH1 *hist3)
Int_t fGemDataPointer[1000]
TVector3 GetMomentum() const
Digitization Parameter Class for GEM part.
TClonesArray * fGemTrackArray
Output array of PndGemTracks.
std::vector< Int_t > fMCTrackNofCrossedGemStations
cout<< "blue = Monte Carlo "<< endl;cout<< "red = Helix Hit "<< endl;cout<< "green = Center Of Tubes "<< endl;for(Int_t k=0;k< track->GetEntriesFast();k++){PndSttTrack *stttrack=(PndSttTrack *) track-> At(k)
TH1F * fhNofRecoTracksPerEvent
TH1F * fhNofNoTrHitsPerRecoTrack
Int_t fNofEvents
event counter
Int_t GetSensorId() const
virtual InitStatus ReInit()
TH1F * fhNofCorrHitsPerRecoTrack
PndTrackCand GetTrackCand()
TClonesArray * fGemHitArray
Int_t FindMatchingPoint(Int_t gemHitIndex)
std::vector< Int_t > fRecoTrackMCMatch
Int_t fNeededStationsToRecoTrack
virtual void Exec(Option_t *opt)
Int_t GetStationNr(Int_t sensorId)
virtual ~PndGemTrackFinderQA()
track finding quality assesment task
TVector3 GetStartVertex() const
TClonesArray * fMCTrackArray
Int_t GetPointVector(Int_t arrayId, Int_t entryId, std::vector< Int_t > &pointVector, Bool_t printInfo=kFALSE)
FairTrackParP GetParamFirst()
TClonesArray * fGemData[10]
virtual InitStatus Init()