Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EMCAL-684] Add mapping for FEC index #5576

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions Detectors/EMCAL/base/include/EMCALBase/Mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,12 @@ class MappingHandler
/// \throw DDLInvalid if DDL is invalid for EMCAL
Mapper& getMappingForDDL(int ddl);

/// \brief Get FEC index for channel based on DDL and information in the channel header
/// \param ddl Absolute DDL index
/// \param channelFEC FEC index in channel header
/// \param branch Branch index (0 or 1) in DDL
int getFEEForChannelInDDL(int dll, int channelFEC, int branch);

private:
std::array<Mapper, 4> mMappings; ///< Mapping container

Expand Down
13 changes: 12 additions & 1 deletion Detectors/EMCAL/base/src/Mapper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,19 @@ Mapper& MappingHandler::getMappingForDDL(int ddl)
return mMappings[sideID * NDDLSM + ddlInSM];
}

int MappingHandler::getFEEForChannelInDDL(int ddl, int channelFEC, int branch)
{
int ddlInSupermodule = ddl % 2;
int fecID = ddlInSupermodule ? 20 : 0;
if (branch) {
fecID += 10;
}
fecID += channelFEC;
return fecID;
}

std::ostream& o2::emcal::operator<<(std::ostream& stream, const Mapper::ChannelID& channel)
{
stream << "Row " << static_cast<int>(channel.mRow) << ", Column " << static_cast<int>(channel.mColumn) << ", type " << o2::emcal::channelTypeToString(channel.mChannelType);
return stream;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class Channel
/// \throw HadrwareAddressError in case the hardware address is not initialized
int getBranchIndex() const;

/// \brief Provide the front-end card index for the current hardware address
/// \brief Provide the front-end card index (0-9) in branch for the current hardware address
/// \return Front-end card index for the current hardware address
/// \throw HadrwareAddressError in case the hardware address is not initialized
int getFECIndex() const;
Expand Down