Skip to content

Commit 3ade723

Browse files
authored
Add files via upload
1 parent cff795b commit 3ade723

2 files changed

Lines changed: 44 additions & 6 deletions

File tree

‎PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ struct AnalysisEnergyCorrelator {
116116
Configurable<float> fConfigJpsiPtMin{"cfgJpsiPtMin", 0.0, "J/psi pt minimum"};
117117
Configurable<float> fConfigJpsiPtMax{"cfgJpsiPtMax", 100.0, "J/psi pt maximum"};
118118
Configurable<float> fConfigJpsiRapMax{"cfgJpsiRapMax", 0.9, "J/psi rapidity maximum"};
119+
Configurable<float> fConfigJpsiTauxyMin{"cfgJpsiTauxyMin", -10000, "J/psi tauxy minimum"};
120+
Configurable<float> fConfigJpsiTauxyMax{"cfgJpsiTauxyMax", 10000.0, "J/psi tauxy maximum"};
119121
Configurable<std::string> fConfigAddSEPHistogram{"cfgAddSEPHistogram", "", "Comma separated list of histograms"};
120122
Configurable<std::string> recSignals{"cfgMCRecSignals", "eeFromJpsi", "Comma separated list of MC signals (reconstructed)"};
121123
Configurable<std::string> recSignalsJSON{"cfgMCRecSignalsJSON", "", "Comma separated list of MC signals (reconstructed) via JSON"};
@@ -627,8 +629,8 @@ struct AnalysisEnergyCorrelator {
627629
}
628630

629631
// Template function to run same event pairing (barrel-barrel, muon-muon, barrel-muon)
630-
template <uint32_t TTrackFillMap, int TPairType, typename TTrack1, typename TTrack2>
631-
void runSameEventPairing(TTrack1 const& t1, TTrack2 const& t2, int iEleCut, aod::McParticles const& /*mcParticles*/)
632+
template <uint32_t TTrackFillMap, int TPairType, typename TTrack1, typename TTrack2, typename TEvent>
633+
void runSameEventPairing(TTrack1 const& t1, TTrack2 const& t2, int iEleCut, TEvent const& event, aod::McParticles const& /*mcParticles*/)
632634
{
633635
std::map<int, std::vector<TString>> histNames = fTrackHistNames;
634636
std::map<int, std::vector<TString>> histNamesMC = fBarrelHistNamesMCmatched;
@@ -647,6 +649,7 @@ struct AnalysisEnergyCorrelator {
647649
} // end loop over MC signals
648650

649651
VarManager::FillPair<TPairType, TTrackFillMap>(t1, t2);
652+
VarManager::FillPairVertexing<TPairType, gkEventFillMapWithMults, TTrackFillMap>(event, t1, t2, false, VarManager::fgValues);
650653

651654
if (sign1 * sign2 < 0) { // +- pairs
652655
fHistMan->FillHistClass(histNames[iEleCut][0].Data(), VarManager::fgValues); // reconstructed, unmatched
@@ -802,18 +805,20 @@ struct AnalysisEnergyCorrelator {
802805
// Fill pair histograms for all cuts that both tracks pass
803806
for (size_t iCut = 0; iCut < fTrackCuts.size(); iCut++) {
804807
if (twoTrackFilter & (static_cast<uint32_t>(1) << iCut)) {
805-
runSameEventPairing<gkTrackFillMapWithCov, VarManager::kDecayToEE>(t1, t2, iCut, mcParticles);
808+
runSameEventPairing<gkTrackFillMapWithCov, VarManager::kDecayToEE>(t1, t2, iCut, event, mcParticles);
806809
}
807810
}
808811

809812
float mass = VarManager::fgValues[VarManager::kMass];
810813
float pt = VarManager::fgValues[VarManager::kPt];
811814
float rap = VarManager::fgValues[VarManager::kRap];
815+
float tauxy = VarManager::fgValues[VarManager::kVertexingTauxyProjectedPoleJPsiMass];
812816

813817
// Apply J/psi cuts
814818
if (mass < fConfigPairOptions.fConfigJpsiMassMin.value || mass > fConfigPairOptions.fConfigJpsiMassMax.value ||
815819
pt < fConfigPairOptions.fConfigJpsiPtMin.value || pt > fConfigPairOptions.fConfigJpsiPtMax.value ||
816-
std::abs(rap) > fConfigPairOptions.fConfigJpsiRapMax.value) {
820+
std::abs(rap) > fConfigPairOptions.fConfigJpsiRapMax.value ||
821+
tauxy < fConfigPairOptions.fConfigJpsiTauxyMin.value || tauxy > fConfigPairOptions.fConfigJpsiTauxyMax.value) {
817822
continue;
818823
}
819824

@@ -928,13 +933,17 @@ struct AnalysisEnergyCorrelator {
928933
}
929934
// Fill pair variables for cut
930935
VarManager::FillPair<VarManager::kDecayToEE, gkTrackFillMapWithCov>(t1, t2, VarManager::fgValues);
936+
VarManager::FillPairVertexing<VarManager::kDecayToEE, gkEventFillMapWithMults, gkTrackFillMapWithCov>(event1, t1, t2, false, VarManager::fgValues);
931937
float mass = VarManager::fgValues[VarManager::kMass];
932938
float pt = VarManager::fgValues[VarManager::kPt];
933939
float rap = VarManager::fgValues[VarManager::kRap];
940+
float tauxy = VarManager::fgValues[VarManager::kVertexingTauxyProjectedPoleJPsiMass];
941+
934942
// Apply J/psi cuts
935943
if (mass < fConfigPairOptions.fConfigJpsiMassMin.value || mass > fConfigPairOptions.fConfigJpsiMassMax.value ||
936944
pt < fConfigPairOptions.fConfigJpsiPtMin.value || pt > fConfigPairOptions.fConfigJpsiPtMax.value ||
937-
std::abs(rap) > fConfigPairOptions.fConfigJpsiRapMax.value) {
945+
std::abs(rap) > fConfigPairOptions.fConfigJpsiRapMax.value ||
946+
tauxy < fConfigPairOptions.fConfigJpsiTauxyMin.value || tauxy > fConfigPairOptions.fConfigJpsiTauxyMax.value) {
938947
continue;
939948
}
940949
if (t1.sign() * t2.sign() >= 0) {

‎PWGDQ/Tasks/tableReader_withAssoc.h‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4133,7 +4133,7 @@ struct AnalysisDileptonTrack {
41334133
o2::framework::Configurable<bool> fConfigApplyMassEC{"cfgApplyMassEC", false, "Apply fit mass for sideband for the energy correlator study"};
41344134
o2::framework::Configurable<std::vector<float>> fConfigFitmassEC{"cfgTFitmassEC", std::vector<float>{-0.541438, 2.8, 3.2}, "parameter from the fit fuction and fit range"};
41354135
o2::framework::Configurable<std::vector<float>> fConfigTransRange{"cfgTransRange", std::vector<float>{0.333333, 0.666667}, "Transverse region for the energy correlstor analysis"};
4136-
4136+
o2::framework::Configurable<int> fConfigbootstrapRN{"cfgBootstrapRN", -1, "Number of bootstrap samples for the energy correlator study"};
41374137
o2::framework::Configurable<bool> fConfigApplyEfficiency{"cfgApplyEfficiency", false, "If true, apply efficiency correction for the energy correlator study"};
41384138
o2::framework::Configurable<bool> fConfigApplyEfficiencyME{"cfgApplyEfficiencyME", false, "If true, apply efficiency correction for the energy correlator study"};
41394139
o2::framework::Configurable<std::string> fConfigAccCCDBPath{"AccCCDBPath", "Users/y/yalin/pptest/test2", "Path of the efficiency corrections"};
@@ -4176,6 +4176,9 @@ struct AnalysisDileptonTrack {
41764176
TH2F* hEfficiency_dilepton = nullptr;
41774177
TH2F* hEfficiency_hadron = nullptr;
41784178
TH1F* hMasswindow = nullptr;
4179+
TRandom3 fRndm{0};
4180+
using BootstrapEventKey = std::pair<uint64_t, uint64_t>;
4181+
std::map<BootstrapEventKey, int> fBootstrapSampleMap;
41794182

41804183
void init(o2::framework::InitContext& context)
41814184
{
@@ -4459,6 +4462,24 @@ struct AnalysisDileptonTrack {
44594462
return hEff->Interpolate(safeX, safeY);
44604463
}
44614464

4465+
template <typename TEvent>
4466+
int getBootstrapSample(TEvent const& event)
4467+
{
4468+
const BootstrapEventKey key{
4469+
static_cast<uint64_t>(event.timestamp()),
4470+
static_cast<uint64_t>(event.globalIndex())};
4471+
4472+
if (auto it = fBootstrapSampleMap.find(key);
4473+
it != fBootstrapSampleMap.end()) {
4474+
return it->second;
4475+
}
4476+
4477+
const int sample = static_cast<int>(fRndm.Rndm() * fConfigbootstrapRN.value);
4478+
fBootstrapSampleMap.emplace(key, sample);
4479+
4480+
return sample;
4481+
}
4482+
44624483
// Template function to run pair - hadron combinations
44634484
template <int TCandidateType, uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvent, typename TTracks, typename TTrackAssocs, typename TDileptons>
44644485
void runDileptonHadron(TEvent const& event, TTrackAssocs const& assocs, TTracks const& tracks, TDileptons const& dileptons)
@@ -4468,6 +4489,10 @@ struct AnalysisDileptonTrack {
44684489
VarManager::FillEvent<TEventFillMap>(event, fValuesHadron);
44694490
VarManager::FillEvent<TEventFillMap>(event, fValuesDilepton);
44704491

4492+
if (fConfigbootstrapRN.value > 0) {
4493+
const int bootstrapSample = getBootstrapSample(event);
4494+
fValuesHadron[VarManager::kECBootstrapSample] = bootstrapSample;
4495+
}
44714496
for (auto const& dilepton : dileptons) {
44724497
// get full track info of tracks based on the index
44734498
auto lepton1 = tracks.rawIteratorAt(dilepton.index0Id());
@@ -4740,6 +4765,10 @@ struct AnalysisDileptonTrack {
47404765
auto evAssocs = assocs.sliceBy(trackAssocsPerCollision, event2.globalIndex());
47414766
evAssocs.bindExternalIndices(&events);
47424767

4768+
if (fConfigbootstrapRN.value > 0) {
4769+
const int bootstrapSample = getBootstrapSample(event1);
4770+
dqtablereader_helpers::varValues()[VarManager::kECBootstrapSample] = bootstrapSample;
4771+
}
47434772
// loop over associations
47444773
for (auto const& assoc : evAssocs) {
47454774

0 commit comments

Comments
 (0)