Skip to content

Commit bd81c4f

Browse files
author
Laura Serksnyte
committed
Updated derived-to-derived producer to include the bitmask check
1 parent 4e47704 commit bd81c4f

File tree

1 file changed

+51
-6
lines changed

1 file changed

+51
-6
lines changed

PWGCF/FemtoDream/TableProducer/femtoDreamProducerTaskForSpecificAnalysis.cxx

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
4949
float mMassOne = -999, mMassTwo = -999, mMassThree = -999;
5050
int collisions = 0;
5151

52+
// Require bitmask selection for candidates
53+
Configurable<bool> ConfRequireBitmask{"ConfRequireBitmask", false, "Require bitmask selection for candidates"};
54+
55+
// Number of candidates required
5256
Configurable<int> ConfNumberOfTracks{"ConfNumberOfTracks", 3, "Number of tracks"};
5357
Configurable<int> ConfNumberOfV0{"ConfNumberOfV0", 0, "Number of V0"};
5458
Configurable<int> ConfNumberOfCascades{"ConfNumberOfCascades", 0, "Number of Cascades"};
@@ -57,6 +61,9 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
5761
Configurable<float> ConfPIDthrMom{"ConfPIDthrMom", 1.f, "Momentum threshold from which TPC and TOF are required for PID"};
5862
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfTPCPIDBit{"ConfTPCPIDBit", 16, "PID TPC bit from cutCulator "};
5963
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfTPCTOFPIDBit{"ConfTPCTOFPIDBit", 8, "PID TPCTOF bit from cutCulator"};
64+
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutPart{"ConfCutPart", 0, "Track - Selection bit from cutCulator for part"};
65+
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutPartAntiPart{"ConfCutPartAntiPart", 0, "Track - Selection bit from cutCulator for antipart"};
66+
6067

6168
/// Partition for selected particles
6269
Partition<aod::FDParticles> SelectedParts = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kTrack)) &&
@@ -67,12 +74,19 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
6774
Configurable<float> Conf_maxInvMass_V0{"Conf_maxInvMass_V0", 1.15, "Maximum invariant mass of V0 (particle)"};
6875
Configurable<float> Conf_minInvMassAnti_V0{"Conf_minInvMassAnti_V0", 1.08, "Minimum invariant mass of V0 (antiparticle)"};
6976
Configurable<float> Conf_maxInvMassAnti_V0{"Conf_maxInvMassAnti_V0", 1.15, "Maximum invariant mass of V0 (antiparticle)"};
77+
Configurable<o2::aod::femtodreamparticle::cutContainerType> ConfCutV0_SameForAntipart{"ConfCutV0_SameForAntipart", 0, "V0 - Selection bit from cutCulator for part/antipart"};
78+
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildPos_CutV0{"Conf_ChildPos_CutV0", 149, "Selection bit for positive child of V0"};
79+
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildPos_TPCBitV0{"Conf_ChildPos_TPCBitV0", 2, "PID TPC bit for positive child of V0"};
80+
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildNeg_CutV0{"Conf_ChildNeg_CutV0", 149, "Selection bit for negative child of V0"};
81+
Configurable<o2::aod::femtodreamparticle::cutContainerType> Conf_ChildNeg_TPCBitV0{"Conf_ChildNeg_TPCBitV0", 2, "PID TPC bit for negative child of V0"};
82+
7083
/// Cascade selection
7184
Configurable<float> Conf_minInvMass_Cascade{"Conf_minInvMass_Cascade", 1.2, "Minimum invariant mass of Cascade (particle)"};
7285
Configurable<float> Conf_maxInvMass_Cascade{"Conf_maxInvMass_Cascade", 1.5, "Maximum invariant mass of Cascade (particle)"};
7386

87+
7488
// Partition for selected particles
75-
Partition<aod::FDParticles> SelectedV0s = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0));
89+
Partition<aod::FDParticles> SelectedV0s = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) ;
7690
Partition<aod::FDParticles> SelectedCascades = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kCascade));
7791

7892
HistogramRegistry EventRegistry{"EventRegistry", {}, OutputObjHandlingPolicy::AnalysisObject};
@@ -95,8 +109,12 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
95109
void init(InitContext&)
96110
{
97111
EventRegistry.add("hStatistiscs", ";bin;Entries", kTH1F, {{3, 0, 3}});
98-
// get bit for the collision mask
112+
// Never run V0s and Cascades together as this will DOUBLE the track number and induce self correlations
113+
if ((doprocessCollisionsWithNTracksAndNCascades && doprocessCollisionsWithNTracksAndNV0)) {
114+
LOG(fatal) << "Never run V0s and Cascades together as this will DOUBLE the track number and induce self correlations!";
115+
}
99116
}
117+
100118
/// This function stores accepted collisions in derived data
101119
/// @tparam PartitionType
102120
/// @tparam PartType
@@ -112,9 +130,13 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
112130
int antitracksCount = 0;
113131
for (auto& part : groupSelectedTracks) {
114132
if (part.cut() & 1) {
115-
antitracksCount++;
133+
if(!ConfRequireBitmask || ncheckbit(part.cut(), ConfCutPartAntiPart ) ){
134+
antitracksCount++;
135+
}
116136
} else {
117-
tracksCount++;
137+
if(!ConfRequireBitmask || ncheckbit(part.cut(), ConfCutPart) ){
138+
tracksCount++;
139+
}
118140
}
119141
}
120142

@@ -123,10 +145,33 @@ struct femtoDreamProducerTaskForSpecificAnalysis {
123145
int antiV0Count = 0;
124146
for (auto& V0 : groupSelectedV0s) {
125147
if ((V0.mLambda() > Conf_minInvMass_V0) && (V0.mLambda() < Conf_maxInvMass_V0)) {
126-
V0Count++;
148+
if (ConfRequireBitmask){
149+
if(ncheckbit(V0.cut(), ConfCutV0_SameForAntipart)){
150+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
151+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
152+
if (((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 &&
153+
(posChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0 &&
154+
(negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 &&
155+
(negChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0)) {
156+
V0Count++;
157+
}
158+
}
159+
} else{ V0Count++;}
127160
} else if ((V0.mAntiLambda() > Conf_minInvMassAnti_V0) && (V0.mAntiLambda() < Conf_maxInvMassAnti_V0)) {
128-
antiV0Count++;
161+
if (ConfRequireBitmask){
162+
if(ncheckbit(V0.cut(), ConfCutV0_SameForAntipart)){
163+
const auto& posChild = parts.iteratorAt(V0.index() - 2);
164+
const auto& negChild = parts.iteratorAt(V0.index() - 1);
165+
if (((posChild.cut() & Conf_ChildPos_CutV0) == Conf_ChildPos_CutV0 &&
166+
(posChild.pidcut() & Conf_ChildNeg_TPCBitV0) == Conf_ChildNeg_TPCBitV0 && // exchanged values because checking antiparticle daughters and pid of particles exchange
167+
(negChild.cut() & Conf_ChildNeg_CutV0) == Conf_ChildNeg_CutV0 &&
168+
(negChild.pidcut() & Conf_ChildPos_TPCBitV0) == Conf_ChildPos_TPCBitV0)) { // exchanged values because checking antiparticle daughters and pid of particles exchange
169+
antiV0Count++;
170+
}
171+
}
172+
} else{antiV0Count++;}
129173
}
174+
130175
}
131176

132177
std::vector<int> tmpIDtrack;

0 commit comments

Comments
 (0)