Skip to content

Commit f33eace

Browse files
committed
bug fixes
1 parent a944658 commit f33eace

File tree

1 file changed

+66
-23
lines changed

1 file changed

+66
-23
lines changed

PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx

Lines changed: 66 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ struct CorrSparse {
100100
O2_DEFINE_CONFIGURABLE(processFT0A, bool, true, "Process FT0A correlations")
101101
O2_DEFINE_CONFIGURABLE(processFT0C, bool, true, "Process FT0C correlations")
102102
O2_DEFINE_CONFIGURABLE(processMFT, bool, true, "Process MFT correlations")
103+
O2_DEFINE_CONFIGURABLE(withGain, bool, true, "Use gain for FT0A and FT0C")
103104

104105
} cfgDetectorConfig;
105106

@@ -143,9 +144,7 @@ struct CorrSparse {
143144
O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector")
144145
O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector")
145146
O2_DEFINE_CONFIGURABLE(cfgRemapFT0ADeadChannels, bool, false, "If true, remap FT0A channels 60-63 to amplitudes from 92-95 respectively")
146-
O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115")
147-
148-
} cfgFITConfig;
147+
O2_DEFINE_CONFIGURABLE(cfgRemapFT0CDeadChannels, bool, false, "If true, remap FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115")} cfgFITConfig;
149148

150149
O2_DEFINE_CONFIGURABLE(cfgMinMixEventNum, int, 5, "Minimum number of events to mix")
151150
O2_DEFINE_CONFIGURABLE(cfgMergingCut, float, 0.02, "Merging cut on track merge")
@@ -158,6 +157,8 @@ struct CorrSparse {
158157
O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object")
159158
O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event")
160159
O2_DEFINE_CONFIGURABLE(cfgCollType, int, 0, "Collision type: 0 = pp, 1 = pPb, 2 = pO, 3 = OO")
160+
O2_DEFINE_CONFIGURABLE(cfgGapSide, int, 0, "0: gapside A;1:C")
161+
O2_DEFINE_CONFIGURABLE(cfgGapSideMerge, bool, false, "whether merge A and C side together")
161162

162163
struct : ConfigurableGroup {
163164
O2_DEFINE_CONFIGURABLE(cfgMultCentHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut");
@@ -190,6 +191,11 @@ struct CorrSparse {
190191
TF1* fT0AV0ASigma = nullptr;
191192
} cfgFuncParas;
192193

194+
Configurable<float> cfgCutFV0{"cfgCutFV0", 50., "FV0A threshold"};
195+
Configurable<float> cfgCutFT0A{"cfgCutFT0A", 150., "FT0A threshold"};
196+
Configurable<float> cfgCutFT0C{"cfgCutFT0C", 50., "FT0C threshold"};
197+
Configurable<float> cfgCutZDC{"cfgCutZDC", 10., "ZDC threshold"};
198+
193199
SliceCache cache;
194200
SliceCache cacheNch;
195201

@@ -399,22 +405,22 @@ struct CorrSparse {
399405
if (cfgDetectorConfig.processFT0A) {
400406
registry.add("deltaEta_deltaPhi_same_TPC_FT0A", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0a}}); // check to see the delta eta and delta phi distribution
401407
registry.add("deltaEta_deltaPhi_mixed_TPC_FT0A", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0a}});
402-
registry.add("Assoc_amp_same_TPC_FT0A", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
403-
registry.add("Assoc_amp_mixed_TPC_FT0A", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
404-
registry.add("Trig_hist_TPC_FT0A", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
408+
registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
409+
registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
410+
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
405411
}
406412
if (cfgDetectorConfig.processFT0C) {
407413
registry.add("deltaEta_deltaPhi_same_TPC_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution
408414
registry.add("deltaEta_deltaPhi_mixed_TPC_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}});
409-
registry.add("Assoc_amp_same_TPC_FT0C", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
410-
registry.add("Assoc_amp_mixed_TPC_FT0C", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
411-
registry.add("Trig_hist_TPC_FT0C", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
415+
registry.add("Assoc_amp_same", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
416+
registry.add("Assoc_amp_mixed", "", {HistType::kTH2D, {axisChannelFt0aAxis, axisAmplitudeFt0a}});
417+
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
412418
}
413419
if (cfgDetectorConfig.processFV0) {
414420
registry.add("deltaEta_deltaPhi_same_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}}); // check to see the delta eta and delta phi distribution
415421
registry.add("deltaEta_deltaPhi_same_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}}); // check to see the delta eta and delta phi distribution
416422
registry.add("deltaEta_deltaPhi_mixed_TPC_FV0", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFv0}});
417-
registry.add("Trig_hist_FT0A_FT0C", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
423+
registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}});
418424
}
419425
}
420426

@@ -1065,13 +1071,23 @@ struct CorrSparse {
10651071
float deltaEta = track1.eta() - eta;
10661072

10671073
if (system == SameEvent) {
1074+
if (cfgDetectorConfig.processMFT) {
1075+
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight);
1076+
} else {
1077+
registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight);
1078+
}
1079+
10681080
registry.fill(HIST("Assoc_amp_same"), channelID, amplitude);
10691081
same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight);
1070-
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FV0"), deltaPhi, deltaEta, amplitude * triggerWeight);
1082+
10711083
} else if (system == MixedEvent) {
1084+
if (cfgDetectorConfig.processMFT) {
1085+
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FV0"), deltaPhi, deltaEta, amplitude);
1086+
} else {
1087+
registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FV0"), deltaPhi, deltaEta, amplitude);
1088+
}
10721089
registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude);
10731090
mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude);
1074-
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FV0"), deltaPhi, deltaEta, amplitude);
10751091
}
10761092
}
10771093
}
@@ -1091,7 +1107,11 @@ struct CorrSparse {
10911107
for (std::size_t iCh = 0; iCh < channelSize; iCh++) {
10921108
int channelID = 0;
10931109
float amplitude = 0.;
1094-
getChannelWithGain(tracks2, iCh, channelID, amplitude, corType);
1110+
if (cfgDetectorConfig.withGain) {
1111+
getChannelWithGain(tracks2, iCh, channelID, amplitude, corType);
1112+
} else {
1113+
getChannelFT0(tracks2, iCh, channelID, amplitude, corType);
1114+
}
10951115

10961116
// reject depending on FT0C/FT0A rings
10971117
if (corType == kFT0C) {
@@ -1111,25 +1131,41 @@ struct CorrSparse {
11111131

11121132
if (system == SameEvent) {
11131133
if (corType == kFT0A) {
1134+
if (cfgDetectorConfig.processMFT) {
1135+
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight);
1136+
} else {
1137+
registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight);
1138+
}
11141139
registry.fill(HIST("Assoc_amp_same"), channelID, amplitude);
11151140
same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight);
1116-
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0A"), deltaPhi, deltaEta, amplitude * triggerWeight);
11171141
}
11181142
if (corType == kFT0C) {
1143+
if (cfgDetectorConfig.processMFT) {
1144+
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight);
1145+
} else {
1146+
registry.fill(HIST("deltaEta_deltaPhi_same_TPC_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight);
1147+
}
11191148
registry.fill(HIST("Assoc_amp_same"), channelID, amplitude);
11201149
same->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude * triggerWeight);
1121-
registry.fill(HIST("deltaEta_deltaPhi_same_MFT_FT0C"), deltaPhi, deltaEta, amplitude * triggerWeight);
11221150
}
11231151
} else if (system == MixedEvent) {
11241152
if (corType == kFT0A) {
1153+
if (cfgDetectorConfig.processMFT) {
1154+
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0A"), deltaPhi, deltaEta, amplitude);
1155+
} else {
1156+
registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FT0A"), deltaPhi, deltaEta, amplitude);
1157+
}
11251158
registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude);
11261159
mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude);
1127-
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0A"), deltaPhi, deltaEta, amplitude);
11281160
}
11291161
if (corType == kFT0C) {
1162+
if (cfgDetectorConfig.processMFT) {
1163+
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0C"), deltaPhi, deltaEta, amplitude);
1164+
} else {
1165+
registry.fill(HIST("deltaEta_deltaPhi_mixed_TPC_FT0C"), deltaPhi, deltaEta, amplitude);
1166+
}
11301167
registry.fill(HIST("Assoc_amp_mixed"), channelID, amplitude);
11311168
mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track1.pt(), track1.pt(), deltaPhi, deltaEta, amplitude);
1132-
registry.fill(HIST("deltaEta_deltaPhi_mixed_MFT_FT0C"), deltaPhi, deltaEta, amplitude);
11331169
}
11341170
}
11351171
}
@@ -1482,7 +1518,10 @@ struct CorrSparse {
14821518
if (!collision.has_foundFT0())
14831519
return;
14841520
loadAlignParam(bc.timestamp());
1485-
loadGain(bc);
1521+
if (cfgDetectorConfig.withGain) {
1522+
loadGain(bc);
1523+
}
1524+
14861525
loadCorrection(bc.timestamp());
14871526

14881527
if ((tpctracks.size() < cfgEventSelection.cfgMinMult || tpctracks.size() >= cfgEventSelection.cfgMaxMult)) {
@@ -1571,7 +1610,7 @@ struct CorrSparse {
15711610
}
15721611
}
15731612
}
1574-
PROCESS_SWITCH(CorrSparse, processSameMftReassociated2DFIT, "Process same event for MFT-FIT correlation with reassociated tracks", true);
1613+
PROCESS_SWITCH(CorrSparse, processSameMftReassociated2DFIT, "Process same event for MFT-FIT correlation with reassociated tracks", false);
15751614

15761615
/////////////////////////
15771616
////////Mid-Mid//////////
@@ -1588,14 +1627,15 @@ struct CorrSparse {
15881627
if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), true))
15891628
return;
15901629

1591-
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
1630+
loadCorrection(bc.timestamp());
1631+
1632+
fillYield(collision, tracks);
15921633

15931634
if (tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult) {
15941635
return;
15951636
}
15961637

1597-
loadCorrection(bc.timestamp());
1598-
fillYield(collision, tracks);
1638+
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin
15991639

16001640
fillCorrelations<CorrelationContainer::kCFStepReconstructed>(tracks, tracks, collision.posZ(), tracks.size(), SameEvent, getMagneticField(bc.timestamp()));
16011641
}
@@ -1623,7 +1663,10 @@ struct CorrSparse {
16231663
}
16241664

16251665
loadAlignParam(bc.timestamp());
1626-
// loadGain(bc);
1666+
if (cfgDetectorConfig.withGain) {
1667+
loadGain(bc);
1668+
}
1669+
16271670
loadCorrection(bc.timestamp());
16281671

16291672
registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin

0 commit comments

Comments
 (0)