Skip to content

Commit a730f52

Browse files
author
jimun_lee
committed
[PWGLF] Added the event selection of KstarInOO.cxx
1 parent bbe272a commit a730f52

1 file changed

Lines changed: 28 additions & 21 deletions

File tree

PWGLF/Tasks/Resonances/kstarInOO.cxx

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <Framework/OutputObjHeader.h>
3535
#include <Framework/runDataProcessing.h>
3636

37-
#include "TRandom.h"
3837
#include <TLorentzVector.h>
3938
#include <TMath.h>
4039
#include <TMathBase.h>
@@ -102,16 +101,17 @@ struct kstarInOO {
102101
Configurable<int> cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"};
103102

104103
// Mixing
105-
ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
106-
ConfigurableAxis cfg_bins_MixMult{"cfg_bins_MixMult", {VARIABLE_WIDTH, 0.0f, 1.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f}, "Mixing bins - z-vertex"};
107-
Configurable<int> cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 5, "Number of mixed events per event"};
104+
ConfigurableAxis cfg_bins_MixMult{"cfg_bins_Cent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"};
105+
ConfigurableAxis cfg_bins_MixVtx{"cfg_bins_MixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"};
106+
Configurable<int> cfg_Mix_NMixedEvents{"cfg_Mix_NMixedEvents", 10, "Number of mixed events per event"};
108107

109108
// Pair
110109
Configurable<int> cfg_MinvNBins{"cfg_MinvNBins", 300, "Number of bins for Minv axis"};
111110
Configurable<float> cfg_MinvMin{"cfg_MinvMin", 0.60, "Minimum Minv value"};
112111
Configurable<float> cfg_MinvMax{"cfg_MinvMax", 1.20, "Maximum Minv value"};
113112

114113
// Histogram
114+
Configurable<bool> cfg_Event_CutQA{"cfg_Event_CutsQA", false, "Enable Event QA Hists"};
115115
Configurable<bool> cfg_Track_CutQA{"cfg_Track_CutQA", false, "Enable Track QA Hists"};
116116

117117
// std::vector<int> eventSelectionBits;
@@ -125,6 +125,12 @@ struct kstarInOO {
125125
const AxisSpec PIDAxis = {120, -6, 6};
126126
const AxisSpec MinvAxis = {cfg_MinvNBins, cfg_MinvMin, cfg_MinvMax};
127127

128+
if (cfg_Event_CutQA){
129+
OOhistos.add("hPosZ_BC", "PosZ_Bc", kTH1F, {{100, 0.0, 15.0}});
130+
OOhistos.add("hPosZ_AC", "PosZ_AC", kTH1F, {{100, 0.0, 15.0}});
131+
}
132+
133+
128134
if (cfg_Track_CutQA) {
129135
OOhistos.add("h_rawpT", "h_rawpT", kTH1F, {{1000, 0.0, 10.0}});
130136
OOhistos.add("h_rawpT_Kaon", "h_rawpT_Kaon", kTH1F, {{1000, 0.0, 10.0}});
@@ -165,8 +171,8 @@ struct kstarInOO {
165171
// For Mixed Event
166172
using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::cent::CentFT0C>;
167173

168-
Partition<TrackCandidates_MC> Kaon_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig));
169-
Partition<TrackCandidates_MC> Pion_MC = (!cfg_Track_TPCPID || (nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig));
174+
Partition<TrackCandidates_MC> Kaon_MC = nabs(aod::pidtpc::tpcNSigmaKa) <= cfg_Track_TPCPID_nSig;
175+
Partition<TrackCandidates_MC> Pion_MC = nabs(aod::pidtpc::tpcNSigmaPi) <= cfg_Track_TPCPID_nSig;
170176

171177
double massKa = o2::constants::physics::MassKPlus;
172178
double massPi = o2::constants::physics::MassPiMinus;
@@ -181,21 +187,20 @@ struct kstarInOO {
181187
{
182188
if (!event.sel8())
183189
return false;
184-
190+
if (std::abs(event.posZ()) > cfg_Event_VtxCut)
191+
return false;
185192
if (!event.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))
186193
return false;
187194
if (!event.selection_bit(aod::evsel::kNoSameBunchPileup))
188195
return false;
189-
190196
if (!event.selection_bit(aod::evsel::kNoTimeFrameBorder))
191197
return false;
192198
if (!event.selection_bit(aod::evsel::kNoITSROFrameBorder))
193199
return false;
194-
195200
if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard))
196201
return false;
197202

198-
return true;
203+
return true;
199204
};
200205

201206
template <typename TracksType>
@@ -335,9 +340,11 @@ struct kstarInOO {
335340
if (!trackPIDKaon(trk1) || !trackPIDPion(trk2))
336341
return {-1.0, -1.0};
337342

338-
if (trk1.globalIndex() == trk2.globalIndex())
343+
if (trk1.globalIndex() == trk2.globalIndex()){
344+
// std::cout<<"This happens"<<std::endl;
345+
339346
return {-1.0, -1.0}; // For Kstar, we need to run (0,1), (1,0) pairs as well. but same id pairs are not neede.
340-
347+
}
341348
lDecayDaughter1.SetXYZM(trk1.px(), trk1.py(), trk1.pz(), massKa);
342349
lDecayDaughter2.SetXYZM(trk2.px(), trk2.py(), trk2.pz(), massPi);
343350
lResonance = lDecayDaughter1 + lDecayDaughter2;
@@ -371,9 +378,6 @@ struct kstarInOO {
371378
if (!goodEv)
372379
return;
373380

374-
if (std::fabs(collision.posZ()) > cfg_Event_VtxCut)
375-
return;
376-
377381
bool INELgt0 = false;
378382
for (const auto& track : tracks) {
379383
if (std::fabs(track.eta()) < cfg_Track_MaxEta) {
@@ -385,18 +389,17 @@ struct kstarInOO {
385389
return;
386390

387391
OOhistos.fill(HIST("nEvents_MC"), 1.5);
388-
389392
TrackSlicing_MC(collision, tracks, collision, tracks, false);
390-
393+
391394
} // processSameEvents_MC
392395
PROCESS_SWITCH(kstarInOO, processSameEvent_MC, "process Same Event MC", true);
393-
396+
394397
//=======================================================
395398
//|
396399
//| MC STUFF (ME)
397400
//|
398401
//=======================================================
399-
402+
400403
int nEvents_MC_Mix = 0;
401404
void processMixedEvent_MC(EventCandidates const& collisions, TrackCandidates_MC const& tracks, aod::McParticles const&)
402405
{
@@ -410,11 +413,10 @@ struct kstarInOO {
410413
std::cout << "Processed Mixed Events: " << nEvents_MC_Mix << std::endl;
411414
}
412415
}
413-
414416
auto goodEv1 = eventSelection(collision1);
415417
auto goodEv2 = eventSelection(collision2);
416418
OOhistos.fill(HIST("nEvents_MC_Mix"), 0.5);
417-
419+
418420
if (!goodEv1 || !goodEv2)
419421
continue;
420422

@@ -424,7 +426,10 @@ struct kstarInOO {
424426
} // mixing
425427
} // processMixedEvent_MC
426428
PROCESS_SWITCH(kstarInOO, processMixedEvent_MC, "process Mixed Event MC", false);
429+
427430

431+
432+
428433
void processEventsDummy(EventCandidates::iterator const&, TrackCandidates const&)
429434
{
430435
return;
@@ -433,6 +438,8 @@ struct kstarInOO {
433438

434439
}; // kstarInOO
435440

441+
442+
436443
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
437444
{
438445
return WorkflowSpec{adaptAnalysisTask<kstarInOO>(cfgc)};

0 commit comments

Comments
 (0)