Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 21, 2024
1 parent 2815d41 commit e9c4a9c
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 62 deletions.
36 changes: 18 additions & 18 deletions inc/TRestRawFEUDreamToSignalProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,25 @@ class TRestRawFEUDreamToSignalProcess : public TRestRawToSignalProcess {
DataLineDream() { data = 0; }
~DataLineDream() {}
void ntohs_() { data = ntohs(data); };
bool is_final_trailer() const { return (((data)&0x7000) >> 12) == 7; } // X111
bool is_end_of_event() const { return (((data)&0x7800) >> 11) == 0xF; } // X1111
bool is_data_trailer() const { return (((data)&0x6000) >> 13) == 2; } // X10X
bool is_first_line() const { return (((data)&0x7000) >> 12) == 3; } // X011
bool is_data() const { return (((data)&0x7000) >> 12) == 0; } // X000
bool is_data_zs() const { return (((data)&0x6000) >> 13) == 0; } // X00X
bool is_channel_ID() const { return (((data)&0x7000) >> 12) == 1; } // X001
bool is_Feu_header() const { return (((data)&0x7000) >> 12) == 6; } // X110
bool is_data_header() const { return (((data)&0x6000) >> 13) == 1; } // X01X
bool get_zs_mode() const { return (((data)&0x400) >> 10); }
int get_Feu_ID() const { return (((data)&0xFF)); }
long int get_finetstp() const { return (((data)&0x0007)); }
bool is_final_trailer() const { return (((data) & 0x7000) >> 12) == 7; } // X111
bool is_end_of_event() const { return (((data) & 0x7800) >> 11) == 0xF; } // X1111
bool is_data_trailer() const { return (((data) & 0x6000) >> 13) == 2; } // X10X
bool is_first_line() const { return (((data) & 0x7000) >> 12) == 3; } // X011
bool is_data() const { return (((data) & 0x7000) >> 12) == 0; } // X000
bool is_data_zs() const { return (((data) & 0x6000) >> 13) == 0; } // X00X
bool is_channel_ID() const { return (((data) & 0x7000) >> 12) == 1; } // X001
bool is_Feu_header() const { return (((data) & 0x7000) >> 12) == 6; } // X110
bool is_data_header() const { return (((data) & 0x6000) >> 13) == 1; } // X01X
bool get_zs_mode() const { return (((data) & 0x400) >> 10); }
int get_Feu_ID() const { return (((data) & 0xFF)); }
long int get_finetstp() const { return (((data) & 0x0007)); }
// #define GET_FINETSTP(word) (word & 0x0007)
int get_sample_ID() const { return (((data)&0xFF8) >> 3); }
int get_channel_ID() const { return (((data)&0x3F)); }
int get_dream_ID() const { return (((data)&0xE00) >> 9); } // non-zS mode
int get_dream_ID_ZS() const { return (((data)&0xE00) >> 6); } // zS mode
int get_TimeStamp_Op() const { return (((data)&0x1FF)); }
int get_data() const { return (((data)&0xFFF)); }
int get_sample_ID() const { return (((data) & 0xFF8) >> 3); }
int get_channel_ID() const { return (((data) & 0x3F)); }
int get_dream_ID() const { return (((data) & 0xE00) >> 9); } // non-zS mode
int get_dream_ID_ZS() const { return (((data) & 0xE00) >> 6); } // zS mode
int get_TimeStamp_Op() const { return (((data) & 0x1FF)); }
int get_data() const { return (((data) & 0xFFF)); }
unsigned short int data;
};

Expand Down
2 changes: 1 addition & 1 deletion inc/TRestRawPeaksFinderProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TRestRawPeaksFinderProcess : public TRestEventProcess {

const char* GetProcessName() const override { return "peaksFinder"; }

explicit TRestRawPeaksFinderProcess(const char* configFilename){};
explicit TRestRawPeaksFinderProcess(const char* configFilename) {};

void InitFromConfigFile() override;

Expand Down
36 changes: 18 additions & 18 deletions inc/mygblink.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,43 +52,43 @@ typedef struct _DataPacket {
#define ACT_RQ_ACK 0x40
#define ACT_SET_REQ 0x80
#define ACT_MASK 0xF0
#define PACKTX_PUT_ACT(act, ix) (((act)&ACT_MASK) | ((ix)&PACKTX_MAX_IX))
#define PACKTX_PUT_ACT(act, ix) (((act) & ACT_MASK) | ((ix) & PACKTX_MAX_IX))
// Supplementary actions not written in header
#define ACT_RD_LB 0x100
#define ACT_RD_UB 0x200
#define ACT_RD_BB 0x300

// Response Packet Header Decode Macros
#define GET_REQ_INDEX(word) ((word)&0x000F)
#define GET_WR_ACK(word) ((word)&0x0030)
#define GET_RD_ACK(word) ((word)&0x0040)
#define GET_TR_OK(word) ((word)&0x0080)
#define GET_TYPE(word) ((word)&0xF000)
#define GET_REQ_INDEX(word) ((word) & 0x000F)
#define GET_WR_ACK(word) ((word) & 0x0030)
#define GET_RD_ACK(word) ((word) & 0x0040)
#define GET_TR_OK(word) ((word) & 0x0080)
#define GET_TYPE(word) ((word) & 0xF000)

// Response Packet Types (see t2k_pkg.vhd for coherence)
#define RESP_TYPE_ADC_DATA 0x0000
#define RESP_TYPE_SLOW_CTRL 0x1000
#define GET_RESP_TYPE(word) (((word)&0xF000) >> 12)
#define GET_RESP_INDEX(word) ((word)&0x000F)
#define GET_RESP_TYPE(word) (((word) & 0xF000) >> 12)
#define GET_RESP_INDEX(word) ((word) & 0x000F)

// Macros to interpret DataPacket header
#define GET_FEC_ERROR(word) (((word)&0x03F0) >> 4)
#define GET_LOS_FLAG(word) (((word)&0x0400) >> 10)
#define GET_SYNCH_FAIL(word) (((word)&0x0800) >> 11)
#define GET_FEC_ERROR(word) (((word) & 0x03F0) >> 4)
#define GET_LOS_FLAG(word) (((word) & 0x0400) >> 10)
#define GET_SYNCH_FAIL(word) (((word) & 0x0800) >> 11)

// Macros to interpret DataPacket read back arguments
#define GET_RB_MODE(word) (((word)&0x4000) >> 14)
#define GET_RB_COMPRESS(word) (((word)&0x2000) >> 13)
#define GET_RB_ARG2(word) (((word)&0x1E00) >> 9)
#define GET_RB_ARG1(word) (((word)&0x01FF))
#define GET_RB_MODE(word) (((word) & 0x4000) >> 14)
#define GET_RB_COMPRESS(word) (((word) & 0x2000) >> 13)
#define GET_RB_ARG2(word) (((word) & 0x1E00) >> 9)
#define GET_RB_ARG1(word) (((word) & 0x01FF))

// Macros to interpret DataPacket event type / count
#define GET_EVENT_TYPE(word) (((word)&0xC000) >> 14)
#define GET_EVENT_COUNT(word) (((word)&0x3FFF))
#define GET_EVENT_TYPE(word) (((word) & 0xC000) >> 14)
#define GET_EVENT_COUNT(word) (((word) & 0x3FFF))

// Macros to interpret DataPacket Samples
#define CELL_INDEX_FLAG 0x1000
#define GET_CELL_INDEX(word) (((word)&0x0FFF))
#define GET_CELL_INDEX(word) (((word) & 0x0FFF))

// Function prototypes
/*
Expand Down
42 changes: 21 additions & 21 deletions src/TRestRawMultiFEMINOSToSignalProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
//
// Macros to act on 8-bit data content
//
#define GET_ASCII_LEN(w) (((w)&0x00FF) >> 0)
#define PUT_ASCII_LEN(w) (PFX_ASCII_MSG_LEN | ((w)&0x00FF))
#define GET_ASCII_LEN(w) (((w) & 0x00FF) >> 0)
#define PUT_ASCII_LEN(w) (PFX_ASCII_MSG_LEN | ((w) & 0x00FF))
//
// Prefix Codes for 0-bit data content
//
Expand Down Expand Up @@ -121,37 +121,37 @@
//
// Macros to act on 4-bit data content
//
#define GET_EVENT_TYPE(w) (((w)&0x0007) >> 0)
#define GET_EOE_SIZE(w) (((w)&0x000F) >> 0)
#define GET_EVENT_TYPE(w) (((w) & 0x0007) >> 0)
#define GET_EOE_SIZE(w) (((w) & 0x000F) >> 0)

//
// Macros to extract 14-bit data content
//
#define GET_CARD_IX(w) (((w)&0x3E00) >> 9)
#define GET_CHIP_IX(w) (((w)&0x0180) >> 7)
#define GET_CHAN_IX(w) (((w)&0x007F) >> 0)
#define GET_CARD_IX(w) (((w) & 0x3E00) >> 9)
#define GET_CHIP_IX(w) (((w) & 0x0180) >> 7)
#define GET_CHAN_IX(w) (((w) & 0x007F) >> 0)

//
// Macros to extract 12-bit data content
//
#define GET_ADC_DATA(w) (((w)&0x0FFF) >> 0)
#define GET_LAT_HISTO_BIN(w) (((w)&0x0FFF) >> 0)
#define PUT_LAT_HISTO_BIN(w) (PFX_LAT_HISTO_BIN | (((w)&0x0FFF) >> 0))
#define GET_LST_READ_CELL(w) (((w)&0x03FF) >> 0)
#define GET_LST_READ_CELL_CHIP_IX(w) (((w)&0x0C00) >> 10)
#define GET_ADC_DATA(w) (((w) & 0x0FFF) >> 0)
#define GET_LAT_HISTO_BIN(w) (((w) & 0x0FFF) >> 0)
#define PUT_LAT_HISTO_BIN(w) (PFX_LAT_HISTO_BIN | (((w) & 0x0FFF) >> 0))
#define GET_LST_READ_CELL(w) (((w) & 0x03FF) >> 0)
#define GET_LST_READ_CELL_CHIP_IX(w) (((w) & 0x0C00) >> 10)

//
// Macros to extract 9-bit data content
//
#define GET_TIME_BIN(w) (((w)&0x01FF) >> 0)
#define GET_HISTO_BIN(w) (((w)&0x01FF) >> 0)
#define GET_PEDTHR_LIST_FEM(w) (((w)&0x01F0) >> 4)
#define GET_PEDTHR_LIST_ASIC(w) (((w)&0x000C) >> 2)
#define GET_PEDTHR_LIST_MODE(w) (((w)&0x0002) >> 1)
#define GET_PEDTHR_LIST_TYPE(w) (((w)&0x0001) >> 0)
#define PUT_FVERSION_FEMID(w, fv, id) (((w)&0xFE00) | (((fv)&0x0003) << 7) | (((id)&0x001F) << 0))
#define GET_FRAMING_VERSION(w) (((w)&0x0180) >> 7)
#define GET_FEMID(w) (((w)&0x001F) >> 0)
#define GET_TIME_BIN(w) (((w) & 0x01FF) >> 0)
#define GET_HISTO_BIN(w) (((w) & 0x01FF) >> 0)
#define GET_PEDTHR_LIST_FEM(w) (((w) & 0x01F0) >> 4)
#define GET_PEDTHR_LIST_ASIC(w) (((w) & 0x000C) >> 2)
#define GET_PEDTHR_LIST_MODE(w) (((w) & 0x0002) >> 1)
#define GET_PEDTHR_LIST_TYPE(w) (((w) & 0x0001) >> 0)
#define PUT_FVERSION_FEMID(w, fv, id) (((w) & 0xFE00) | (((fv) & 0x0003) << 7) | (((id) & 0x001F) << 0))
#define GET_FRAMING_VERSION(w) (((w) & 0x0180) >> 7)
#define GET_FEMID(w) (((w) & 0x001F) >> 0)

// Definition of verboseness flags used by MFrame_Print
#define FRAME_PRINT_ALL 0x00000001
Expand Down
6 changes: 2 additions & 4 deletions src/TRestRawSignalViewerProcess.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ TRestEvent* TRestRawSignalViewerProcess::ProcessEvent(TRestEvent* inputEvent) {
} else if (a == 27) // esc
{
fDrawRefresh = 1e99;
while (getchar() != '\n')
;
while (getchar() != '\n');
break;
} else if (a == 110 || a == 78) // n
{
Expand All @@ -202,8 +201,7 @@ TRestEvent* TRestRawSignalViewerProcess::ProcessEvent(TRestEvent* inputEvent) {
RESTWarning << "cannot plot signal with id " << sgnCounter << RESTendl;
}
}
while (getchar() != '\n')
;
while (getchar() != '\n');
}
}

Expand Down

0 comments on commit e9c4a9c

Please sign in to comment.