Skip to content
Snippets Groups Projects
Commit 5c66657f authored by Patrick Scholer's avatar Patrick Scholer Committed by Frank Winklmeier
Browse files

Adding relbcid to MM RDO

parent 6a984ec8
No related branches found
No related tags found
No related merge requests found
......@@ -84,10 +84,17 @@ StatusCode MM_DigitToRDO::execute(const EventContext& ctx) const
continue;
}
// at some point the time measurement should be converted to tdc counts and relBcid
// but for now we set relBcid to zero for the simulation
// Patrick Scholer 6. September 2021
uint16_t relBcid = 0;
MM_RawData* rdo = new MM_RawData(newId,
digit->stripResponsePosition().at(i),
digit->stripResponseTime().at(i),
digit->stripResponseCharge().at(i));
digit->stripResponseCharge().at(i),
relBcid);
coll->push_back(rdo);
......
......@@ -11,7 +11,7 @@ namespace Muon
class MM_RawData_p1
{
public:
MM_RawData_p1() : m_id(0), m_channel(0), m_time(0), m_charge(0) {}
MM_RawData_p1() : m_id(0), m_channel(0), m_time(0), m_charge(0), m_relBcid(0) {}
unsigned int m_id; //!< FIXME! Remove this eventually
......@@ -21,6 +21,8 @@ namespace Muon
unsigned int m_time;
unsigned int m_charge;
uint16_t m_relBcid;
};
}
......
......@@ -14,6 +14,7 @@ void Muon::MM_RawDataCnv_p1::transToPers( const Muon::MM_RawData *transObj, Muon
persObj->m_channel = transObj->channel();
persObj->m_time = transObj->time();
persObj->m_charge = transObj->charge();
persObj->m_relBcid = transObj->relBcid();
}
Muon::MM_RawData* Muon::MM_RawDataCnv_p1::createTransient(const Muon::MM_RawData_p1* persObj, MsgStream& /**log*/)
......@@ -21,7 +22,8 @@ Muon::MM_RawData* Muon::MM_RawDataCnv_p1::createTransient(const Muon::MM_RawData
Muon::MM_RawData* trans = new MM_RawData( Identifier (persObj->m_id),
persObj->m_channel,
persObj->m_time,
persObj->m_charge );
persObj->m_charge,
persObj->m_relBcid );
return trans;
}
......
......@@ -48,12 +48,15 @@ inline MmDigit * Muon::MM_RDO_Decoder::getDigit(const Muon::MM_RawData* data) co
int channel = data->channel();
int time = data->time();
int charge = data->charge();
uint16_t relBcid = data->relBcid();
std::vector<float> Time;
std::vector<int> pos;
std::vector<float> Charge;
std::vector<uint16_t> RelBcid;
Time.push_back(time);
pos.push_back(channel);
Charge.push_back(charge);
RelBcid.push_back(relBcid); // needs to be used once time calibration is available. pscholer Sept 2021
// MM_RawData is built using only the first 4 values. The others are now simply filled proper objects.
MmDigit* mmDigit = new MmDigit(Id,Time,pos,Charge,Time,pos,Charge,Time,pos,Charge,pos,pos);
......
......@@ -102,7 +102,7 @@ StatusCode Muon::MM_ROD_Decoder::fillCollection(const OFFLINE_FRAGMENTS_NAMESPAC
Identifier channel_ID = m_MmIdHelper->channelID(module_ID, multi_layer, gas_gap, channel_number, true, &is_validID);
if (!is_validID) { ATH_MSG_ERROR("Invalid identifier created for MM channel"); continue; }
rdo->push_back(new MM_RawData(channel_ID, channel_number, channel->tdo(), channel->pdo())); // isDead = false (ok?)
rdo->push_back(new MM_RawData(channel_ID, channel_number, channel->tdo(), channel->pdo(), channel->rel_bcid())); // isDead = false (ok?)
}
}
......
......@@ -32,16 +32,18 @@ class MM_RawData {
int m_time;
/// adc counts
int m_charge;
/// rel bcid
uint16_t m_relBcid;
public:
/** default constructor */
MM_RawData ( const Identifier& id ) : m_id(id), m_channel(0), m_time(0), m_charge(0) {}
MM_RawData ( const Identifier& id ) : m_id(id), m_channel(0), m_time(0), m_charge(0), m_relBcid(0) {}
MM_RawData ( const Identifier& id, const int channel,
const int time, const int charge )
: m_id(id), m_channel(channel), m_time(time), m_charge(charge) {}
const int time, const int charge, const uint16_t relBcid)
: m_id(id), m_channel(channel), m_time(time), m_charge(charge), m_relBcid(relBcid) {}
MM_RawData () {} ; //!< TODO remove this. Currently have problems with convertor if I do though.
......@@ -53,6 +55,7 @@ class MM_RawData {
// access functions to the online data
int channel() const { return m_channel; }
int time() const { return m_time; }
uint16_t relBcid() const { return m_relBcid; }
int charge() const { return m_charge; }
};
......
......@@ -66,6 +66,7 @@ StatusCode MMRDOVariables::fillVariables(const MuonGM::MuonDetectorManager* Muon
m_NSWMM_rdo_gas_gap->push_back(gas_gap);
m_NSWMM_rdo_channel->push_back(channel);
m_NSWMM_rdo_time->push_back(rdo->time());
m_NSWMM_rdo_relBcid->push_back(rdo->relBcid());
m_NSWMM_rdo_charge->push_back(rdo->charge());
// get the readout element class where the RDO is recorded
......@@ -114,6 +115,7 @@ StatusCode MMRDOVariables::clearVariables()
m_NSWMM_rdo_gas_gap->clear();
m_NSWMM_rdo_channel->clear();
m_NSWMM_rdo_time->clear();
m_NSWMM_rdo_relBcid->clear();
m_NSWMM_rdo_charge->clear();
m_NSWMM_rdo_globalPosX->clear();
......@@ -140,6 +142,7 @@ StatusCode MMRDOVariables::initializeVariables()
m_NSWMM_rdo_gas_gap = new std::vector<int>();
m_NSWMM_rdo_channel = new std::vector<int>();
m_NSWMM_rdo_time = new std::vector<int>();
m_NSWMM_rdo_relBcid = new std::vector<uint16_t>();
m_NSWMM_rdo_charge = new std::vector<int>();
m_NSWMM_rdo_localPosX = new std::vector<double>();
......@@ -159,6 +162,7 @@ StatusCode MMRDOVariables::initializeVariables()
m_tree->Branch("RDO_MM_gas_gap", &m_NSWMM_rdo_gas_gap);
m_tree->Branch("RDO_MM_channel", &m_NSWMM_rdo_channel);
m_tree->Branch("RDO_MM_time", &m_NSWMM_rdo_time);
m_tree->Branch("RDO_MM_relBcid", &m_NSWMM_rdo_relBcid);
m_tree->Branch("RDO_MM_charge", &m_NSWMM_rdo_charge);
m_tree->Branch("RDO_MM_localPosX", &m_NSWMM_rdo_localPosX);
......@@ -185,6 +189,7 @@ void MMRDOVariables::deleteVariables()
delete m_NSWMM_rdo_gas_gap;
delete m_NSWMM_rdo_channel;
delete m_NSWMM_rdo_time;
delete m_NSWMM_rdo_relBcid;
delete m_NSWMM_rdo_charge;
delete m_NSWMM_rdo_localPosX;
delete m_NSWMM_rdo_localPosY;
......@@ -201,6 +206,7 @@ void MMRDOVariables::deleteVariables()
m_NSWMM_rdo_gas_gap = nullptr;
m_NSWMM_rdo_channel = nullptr;
m_NSWMM_rdo_time = nullptr;
m_NSWMM_rdo_relBcid = nullptr;
m_NSWMM_rdo_charge = nullptr;
m_NSWMM_rdo_localPosX = nullptr;
m_NSWMM_rdo_localPosY = nullptr;
......
......@@ -29,6 +29,7 @@ class MMRDOVariables : public ValAlgVariables
m_NSWMM_rdo_gas_gap(0),
m_NSWMM_rdo_channel(0),
m_NSWMM_rdo_time(0),
m_NSWMM_rdo_relBcid(0),
m_NSWMM_rdo_charge(0),
m_NSWMM_rdo_localPosX(0),
m_NSWMM_rdo_localPosY(0),
......@@ -70,6 +71,7 @@ class MMRDOVariables : public ValAlgVariables
std::vector<int> *m_NSWMM_rdo_gas_gap;
std::vector<int> *m_NSWMM_rdo_channel;
std::vector<int> *m_NSWMM_rdo_time;
std::vector<uint16_t> *m_NSWMM_rdo_relBcid;
std::vector<int> *m_NSWMM_rdo_charge;
std::vector<double> *m_NSWMM_rdo_localPosX;
......
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