Skip to content

Commit 21e2452

Browse files
committed
Added histograms for data quality checks. Removed unused functions
1 parent 3672228 commit 21e2452

File tree

2 files changed

+90
-47
lines changed

2 files changed

+90
-47
lines changed

PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.cxx

Lines changed: 90 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,19 @@ TH1F* fhPtNegA[kIdBfNoOfSpecies + 1] = {nullptr};
9595
TH2F* fhNPosNegA[kIdBfNoOfSpecies + 1] = {nullptr};
9696
TH1F* fhDeltaNA[kIdBfNoOfSpecies + 1] = {nullptr};
9797

98+
TH1I* fhNClustersB = nullptr;
99+
TH2F* fhPhiYB = nullptr;
100+
TH2F* fhPtYB = nullptr;
101+
TH1F* fhChi2B = nullptr;
102+
TH1I* fhITSNclB = nullptr;
103+
104+
TH1I* fhNClustersA = nullptr;
105+
TH2F* fhPhiYA = nullptr;
106+
TH2F* fhPtYA = nullptr;
107+
TH1F* fhChi2A = nullptr;
108+
TH1I* fhITSNclA = nullptr;
109+
110+
98111
TH2F* fhNSigmaTPC[kIdBfNoOfSpecies] = {nullptr};
99112
TH2F* fhNSigmaTOF[kIdBfNoOfSpecies] = {nullptr};
100113
TH2F* fhNSigmaCombo[kIdBfNoOfSpecies] = {nullptr};
@@ -122,8 +135,10 @@ TH1F* fhDCAxyB = nullptr;
122135
TH1F* fhDCAxyA = nullptr;
123136
TH1F* fhFineDCAxyA = nullptr;
124137
TH1F* fhDCAzB = nullptr;
138+
TH2F* fhDCAxyzB = nullptr;
125139
TH1F* fhDCAzA = nullptr;
126140
TH1F* fhFineDCAzA = nullptr;
141+
TH2F* fhDCAxyzA = nullptr;
127142

128143
TH1F* fhWrongTrackID = nullptr;
129144

@@ -149,6 +164,12 @@ TH1F* fhTruePtNegA[kIdBfNoOfSpecies + 1] = {nullptr};
149164
TH2F* fhTrueNPosNegA[kIdBfNoOfSpecies + 1] = {nullptr};
150165
TH1F* fhTrueDeltaNA[kIdBfNoOfSpecies + 1] = {nullptr};
151166

167+
TH2F* fhTruePhiYB = nullptr;
168+
TH2F* fhTruePtYB = nullptr;
169+
170+
TH2F* fhTruePhiYA = nullptr;
171+
TH2F* fhTruePtYA = nullptr;
172+
152173

153174
TH1F* fhTrueEtaB = nullptr;
154175
TH1F* fhTrueEtaA = nullptr;
@@ -161,6 +182,9 @@ TH1F* fhTrueDCAxyA = nullptr;
161182
TH1F* fhTrueDCAzB = nullptr;
162183
TH1F* fhTrueDCAxyBid = nullptr;
163184
TH1F* fhTrueDCAzA = nullptr;
185+
TH2F* fhTrueDCAxyzB = nullptr;
186+
TH2F* fhTrueDCAxyzA = nullptr;
187+
164188

165189
//============================================================================================
166190
// The IdentifiedBfFilter multiplicity counters
@@ -766,10 +790,24 @@ struct IdentifiedBfFilterTracks {
766790
fhPhiA = new TH1F("fHistPhiA", "#phi distribution for reconstructed;#phi;counts", 360, 0.0, constants::math::TwoPI);
767791
fhDCAxyB = new TH1F("DCAxyB", "DCA_{xy} distribution for reconstructed before;DCA_{xy} (cm);counts", 1000, -4.0, 4.0);
768792
fhDCAxyA = new TH1F("DCAxyA", "DCA_{xy} distribution for reconstructed;DCA_{xy} (cm);counts", 1000, -4., 4.0);
793+
fhDCAxyzB = new TH2F("DCAxyzB", "DCA_{xy} vs DCA_{z} distribution for reconstructed before;DCA_{xy} (cm); DCA_{z} (cm);counts", 1000, -4.0, 4.0, 1000, -4.0, 4.0);
769794
fhFineDCAxyA = new TH1F("FineDCAxyA", "DCA_{xy} distribution for reconstructed;DCA_{xy} (cm);counts", 4000, -1.0, 1.0);
770795
fhDCAzB = new TH1F("DCAzB", "DCA_{z} distribution for reconstructed before;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
771796
fhDCAzA = new TH1F("DCAzA", "DCA_{z} distribution for reconstructed;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
772797
fhFineDCAzA = new TH1F("FineDCAzA", "DCA_{z} distribution for reconstructed;DCA_{z} (cm);counts", 4000, -1.0, 1.0);
798+
fhDCAxyzA = new TH2F("DCAxyzA", "DCA_{xy} vs DCA_{z} distribution for reconstructed;DCA_{xy} (cm); DCA_{z} (cm);counts", 1000, -4.0, 4.0, 1000, -4.0, 4.0);
799+
800+
fhNClustersB = new TH1I("fHistNClB", "TPC NClusters distribution for reconstructed before;counts", 201, 0, 200);
801+
fhPhiYB = new TH2F("fHistPhiYB", "#phi vs #eta distribution for reconstructed before;#phi;#eta;counts", 360, 0.0, constants::math::TwoPI, 40, -2.0, 2.0);
802+
fhPtYB = new TH2F("fHistPtYB", "p_{T} vs #eta distribution for reconstructed before;p_{T} (GeV/c);#eta;counts", 100, 0.0, 15.0, 40, -2.0, 2.0);
803+
fhChi2B = new TH1F("fHistChi2B", "#chi^{2}/Ncl TPC distribution for reconstructed before;", 100, 0.0, 20.0);
804+
fhITSNclB = new TH1I("fHistITSNClB", "ITS NClusters distribution for reconstructed before;counts", 21, 0, 20);
805+
806+
fhNClustersA = new TH1I("fHistNClA", "TPC NClusters distribution for reconstructed after;counts", 201, 0, 200);
807+
fhPhiYA = new TH2F("fHistPhiYA", "#phi vs #eta distribution for reconstructed after;#phi;#eta;counts", 360, 0.0, constants::math::TwoPI, 40, -2.0, 2.0);
808+
fhPtYA = new TH2F("fHistPtYA", "p_{T} vs #eta distribution for reconstructed after;p_{T} (GeV/c);#eta;counts", 100, 0.0, 15.0, 40, -2.0, 2.0);
809+
fhChi2A = new TH1F("fHistChi2A", "#chi^{2}/Ncl TPC distribution for reconstructed after;", 100, 0.0, 20.0);
810+
fhITSNclA = new TH1I("fHistITSNClA", "ITS NClusters distribution for reconstructed after;counts", 21, 0, 20);
773811

774812
fhDoublePID = new TH2S("DoublePID", "PIDs for double match;Original Species;Secondary Species", kIdBfNoOfSpecies, 0, kIdBfNoOfSpecies, kIdBfNoOfSpecies, 0, kIdBfNoOfSpecies);
775813

@@ -839,6 +877,16 @@ struct IdentifiedBfFilterTracks {
839877
fOutputList->Add(fhYZB);
840878
fOutputList->Add(fhXYA);
841879
fOutputList->Add(fhYZA);
880+
fOutputList->Add(fhNClustersB);
881+
fOutputList->Add(fhNClustersA);
882+
fOutputList->Add(fhPhiYB);
883+
fOutputList->Add(fhPhiYA);
884+
fOutputList->Add(fhPtYB);
885+
fOutputList->Add(fhPtYA);
886+
fOutputList->Add(fhChi2B);
887+
fOutputList->Add(fhChi2A);
888+
fOutputList->Add(fhITSNclB);
889+
fOutputList->Add(fhITSNclA);
842890
fOutputList->Add(fhPB);
843891
fOutputList->Add(fhPtB);
844892
fOutputList->Add(fhPtPosB);
@@ -851,6 +899,8 @@ struct IdentifiedBfFilterTracks {
851899
fOutputList->Add(fhdEdxIPTPCB);
852900
fOutputList->Add(fhDCAxyB);
853901
fOutputList->Add(fhDCAxyA);
902+
fOutputList->Add(fhDCAxyzB);
903+
fOutputList->Add(fhDCAxyzA);
854904
fOutputList->Add(fhWrongTrackID);
855905
fOutputList->Add(fhDoublePID);
856906
fOutputList->Add(fhFineDCAxyA);
@@ -894,6 +944,13 @@ struct IdentifiedBfFilterTracks {
894944

895945
fhTruePB = new TH1F("fTrueHistPB", "p distribution before (truth);p (GeV/c);dN/dp (c/GeV)", 100, 0.0, 15.0);
896946
fhTrueCharge = new TH1F("fTrueHistCharge", "Charge distribution before (truth);charge;count", 3, -1.0, 1.0);
947+
948+
fhTruePhiYB = new TH2F("fTrueHistPhiYB", "#phi vs #eta distribution before (truth);#phi;#eta;counts", 360, 0.0, constants::math::TwoPI, 40, -2.0, 2.0);
949+
fhTruePtYB = new TH2F("fTrueHistPtYB", "p_{T} vs #eta distribution before (truth);p_{T} (GeV/c);#eta;counts", 100, 0.0, 15.0, 40, -2.0, 2.0);
950+
951+
fhTruePhiYA = new TH2F("fTrueHistPhiYA", "#phi vs #eta distribution after (truth);#phi;#eta;counts", 360, 0.0, constants::math::TwoPI, 40, -2.0, 2.0);
952+
fhTruePtYA = new TH2F("fTrueHistPtYA", "p_{T} vs #eta distribution after (truth);p_{T} (GeV/c);#eta;counts", 100, 0.0, 15.0, 40, -2.0, 2.0);
953+
897954
fhTruePtB = new TH1F("fTrueHistPtB", "p_{T} distribution before (truth);p_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0);
898955
fhTruePtPosB = new TH1F("fTrueHistPtPosB", "P_{T} distribution (#plus) before (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0);
899956
fhTruePtNegB = new TH1F("fTrueHistPtNegB", "P_{T} distribution (#minus) before (truth);P_{T} (GeV/c);dN/dP_{T} (c/GeV)", 100, 0.0, 15.0);
@@ -910,6 +967,8 @@ struct IdentifiedBfFilterTracks {
910967
fhTrueDCAxyA = new TH1F("TrueDCAxyA", "DCA_{xy} distribution for generated;DCA_{xy};counts (cm)", 1000, -4., 4.0);
911968
fhTrueDCAzB = new TH1F("TrueDCAzB", "DCA_{z} distribution for generated before;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
912969
fhTrueDCAzA = new TH1F("TrueDCAzA", "DCA_{z} distribution for generated;DCA_{z} (cm);counts", 1000, -4.0, 4.0);
970+
fhTrueDCAxyzB = new TH2F("TrueDCAxyzB", "DCA_{xy} vs DCA_{z} distribution for generated before;DCA_{xy} (cm);DCA_{z} (cm);counts", 1000, -4.0, 4.0,1000, -4.0, 4.0);
971+
fhTrueDCAxyzA = new TH2F("TrueDCAxyzA", "DCA_{xy} vs DCA_{z} distribution for generated after;DCA_{xy} (cm);DCA_{z} (cm);counts", 1000, -4.0, 4.0, 1000, -4.0, 4.0);
913972

914973
for (int sp = 0; sp < kIdBfNoOfSpecies + 1; ++sp) {
915974
fhTruePA[sp] = new TH1F(TString::Format("fTrueHistPA_%s", speciesName[sp]).Data(),
@@ -933,6 +992,10 @@ struct IdentifiedBfFilterTracks {
933992
}
934993

935994
/* add the hstograms to the output list */
995+
fOutputList->Add(fhTruePhiYB);
996+
fOutputList->Add(fhTruePtYB);
997+
fOutputList->Add(fhTruePhiYA);
998+
fOutputList->Add(fhTruePtYA);
936999
fOutputList->Add(fhTruePB);
9371000
fOutputList->Add(fhTruePtB);
9381001
fOutputList->Add(fhTruePtPosB);
@@ -949,6 +1012,9 @@ struct IdentifiedBfFilterTracks {
9491012
fOutputList->Add(fhTrueDCAxyA);
9501013
fOutputList->Add(fhTrueDCAzB);
9511014
fOutputList->Add(fhTrueDCAzA);
1015+
fOutputList->Add(fhTrueDCAxyzB);
1016+
fOutputList->Add(fhTrueDCAxyzA);
1017+
9521018

9531019
for (int sp = 0; sp < kIdBfNoOfSpecies + 1; ++sp) {
9541020
fOutputList->Add(fhTruePA[sp]);
@@ -1435,7 +1501,7 @@ inline int8_t IdentifiedBfFilterTracks::AcceptParticle(ParticleObject& particle,
14351501
}
14361502

14371503

1438-
if (particle.isPhysicalPrimary()) {
1504+
if (particle.isPhysicalPrimary() && fabs(charge)>0.0) {
14391505
if ((particle.mcCollisionId() == 0) && traceCollId0) {
14401506
LOGF(info, "Particle %d passed isPhysicalPrimary", particle.globalIndex());
14411507
}
@@ -1536,6 +1602,12 @@ void IdentifiedBfFilterTracks::fillTrackHistosBeforeSelection(TrackObject const&
15361602
{
15371603
fhXYB->Fill(track.x(),track.y());
15381604
fhYZB->Fill(track.y(),track.z());
1605+
fhNClustersB->Fill(track.tpcNClsFound());
1606+
fhPhiYB->Fill(track.phi(),track.eta());
1607+
fhPtYB->Fill(track.pt(),track.eta());
1608+
fhChi2B->Fill(track.tpcChi2NCl());
1609+
fhITSNclB->Fill(track.itsNCls());
1610+
15391611
fhPB->Fill(track.p());
15401612
fhPtB->Fill(track.pt());
15411613
fhEtaB->Fill(track.eta());
@@ -1554,6 +1626,7 @@ void IdentifiedBfFilterTracks::fillTrackHistosBeforeSelection(TrackObject const&
15541626
//fhDCAzB->Fill(dcaz);
15551627
fhDCAxyB->Fill(track.dcaXY());
15561628
fhDCAzB->Fill(track.dcaZ());
1629+
fhDCAxyzB->Fill(track.dcaXY(),track.dcaZ());
15571630
}
15581631

15591632
template <typename TrackObject, typename CollisionObject>
@@ -1565,12 +1638,18 @@ void IdentifiedBfFilterTracks::fillTrackHistosAfterSelection(TrackObject const&
15651638
fhPhiA->Fill(track.phi());
15661639
fhXYA->Fill(track.x(),track.y());
15671640
fhYZA->Fill(track.y(),track.z());
1641+
fhNClustersA->Fill(track.tpcNClsFound());
1642+
fhPhiYA->Fill(track.phi(),track.eta());
1643+
fhPtYA->Fill(track.pt(),track.eta());
1644+
fhChi2A->Fill(track.tpcChi2NCl());
1645+
fhITSNclA->Fill(track.itsNCls());
15681646
//float dcaxy = CalculateDCA(track, collision, 0);
15691647
//float dcaz = CalculateDCA(track, collision, 1);
15701648
//fhDCAxyA->Fill(dcaxy);
15711649
//fhDCAzA->Fill(dcaz);
15721650
fhDCAxyA->Fill(track.dcaXY());
15731651
fhDCAzA->Fill(track.dcaZ());
1652+
fhDCAxyzA->Fill(track.dcaXY(),track.dcaZ());
15741653

15751654
if (track.dcaXY() < 1.0) {
15761655
fhFineDCAxyA->Fill(track.dcaXY());
@@ -1593,6 +1672,8 @@ void IdentifiedBfFilterTracks::fillTrackHistosAfterSelection(TrackObject const&
15931672
template <typename ParticleObject, typename MCCollisionObject>
15941673
void IdentifiedBfFilterTracks::fillParticleHistosBeforeSelection(ParticleObject const& particle, MCCollisionObject const& collision, float charge)
15951674
{
1675+
fhTruePhiYB->Fill(particle.phi(),particle.eta());
1676+
fhTruePtYB->Fill(particle.pt(),particle.eta());
15961677
fhTruePB->Fill(particle.p());
15971678
fhTruePtB->Fill(particle.pt());
15981679
fhTrueEtaB->Fill(particle.eta());
@@ -1611,6 +1692,9 @@ void IdentifiedBfFilterTracks::fillParticleHistosBeforeSelection(ParticleObject
16111692

16121693
fhTrueDCAxyB->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
16131694
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())));
1695+
fhTrueDCAxyzB->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
1696+
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
1697+
(particle.vz() - collision.posZ()));
16141698
fhTrueDCAzB->Fill((particle.vz() - collision.posZ()));
16151699
}
16161700

@@ -1619,6 +1703,8 @@ void IdentifiedBfFilterTracks::fillParticleHistosAfterSelection(ParticleObject c
16191703
{
16201704
/* the charged species should have been called first so avoid double counting */
16211705
if (sp == kIdBfCharged) {
1706+
fhTruePhiYA->Fill(particle.phi(),particle.eta());
1707+
fhTruePtYA->Fill(particle.pt(),particle.eta());
16221708
fhTrueEtaA->Fill(particle.eta());
16231709
fhTruePhiA->Fill(particle.phi());
16241710
float dcaxy = TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
@@ -1632,6 +1718,9 @@ void IdentifiedBfFilterTracks::fillParticleHistosAfterSelection(ParticleObject c
16321718
fhTrueDCAxyA->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
16331719
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())));
16341720
fhTrueDCAzA->Fill((particle.vz() - collision.posZ()));
1721+
fhTrueDCAxyzA->Fill(TMath::Sqrt((particle.vx() - collision.posX()) * (particle.vx() - collision.posX()) +
1722+
(particle.vy() - collision.posY()) * (particle.vy() - collision.posY())),
1723+
(particle.vz() - collision.posZ()));
16351724
}
16361725
fhTruePA[sp]->Fill(particle.p());
16371726
fhTruePtA[sp]->Fill(particle.pt());

PWGCF/TwoParticleCorrelations/TableProducer/identifiedBfFilter.h

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -703,50 +703,6 @@ inline bool IsEvtSelected(CollisionObject const& collision, float& centormult)
703703
//////////////////////////////////////////////////////////////////////////////////
704704
/// Track selection
705705
//////////////////////////////////////////////////////////////////////////////////
706-
template <typename TrackObject, typename CollisionObject>
707-
float CalculateDCA(TrackObject const& track,CollisionObject const& collision, int vtx)
708-
{
709-
float dca;
710-
// propagate track to DCA to the vertex
711-
float sn, cs;
712-
auto alp = track.alpha();
713-
math_utils::detail::sincos<float>(alp, sn, cs);
714-
auto x = track.x(), y = track.y(), snp = track.snp(), csp = math_utils::detail::sqrt<float>((1.f - snp) * (1.f + snp));
715-
auto xv = collision.posX() * cs + collision.posX() * sn, yv = -collision.posX() * sn + collision.posY() * cs, zv = collision.posZ();
716-
717-
x -= xv;
718-
y -= yv;
719-
// Estimate the impact parameter neglecting the track curvature
720-
721-
auto crv = 0;
722-
auto tgfv = -(crv * x - snp) / (crv * y + csp);
723-
sn = tgfv / math_utils::detail::sqrt<float>(1.f + tgfv * tgfv);
724-
cs = math_utils::detail::sqrt<float>((1. - sn) * (1. + sn));
725-
cs = (math_utils::detail::abs<float>(tgfv) > o2::constants::math::Almost0) ? sn / tgfv : o2::constants::math::Almost1;
726-
727-
x = xv * cs + yv * sn;
728-
//yv = -xv * sn + yv * cs;
729-
xv = x;
730-
731-
math_utils::detail::sincos<float>(alp, sn, cs);
732-
733-
if(vtx == 0){
734-
if (fabs(track.x())>fabs(track.y())){
735-
dca = track.y() - yv;
736-
} else{
737-
dca = track.x() - xv;
738-
}
739-
if(dca>10.0){
740-
std::cout<<"Big dca: "<<dca<<std::endl;
741-
std::cout<<"x: "<<track.x()<<std::endl;
742-
std::cout<<"y: "<<track.y()<<std::endl;
743-
std::cout<<"yv: "<<yv<<std::endl;
744-
}
745-
} else if(vtx == 1){
746-
dca = track.z() - zv;
747-
}
748-
return dca;
749-
}
750706

751707
template <typename TrackObject, typename CollisionObject>
752708
inline bool matchTrackType(TrackObject const& track, CollisionObject const& collision)
@@ -757,8 +713,6 @@ inline bool matchTrackType(TrackObject const& track, CollisionObject const& coll
757713
for (auto filter : trackFilters) {
758714
if (filter->IsSelected(track)) {
759715
if (dca2Dcut) {
760-
//float dcaxy = CalculateDCA(track, collision, 0);
761-
//float dcaz = CalculateDCA(track, collision, 1);
762716
if (track.dcaXY() * track.dcaXY() / maxDCAxy / maxDCAxy + track.dcaZ() * track.dcaZ() / maxDCAz / maxDCAz > 1) {
763717
return false;
764718
} else {

0 commit comments

Comments
 (0)