Skip to content

Commit 8bd5029

Browse files
authored
QA histograms for ppp trigger (#471)
1 parent 4eb88fe commit 8bd5029

1 file changed

Lines changed: 44 additions & 27 deletions

File tree

EventFiltering/PWGCF/CFFilter.cxx

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <cmath>
4141
#include <string>
4242

43+
#include <bitset>
4344
#include <iostream>
4445

4546
namespace
@@ -65,9 +66,10 @@ static const std::vector<std::string> CfTriggerNames{"ppp", "ppL", "pLL", "LLL"}
6566
// uint V0TypeSel = o2::aod::femtodreamparticle::ParticleType::kV0; Fix this to work instead of below hardcoded lines
6667
static constexpr uint8_t Track = 0; // Track
6768
static constexpr uint8_t V0 = 1; // V0
68-
//static constexpr uint8_t V0Daughter = 2; // V0 daughters
69+
static constexpr uint8_t V0Daughter = 2; // V0 daughters
6970
static constexpr uint32_t kSignMinusMask = 1;
7071
static constexpr uint32_t kSignPlusMask = 2;
72+
static constexpr uint32_t knSigmaProton = 48;
7173
static constexpr uint32_t kValue0 = 0;
7274

7375
} // namespace
@@ -92,13 +94,12 @@ struct CFFilter {
9294
Configurable<int> Q3Trigger{"Q3Trigger", 0, "Choice which trigger to run"};
9395
Configurable<float> ldeltaPhiMax{"ldeltaPhiMax", 0.017, "Max limit of delta phi"};
9496
Configurable<float> ldeltaEtaMax{"ldeltaEtaMax", 0.017, "Max limit of delta eta"};
95-
Configurable<float> lmagfield{"lmagfield", 0.5, "Magnetic field value"};
9697

9798
// Obtain particle and antiparticle candidates of protons and lambda hyperons for current femto collision
98-
Partition<o2::aod::FemtoDreamParticles> partsProton1 = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0);
99-
Partition<o2::aod::FemtoDreamParticles> partsLambda1 = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0);
100-
Partition<o2::aod::FemtoDreamParticles> partsProton0 = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0);
101-
Partition<o2::aod::FemtoDreamParticles> partsLambda0 = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0);
99+
Partition<o2::aod::FemtoDreamParticles> partsProton0Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0) && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0);
100+
Partition<o2::aod::FemtoDreamParticles> partsLambda0Part = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignPlusMask) > kValue0);
101+
Partition<o2::aod::FemtoDreamParticles> partsProton1Part = (o2::aod::femtodreamparticle::partType == Track) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0) && ((o2::aod::femtodreamparticle::pidcut & knSigmaProton) > kValue0);
102+
Partition<o2::aod::FemtoDreamParticles> partsLambda1Part = (o2::aod::femtodreamparticle::partType == V0) && ((o2::aod::femtodreamparticle::cut & kSignMinusMask) > kValue0);
102103

103104
HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject};
104105
HistogramRegistry registryQA{"registryQA", {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -125,16 +126,14 @@ struct CFFilter {
125126
bool isFullPIDSelectedProton(aod::femtodreamparticle::cutContainerType const& pidCut, float const& momentum)
126127
{
127128
float pidThresh = 0.75;
128-
bool pidSelection = true;
129-
float nSigmaTPC = 3.5;
130-
float nSigmaTPCTOF = 3.5;
129+
bool pidSelection = false;
131130
auto vSpecies = std::vector<int>{2};
132131
if (momentum < pidThresh) {
133132
/// TPC PID only
134-
pidSelection = isPIDSelected(pidCut, vSpecies, nSigmaTPC, kDetector::kTPC);
133+
pidSelection = isPIDSelected(pidCut, vSpecies, 3.5, kDetector::kTPC);
135134
} else {
136135
/// TPC + TOF PID
137-
pidSelection = isPIDSelected(pidCut, vSpecies, nSigmaTPCTOF, kDetector::kTPCTOF);
136+
pidSelection = isPIDSelected(pidCut, vSpecies, 3.5, kDetector::kTPCTOF);
138137
}
139138
return pidSelection;
140139
};
@@ -153,6 +152,12 @@ struct CFFilter {
153152
if (Q3Trigger == 0 || Q3Trigger == 11) {
154153
registry.add("fSameEventPartPPP", "CF - same event ppp distribution for particles;;events", HistType::kTH1F, {{8000, 0, 8}});
155154
registry.add("fSameEventAntiPartPPP", "CF - same event ppp distribution for antiparticles;;events", HistType::kTH1F, {{8000, 0, 8}});
155+
registry.add("fMultiplicityBefore", "Multiplicity of all processed events", HistType::kTH1F, {{1000, 0, 1000}});
156+
registry.add("fMultiplicityAfter", "Multiplicity of events which passed ppp trigger", HistType::kTH1F, {{1000, 0, 1000}});
157+
registry.add("fZvtxBefore", "Zvtx of all processed events", HistType::kTH1F, {{1000, -15, 15}});
158+
registry.add("fZvtxAfter", "Zvtx of events which passed ppp trigger", HistType::kTH1F, {{1000, -15, 15}});
159+
registry.add("fPtBefore", "Transverse momentum of all processed tracks", HistType::kTH1F, {{1000, 0, 10}});
160+
registry.add("fPtAfter", "Transverse momentum of processed tracks which passed ppp trigger", HistType::kTH1F, {{1000, 0, 10}});
156161
}
157162
if (Q3Trigger == 1 || Q3Trigger == 11) {
158163
registry.add("fSameEventPartPPL", "CF - same event ppL distribution for particles;;events", HistType::kTH1F, {{8000, 0, 8}});
@@ -182,12 +187,6 @@ struct CFFilter {
182187
LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field());
183188
}
184189
float output = 0.1 * (grpo->getNominalL3Field());
185-
std::cout << "###################################" << std::endl;
186-
std::cout << "###################################" << std::endl;
187-
std::cout << "Mag Field (T) = " << output << std::endl;
188-
std::cout << "###################################" << std::endl;
189-
std::cout << "###################################" << std::endl;
190-
191190
return output;
192191
}
193192

@@ -196,8 +195,20 @@ struct CFFilter {
196195

197196
void process(o2::aod::FemtoDreamCollision& col, o2::aod::FemtoDreamParticles& partsFemto)
198197
{
198+
auto partsProton0 = partsProton0Part->sliceByCached(aod::femtodreamparticle::femtoDreamCollisionId, col.globalIndex());
199+
auto partsLambda0 = partsLambda0Part->sliceByCached(aod::femtodreamparticle::femtoDreamCollisionId, col.globalIndex());
200+
auto partsProton1 = partsProton1Part->sliceByCached(aod::femtodreamparticle::femtoDreamCollisionId, col.globalIndex());
201+
auto partsLambda1 = partsLambda1Part->sliceByCached(aod::femtodreamparticle::femtoDreamCollisionId, col.globalIndex());
199202
auto tmstamp = col.timestamp();
203+
auto mafneticField = getMagneticFieldTesla(tmstamp);
200204
registry.get<TH1>(HIST("fProcessedEvents"))->Fill(0);
205+
registry.get<TH1>(HIST("fMultiplicityBefore"))->Fill(col.multV0M());
206+
registry.get<TH1>(HIST("fZvtxBefore"))->Fill(col.posZ());
207+
208+
for (auto p1pt : partsProton0) {
209+
registry.get<TH1>(HIST("fPtBefore"))->Fill(p1pt.pt());
210+
}
211+
201212
bool keepEvent[nTriplets]{false};
202213
int lowQ3Triplets[2] = {0, 0};
203214
if (partsFemto.size() != 0) {
@@ -211,13 +222,13 @@ struct CFFilter {
211222
}
212223
// Think if pair cleaning is needed in current framework
213224
// Run close pair rejection
214-
if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, getMagneticFieldTesla(tmstamp))) {
225+
if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, mafneticField)) {
215226
continue;
216227
}
217-
if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, getMagneticFieldTesla(tmstamp))) {
228+
if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, mafneticField)) {
218229
continue;
219230
}
220-
if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, getMagneticFieldTesla(tmstamp))) {
231+
if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, mafneticField)) {
221232
continue;
222233
}
223234
auto Q3 = FemtoDreamMath::getQ3(p1, mMassProton, p2, mMassProton, p3, mMassProton);
@@ -228,7 +239,7 @@ struct CFFilter {
228239
}
229240
} // end if
230241

231-
if (lowQ3Triplets[0] == 0) { // if at least one triplet found in particles, no need to check antiparticles
242+
/*if (lowQ3Triplets[0] == 0) { // if at least one triplet found in particles, no need to check antiparticles
232243
if (partsProton1.size() >= 3) {
233244
for (auto& [p1, p2, p3] : combinations(partsProton1, partsProton1, partsProton1)) {
234245
@@ -237,13 +248,13 @@ struct CFFilter {
237248
}
238249
// Think if pair cleaning is needed in current framework
239250
// Run close pair rejection
240-
if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, getMagneticFieldTesla(tmstamp))) {
251+
if (closePairRejectionTT.isClosePair(p1, p2, partsFemto, mafneticField)) {
241252
continue;
242253
}
243-
if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, getMagneticFieldTesla(tmstamp))) {
254+
if (closePairRejectionTT.isClosePair(p1, p3, partsFemto, mafneticField)) {
244255
continue;
245256
}
246-
if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, getMagneticFieldTesla(tmstamp))) {
257+
if (closePairRejectionTT.isClosePair(p2, p3, partsFemto, mafneticField)) {
247258
continue;
248259
}
249260
auto Q3 = FemtoDreamMath::getQ3(p1, mMassProton, p2, mMassProton, p3, mMassProton);
@@ -253,11 +264,11 @@ struct CFFilter {
253264
}
254265
}
255266
} // end if
256-
}
267+
}*/
257268
}
258269

259270
// TRIGGER FOR PPL TRIPLETS
260-
if (Q3Trigger == 1 || Q3Trigger == 11) {
271+
/*if (Q3Trigger == 1 || Q3Trigger == 11) {
261272
if (partsLambda0.size() >= 1 && partsProton0.size() >= 2) {
262273
for (auto& partLambda : partsLambda0) {
263274
if (!pairCleanerTV.isCleanPair(partLambda, partLambda, partsFemto)) {
@@ -307,11 +318,17 @@ struct CFFilter {
307318
}
308319
} // end if
309320
}
310-
}
321+
}*/
311322
}
312323

313324
if (lowQ3Triplets[0] > 0) {
314325
keepEvent[kPPP] = true;
326+
registry.get<TH1>(HIST("fMultiplicityAfter"))->Fill(col.multV0M());
327+
registry.get<TH1>(HIST("fZvtxAfter"))->Fill(col.posZ());
328+
for (auto p1pt : partsProton0) {
329+
// All protons from selected events
330+
registry.get<TH1>(HIST("fPtAfter"))->Fill(p1pt.pt());
331+
}
315332
}
316333

317334
if (lowQ3Triplets[1] > 0) {

0 commit comments

Comments
 (0)