29 fInputFile = filename;
48 std::cerr <<
"Bad DGF module requested: " << i << std::endl;
74 std::cerr <<
"Bad CAEN ADC module requested: " << i << std::endl;
87 std::cerr <<
"Bad Mesytec ADC module requested: " << i << std::endl;
99 std::cerr <<
"Bad Pattern Unit module requested: " << i << std::endl;
110 std::cerr <<
"Bad Scaler Unit module requested: " << i << std::endl;
198 bool IsMiniball(
unsigned int dgf,
unsigned int ch );
199 bool IsMiniball(
unsigned int sfp,
unsigned int board,
unsigned int ch );
201 const std::vector<std::vector<std::vector<int>>> &vector );
202 int GetMiniballID(
unsigned int sfp,
unsigned int board,
unsigned int ch,
203 const std::vector<std::vector<std::vector<int>>> &vector );
233 bool IsCD(
unsigned int adc,
unsigned int ch );
234 bool IsCD(
unsigned int sfp,
unsigned int board,
unsigned int ch );
235 int GetCDID(
unsigned int adc,
unsigned int ch,
236 const std::vector<std::vector<std::vector<int>>> &vector );
237 int GetCDID(
unsigned int sfp,
unsigned int board,
unsigned int ch,
238 const std::vector<std::vector<std::vector<int>>> &vector );
242 inline int GetCDDetector(
unsigned int sfp,
unsigned int board,
unsigned int ch ){
248 inline int GetCDSector(
unsigned int sfp,
unsigned int board,
unsigned int ch ){
251 inline int GetCDSide(
unsigned int adc,
unsigned int ch ){
254 inline int GetCDSide(
unsigned int sfp,
unsigned int board,
unsigned int ch ){
260 inline int GetCDStrip(
unsigned int sfp,
unsigned int board,
unsigned int ch ){
267 bool IsPad(
unsigned int adc,
unsigned int ch );
268 bool IsPad(
unsigned int sfp,
unsigned int board,
unsigned int ch );
270 int GetPadDetector(
unsigned int sfp,
unsigned int board,
unsigned int ch );
272 int GetPadSector(
unsigned int sfp,
unsigned int board,
unsigned int ch );
278 bool IsBeamDump(
unsigned int dgf,
unsigned int ch );
279 bool IsBeamDump(
unsigned int sfp,
unsigned int board,
unsigned int ch );
286 bool IsSpede(
unsigned int sfp,
unsigned int board,
unsigned int ch );
287 int GetSpedeSegment(
unsigned int sfp,
unsigned int board,
unsigned int ch );
293 bool IsIonChamber(
unsigned int sfp,
unsigned int board,
unsigned int ch );
301 bool IsPulser(
unsigned int sfp,
unsigned int board,
unsigned int ch );
302 int GetPulser(
unsigned int sfp,
unsigned int board,
unsigned int ch );
309 std::
string fInputFile;
346 std::vector<std::vector<std::vector<
unsigned int>>>
mb_sfp;
347 std::vector<std::vector<std::vector<
unsigned int>>>
mb_board;
348 std::vector<std::vector<std::vector<
unsigned int>>>
mb_dgf;
349 std::vector<std::vector<std::vector<
unsigned int>>>
mb_ch;
350 std::vector<std::vector<std::vector<
bool>>>
mb_veto;
363 std::vector<std::vector<std::vector<std::vector<
unsigned int>>>>
cd_sfp;
364 std::vector<std::vector<std::vector<std::vector<
unsigned int>>>>
cd_board;
365 std::vector<std::vector<std::vector<std::vector<
unsigned int>>>>
cd_adc;
366 std::vector<std::vector<std::vector<std::vector<
unsigned int>>>>
cd_ch;
367 std::vector<std::vector<std::vector<
int>>>
cd_det;
369 std::vector<std::vector<std::vector<
int>>>
cd_side;
370 std::vector<std::vector<std::vector<
int>>>
cd_strip;
373 std::vector<std::vector<
unsigned int>>
pad_sfp;
375 std::vector<std::vector<
unsigned int>>
pad_adc;
376 std::vector<std::vector<
unsigned int>>
pad_ch;
377 std::vector<std::vector<std::vector<
int>>>
pad_det;
389 std::vector<std::vector<std::vector<
int>>>
bd_det;
409 std::vector<std::vector<std::vector<
int>>>
ic_layer;
417 std::vector<std::vector<std::vector<
int>>>
pulser;
unsigned int n_pattern_unit
Number of pattern unit modules.
unsigned int dgf_mod_offset
module number offset for the DGFs
unsigned int n_caen_mod
Number of CAEN ADC modules.
unsigned int pulser_code
Info code when we have a pulser event in InfoData packets.
unsigned int ebis_sfp
Location of the EBIS signal in the FEBEX system (sfp)
unsigned int caen_mod_offset
module number offset for the CAEN ADCs
double mb_hit_window
Prompt time for correlated Miniball events in crystal, i.e. segmen-core events.
unsigned int GetNumberOfFebexSfps()
unsigned int n_madc_mod
Number of Mesytec ADC modules.
std::vector< std::vector< std::vector< int > > > cd_det
A channel map for the CD detectors (-1 if not a CD, 0 forward CD, 1 backward CD)
unsigned int ebis_dgf
Location of the EBIS signal in the DGF system (module)
unsigned int n_scaler_unit
Number of scaler unit modules.
bool IsCD(unsigned int adc, unsigned int ch)
std::vector< unsigned int > bd_dgf
A list of DGF module numbers for each beam dump detector.
int GetCDStrip(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int laser_board
Location of the RILIS laser signal in the FEBEX system (board)
unsigned int block_size
not yet implemented, needs C++ style reading of data files
unsigned int ebis_ch
Location of the EBIS signal in the FEBEX system (channel)
unsigned int GetNumberOfMesytecAdcModules()
int GetDgfModuleNumber(unsigned int i)
unsigned int GetRILISChannel()
unsigned int adc_vme_first
bool GetPileupRejection()
const std::string InputFile()
unsigned int GetNumberOfPulsers()
unsigned int laser_sfp
Location of the RILIS laser signal in the FEBEX system (sfp)
unsigned int dgf_vme_last
Marabou IDs for DGFs.
std::vector< std::vector< std::vector< bool > > > mb_veto
A boolean to check if we need to veto any segments.
int GetIonChamberLayer(unsigned int adc, unsigned int ch)
std::vector< unsigned int > pulser_sfp
A list of SFP numbers for each pulser.
std::vector< std::vector< unsigned int > > pad_ch
A list of channel numbers for each PAD detector.
unsigned int GetNumberOfPatternUnits()
unsigned int dgf_ts_mod_offset
module number offset for the timestamper DGFs
bool GetBufferPartRejection()
bool GetClippedRejection()
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_adc
A list of ADC module numbers for each CD detector, sector, side and strip.
unsigned int GetNumberOfFebexChannels()
unsigned int n_cd_nstrip
number of n-side strips
std::vector< unsigned int > ic_board
A list of board numbers for each IonChamber segment.
unsigned int tm_msb_code
Medium significant bits of the timestamp are here.
double GetIonChamberHitWindow()
unsigned int n_cd_sector
number of sectors in the CD (or quadrants, it's 4)
unsigned int GetMsbSyncCode()
unsigned int pattern_unit_offset
module number offset for the pattern units
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_ch
A list of channel numbers for each CD detector, sector, side and strip.
bool clipped_reject
reject events that are clipped by the ADC range
unsigned int GetRILISPattern()
unsigned int ebis_code
Info code when we have an EBIS event in InfoData packets.
double ab_hit_window
Prompt time for correlated Miniball events in cluster, i.e. addback events.
int GetSpedeSegment(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int pattern_vme_last
Marabou IDs for pattern unit modules.
unsigned int GetNumberOfBeamDumpDetectors()
unsigned int GetEBISDgf()
unsigned int GetEBISChannel()
int GetMiniballSegment(unsigned int dgf, unsigned int ch)
unsigned int GetNumberOfMesytecAdcChannels()
int GetPadDetector(unsigned int adc, unsigned int ch)
bool IsIonChamber(unsigned int adc, unsigned int ch)
std::vector< unsigned int > spede_dgf
A list of DGF module numbers for each SPEDE segment.
int GetPadSector(unsigned int adc, unsigned int ch)
unsigned int n_cd_pstrip
number of p-side strips
unsigned int GetNumberOfMiniballSegments()
unsigned int GetHsbTimestampCode()
bool IsPulser(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int GetNumberOfCDDetectors()
void SetBlockSize(unsigned int size)
std::vector< unsigned int > ic_ch
A list of channel numbers for each IonChamber segment.
unsigned int n_madc_ch
Number of Mesytec ADC channels.
unsigned int GetNumberOfMiniballCrystals()
unsigned int laser_ch
Location of the RILIS laser signal in the FEBEX system (channel)
int GetPatternUnitNumber(unsigned int i)
std::vector< std::vector< unsigned int > > pad_board
A list of board numbers for each PAD detector.
unsigned int GetT1Channel()
std::vector< std::vector< std::vector< int > > > pad_det
A channel map for the PAD detectors (-1 if not a PAD, 0 forward CD-PAD, 1 backward CD-PAD)
int GetMiniballCrystal(unsigned int dgf, unsigned int ch)
double GetDgfTimestampDelay()
unsigned int GetSCChannel()
int GetMiniballID(unsigned int dgf, unsigned int ch, const std::vector< std::vector< std::vector< int > > > &vector)
ClassDef(MiniballSettings, 3) private unsigned int n_febex_sfp
Number of SFPs in acquisition.
unsigned int GetNumberOfIonChamberLayers()
std::vector< unsigned int > bd_ch
A list of channel numbers for each beam dump detector.
std::vector< std::vector< std::vector< unsigned int > > > mb_sfp
A list of SFP numbers for each MB cluster, crystal and segment.
unsigned int sync_msb_code
Sync pulse code from Exploder (msb)
bool CheckVmeModuleIsDgfScaler(unsigned int id)
unsigned int GetNumberOfDgfChannels()
std::vector< unsigned int > spede_ch
A list of channel numbers for each SPEDE segment.
int GetMiniballCluster(unsigned int dgf, unsigned int ch)
unsigned int GetPauseCode()
void SetFile(std::string filename)
unsigned int n_caen_ch
Number of CAENADC channels.
bool mbs_event_sort
Flag to define if we sort MBS data by readout event (true), or by global time (false)
unsigned int scaler_unit_offset
module number offset for the scaler units
std::vector< unsigned int > bd_board
A list of board numbers for each beam dump detector.
unsigned int n_mb_cluster
Miniball usuall has 8 triple cluster detectors.
bool CheckVmeModuleIsScaler(unsigned int id)
unsigned int IsFebexOnly()
double GetDgfTimestampUnits()
int GetCDStrip(unsigned int adc, unsigned int ch)
unsigned int GetRILISBoard()
bool IsPad(unsigned int adc, unsigned int ch)
unsigned int t1_sfp
Location of the T1 signal in the FEBEX system (sfp)
int GetScalerUnitNumber(unsigned int i)
double cd_hit_window
Prompt time for correlated CD events.
std::vector< unsigned int > spede_board
A list of board numbers for each SPEDE segment.
int GetCDSector(unsigned int adc, unsigned int ch)
bool pileup_reject
reject events where the pileup flag is set by the MWD firmware
int GetCDDetector(unsigned int adc, unsigned int ch)
unsigned int GetNumberOfSpedeSegments()
std::vector< unsigned int > spede_sfp
A list of SFP numbers for each SPEDE segment.
int GetCDSector(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int n_spede_seg
Number of SPEDE segments, usually 24.
bool CheckVmeModuleIsAdc(unsigned int id)
unsigned int GetBlockSize()
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_board
A list of board numbers for each CD detector, sector, side and strip.
unsigned int GetNumberOfCDSectors()
std::vector< std::vector< std::vector< int > > > pad_sector
std::vector< std::vector< std::vector< unsigned int > > > mb_dgf
A list of DGF module numbers for each MB cluster, crystal and segment.
unsigned int n_bd_det
Number of beam dump detectors.
bool flag_febex_only
when there is only FEBEX data in the file
unsigned int t1_dgf
Location of the T1 signal in the DGF system (module)
unsigned int scaler_vme_last
Marabou IDs for scaler modules.
int GetMiniballCrystal(unsigned int sfp, unsigned int board, unsigned int ch)
std::vector< std::vector< std::vector< unsigned int > > > mb_board
A list of board numbers for each MB cluster, crystal and segment.
unsigned int n_dgf_ch
Number of DGF channels.
unsigned int GetNumberOfDgfTimestampModules()
unsigned int t1_code
Info code when we have a T1 event in InfoData packets.
bool IsTimestampModule(unsigned int m)
unsigned int GetT1Board()
unsigned int GetResumeCode()
std::vector< unsigned int > ic_adc
A list of ADC module numbers for each IonChamber segment.
unsigned int ebis_board
Location of the EBIS signal in the FEBEX system (board)
unsigned int GetMsbTimestampCode()
double pad_hit_window
Prompt time for correlated CD-Pad events.
std::vector< std::vector< std::vector< int > > > cd_strip
A channel map for the CD strips IDs (-1 if not a CD, strip ID otherwise)
unsigned int n_cd_side
number of sides, it's always 2, i.e. p-side and n-side
unsigned int laser_pattern
Location of the RILIS laser signal in the pattern unit (channel)
unsigned int GetNumberOfAdcModules()
void SetMbsEventMode(bool flag)
bool IsMiniballSegmentVetoed(unsigned int clu, unsigned int cry, unsigned int seg)
std::vector< std::vector< std::vector< std::vector< unsigned int > > > > cd_sfp
A list of SFP numbers for each CD detector, sector, side and strip.
int GetMiniballCluster(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int GetEBISSfp()
std::vector< std::vector< std::vector< int > > > bd_det
A channel map for the beam dump detectors (-1 if not a beam dump, otherwise detector number)
std::vector< std::vector< std::vector< int > > > mb_cluster
A channel map for the Miniball cluster IDs (-1 if not Miniball)
unsigned int madc_mod_offset
module number offset for the MADCs
unsigned int n_dgf_ts_mod
Number of DGF timestamp modules (subset of n_dgf_mod)
std::vector< std::vector< std::vector< int > > > cd_sector
A channel map for the CD sectors (-1 if not a CD, 0-3 for quadrants)
std::vector< std::vector< std::vector< int > > > ic_layer
A channel map for the IonChamber segments (-1 if not a IonChamber, otherwise layer number,...
std::vector< std::vector< std::vector< unsigned int > > > mb_ch
A list of channel numbers for each MB cluster, crystal and segment.
unsigned int GetHsbSyncCode()
unsigned int laser_code
Info code when we have a RILIS Laser ON coincidence with EBIS in InfoData packets.
unsigned int n_ic_layer
Number of IonChamber layers, usually 2, dE (gas) and E (Si)
int GetCDSide(unsigned int sfp, unsigned int board, unsigned int ch)
int GetMesytecAdcModuleNumber(unsigned int i)
bool GetBufferFullRejection()
unsigned int sc_sfp
Location of the SuperCycle signal in the FEBEX system (sfp)
unsigned int GetNumberOfScalerUnits()
int GetCaenAdcModuleNumber(unsigned int i)
bool IsSpede(unsigned int sfp, unsigned int board, unsigned int ch)
std::vector< std::vector< std::vector< int > > > cd_side
A channel map for the CD sides (-1 if not a CD, 0 for p-side, 1 for n-side)
double ic_hit_window
Prompt time for correlated ionchamber events.
bool IsMiniball(unsigned int dgf, unsigned int ch)
std::vector< unsigned int > ic_sfp
A list of SFP numbers for each IonChamber segment.
unsigned int GetRILISCode()
double GetCaenAdcTimestampUnits()
bool IsBeamDump(unsigned int dgf, unsigned int ch)
unsigned int GetNumberOfCaenAdcModules()
unsigned int n_mb_segment
Number of sgements in a crystal is 7, including core = 0.
int GetBeamDumpDetector(unsigned int dgf, unsigned int ch)
int GetCDID(unsigned int adc, unsigned int ch, const std::vector< std::vector< std::vector< int > > > &vector)
int GetCDSide(unsigned int adc, unsigned int ch)
bool CheckVmeModuleIsPattern(unsigned int id)
std::vector< std::vector< std::vector< int > > > pulser
A channel map for the pulser inputs.
unsigned int GetPulserCode()
std::vector< std::vector< std::vector< int > > > mb_crystal
A channel map for the Miniball crystal IDs (-1 if not Miniball)
unsigned int sc_dgf
Location of the SuperCycle signal in the DGF system (module)
unsigned int GetNumberOfCDSides()
unsigned int GetMaximumNumberOfAdcChannels()
int GetPulser(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int dgfscaler_vme_last
Marabou IDs for DGF scalers.
unsigned int n_febex_ch
Number of channels per board (16 for FEBEX4)
unsigned int GetNumberOfMiniballClusters()
double event_window
Event builder time window in ns.
std::vector< std::vector< unsigned int > > pad_sfp
A list of SFP numbers for each PAD detector.
unsigned int GetNumberOfCaenAdcChannels()
unsigned int GetNumberOfCDPStrips()
unsigned int pause_code
Info code when acquisition has paused due to a full buffer.
unsigned int GetNumberOfCDNStrips()
unsigned int GetEBISCode()
int GetCDDetector(unsigned int sfp, unsigned int board, unsigned int ch)
bool CheckVmeModuleIsDgf(unsigned int id)
unsigned int GetSCBoard()
unsigned int t1_board
Location of the T1 signal in the FEBEX system (board)
std::vector< std::vector< unsigned int > > pad_adc
A list of ADC module numbers for each PAD detector.
unsigned int GetNumberOfDgfModules()
unsigned int pattern_vme_first
unsigned int sc_ch
Location of the SuperCycle signal in the FEBEX system (channel)
unsigned int scaler_vme_first
unsigned int adc_vme_last
Marabou IDs for ADCs.
unsigned int tm_hsb_code
Highest significant bits of the timestamp are here.
unsigned int GetNumberOfFebexBoards()
double GetMiniballAddbackHitWindow()
unsigned int n_dgf_mod
Number of DGF modules.
std::vector< std::vector< std::vector< int > > > mb_segment
A channel map for the Miniball segment IDs (-1 if not Miniball)
double GetMiniballCrystalHitWindow()
unsigned int dgfscaler_vme_first
unsigned int n_febex_board
Maximum number of boards per SFP.
unsigned int n_pulsers
Number of pulser inputs for synchronisation tests.
std::vector< unsigned int > pulser_board
A list of board numbers for each pulser.
unsigned int n_cd_det
Number of CD detectors (just 1 for Coulex)
unsigned int t1_ch
Location of the T1 signal in the FEBEX system (channel)
unsigned int n_mb_crystal
Number of crystals in a triple cluster is 3.
unsigned int GetRILISSfp()
unsigned int dgf_vme_first
unsigned int sync_hsb_code
Sync pulse code from Exploder (hsb)
unsigned int GetEBISBoard()
std::vector< unsigned int > bd_sfp
A list of SFP numbers for each beam dump detector.
unsigned int sc_board
Location of the SuperCycle signal in the FEBEX system (board)
int GetMiniballSegment(unsigned int sfp, unsigned int board, unsigned int ch)
unsigned int sc_code
Info code when we have a SuperCycle event in InfoData packets.
unsigned int resume_code
Info code when acquisition has resumed after a pause.
std::vector< unsigned int > pulser_ch
A list of channel numbers for each pulser.
double GetMesytecAdcTimestampUnits()
std::vector< std::vector< std::vector< int > > > spede_seg
A channel map for the SPEDE segments (-1 if not a SPEDE, otherwise segment number)