Skip to content

Commit 66f232d

Browse files
authored
[PWGUD] Remove ZDC fields from MC output (#17653)
1 parent 40214ad commit 66f232d

2 files changed

Lines changed: 56 additions & 54 deletions

File tree

PWGUD/DataModel/TauThreeProngEventTables.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ DECLARE_SOA_TABLE(TrueTauFourTracks, "AOD", "TRUETAU",
180180
// tautree::Trs, tautree::Trofs, tautree::Hmpr,
181181
// tautree::Tfb, tautree::ItsRofb, tautree::Sbp, tautree::ZvtxFT0vsPv, tautree::VtxITSTPC,
182182
//
183-
tautree::ZdcAenergy, tautree::ZdcCenergy,
184-
tautree::ZdcAtime, tautree::ZdcCtime,
183+
// zdc information do not exist in MC
184+
// tautree::ZdcAenergy, tautree::ZdcCenergy,
185+
// tautree::ZdcAtime, tautree::ZdcCtime,
185186
// tautree::Qtot,
186187
tautree::TotalFT0AmplitudeA, tautree::TotalFT0AmplitudeC, tautree::TotalFV0AmplitudeA,
187188
// tautree::TimeFT0A, tautree::TimeFT0C, tautree::TimeFV0A,
@@ -248,8 +249,9 @@ DECLARE_SOA_TABLE(TrueTauSixTracks, "AOD", "TRUETAUSIX",
248249
// tautree::Trs, tautree::Trofs, tautree::Hmpr,
249250
// tautree::Tfb, tautree::ItsRofb, tautree::Sbp, tautree::ZvtxFT0vsPv, tautree::VtxITSTPC,
250251
//
251-
tautree::ZdcAenergy, tautree::ZdcCenergy,
252-
tautree::ZdcAtime, tautree::ZdcCtime,
252+
// ZDC information do not exist in MC
253+
// tautree::ZdcAenergy, tautree::ZdcCenergy,
254+
// tautree::ZdcAtime, tautree::ZdcCtime,
253255
// tautree::Qtot,
254256
tautree::TotalFT0AmplitudeA, tautree::TotalFT0AmplitudeC, tautree::TotalFV0AmplitudeA,
255257
// tautree::TimeFT0A, tautree::TimeFT0C, tautree::TimeFV0A,

PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,7 @@ struct TauThreeProngEventTableProducer {
834834
// different events flags
835835
int8_t bcSels[8] = {-99, -99, -99, -99, -99, -99, -99, -99};
836836
uint8_t bcSelBits = 0;
837+
const int nBitsMax = 8;
837838
bcSels[0] = dgcand.trs();
838839
bcSels[1] = dgcand.trofs();
839840
bcSels[2] = dgcand.hmpr();
@@ -845,7 +846,7 @@ struct TauThreeProngEventTableProducer {
845846

846847
const int offset = 1;
847848
bcSelBits = bcSels[0]; // initialization
848-
for (int ibit = 1; ibit < 8; ibit++) {
849+
for (int ibit = 1; ibit < nBitsMax; ibit++) {
849850
bcSelBits = (bcSelBits << offset); // shift by 1 position towards left
850851
bcSelBits += bcSels[ibit]; // add next bit to the pool
851852
}
@@ -1257,7 +1258,7 @@ struct TauThreeProngEventTableProducer {
12571258
continue;
12581259
}
12591260

1260-
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(3., 1.); // particles from tau in |eta|<0.9
1261+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(3., 1.); // charged particles from tau in |eta|<0.9
12611262

12621263
registrySkim.get<TH1>(HIST("skim/nChPartMC"))->Fill(nChargedDaughtersTau[0] + nChargedDaughtersTau[1]); // N charged particles from taus
12631264
// check number of charged particles in MC event
@@ -1267,18 +1268,12 @@ struct TauThreeProngEventTableProducer {
12671268
continue;
12681269
}
12691270

1270-
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(4., 1.); // 1+3 (3+3) topology
1271-
if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == fourTracks) { // 4
1272-
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(5., 1.);
1273-
} else if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == sixTracks) { // 6
1274-
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(6., 1.);
1275-
}
1276-
1277-
// if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == fourTracks) { // 4
1278-
// registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(7., 1.);
1279-
// } else if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == sixTracks) { // 6
1280-
// registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(8., 1.);
1281-
// }
1271+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(4., 1.); // 1+3 (3+3) topology = 4 or 6 tracks
1272+
// if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == fourTracks) { // 4
1273+
// registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(5., 1.);
1274+
// } else if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == sixTracks) { // 6
1275+
// registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(6., 1.);
1276+
// }
12821277

12831278
if ((nChargedDaughtersTau[0] == oneProng) || // 1
12841279
(nChargedDaughtersTau[0] == threeProng && nChargedDaughtersTau[1] == threeProng)) // 3 and 3
@@ -1303,11 +1298,12 @@ struct TauThreeProngEventTableProducer {
13031298
double hadronicRate = -999.;
13041299
int8_t bcSels[8] = {-99, -99, -99, -99, -99, -99, -99, -99};
13051300
uint8_t bcSelBits = 0;
1301+
const int nBitsMax = 8;
13061302
// zdc information - there is no information in MC
1307-
float energyZNA = -999.;
1308-
float energyZNC = -999.;
1309-
float timeZNA = -999.;
1310-
float timeZNC = -999.;
1303+
// float energyZNA = -999.;
1304+
// float energyZNC = -999.;
1305+
// float timeZNA = -999.;
1306+
// float timeZNC = -999.;
13111307

13121308
float amplitudesFIT[3] = {-999., -999., -999.}; // FT0A, FT0C, FV0
13131309
// float timesFIT[3] = {-999., -999., -999.}; // FT0A, FT0C, FV0
@@ -1350,7 +1346,7 @@ struct TauThreeProngEventTableProducer {
13501346
float trueDaugY[6] = {-998., -998., -998., -998., -998., -998.};
13511347
float trueDaugZ[6] = {-998., -998., -998., -998., -998., -998.};
13521348
int trueDaugPdgCode[6] = {-999, -999, -999, -999, -999, -999};
1353-
// bool problem = false;
1349+
13541350
MyRecoProblem problem = NO_PROBLEM;
13551351
registrySkim.get<TH1>(HIST("skim/problemMC"))->Fill(NO_PROBLEM);
13561352

@@ -1360,14 +1356,19 @@ struct TauThreeProngEventTableProducer {
13601356
// 3 = pi+3pi
13611357
// 4 = 3pi+3pi
13621358

1363-
if (nElec == oneProng && nPi == threeProng) // 1 + 3
1359+
if (nElec == oneProng && nPi == threeProng) { // 1 + 3
13641360
trueChannel = 1;
1365-
else if (nMuon == oneProng && nPi == threeProng) // 1 + 3
1361+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(5., 1.);
1362+
} else if (nMuon == oneProng && nPi == threeProng) { // 1 + 3
13661363
trueChannel = 2;
1367-
else if (nPi == fourTracks) // 4
1364+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(6., 1.);
1365+
} else if (nPi == fourTracks) { // 4
13681366
trueChannel = 3;
1369-
else if (nPi == sixTracks) // 6
1367+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(7., 1.);
1368+
} else if (nPi == sixTracks) { // 6
13701369
trueChannel = 4;
1370+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(8., 1.);
1371+
}
13711372

13721373
// LOGF(info, "MC Coll global index %d", mccoll.globalIndex());
13731374
// LOGF(info, "2. <MC> UDMcCollision size %d, Collisions size %d, UDtracks %d, UDMcParticles %d", mcCollisions.size(), collisions.size(), tracks.size(), mcParticles.size());
@@ -1383,6 +1384,7 @@ struct TauThreeProngEventTableProducer {
13831384
if (collFromMcColls.size() > 0) { // get the truth and reco-level info
13841385
if (verbose)
13851386
LOGF(info, "--- MC Collision has reconstructed collision!");
1387+
registrySkim.get<TH1>(HIST("skim/efficiencyMC"))->Fill(9., 1.);
13861388
// trueHasRecoColl = true;
13871389
// check there is exactly one reco-level collision associated to generated collision
13881390
if (collFromMcColls.size() > 1) {
@@ -1446,7 +1448,7 @@ struct TauThreeProngEventTableProducer {
14461448

14471449
const int offset = 1;
14481450
bcSelBits = bcSels[0]; // initialization
1449-
for (int ibit = 1; ibit < 8; ibit++) {
1451+
for (int ibit = 1; ibit < nBitsMax; ibit++) {
14501452
bcSelBits = (bcSelBits << offset); // shift by 1 position towards left
14511453
bcSelBits += bcSels[ibit]; // add next bit to the pool
14521454
}
@@ -1624,8 +1626,8 @@ struct TauThreeProngEventTableProducer {
16241626
bcSelBits,
16251627
// bcSels[0], bcSels[1], bcSels[2], // to test it
16261628
// bcSels[3], bcSels[4], bcSels[5], bcSels[6], bcSels[7],
1627-
energyZNA, energyZNC,
1628-
timeZNA, timeZNC,
1629+
// energyZNA, energyZNC,
1630+
// timeZNA, timeZNC,
16291631
// qtot, <<-------- comment out
16301632
amplitudesFIT[0], amplitudesFIT[1], amplitudesFIT[2],
16311633
// timesFIT[0], timesFIT[1], timesFIT[2],
@@ -1656,8 +1658,8 @@ struct TauThreeProngEventTableProducer {
16561658
bcSelBits,
16571659
// bcSels[0], bcSels[1], bcSels[2], // to test it
16581660
// bcSels[3], bcSels[4], bcSels[5], bcSels[6], bcSels[7],
1659-
energyZNA, energyZNC,
1660-
timeZNA, timeZNC,
1661+
// energyZNA, energyZNC,
1662+
// timeZNA, timeZNC,
16611663
// qtot, <<-------- comment out
16621664
amplitudesFIT[0], amplitudesFIT[1], amplitudesFIT[2],
16631665
// timesFIT[0], timesFIT[1], timesFIT[2],
@@ -1839,7 +1841,7 @@ struct TauThreeProngEventTableProducer {
18391841
continue;
18401842
}
18411843

1842-
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(3., 1.); // particles from tau in |eta|<=0.9
1844+
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(3., 1.); // charged particles from tau in |eta|<=0.9
18431845

18441846
registrySkim.get<TH1>(HIST("gen/nChPartMC"))->Fill(nChargedDaughtersTau[0] + nChargedDaughtersTau[1]); // N charged particles from taus
18451847
// check number of charged particles in MC event
@@ -1850,11 +1852,6 @@ struct TauThreeProngEventTableProducer {
18501852
}
18511853

18521854
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(4., 1.); // 1+3 (3+3) topology = 4 or 6 tracks
1853-
// if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == fourTracks) { // 4
1854-
// registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(5., 1.);
1855-
// } else if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == sixTracks) { // 6
1856-
// registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(6., 1.);
1857-
// }
18581855

18591856
if ((nChargedDaughtersTau[0] == oneProng) || // 1
18601857
(nChargedDaughtersTau[0] == threeProng && nChargedDaughtersTau[1] == threeProng)) // 3 and 3
@@ -1890,22 +1887,6 @@ struct TauThreeProngEventTableProducer {
18901887
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(8., 1.);
18911888
}
18921889

1893-
bool trueHasRecoColl = false;
1894-
// find reconstructed collisions associated to the generated collision
1895-
auto const& collFromMcColls = collisions.sliceBy(colPerMcCollision, mccoll.globalIndex());
1896-
if (verbose)
1897-
LOGF(info, "-- coll from MC Coll %d", collFromMcColls.size());
1898-
// check the generated collision was reconstructed
1899-
if (collFromMcColls.size() > 0) { // get the truth and reco-level info
1900-
trueHasRecoColl = true;
1901-
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(9., 1.);
1902-
if (verbose)
1903-
LOGF(info, "--- MC Collision has reconstructed collision!");
1904-
} else { // get only the truth information.
1905-
if (verbose)
1906-
LOGF(info, "MC Collision has NO reconstructed collision!");
1907-
}
1908-
19091890
// get particles associated to generated collision
19101891
auto const& partsFromMcColl = mcParticles.sliceBy(partPerMcCollision, mccoll.globalIndex());
19111892
if (verbose)
@@ -1959,6 +1940,25 @@ struct TauThreeProngEventTableProducer {
19591940
// decide the channel and set the variable.
19601941
trueChannel = trueChannel + countPi0 * 10 + zerothTau * 100;
19611942

1943+
//
1944+
// check whwther event is reconstructed
1945+
//
1946+
bool trueHasRecoColl = false;
1947+
// find reconstructed collisions associated to the generated collision
1948+
auto const& collFromMcColls = collisions.sliceBy(colPerMcCollision, mccoll.globalIndex());
1949+
if (verbose)
1950+
LOGF(info, "-- coll from MC Coll %d", collFromMcColls.size());
1951+
// check the generated collision was reconstructed
1952+
if (collFromMcColls.size() > 0) { // get the truth and reco-level info
1953+
trueHasRecoColl = true;
1954+
registrySkim.get<TH1>(HIST("gen/efficiencyMC"))->Fill(9., 1.);
1955+
if (verbose)
1956+
LOGF(info, "--- MC Collision has reconstructed collision!");
1957+
} else { // get only the truth information.
1958+
if (verbose)
1959+
LOGF(info, "MC Collision has NO reconstructed collision!");
1960+
}
1961+
19621962
// LOGF(info, "Should be written!");
19631963

19641964
if (nChargedDaughtersTau[0] + nChargedDaughtersTau[1] == fourTracks) { // 4

0 commit comments

Comments
 (0)