Skip to content

Commit 585bd03

Browse files
author
contrgui
committed
small code additions to finetune the analysis
1 parent 877668f commit 585bd03

1 file changed

Lines changed: 45 additions & 4 deletions

File tree

PWGUD/Tasks/upcVmRof.cxx

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ DECLARE_SOA_COLUMN(PidPion4, pidPion4, float);
134134
DECLARE_SOA_COLUMN(PidElectron4, pidElectron4, float);
135135
DECLARE_SOA_COLUMN(PidKaon4, pidKaon4, float);
136136
DECLARE_SOA_COLUMN(PidProton4, pidProton4, float);
137+
DECLARE_SOA_COLUMN(HasTof1, hasTof1, int);
138+
DECLARE_SOA_COLUMN(HasTof2, hasTof2, int);
139+
DECLARE_SOA_COLUMN(HasTof3, hasTof3, int);
140+
DECLARE_SOA_COLUMN(HasTof4, hasTof4, int);
137141
} // namespace datarows
138142

139143
DECLARE_SOA_TABLE(TwoTrkTable, "AOD", "TWOTRKTABLE",
@@ -144,7 +148,8 @@ DECLARE_SOA_TABLE(TwoTrkTable, "AOD", "TWOTRKTABLE",
144148
datarows::ChannelsFT0A, datarows::ChannelsFT0C, datarows::ChannelsFV0A, datarows::ChannelsFDDA, datarows::ChannelsFDDC,
145149
datarows::EnergyCommonZNA, datarows::EnergyCommonZNC, datarows::TimeZNA, datarows::TimeZNC,
146150
datarows::Pt1, datarows::Eta1, datarows::Phi1, datarows::Q1, datarows::PidPion1, datarows::PidElectron1, datarows::PidKaon1, datarows::PidProton1,
147-
datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2);
151+
datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2,
152+
datarows::HasTof1, datarows::HasTof2);
148153
DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE",
149154
datarows::RunNumber, datarows::PosX, datarows::PosY, datarows::PosZ, datarows::Chi2,
150155
datarows::LocalBC, datarows::LocalTF, datarows::LocalROF, datarows::UpcFlag,
@@ -155,7 +160,8 @@ DECLARE_SOA_TABLE(FourTrkTable, "AOD", "FOURTRKTABLE",
155160
datarows::Pt1, datarows::Eta1, datarows::Phi1, datarows::Q1, datarows::PidPion1, datarows::PidElectron1, datarows::PidKaon1, datarows::PidProton1,
156161
datarows::Pt2, datarows::Eta2, datarows::Phi2, datarows::Q2, datarows::PidPion2, datarows::PidElectron2, datarows::PidKaon2, datarows::PidProton2,
157162
datarows::Pt3, datarows::Eta3, datarows::Phi3, datarows::Q3, datarows::PidPion3, datarows::PidElectron3, datarows::PidKaon3, datarows::PidProton3,
158-
datarows::Pt4, datarows::Eta4, datarows::Phi4, datarows::Q4, datarows::PidPion4, datarows::PidElectron4, datarows::PidKaon4, datarows::PidProton4);
163+
datarows::Pt4, datarows::Eta4, datarows::Phi4, datarows::Q4, datarows::PidPion4, datarows::PidElectron4, datarows::PidKaon4, datarows::PidProton4,
164+
datarows::HasTof1, datarows::HasTof2, datarows::HasTof3, datarows::HasTof4);
159165
} // namespace o2::aod
160166

161167
struct UpcVmRof {
@@ -204,6 +210,8 @@ struct UpcVmRof {
204210
// PbPb triggers: 1ZNC, FV0CH+FT0VTX, OO: 1ZNC, FT0CE+FT0VTX
205211
static constexpr int Ft0VtxIdx = 2;
206212
static constexpr int Ft0CeIdx = 4;
213+
static constexpr int Ft0AIdx = 0;
214+
static constexpr int Ft0CIdx = 1;
207215

208216
// number of tracks for the selected event topologies
209217
static constexpr int NTrksTwoBody = 2;
@@ -390,6 +398,10 @@ struct UpcVmRof {
390398
// trigger info per bcb
391399
bcTH2Pointers[Form("bc/%d/ft0Vtx_bcb_H", run)] = bcTH2Registry.add<TH2>(Form("bc/%d/ft0Vtx_bcb_H", run), "ft0Vtx triggers; TF; bc-B idx; Counter",
392400
{HistType::kTH2F, {{nBinsTF, -0.5, static_cast<double>(lastTFinHisto) - 0.5}, {nbcB, -0.5, nbcB - 0.5}}});
401+
bcTH2Pointers[Form("bc/%d/ft0CnotA_bcb_H", run)] = bcTH2Registry.add<TH2>(Form("bc/%d/ft0CnotA_bcb_H", run), "ft0CnotA triggers; TF; bc-B idx; Counter",
402+
{HistType::kTH2F, {{nBinsTF, -0.5, static_cast<double>(lastTFinHisto) - 0.5}, {nbcB, -0.5, nbcB - 0.5}}});
403+
bcTH2Pointers[Form("bc/%d/ft0AnotC_bcb_H", run)] = bcTH2Registry.add<TH2>(Form("bc/%d/ft0AnotC_bcb_H", run), "ft0AnotC triggers; TF; bc-B idx; Counter",
404+
{HistType::kTH2F, {{nBinsTF, -0.5, static_cast<double>(lastTFinHisto) - 0.5}, {nbcB, -0.5, nbcB - 0.5}}});
393405
bcTH2Pointers[Form("bc/%d/ft0VtxCe_bcb_H", run)] = bcTH2Registry.add<TH2>(Form("bc/%d/ft0VtxCe_bcb_H", run), "ft0Vtx triggers; TF; bc-B idx; Counter",
394406
{HistType::kTH2F, {{nBinsTF, -0.5, static_cast<double>(lastTFinHisto) - 0.5}, {nbcB, -0.5, nbcB - 0.5}}});
395407
} // addBcHistos
@@ -491,7 +503,15 @@ struct UpcVmRof {
491503
// get triggers
492504
std::bitset<64> mask = bc.inputMask();
493505
bool ft0vtxTrg = mask[Ft0VtxIdx];
506+
bool ft0aTrg = mask[Ft0AIdx];
507+
bool ft0cTrg = mask[Ft0CIdx];
494508
bool ft0ceTrg = mask[Ft0CeIdx];
509+
if (ft0aTrg && !ft0cTrg) {
510+
bcTH2Pointers[Form("bc/%d/ft0AnotC_bcb_H", runNumberBc)]->Fill(thisTF, bcbIdx[thisBC]);
511+
}
512+
if (!ft0aTrg && ft0cTrg) {
513+
bcTH2Pointers[Form("bc/%d/ft0CnotA_bcb_H", runNumberBc)]->Fill(thisTF, bcbIdx[thisBC]);
514+
}
495515
if (ft0vtxTrg) {
496516
bcTH2Pointers[Form("bc/%d/ft0Vtx_H", runNumberBc)]->Fill(thisTF, thisROF);
497517
bcTH2Pointers[Form("bc/%d/ft0Vtx_bcb_H", runNumberBc)]->Fill(thisTF, bcbIdx[thisBC]);
@@ -745,17 +765,37 @@ struct UpcVmRof {
745765

746766
// fill output table
747767
const int recoFlag = ((col.flags() & dataformats::Vertex<o2::dataformats::TimeStamp<int>>::Flags::UPCMode) != 0) ? upcReco : stdReco;
768+
int tof[4] = {0,0,0,0};
748769
if (isTwoBody) {
770+
if (selTrks[0].hasTOF()) {
771+
tof[0] = 1;
772+
}
773+
if (selTrks[1].hasTOF()) {
774+
tof[1] = 1;
775+
}
749776
colTH1Pointers[Form("col/%d/twoTrkTF_H", runNumberCol)]->Fill(thisTF);
750777
twoTrkTable(runNumberCol, col.posX(), col.posY(), col.posZ(), col.chi2(), thisBC, thisTF, thisROF, recoFlag,
751778
aFT0A, aFT0C, aFV0A, aFDDA, aFDDC, tFT0A, tFT0C, tFV0A, tFDDA, tFDDC, nFT0A, nFT0C, nFV0A, nFDDA, nFDDC,
752779
eZNA, eZNC, tZNA, tZNC,
753780
selTrks[0].pt(), selTrks[0].eta(), selTrks[0].phi(), selTrks[0].sign(),
754781
selTrks[0].tpcNSigmaPi(), selTrks[0].tpcNSigmaEl(), selTrks[0].tpcNSigmaKa(), selTrks[0].tpcNSigmaPr(),
755782
selTrks[1].pt(), selTrks[1].eta(), selTrks[1].phi(), selTrks[1].sign(),
756-
selTrks[1].tpcNSigmaPi(), selTrks[1].tpcNSigmaEl(), selTrks[1].tpcNSigmaKa(), selTrks[1].tpcNSigmaPr());
783+
selTrks[1].tpcNSigmaPi(), selTrks[1].tpcNSigmaEl(), selTrks[1].tpcNSigmaKa(), selTrks[1].tpcNSigmaPr(),
784+
tof[0], tof[1]);
757785
}
758786
if (isFourBody) {
787+
if (selTrks[0].hasTOF()) {
788+
tof[0] = 1;
789+
}
790+
if (selTrks[1].hasTOF()) {
791+
tof[1] = 1;
792+
}
793+
if (selTrks[2].hasTOF()) {
794+
tof[2] = 1;
795+
}
796+
if (selTrks[3].hasTOF()) {
797+
tof[3] = 1;
798+
}
759799
colTH1Pointers[Form("col/%d/fourTrkTF_H", runNumberCol)]->Fill(thisTF);
760800
fourTrkTable(runNumberCol, col.posX(), col.posY(), col.posZ(), col.chi2(), thisBC, thisTF, thisROF, recoFlag,
761801
aFT0A, aFT0C, aFV0A, aFDDA, aFDDC, tFT0A, tFT0C, tFV0A, tFDDA, tFDDC, nFT0A, nFT0C, nFV0A, nFDDA, nFDDC,
@@ -767,7 +807,8 @@ struct UpcVmRof {
767807
selTrks[2].pt(), selTrks[2].eta(), selTrks[2].phi(), selTrks[2].sign(),
768808
selTrks[2].tpcNSigmaPi(), selTrks[2].tpcNSigmaEl(), selTrks[2].tpcNSigmaKa(), selTrks[2].tpcNSigmaPr(),
769809
selTrks[3].pt(), selTrks[3].eta(), selTrks[3].phi(), selTrks[3].sign(),
770-
selTrks[3].tpcNSigmaPi(), selTrks[3].tpcNSigmaEl(), selTrks[3].tpcNSigmaKa(), selTrks[3].tpcNSigmaPr());
810+
selTrks[3].tpcNSigmaPi(), selTrks[3].tpcNSigmaEl(), selTrks[3].tpcNSigmaKa(), selTrks[3].tpcNSigmaPr(),
811+
tof[0], tof[1], tof[2], tof[3]);
771812
}
772813

773814
} // end processCol

0 commit comments

Comments
 (0)