Skip to content
Snippets Groups Projects
Commit 4c1c2424 authored by Alexandru Bercuci's avatar Alexandru Bercuci
Browse files

nomenclature changes reflecting the possibility of having different

chambers coupled with different FEEs
parent 785e06f1
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !634. Comments created here will be created in the context of that merge request.
......@@ -20,7 +20,7 @@ using std::string;
using std::stringstream;
using std::vector;
//____________________________________________________________________
CbmTrdCluster::CbmTrdCluster() : CbmCluster(), fNCols(0), fNRows(0xff), fStartCh(0xffff), fStartTime(0xffffffff) {}
CbmTrdCluster::CbmTrdCluster() : CbmCluster(), fNCols(0), fNRows(0x1f), fStartCh(0xffff), fStartTime(0xffffffff) {}
//____________________________________________________________________
CbmTrdCluster::CbmTrdCluster(const CbmTrdCluster& ref)
......@@ -36,7 +36,7 @@ CbmTrdCluster::CbmTrdCluster(const CbmTrdCluster& ref)
CbmTrdCluster::CbmTrdCluster(const std::vector<int32_t>& indices, int32_t address)
: CbmCluster(indices, address)
, fNCols(0)
, fNRows(0xff)
, fNRows(0x1f)
, fStartCh(0xffff)
, fStartTime(0xffffffff)
{
......@@ -46,7 +46,7 @@ CbmTrdCluster::CbmTrdCluster(const std::vector<int32_t>& indices, int32_t addres
CbmTrdCluster::CbmTrdCluster(int32_t address, int32_t idx, int32_t ch, int32_t row, int32_t time)
: CbmCluster()
, fNCols(0)
, fNRows(0xff)
, fNRows(0x1f)
, fStartCh(0xffff)
, fStartTime(0xffffffff)
{
......@@ -104,7 +104,7 @@ void CbmTrdCluster::Clear(Option_t*)
{
CbmCluster::ClearDigis();
fNCols = 0;
fNRows = 0xff;
fNRows = 0x1f;
fStartCh = 0xffff;
fStartTime = 0xffffffff;
}
......@@ -137,7 +137,7 @@ int32_t CbmTrdCluster::IsChannelInRange(int32_t ch) const
}
//____________________________________________________________________
bool CbmTrdCluster::Merge(CbmTrdCluster* second)
bool CbmTrdCluster::Merge(CbmTrdCluster* second, bool typ)
{
if (GetRow() != second->GetRow()) return false;
// time difference condition
......@@ -160,8 +160,8 @@ bool CbmTrdCluster::Merge(CbmTrdCluster* second)
if (second->HasOpenStart()) SetProfileStart();
return true;
}
// special care for FASP clusters which can be merged also on pairing neighboring
if (HasTrianglePads()) {
// special care for clusters which can be merged also on pairing neighboring on 2D read-out
if (typ) {
if ((second->fStartCh + second->fNCols - 1 == fStartCh) && second->HasOpenStop()
&& HasOpenStart()) { // need to merge digi
fStartCh = second->fStartCh;
......@@ -187,8 +187,8 @@ bool CbmTrdCluster::Merge(CbmTrdCluster* second)
return true;
}
// special care for FASP clusters which can be merged also on pairing neighboring
if (HasTrianglePads()) {
// special care for clusters which can be merged also on pairing neighboring on 2D read-out
if (typ) {
if ((fStartCh + fNCols - 1 == second->fStartCh) && HasOpenStop() && second->HasOpenStart()) { // need to merge digi
fNCols += second->fNCols - 1;
fStartTime = std::min(fStartTime, second->fStartTime);
......@@ -206,8 +206,8 @@ string CbmTrdCluster::ToString() const
{
stringstream ss;
ss << CbmCluster::ToString();
ss << "CbmTrdCluster: mod=" << GetAddress() << " t0=" << fStartTime << " R=" << (int32_t) GetRow() << " "
<< (HasTrianglePads() ? "T" : "R") << "Chs=";
ss << "CbmTrdCluster: mod=" << GetAddress() << " t0=" << fStartTime << " row=" << (int32_t) GetRow() << " "
<< (HasFaspDigis() ? "Fasp " : "Spadic ") << "Chs=";
ss << (HasOpenStart() ? "/" : "|");
for (int32_t i(0); i < fNCols; i++)
ss << fStartCh + i << " ";
......
......@@ -26,9 +26,9 @@
*/
class CbmTrdCluster : public CbmCluster {
public:
enum CbmTrdClusterDef
enum eCbmTrdClusterDef
{
kTriang = 5 ///< set type of pads on which the cluster is reconstructed
kFasp = 5 ///< set type of FEE digis contained
,
kProfileStart ///< only for triangular if no T in first col
,
......@@ -71,7 +71,7 @@ public:
uint16_t GetRow() const { return GetNRows(); }
uint16_t GetStartCh() const { return fStartCh; }
uint32_t GetStartTime() const { return fStartTime; }
bool HasTrianglePads() const { return TESTBIT(fNRows, kTriang); }
bool HasFaspDigis() const { return TESTBIT(fNRows, kFasp); }
bool HasOpenStart() const { return TESTBIT(fNRows, kProfileStart); }
bool HasOpenStop() const { return TESTBIT(fNRows, kProfileStop); }
......@@ -82,9 +82,10 @@ public:
int32_t IsChannelInRange(int32_t ch) const;
/** \brief Merge current cluster with info from second
* \param[in] second cluster to be added
* \param[in] typ the type of pad-plane of the source chamber; true if Trd2d
* \return success or fail
*/
bool Merge(CbmTrdCluster* second);
bool Merge(CbmTrdCluster* second, bool typ = true);
/** \brief Initialize basic parameters of the cluster
* \param[in] address global module address
* \param[in] row cluster row in the module
......@@ -98,7 +99,7 @@ public:
fNRows &= (7 << 5);
fNRows |= (nrows & 0x1f);
}
void SetTrianglePads(bool set = true) { set ? SETBIT(fNRows, kTriang) : CLRBIT(fNRows, kTriang); }
void SetFaspDigis(bool set = true) { set ? SETBIT(fNRows, kFasp) : CLRBIT(fNRows, kFasp); }
void SetProfileStart(bool set = true) { set ? SETBIT(fNRows, kProfileStart) : CLRBIT(fNRows, kProfileStart); }
void SetProfileStop(bool set = true) { set ? SETBIT(fNRows, kProfileStop) : CLRBIT(fNRows, kProfileStop); }
......@@ -106,8 +107,8 @@ public:
virtual std::string ToString() const;
protected:
uint8_t fNCols; // number of columns with charge above threshold
uint8_t fNRows; // cluster row info plus extra. Use dedicated getters for the correct value
uint8_t fNCols; //! number of columns with charge above threshold
uint8_t fNRows; //! cluster row info plus extra meta data. Use dedicated getters for the correct value
uint16_t fStartCh; //! channel address of first channel
uint32_t fStartTime; //! start time of cluster in clk units wrt buffer start
......
......@@ -300,7 +300,7 @@ void CbmTrdDigi::SetTriggerType(const int32_t ttype)
string CbmTrdDigi::ToString() const
{
stringstream ss;
ss << "CbmTrdDigi(" << (GetType() == eCbmTrdAsicType::kFASP ? "T)" : "R)")
ss << "CbmTrdDigi(" << (GetType() == eCbmTrdAsicType::kFASP ? "F)" : "S)")
<< " | moduleAddress=" << GetAddressModule() << " | layer=" << Layer() << " | moduleId=" << Module()
<< " | pad=" << GetAddressChannel() << " | time[ns]=" << std::fixed << std::setprecision(1) << GetTime();
if (GetType() == eCbmTrdAsicType::kFASP) {
......
......@@ -34,7 +34,7 @@ public:
kTrg2,
kNTrg
};
enum CbmTrdDigiDef
enum eCbmTrdDigiDef
{
kFlag1 = 0 //<
,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment