Skip to content

Commit

Permalink
Common: add outer FV0A mult
Browse files Browse the repository at this point in the history
  • Loading branch information
David Dobrigkeit Chinellato committed Dec 23, 2024
1 parent e5d64ac commit 5ca30d1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
29 changes: 16 additions & 13 deletions Common/DataModel/Multiplicity.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@ namespace o2::aod
{
namespace mult
{
DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //!
DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //!
DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //!
DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //!
DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //!
DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //!
DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //!
DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //!
DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //!
DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //!
DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //!
DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //!
DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //!
DECLARE_SOA_COLUMN(MultFV0A, multFV0A, float); //!
DECLARE_SOA_COLUMN(MultFV0AOuter, multFV0AOuter, float); //!
DECLARE_SOA_COLUMN(MultFV0C, multFV0C, float); //!
DECLARE_SOA_COLUMN(MultFT0A, multFT0A, float); //!
DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); //!
DECLARE_SOA_COLUMN(MultFDDA, multFDDA, float); //!
DECLARE_SOA_COLUMN(MultFDDC, multFDDC, float); //!
DECLARE_SOA_COLUMN(MultZNA, multZNA, float); //!
DECLARE_SOA_COLUMN(MultZNC, multZNC, float); //!
DECLARE_SOA_COLUMN(MultZEM1, multZEM1, float); //!
DECLARE_SOA_COLUMN(MultZEM2, multZEM2, float); //!
DECLARE_SOA_COLUMN(MultZPA, multZPA, float); //!
DECLARE_SOA_COLUMN(MultZPC, multZPC, float); //!
DECLARE_SOA_DYNAMIC_COLUMN(MultFV0M, multFV0M, //!
[](float multFV0A, float multFV0C) -> float { return multFV0A + multFV0C; });
DECLARE_SOA_DYNAMIC_COLUMN(MultFT0M, multFT0M, //!
[](float multFT0A, float multFT0C) -> float { return multFT0A + multFT0C; });
Expand Down Expand Up @@ -95,6 +96,8 @@ DECLARE_SOA_COLUMN(TimeToNeNext, timeToNeNext, float); //!
DECLARE_SOA_TABLE(FV0Mults, "AOD", "FV0MULT", //! Multiplicity with the FV0 detector
mult::MultFV0A, mult::MultFV0C,
mult::MultFV0M<mult::MultFV0A, mult::MultFV0C>);
DECLARE_SOA_TABLE(FV0AOuterMults, "AOD", "FVOAOUTERMULT", //! FV0 without innermost ring
mult::MultFV0AOuter);
DECLARE_SOA_TABLE(FT0Mults, "AOD", "FT0MULT", //! Multiplicity with the FT0 detector
mult::MultFT0A, mult::MultFT0C,
mult::MultFT0M<mult::MultFT0A, mult::MultFT0C>);
Expand Down
13 changes: 12 additions & 1 deletion Common/TableProducer/multiplicityTable.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ static const int defaultParameters[nTables][nParameters]{{-1}, {-1}, {-1}, {-1},
struct MultiplicityTable {
SliceCache cache;
Produces<aod::FV0Mults> tableFV0; // 0
Produces<aod::FV0AOuterMults> tableFV0AOuter; // 0-bis (produced with FV0)
Produces<aod::FT0Mults> tableFT0; // 1
Produces<aod::FDDMults> tableFDD; // 2
Produces<aod::ZDCMults> tableZDC; // 3
Expand Down Expand Up @@ -236,6 +237,7 @@ struct MultiplicityTable {
aod::FT0s const&)
{
float multFV0A = 0.f;
float multFV0Aouter = 0.f;
float multFV0C = 0.f;
float multFT0A = 0.f;
float multFT0C = 0.f;
Expand Down Expand Up @@ -307,6 +309,7 @@ struct MultiplicityTable {
switch (i) {
case kFV0Mults: // FV0
tableFV0.reserve(collisions.size());
tableFV0AOuter.reserve(collisions.size());
break;
case kFT0Mults: // FT0
tableFT0.reserve(collisions.size());
Expand Down Expand Up @@ -354,6 +357,7 @@ struct MultiplicityTable {

// Initializing multiplicity values
float multFV0A = 0.f;
float multFV0AOuter = 0.f;
float multFV0C = 0.f;
float multFT0A = 0.f;
float multFT0C = 0.f;
Expand Down Expand Up @@ -429,18 +433,25 @@ struct MultiplicityTable {
case kFV0Mults: // FV0
{
multFV0A = 0.f;
multFV0AOuter = 0.f;
multFV0C = 0.f;
// using FV0 row index from event selection task
if (collision.has_foundFV0()) {
const auto& fv0 = collision.foundFV0();
for (auto amplitude : fv0.amplitude()) {
for (size_t ii=0; ii<fv0.amplitude().size(); ii++) {
auto amplitude = fv0.amplitude()[ii];
auto channel = fv0.channel()[ii];
multFV0A += amplitude;
if(channel>7){
multFV0AOuter += amplitude;
}
}
} else {
multFV0A = -999.f;
multFV0C = -999.f;
}
tableFV0(multFV0A, multFV0C);
tableFV0AOuter(multFV0AOuter);
LOGF(debug, "multFV0A=%5.0f multFV0C=%5.0f", multFV0A, multFV0C);
} break;
case kFT0Mults: // FT0
Expand Down

0 comments on commit 5ca30d1

Please sign in to comment.