Skip to content

Commit e31d90a

Browse files
authored
Add files via upload
1 parent dc840db commit e31d90a

File tree

1 file changed

+57
-14
lines changed

1 file changed

+57
-14
lines changed

PWGDQ/Tasks/dqEfficiency_withAssoc.cxx

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1721,10 +1721,10 @@ struct AnalysisSameEventPairing {
17211721
template <bool TTwoProngFitter, int TPairType, uint32_t TEventFillMap, uint32_t TTrackFillMap, typename TEvents, typename TTrackAssocs, typename TTracks>
17221722
void runSameEventPairing(TEvents const& events, Preslice<TTrackAssocs>& preslice, TTrackAssocs const& assocs, TTracks const& /*tracks*/, ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& /*mcTracks*/)
17231723
{
1724-
// if (events.size() == 0) {
1725-
// LOG(warning) << "No events in this TF, going to the next one ...";
1726-
// return;
1727-
// }
1724+
if (events.size() == 0) {
1725+
LOG(warning) << "No events in this TF, going to the next one ...";
1726+
return;
1727+
}
17281728
if (fCurrentRun != events.begin().runNumber()) {
17291729
initParamsFromCCDB(events.begin().timestamp(), TTwoProngFitter);
17301730
fCurrentRun = events.begin().runNumber();
@@ -3452,9 +3452,15 @@ struct AnalysisDileptonTrack {
34523452
Configurable<std::string> fConfigTrackCuts{"cfgTrackCuts", "kaonPID", "Comma separated list of track cuts to be correlated with the dileptons"};
34533453
Configurable<float> fConfigDileptonLowMass{"cfgDileptonLowMass", 2.8, "Low mass cut for the dileptons used in analysis"};
34543454
Configurable<float> fConfigDileptonHighMass{"cfgDileptonHighMass", 3.2, "High mass cut for the dileptons used in analysis"};
3455-
Configurable<float> fConfigDileptonpTCut{"cfgDileptonpTCut", 0.0, "pT cut for dileptons used in the triplet vertexing"};
3455+
Configurable<float> fConfigDileptonLowpTCut{"cfgDileptonLowpTCut", 0.0, "Low pT cut for dileptons used in the triplet vertexing"};
3456+
Configurable<float> fConfigDileptonHighpTCut{"cfgDileptonHighpTCut", 1E5, "High pT cut for dileptons used in the triplet vertexing"};
3457+
Configurable<float> fConfigDileptonRapCutAbs{"cfgDileptonRapCutAbs", 1.0, "Rap cut for dileptons used in the triplet vertexing"};
34563458
Configurable<float> fConfigDileptonLxyCut{"cfgDileptonLxyCut", 0.0, "Lxy cut for dileptons used in the triplet vertexing"};
34573459
Configurable<bool> fConfigUseKFVertexing{"cfgUseKFVertexing", false, "Use KF Particle for secondary vertex reconstruction (DCAFitter is used by default)"};
3460+
Configurable<bool> fConfigUseMCGenpTcut{"cfgUseMCGenpTcut", false, "Use pT cut for dileptons used in the triplet vertexing(generated)"};
3461+
Configurable<bool> fConfigUseMCRapcut{"cfgUseMCRapcut", false, "Use Rap cut for dileptons used in the triplet vertexing(generated and reconstructed)"};
3462+
Configurable<bool> fConfigCaculateEC{"cfgCaculateEC", false, "the switch for caculate the energy correlators"};
3463+
Configurable<bool> fConfigCaculateRE{"cfgCaculateRE", true, "the switch for caculate the RE"};
34583464

34593465
Configurable<std::string> fConfigHistogramSubgroups{"cfgDileptonTrackHistogramsSubgroups", "invmass,vertexing", "Comma separated list of dilepton-track histogram subgroups"};
34603466
Configurable<std::string> fConfigAddJSONHistograms{"cfgAddJSONHistograms", "", "Histograms in JSON format"};
@@ -3497,14 +3503,16 @@ struct AnalysisDileptonTrack {
34973503

34983504
// TODO: The filter expressions seem to always use the default value of configurables, not the values from the actual configuration file
34993505
Filter eventFilter = aod::dqanalysisflags::isEventSelected > static_cast<uint32_t>(0);
3500-
Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonpTCut&& aod::reducedpair::mass > fConfigDileptonLowMass&& aod::reducedpair::mass<fConfigDileptonHighMass && aod::reducedpair::sign == 0 && aod::reducedpair::lxy> fConfigDileptonLxyCut;
3506+
Filter dileptonFilter = aod::reducedpair::pt > fConfigDileptonLowpTCut&& aod::reducedpair::pt<fConfigDileptonHighpTCut && aod::reducedpair::mass> fConfigDileptonLowMass&& aod::reducedpair::mass<fConfigDileptonHighMass && aod::reducedpair::sign == 0 && aod::reducedpair::lxy> fConfigDileptonLxyCut;
35013507
Filter filterBarrel = aod::dqanalysisflags::isBarrelSelected > static_cast<uint32_t>(0);
35023508
Filter filterMuon = aod::dqanalysisflags::isMuonSelected > static_cast<uint32_t>(0);
35033509

35043510
constexpr static uint32_t fgDileptonFillMap = VarManager::ObjTypes::ReducedTrack | VarManager::ObjTypes::Pair; // fill map
35053511

35063512
// use two values array to avoid mixing up the quantities
35073513
float* fValuesDilepton;
3514+
float* fValuesSignal;
3515+
float* fValuesEC;
35083516
float* fValuesHadron;
35093517
HistogramManager* fHistMan;
35103518

@@ -3540,6 +3548,9 @@ struct AnalysisDileptonTrack {
35403548

35413549
fValuesDilepton = new float[VarManager::kNVars];
35423550
fValuesHadron = new float[VarManager::kNVars];
3551+
fValuesSignal = new float[VarManager::kNVars];
3552+
fValuesEC = new float[VarManager::kNVars];
3553+
35433554
fTrackCutBitMap = 0;
35443555
VarManager::SetDefaultVarNames();
35453556
fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars);
@@ -3799,9 +3810,11 @@ struct AnalysisDileptonTrack {
37993810
DefineHistograms(fHistMan, Form("MCTruthGen_%s", sig->GetName()), "");
38003811
DefineHistograms(fHistMan, Form("MCTruthGenSel_%s", sig->GetName()), "");
38013812
}
3802-
for (auto& sig : fRecMCSignals) {
3803-
DefineHistograms(fHistMan, Form("MCTruthGenSelBR_%s", sig->GetName()), "");
3804-
DefineHistograms(fHistMan, Form("MCTruthGenSelBRAccepted_%s", sig->GetName()), "");
3813+
if (fConfigCaculateRE) {
3814+
for (auto& sig : fRecMCSignals) {
3815+
DefineHistograms(fHistMan, Form("MCTruthGenSelBR_%s", sig->GetName()), "");
3816+
DefineHistograms(fHistMan, Form("MCTruthGenSelBRAccepted_%s", sig->GetName()), "");
3817+
}
38053818
}
38063819
}
38073820

@@ -3866,6 +3879,11 @@ struct AnalysisDileptonTrack {
38663879
continue;
38673880
}
38683881

3882+
// dilepton rap cut
3883+
float rap = dilepton.rap();
3884+
if (fConfigUseMCRapcut && abs(rap) > fConfigDileptonRapCutAbs)
3885+
continue;
3886+
38693887
VarManager::FillTrack<fgDileptonFillMap>(dilepton, fValuesDilepton);
38703888

38713889
// fill selected dilepton histograms for each specified selection
@@ -4185,6 +4203,8 @@ struct AnalysisDileptonTrack {
41854203
void processMCGenWithEventSelection(soa::Filtered<MyEventsVtxCovSelected> const& events,
41864204
ReducedMCEvents const& /*mcEvents*/, ReducedMCTracks const& mcTracks)
41874205
{
4206+
VarManager::ResetValues(0, VarManager::kNVars, fValuesSignal);
4207+
VarManager::ResetValues(0, VarManager::kNVars, fValuesEC);
41884208
for (auto& event : events) {
41894209
if (!event.isEventSelected_bit(0)) {
41904210
continue;
@@ -4196,17 +4216,39 @@ struct AnalysisDileptonTrack {
41964216
auto groupedMCTracks = mcTracks.sliceBy(perReducedMcEvent, event.reducedMCeventId());
41974217
groupedMCTracks.bindInternalIndicesTo(&mcTracks);
41984218
for (auto& track : groupedMCTracks) {
4199-
4200-
VarManager::FillTrackMC(mcTracks, track);
4201-
4202-
auto track_raw = groupedMCTracks.rawIteratorAt(track.globalIndex());
4219+
auto track_raw = mcTracks.rawIteratorAt(track.globalIndex());
4220+
// apply kinematic cuts for signal
4221+
if (fConfigUseMCGenpTcut && (track_raw.pt() < fConfigDileptonLowpTCut || track_raw.pt() > fConfigDileptonHighpTCut))
4222+
continue;
4223+
if (fConfigUseMCRapcut && abs(track_raw.y()) > fConfigDileptonRapCutAbs)
4224+
continue;
4225+
VarManager::FillTrackMC(mcTracks, track_raw, fValuesSignal);
42034226
for (auto& sig : fGenMCSignals) {
42044227
if (sig->CheckSignal(true, track_raw)) {
4205-
fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), VarManager::fgValues);
4228+
fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), fValuesSignal);
4229+
}
4230+
}
4231+
// for the energy correlators
4232+
if (!fConfigCaculateEC)
4233+
continue;
4234+
for (auto& mctrack1 : groupedMCTracks) {
4235+
if (TMath::Abs(mctrack1.pdgCode()) == 443 || TMath::Abs(mctrack1.pdgCode()) == 11 || TMath::Abs(mctrack1.pdgCode()) == 22)
4236+
continue;
4237+
if (mctrack1.pt() < fConfigMCGenHadronPtMin.value || std::abs(mctrack1.eta()) > fConfigMCGenHadronEtaAbs.value)
4238+
continue;
4239+
if (mctrack1.getGenStatusCode() <= 0)
4240+
continue;
4241+
for (auto& sig : fGenMCSignals) {
4242+
VarManager::FillEnergyCorrelators(track_raw, mctrack1, fValuesEC);
4243+
if (sig->CheckSignal(true, track_raw)) {
4244+
fHistMan->FillHistClass(Form("MCTruthGenSel_%s", sig->GetName()), fValuesEC);
4245+
}
42064246
}
42074247
}
42084248
}
42094249

4250+
if (!fConfigCaculateRE)
4251+
continue;
42104252
// make a list of all MC tracks in the MC collision corresponding to the current reconstructed event
42114253
std::vector<size_t> mcTrackIndices;
42124254
for (auto& t : groupedMCTracks) {
@@ -4334,6 +4376,7 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char
43344376

43354377
if (classStr.Contains("MCTruthGen")) {
43364378
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_track");
4379+
dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "energy_correlator_gen");
43374380
}
43384381

43394382
if (classStr.Contains("DileptonsSelected")) {

0 commit comments

Comments
 (0)