Skip to content

Commit cdf3f68

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/master'
2 parents e33800b + 60ab221 commit cdf3f68

24 files changed

Lines changed: 1481 additions & 1180 deletions

File tree

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include <Framework/AnalysisHelpers.h>
4343
#include <Framework/AnalysisTask.h>
4444
#include <Framework/Configurable.h>
45+
#include <Framework/HistogramRegistry.h>
46+
#include <Framework/HistogramSpec.h>
4547
#include <Framework/InitContext.h>
4648
#include <Framework/runDataProcessing.h>
4749
#include <ReconstructionDataFormats/PID.h>
@@ -101,6 +103,10 @@ struct TreeWriterTpcV0 {
101103
Configurable<float> maxPt4dwnsmplTsalisProtons{"maxPt4dwnsmplTsalisProtons", 100., "Maximum Pt for applying downsampling factor of protons"};
102104
Configurable<float> maxPt4dwnsmplTsalisElectrons{"maxPt4dwnsmplTsalisElectrons", 100., "Maximum Pt for applying downsampling factor of electrons"};
103105
Configurable<float> maxPt4dwnsmplTsalisKaons{"maxPt4dwnsmplTsalisKaons", 100., "Maximum Pt for applying downsampling factor of kaons"};
106+
// Configurables for output tables reservation size
107+
Configurable<float> reserveV0Ratio{"reserveV0Ratio", 0.05, "Ratio of how many tracks from V0s are expected in the output table to the input V0 table size"};
108+
Configurable<float> reserveCascRatio{"reserveCascRatio", 0.0025, "Ratio of how many tracks from cascades are expected in the output table to the input Cascade table size"};
109+
Configurable<bool> saveReserveQaHisto{"saveReserveQaHisto", true, "Flag to save the DF-wise ratio of output table size to that of input table"};
104110
// Configurables for run condtion table
105111
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
106112
Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"};
@@ -109,6 +115,8 @@ struct TreeWriterTpcV0 {
109115
// Configurable for the path of CCDB General Run Parameters LHC Interface information
110116
Configurable<std::string> ccdbPathGrpLhcIf{"ccdbPathGrpLhcIf", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"};
111117

118+
HistogramRegistry registry{"registry", {}};
119+
112120
// an arbitrary value of N sigma TOF assigned by TOF task to tracks which are not matched to TOF hits
113121
constexpr static float NSigmaTofUnmatched{o2::aod::v0data::kNoTOFValue};
114122
const float nSigmaTofUnmatchedEqualityTolerance{std::fabs(NSigmaTofUnmatched) / 1e4f};
@@ -182,6 +190,11 @@ struct TreeWriterTpcV0 {
182190
ccdb->setFatalWhenNull(false);
183191

184192
rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad);
193+
194+
if (saveReserveQaHisto) {
195+
registry.add("hV0OutputRatio", "V0 out/in ratio;V0 out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveV0Ratio}}});
196+
registry.add("hCascOutputRatio", "Casc out/in ratio;Casc out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveCascRatio}}});
197+
}
185198
}
186199

187200
template <bool IsCorrectedDeDx, typename V0Casc, typename T>
@@ -422,6 +435,16 @@ struct TreeWriterTpcV0 {
422435
aod::pidits::ITSNSigmaEl, aod::pidits::ITSNSigmaPi,
423436
aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr>(myTracks);
424437

438+
int nV0Entries{0};
439+
int nCascEntries{0};
440+
441+
const int64_t expectedOutputTableSize = static_cast<int64_t>(reserveV0Ratio * myV0s.size() + reserveCascRatio * myCascs.size());
442+
if constexpr (ModeId == ModeWithdEdxTrkQA || ModeId == ModeStandard) {
443+
rowTPCTree.reserve(expectedOutputTableSize);
444+
} else {
445+
rowTPCTreeWithTrkQA.reserve(expectedOutputTableSize);
446+
}
447+
425448
std::string irSource{};
426449
float sqrtSNN{};
427450
bool isFirstCollision{true};
@@ -448,11 +471,9 @@ struct TreeWriterTpcV0 {
448471
if constexpr (ModeId == ModeWithdEdxTrkQA || ModeId == ModeStandard) {
449472
bcTimeFrameId = UndefValueInt;
450473
bcBcInTimeFrame = UndefValueInt;
451-
rowTPCTree.reserve(2 * v0s.size() + cascs.size());
452474
} else if constexpr (ModeId == ModeWithTrkQA) {
453475
bcTimeFrameId = bc.tfId();
454476
bcBcInTimeFrame = bc.bcInTF();
455-
rowTPCTreeWithTrkQA.reserve(2 * v0s.size() + cascs.size());
456477
}
457478

458479
auto getTrackQA = [&](const TrksType::iterator& track) {
@@ -488,7 +509,9 @@ struct TreeWriterTpcV0 {
488509
evaluateOccupancyVariables(dauTrack, occValues);
489510
}
490511
fillSkimmedV0Table<IsCorrectedDeDx, ModeId>(mother, dauTrack, trackQAInstance, existTrkQA, collision, daughter.tpcNSigma, daughter.tofNSigma, daughter.itsNSigma, daughter.tpcExpSignal, daughter.id, runnumber, daughter.dwnSmplFactor, hadronicRate, bcGlobalIndex, bcTimeFrameId, bcBcInTimeFrame, occValues, isGoodRctEvent);
512+
return true;
491513
}
514+
return false;
492515
};
493516

494517
/// Loop over v0 candidates
@@ -500,8 +523,12 @@ struct TreeWriterTpcV0 {
500523
const auto posTrack = v0.posTrack_as<TrksType>();
501524
const auto negTrack = v0.negTrack_as<TrksType>();
502525

503-
fillDaughterTrack(v0, posTrack, v0, true);
504-
fillDaughterTrack(v0, negTrack, v0, false);
526+
if (fillDaughterTrack(v0, posTrack, v0, true)) {
527+
++nV0Entries;
528+
}
529+
if (fillDaughterTrack(v0, negTrack, v0, false)) {
530+
++nV0Entries;
531+
}
505532
}
506533

507534
/// Loop over cascade candidates
@@ -513,9 +540,23 @@ struct TreeWriterTpcV0 {
513540
const auto bachTrack = casc.bachelor_as<TrksType>();
514541
// Omega and antiomega
515542
const auto isDaughterPositive = cascId == MotherAntiOmega ? true : false;
516-
fillDaughterTrack(casc, bachTrack, casc, isDaughterPositive);
543+
if (fillDaughterTrack(casc, bachTrack, casc, isDaughterPositive)) {
544+
++nCascEntries;
545+
}
517546
}
518547
}
548+
LOG(info) << "runV0() summary:";
549+
LOG(info) << "V0 table size = " << myV0s.size();
550+
LOG(info) << "Cascade table size = " << myCascs.size();
551+
LOG(info) << "nV0Entries = " << nV0Entries;
552+
LOG(info) << "nCascEntries = " << nCascEntries;
553+
LOG(info) << "nV0Entries / V0 table size = " << static_cast<double>(nV0Entries) / myV0s.size();
554+
LOG(info) << "nCascEntries / Cascade table size = " << static_cast<double>(nCascEntries) / myCascs.size();
555+
556+
if (saveReserveQaHisto) {
557+
registry.fill(HIST("hV0OutputRatio"), static_cast<double>(nV0Entries) / myV0s.size());
558+
registry.fill(HIST("hCascOutputRatio"), static_cast<double>(nCascEntries) / myCascs.size());
559+
}
519560
} /// runV0
520561

521562
void processStandard(Colls const& collisions,
@@ -637,6 +678,9 @@ struct TreeWriterTpcTof {
637678
Configurable<float> downsamplingTsalisProtons{"downsamplingTsalisProtons", -1., "Downsampling factor to reduce the number of protons"};
638679
Configurable<float> downsamplingTsalisKaons{"downsamplingTsalisKaons", -1., "Downsampling factor to reduce the number of kaons"};
639680
Configurable<float> downsamplingTsalisPions{"downsamplingTsalisPions", -1., "Downsampling factor to reduce the number of pions"};
681+
// Configurable for output table reservation size
682+
Configurable<float> reserveTrackRatio{"reserveTrackRatio", 0.003, "Ratio of how many tracks are expected in the output table to the input Tracks table size"};
683+
Configurable<bool> saveReserveQaHisto{"saveReserveQaHisto", true, "Flag to save the DF-wise ratio of output table size to that of input table"};
640684
// Configurables for run condtion table
641685
Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
642686
Configurable<bool> checkZdc{"checkZdc", false, "set ZDC flag for PbPb"};
@@ -645,6 +689,8 @@ struct TreeWriterTpcTof {
645689
// Configurable for the path of CCDB General Run Parameters LHC Interface information
646690
Configurable<std::string> ccdbPathGrpLhcIf{"ccdbPathGrpLhcIf", "GLO/Config/GRPLHCIF", "Path on the CCDB for the GRPLHCIF object"};
647691

692+
HistogramRegistry registry{"registry", {}};
693+
648694
struct TofTrack {
649695
bool isApplyHardCutOnly;
650696
double maxMomHardCutOnly;
@@ -699,6 +745,10 @@ struct TreeWriterTpcTof {
699745
ccdb->setFatalWhenNull(false);
700746

701747
rctChecker.init(rctLabel, checkZdc, treatLimitedAcceptanceAsBad);
748+
749+
if (saveReserveQaHisto) {
750+
registry.add("hTrackOutputRatio", "Track out/in ratio;Track out/in ratio;Entries", {HistType::kTH1F, {{100, 0, reserveTrackRatio}}});
751+
}
702752
}
703753

704754
template <bool DoCorrectDeDx, int ModeId, typename T, typename C>
@@ -810,6 +860,14 @@ struct TreeWriterTpcTof {
810860
labelTrack2TrackQA.at(trackId) = trackQA.globalIndex();
811861
}
812862
}
863+
864+
const int64_t expectedOutputTableSize = static_cast<int64_t>(reserveTrackRatio * myTracks.size());
865+
if constexpr (ModeId == ModeWithdEdxTrkQA || ModeId == ModeStandard) {
866+
rowTPCTOFTree.reserve(expectedOutputTableSize);
867+
} else {
868+
rowTPCTOFTreeWithTrkQA.reserve(expectedOutputTableSize);
869+
}
870+
813871
std::string irSource{};
814872
float sqrtSNN{};
815873
bool isFirstCollision{true};
@@ -843,11 +901,9 @@ struct TreeWriterTpcTof {
843901
if constexpr (ModeId == ModeStandard || ModeId == ModeWithdEdxTrkQA) {
844902
bcTimeFrameId = UndefValueInt;
845903
bcBcInTimeFrame = UndefValueInt;
846-
rowTPCTOFTree.reserve(tracks.size());
847904
} else {
848905
bcTimeFrameId = bc.tfId();
849906
bcBcInTimeFrame = bc.bcInTF();
850-
rowTPCTOFTreeWithTrkQA.reserve(tracks.size());
851907
}
852908
for (auto const& trk : tracksWithITSPid) {
853909
if (!isTrackSelected(trk, trackSelection)) {
@@ -889,6 +945,14 @@ struct TreeWriterTpcTof {
889945
}
890946
} /// Loop tracks
891947
}
948+
LOG(info) << "runTof() summary:";
949+
LOG(info) << "Track table size = " << myTracks.size();
950+
LOG(info) << "nTrackEntries = " << rowTPCTOFTree.lastIndex() + 1;
951+
LOG(info) << "nTrackEntries / Track table size = " << static_cast<double>((rowTPCTOFTree.lastIndex() + 1)) / myTracks.size();
952+
953+
if (saveReserveQaHisto) {
954+
registry.fill(HIST("hTrackOutputRatio"), static_cast<double>((rowTPCTOFTree.lastIndex() + 1)) / myTracks.size());
955+
}
892956
} /// runTof
893957

894958
void processStandard(Colls const& collisions,

PWGCF/EbyEFluctuations/Tasks/v0ptHadPiKaProt.cxx

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ struct V0ptHadPiKaProt {
379379
histos.add("h2DnsigmaPionTofVsPtAfterCut", "2D hist of nSigmaTOF vs. pT (pion)", kTH2F, {ptAxis, nSigmaAxis});
380380
histos.add("h2DnsigmaKaonTofVsPtAfterCut", "2D hist of nSigmaTOF vs. pT (kaon)", kTH2F, {ptAxis, nSigmaAxis});
381381
histos.add("h2DnsigmaProtonTofVsPtAfterCut", "2D hist of nSigmaTOF vs. pT (proton)", kTH2F, {ptAxis, nSigmaAxis});
382+
383+
histos.add("h2DnsigmaPionTpcVsTofInterimCut", "3D hist of nSigmaTPC vs. nSigmaTOF (pion)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
384+
histos.add("h2DnsigmaKaonTpcVsTofInterimCut", "3D hist of nSigmaTPC vs. nSigmaTOF (kaon)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
385+
histos.add("h2DnsigmaProtonTpcVsTofInterimCut", "3D hist of nSigmaTPC vs. nSigmaTOF (proton)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
386+
382387
histos.add("h2DnsigmaPionTpcVsTofAfterCut", "3D hist of nSigmaTPC vs. nSigmaTOF (pion)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
383388
histos.add("h2DnsigmaKaonTpcVsTofAfterCut", "3D hist of nSigmaTPC vs. nSigmaTOF (kaon)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
384389
histos.add("h2DnsigmaProtonTpcVsTofAfterCut", "3D hist of nSigmaTPC vs. nSigmaTOF (proton)", kTH3F, {ptAxis, nSigmaAxis, nSigmaAxis});
@@ -782,20 +787,11 @@ struct V0ptHadPiKaProt {
782787
}
783788

784789
if (candidate.pt() > cfgCutPtLower && candidate.pt() <= cfgCutPtUpperTPC) {
785-
int flagg1 = 0;
786-
if (candidate.tpcNSigmaPi() < cfgnSigmaOtherParticles)
787-
flagg1 += 1;
788-
if (candidate.tpcNSigmaKa() < cfgnSigmaOtherParticles)
789-
flagg1 += 1;
790-
if (candidate.tpcNSigmaPr() < cfgnSigmaOtherParticles)
791-
flagg1 += 1;
792-
if (candidate.tpcNSigmaEl() < cfgnSigmaOtherParticles)
793-
flagg1 += 1;
794-
795-
if (!(flagg1 > 1) && !candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPr) < cfgnSigmaCutTPC) {
790+
791+
if (!candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPr) < cfgnSigmaCutTPC) {
796792
flag = 1;
797793
}
798-
if (!(flagg1 > 1) && candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPr) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF) {
794+
if (candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPr) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF) {
799795
flag = 1;
800796
}
801797
}
@@ -826,6 +822,8 @@ struct V0ptHadPiKaProt {
826822
}
827823

828824
if (!(flag2 > 1) && passDominance) {
825+
histos.fill(HIST("h2DnsigmaKaonTpcVsTofInterimCut"), candidate.pt(), candidate.tpcNSigmaPr(), candidate.tofNSigmaPr());
826+
829827
if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) {
830828
flag = 1;
831829
}
@@ -860,20 +858,10 @@ struct V0ptHadPiKaProt {
860858

861859
if (candidate.pt() > cfgCutPtLower && candidate.pt() <= cfgCutPtUpperTPC) {
862860

863-
int flagg1 = 0;
864-
if (candidate.tpcNSigmaPi() < cfgnSigmaOtherParticles)
865-
flagg1 += 1;
866-
if (candidate.tpcNSigmaKa() < cfgnSigmaOtherParticles)
867-
flagg1 += 1;
868-
if (candidate.tpcNSigmaPr() < cfgnSigmaOtherParticles)
869-
flagg1 += 1;
870-
if (candidate.tpcNSigmaEl() < cfgnSigmaOtherParticles)
871-
flagg1 += 1;
872-
873-
if (!(flagg1 > 1) && !candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPi) < cfgnSigmaCutTPC) {
861+
if (!candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPi) < cfgnSigmaCutTPC) {
874862
flag = 1;
875863
}
876-
if (!(flagg1 > 1) && candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPi) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOF) {
864+
if (candidate.hasTOF() && std::abs(partNsigmaTpcOrItsPi) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPi()) < cfgnSigmaCutTOF) {
877865
flag = 1;
878866
}
879867
}
@@ -904,6 +892,7 @@ struct V0ptHadPiKaProt {
904892
}
905893

906894
if (!(flag2 > 1) && passDominance) {
895+
histos.fill(HIST("h2DnsigmaKaonTpcVsTofInterimCut"), candidate.pt(), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi());
907896
if (combNSigmaPi < cfgnSigmaCutCombTPCTOF) {
908897
flag = 1;
909898
}
@@ -938,20 +927,10 @@ struct V0ptHadPiKaProt {
938927

939928
if (candidate.pt() > cfgCutPtLower && candidate.pt() <= cfgCutPtUpperTPC) {
940929

941-
int flagg1 = 0;
942-
if (candidate.tpcNSigmaPi() < cfgnSigmaOtherParticles)
943-
flagg1 += 1;
944-
if (candidate.tpcNSigmaKa() < cfgnSigmaOtherParticles)
945-
flagg1 += 1;
946-
if (candidate.tpcNSigmaPr() < cfgnSigmaOtherParticles)
947-
flagg1 += 1;
948-
if (candidate.tpcNSigmaEl() < cfgnSigmaOtherParticles)
949-
flagg1 += 1;
950-
951-
if (!(flagg1 > 1) && !candidate.hasTOF() && std::abs(partNsigmaTpcOrItsKa) < cfgnSigmaCutTPC) {
930+
if (!candidate.hasTOF() && std::abs(partNsigmaTpcOrItsKa) < cfgnSigmaCutTPC) {
952931
flag = 1;
953932
}
954-
if (!(flagg1 > 1) && candidate.hasTOF() && std::abs(partNsigmaTpcOrItsKa) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOF) {
933+
if (candidate.hasTOF() && std::abs(partNsigmaTpcOrItsKa) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaKa()) < cfgnSigmaCutTOF) {
955934
flag = 1;
956935
}
957936
}
@@ -982,6 +961,7 @@ struct V0ptHadPiKaProt {
982961
}
983962

984963
if (!(flag2 > 1) && passDominance) {
964+
histos.fill(HIST("h2DnsigmaKaonTpcVsTofInterimCut"), candidate.pt(), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa());
985965
if (combNSigmaKa < cfgnSigmaCutCombTPCTOF) {
986966
flag = 1;
987967
}

PWGCF/MultiparticleCorrelations/Tasks/multiharmonicCorrelations.cxx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <TCollection.h>
2828
#include <TComplex.h>
29+
#include <TF1.h>
2930
#include <TFile.h>
3031
#include <TGrid.h>
3132
#include <TH1.h>
@@ -114,6 +115,7 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
114115
Configurable<bool> cfQA{"cfQA", true, "quality assurance"};
115116
Configurable<bool> cfInitsim{"cfInitsim", false, "init histograms of sim"};
116117
Configurable<bool> cfUseWeights{"cfUseWeights", true, "use weights"};
118+
Configurable<bool> cfToyModel{"cfToyModel", true, "phi-distribution from toy model"};
117119

118120
Configurable<std::vector<float>> cfVertexZ{"cfVertexZ", {-10, 10.}, "vertex z position range: {min, max}[cm], with convention: min <= Vz < max"};
119121
Configurable<std::vector<float>> cfPt{"cfPt", {0.2, 5.0}, "transverse momentum range"};
@@ -399,6 +401,16 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
399401
return four;
400402
} // TComplex Four(Int_t n1, Int_t n2, Int_t n3, Int_t n4)
401403

404+
static double pdf(double* x, double* par)
405+
{
406+
double y = 1;
407+
int harm = 6;
408+
for (int i = 0; i < harm; i = i + 1) {
409+
y = y + 2 * (0.04 + (i + 1.) * 0.01) * TMath::Cos((i + 1) * (x[0] - par[0]));
410+
}
411+
return y;
412+
}
413+
402414
template <eRecSim rs, typename T1, typename T2>
403415
void Steer(T1 const& collision, T2 const& tracks)
404416
{
@@ -412,6 +424,8 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
412424
auto it = phih.histMap.find(currentRun);
413425
auto histweight = wh.weightsmap.find(currentRun);
414426
float centr = 0, M = 0., msel = 0.;
427+
TF1* f = new TF1("f", pdf, 0, TMath::TwoPi(), 1);
428+
f->SetParameters(0.);
415429

416430
if constexpr (rs == eRec || rs == eRecAndSim) {
417431
if (cfCent.value == "FT0C")
@@ -511,6 +525,9 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
511525
event.fEventHistograms[ePt][eRec][1]->Fill(ptrec);
512526

513527
phi = track.phi();
528+
if (cfToyModel) {
529+
phi = f->GetRandom();
530+
}
514531
if (it != phih.histMap.end()) {
515532
it->second->Fill(phi);
516533
}
@@ -674,8 +691,8 @@ struct MultiharmonicCorrelations { // this name is used in lower-case format to
674691
float maxdcaxy = l_dcaxy_bins[2];
675692
float mindcaz = l_dcaz_bins[1];
676693
float maxdcaz = l_dcaz_bins[2];
677-
float maxncontr = l_ncontr_bins[1];
678-
float minncontr = l_ncontr_bins[2];
694+
float minncontr = l_ncontr_bins[1];
695+
float maxncontr = l_ncontr_bins[2];
679696

680697
const char* cevent[] = {"vertexZ", "Pt"};
681698
const char* cpro[] = {"rec", "sim"};

0 commit comments

Comments
 (0)