Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 61 additions & 10 deletions PWGUD/Tasks/upcVmRof.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float);
DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float);
DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float);
DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float);
DECLARE_SOA_COLUMN(PerROFZNA, perROFZNA, int);
DECLARE_SOA_COLUMN(PerROFZNC, perROFZNC, int);
DECLARE_SOA_COLUMN(PerROFZN, perROFZN, int);

// track info
DECLARE_SOA_COLUMN(Pt1, pt1, float);
Expand Down Expand Up @@ -198,7 +201,8 @@ DECLARE_SOA_TABLE(TwoTrkTable, "AOD", "TWOTRKTABLE",
datarows::EnergyCommonZNA, datarows::EnergyCommonZNC, datarows::TimeZNA, datarows::TimeZNC,
datarows::Pt1, datarows::Eta1, datarows::Phi1, datarows::Q1, datarows::PidPion1, datarows::PidElectron1, datarows::PidKaon1, datarows::PidProton1,
datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2,
datarows::HasTof1, datarows::HasTof2, datarows::PerROFFT0Low, datarows::PerROFFT0High);
datarows::HasTof1, datarows::HasTof2, datarows::PerROFFT0Low, datarows::PerROFFT0High,
datarows::PerROFZNA, datarows::PerROFZNC, datarows::PerROFZN);
DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE",
datarows::RunNumber, datarows::PosX, datarows::PosY, datarows::PosZ, datarows::Chi2,
datarows::LocalBC, datarows::NearestBCB, datarows::LocalTF, datarows::LocalROF, datarows::UpcFlag,
Expand All @@ -210,7 +214,8 @@ DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE",
datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2,
datarows::Pt3, datarows::Eta3, datarows::Phi3, datarows::Q3, datarows::PidPion3, datarows::PidElectron3, datarows::PidKaon3, datarows::PidProton3,
datarows::Pt4, datarows::Eta4, datarows::Phi4, datarows::Q4, datarows::PidPion4, datarows::PidElectron4, datarows::PidKaon4, datarows::PidProton4,
datarows::HasTof1, datarows::HasTof2, datarows::HasTof3, datarows::HasTof4, datarows::PerROFFT0Low, datarows::PerROFFT0High);
datarows::HasTof1, datarows::HasTof2, datarows::HasTof3, datarows::HasTof4, datarows::PerROFFT0Low, datarows::PerROFFT0High,
datarows::PerROFZNA, datarows::PerROFZNC, datarows::PerROFZN);

DECLARE_SOA_TABLE(TwoTrkRecGenTable, "AOD", "TWOTRKRECGEN",
mcgen::McMotherPdg, mcgen::McMotherPt, mcgen::McMotherPhi, mcgen::McMotherMass, mcgen::McMotherRapidity,
Expand Down Expand Up @@ -305,6 +310,7 @@ struct UpcVmRof {

// information for selection collisions
Configurable<float> maxAbsPosZ{"maxAbsPosZ", 10.0, "max |Z| position of vtx"};
Configurable<float> maxAbsTimeZN{"maxAbsTimeZN", 2.0, "max |time| in a ZN side"};
Configurable<float> maxAbsTimeFT0{"maxAbsTimeFT0", 4.0, "max |time| in a FT0 side"};
Configurable<float> maxAmpFT0{"maxAmpFT0", 150.0, "max amplitude for signals in a FT0 side"};
Configurable<float> minAmpFT0Low{"minAmpFT0Low", 50.0, "min amplitude for signals in a FT0 side to define an interaction, low threshold"};
Expand Down Expand Up @@ -918,6 +924,8 @@ struct UpcVmRof {
if (gidxBCB <= bcs.iteratorAt(bcs.size() - 1).globalIndex()) {
while (nearbcb != bcs.end()) {
++nearbcb;
if (nearbcb == bcs.end())
break;
if (nearbcb.globalIndex() > gidxBCB) {
break;
} else if (getBcWithinOrbit(nearbcb.globalBC()) == vecNearestBCB[thisBC]) {
Expand Down Expand Up @@ -1089,29 +1097,53 @@ struct UpcVmRof {
colTH1Pointers[Form("colSel/%d/trkDcaXY_H", runNumberCol)]->Fill(selTrks[itrk].dcaXY());
}

// compute the number of FT0 interactions in this ROF
int nPerROFFT0Low = 0;
int nPerROFFT0High = 0;
// -- FT0: find interactions in the same ROF
// compute the number of FT0 and ZN bcB interactions in this ROF
int nPerROFFT0Low = 0; // Low amplitude threshold
int nPerROFFT0High = 0; // high amplitude threshold
int nPerROFZNA = 0;
int nPerROFZNC = 0;
int nPerROFZN = 0;
// -- find interactions in the same ROF
auto fwdbc = bcs.iteratorAt(nearbcb.globalIndex());
// -- FT0: find later interactions in the same ROF
// -- find later interactions in the same ROF
while (fwdbc != bcs.end()) {
++fwdbc;
if (fwdbc == bcs.end())
break;
int64_t tmpLocalBC = getBcWithinOrbit(fwdbc.globalBC());
int64_t tmpTF = getTimeFrame(fwdbc.globalBC());
int64_t tmpROF = getRof(tmpLocalBC);
if (tmpTF != nearbcbTF)
break;
if (tmpROF != nearbcbROF)
break;
if (!bcPatternB.test(tmpLocalBC)) {
continue;
}
if (fwdbc.has_zdc()) {
tZNA = (fwdbc.zdc()).timeZNA();
tZNC = (fwdbc.zdc()).timeZNC();
bool isZNA = false;
bool isZNC = false;
if (std::isfinite(tZNA) && std::abs(tZNA) < maxAbsTimeZN)
isZNA = true;
if (std::isfinite(tZNC) && std::abs(tZNC) < maxAbsTimeZN)
isZNC = true;
if (isZNA)
nPerROFZNA++;
if (isZNC)
nPerROFZNC++;
if (isZNA && isZNC)
nPerROFZN++;
}
if (fwdbc.has_foundFT0()) {
if (fwdbc.foundFT0().sumAmpA() > minAmpFT0Low && fwdbc.foundFT0().sumAmpC() > minAmpFT0Low)
nPerROFFT0Low++;
if (fwdbc.foundFT0().sumAmpA() > minAmpFT0High && fwdbc.foundFT0().sumAmpC() > minAmpFT0High)
nPerROFFT0High++;
}
}
// -- FT0: find earlier interactions in the same ROF
// -- find earlier interactions in the same ROF
auto bwdbc = bcs.iteratorAt(nearbcb.globalIndex());
while (bwdbc != bcs.iteratorAt(0)) {
--bwdbc;
Expand All @@ -1122,6 +1154,25 @@ struct UpcVmRof {
break;
if (tmpROF != nearbcbROF)
break;
if (!bcPatternB.test(tmpLocalBC)) {
continue;
}
if (bwdbc.has_zdc()) {
tZNA = (bwdbc.zdc()).timeZNA();
tZNC = (bwdbc.zdc()).timeZNC();
bool isZNA = false;
bool isZNC = false;
if (std::isfinite(tZNA) && std::abs(tZNA) < maxAbsTimeZN)
isZNA = true;
if (std::isfinite(tZNC) && std::abs(tZNC) < maxAbsTimeZN)
isZNC = true;
if (isZNA)
nPerROFZNA++;
if (isZNC)
nPerROFZNC++;
if (isZNA && isZNC)
nPerROFZN++;
}
if (bwdbc.has_foundFT0()) {
if (bwdbc.foundFT0().sumAmpA() > minAmpFT0Low && bwdbc.foundFT0().sumAmpC() > minAmpFT0Low)
nPerROFFT0Low++;
Expand All @@ -1148,7 +1199,7 @@ struct UpcVmRof {
selTrks[0].tpcNSigmaPi(), selTrks[0].tpcNSigmaEl(), selTrks[0].tpcNSigmaKa(), selTrks[0].tpcNSigmaPr(),
selTrks[1].pt(), selTrks[1].eta(), selTrks[1].phi(), selTrks[1].sign(),
selTrks[1].tpcNSigmaPi(), selTrks[1].tpcNSigmaEl(), selTrks[1].tpcNSigmaKa(), selTrks[1].tpcNSigmaPr(),
tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High);
tof[0], tof[1], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN);
}
if (isFourBody) {
if (selTrks[0].hasTOF()) {
Expand All @@ -1175,7 +1226,7 @@ struct UpcVmRof {
selTrks[2].tpcNSigmaPi(), selTrks[2].tpcNSigmaEl(), selTrks[2].tpcNSigmaKa(), selTrks[2].tpcNSigmaPr(),
selTrks[3].pt(), selTrks[3].eta(), selTrks[3].phi(), selTrks[3].sign(),
selTrks[3].tpcNSigmaPi(), selTrks[3].tpcNSigmaEl(), selTrks[3].tpcNSigmaKa(), selTrks[3].tpcNSigmaPr(),
tof[0], tof[1], tof[2], tof[3], nPerROFFT0Low, nPerROFFT0High);
tof[0], tof[1], tof[2], tof[3], nPerROFFT0Low, nPerROFFT0High, nPerROFZNA, nPerROFZNC, nPerROFZN);
}

outIsTwoBody = isTwoBody;
Expand Down
Loading