Skip to content
Snippets Groups Projects
Commit 6ebc32e7 authored by Pascal Raisig's avatar Pascal Raisig Committed by Pierre-Alain Loizeau
Browse files

Add multi hit extraction function to TrdDigi

parent bfb432bd
No related branches found
No related tags found
1 merge request!415Include all unpackers in the new /reco/steer/ based scheme
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <iomanip> // for operator<<, setprecision, setw #include <iomanip> // for operator<<, setprecision, setw
#include <sstream> // for operator<<, basic_ostream, stringstream #include <sstream> // for operator<<, basic_ostream, stringstream
#include <string> // for char_traits #include <string> // for char_traits
#include <utility>
using std::endl; using std::endl;
using std::string; using std::string;
...@@ -171,6 +172,18 @@ Double_t CbmTrdDigi::GetCharge(Double_t& tilt, Int_t& dt) const ...@@ -171,6 +172,18 @@ Double_t CbmTrdDigi::GetCharge(Double_t& tilt, Int_t& dt) const
//_________________________________________________________________________________ //_________________________________________________________________________________
Double_t CbmTrdDigi::GetChargeError() const { return 0; } Double_t CbmTrdDigi::GetChargeError() const { return 0; }
//_________________________________________________________________________________
std::pair<CbmTrdDigi::eTriggerType, bool> CbmTrdDigi::GetTriggerPair(const Int_t triggerValue)
{
// First get the trigger type kSelf or kNeighbor it is written to the first bit of the trigger bits.
eTriggerType type = static_cast<eTriggerType>(triggerValue & 1);
// Now extract if we had a multihit or not the info is written two the next bit
bool isMultihit = static_cast<bool>((triggerValue >> 1) & 1);
return std::make_pair(type, isMultihit);
}
//_________________________________________________________________________________ //_________________________________________________________________________________
Bool_t CbmTrdDigi::IsFlagged(const Int_t iflag) const Bool_t CbmTrdDigi::IsFlagged(const Int_t iflag) const
{ {
......
...@@ -151,6 +151,14 @@ public: ...@@ -151,6 +151,14 @@ public:
} }
/** \brief Channel trigger type. SPADIC specific see CbmTrdTriggerType*/ /** \brief Channel trigger type. SPADIC specific see CbmTrdTriggerType*/
Int_t GetTriggerType() const { return (fInfo >> fgkTrgOffset) & 0x3; } Int_t GetTriggerType() const { return (fInfo >> fgkTrgOffset) & 0x3; }
/**
* @brief Get the trigger combination, i.e. St or Nt and is multihit or not (true/false)
* @param[in] Int_t trigger value of a digi as stored in fInfo
* @return std::pair<eTriggerType, bool> <St or Nt, multihit or not>
*/
static std::pair<eTriggerType, bool> GetTriggerPair(const Int_t triggerValue);
/** \brief Channel FEE SPADIC/FASP according to CbmTrdAsicType*/ /** \brief Channel FEE SPADIC/FASP according to CbmTrdAsicType*/
eCbmTrdAsicType GetType() const eCbmTrdAsicType GetType() const
{ {
......
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