Skip to content

Commit ee4f8a4

Browse files
mfasDashahor02
andauthored
[EMCAL-684] Add mapping for FEC index (#5576)
* [EMCAL-684] Add mapping for FEC index FEC index in supermodule is encoded based on the DDL (FEC) in the RDH, the FEC index in the ALTRO channel and the branch index. A mapping function in the MappingHandler calculates the absolute FEC index based on the parameters specified above. * Add braces to if statement Co-authored-by: Ruben Shahoyan <shahor02@users.noreply.github.com>
1 parent 2dfd8e2 commit ee4f8a4

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Detectors/EMCAL/base/include/EMCALBase/Mapper.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,12 @@ class MappingHandler
339339
/// \throw DDLInvalid if DDL is invalid for EMCAL
340340
Mapper& getMappingForDDL(int ddl);
341341

342+
/// \brief Get FEC index for channel based on DDL and information in the channel header
343+
/// \param ddl Absolute DDL index
344+
/// \param channelFEC FEC index in channel header
345+
/// \param branch Branch index (0 or 1) in DDL
346+
int getFEEForChannelInDDL(int dll, int channelFEC, int branch);
347+
342348
private:
343349
std::array<Mapper, 4> mMappings; ///< Mapping container
344350

Detectors/EMCAL/base/src/Mapper.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,19 @@ Mapper& MappingHandler::getMappingForDDL(int ddl)
119119
return mMappings[sideID * NDDLSM + ddlInSM];
120120
}
121121

122+
int MappingHandler::getFEEForChannelInDDL(int ddl, int channelFEC, int branch)
123+
{
124+
int ddlInSupermodule = ddl % 2;
125+
int fecID = ddlInSupermodule ? 20 : 0;
126+
if (branch) {
127+
fecID += 10;
128+
}
129+
fecID += channelFEC;
130+
return fecID;
131+
}
132+
122133
std::ostream& o2::emcal::operator<<(std::ostream& stream, const Mapper::ChannelID& channel)
123134
{
124135
stream << "Row " << static_cast<int>(channel.mRow) << ", Column " << static_cast<int>(channel.mColumn) << ", type " << o2::emcal::channelTypeToString(channel.mChannelType);
125136
return stream;
126-
}
137+
}

Detectors/EMCAL/reconstruction/include/EMCALReconstruction/Channel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class Channel
105105
/// \throw HadrwareAddressError in case the hardware address is not initialized
106106
int getBranchIndex() const;
107107

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

0 commit comments

Comments
 (0)