Commit a97df517 authored by nkx Nicholas's avatar nkx Nicholas
Browse files

Merge branch 'development' of https://lfna.unizar.es/rest-development/REST_v2 into development

parents 895ca346 c1cab4d1
......@@ -44,18 +44,23 @@ enum TRestReadoutChannelType {
/// It allows to integrate any number of independent readout pixels.
class TRestReadoutChannel : public TObject {
private:
Int_t fDaqID; ///< Defines the corresponding daq channel id. See decoding
///< details at TRestReadout.
Int_t fDaqID; ///< Defines the corresponding daq channel id. See decoding
///< details at TRestReadout.
std::vector<TRestReadoutPixel> fReadoutPixel; ///< A vector storing the different TRestReadoutPixel
///< definitions.
Short_t fChannelId = -1; ///< It stores the corresponding physical readout channel
void Initialize();
protected:
public:
/// Returns the corresponding daq channel id
Int_t GetDaqID() { return fDaqID; }
/// Returns the corresponding channel id
Int_t GetChannelId() { return fChannelId; }
/// Returns the total number of pixels inside the readout channel
Int_t GetNumberOfPixels() { return fReadoutPixel.size(); }
......@@ -79,18 +84,21 @@ class TRestReadoutChannel : public TObject {
/// Sets the daq channel number id
void SetDaqID(Int_t id) { fDaqID = id; }
/// Sets the readout channel number id
void SetChannelID(Int_t id) { fChannelId = id; }
/// Adds a new pixel to the readout channel
void AddPixel(TRestReadoutPixel pix) { fReadoutPixel.push_back(pix); }
Int_t isInside(Double_t x, Double_t y);
void Print(int DetailLevel = 0, int index = -1);
void Print(int DetailLevel = 0);
// Construtor
TRestReadoutChannel();
// Destructor
virtual ~TRestReadoutChannel();
ClassDef(TRestReadoutChannel, 2); // REST run class
ClassDef(TRestReadoutChannel, 3); // REST run class
};
#endif
......@@ -563,6 +563,7 @@ void TRestReadout::InitFromConfigFile() {
// WRONG version before -->
// fModuleDefinitions[mid].GetChannel(ch)->SetID( rChannel[ch] );
fModuleDefinitions[mid].GetChannel(rChannel[ch])->SetDaqID(dChannel[ch]);
fModuleDefinitions[mid].GetChannel(rChannel[ch])->SetChannelID(rChannel[ch]);
#pragma endregion
addedChannels++;
......
......@@ -74,9 +74,9 @@ Int_t TRestReadoutChannel::isInside(Double_t x, Double_t y) {
/// \brief Prints the details of the readout channel including pixel
/// coordinates.
///
void TRestReadoutChannel::Print(int DetailLevel, int index) {
void TRestReadoutChannel::Print(int DetailLevel) {
if (DetailLevel >= 0) {
metadata << "++++ Channel : " << index << " Daq channel : " << GetDaqID() << endl;
metadata << "++++ Channel : " << GetChannelId() << " Daq channel : " << GetDaqID() << endl;
string typestr;
if (GetType() == Channel_NoType)
......
......@@ -550,6 +550,6 @@ void TRestReadoutModule::Print(Int_t DetailLevel) {
metadata << "-- Total channels : " << GetNumberOfChannels() << endl;
metadata << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" << endl;
for (int n = 0; n < GetNumberOfChannels(); n++) fReadoutChannel[n].Print(DetailLevel - 1, n);
for (int n = 0; n < GetNumberOfChannels(); n++) fReadoutChannel[n].Print(DetailLevel - 1);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment