ATLAS Offline Software
Loading...
Searching...
No Matches
TileTBDump Class Reference

TileTBDump produces formatted dump for both RawChannels and Digits Properties (JobOption Parameters): drawerList - vector of frag IDs present in data (hex numbers as strings) drawerType - type for every frag from drawerList 1=B+, 2=B-, 3=EB+, 4=EB- these parameters are needed only for 2003 data (when 0x102 and 0x202 were ext.barrel modules) correct values for 2004 are set by default. More...

#include <TileTBDump.h>

Inheritance diagram for TileTBDump:
Collaboration diagram for TileTBDump:

Classes

struct  T_RodDataFrag
struct  T_TileDigiChannel
struct  T_TileRecoQuality
struct  T_TileRecoChannel
struct  T_TileRawComp
struct  T_TileRecoCalib

Public Member Functions

 TileTBDump (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TileTBDump ()
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef std::map< unsignedint, unsignedint, std::less< unsignedint > >::iterator drawerMap_iterator
typedef std::vector< std::vector< unsigned int > > FelixData_t
typedef struct TileTBDump::T_RodDataFrag T_RodDataFrag
typedef struct TileTBDump::T_TileDigiChannel T_TileDigiChannel
typedef struct TileTBDump::T_TileRecoQuality T_TileRecoQuality
typedef struct TileTBDump::T_TileRecoChannel T_TileRecoChannel
typedef struct TileTBDump::T_TileRawComp T_TileRawComp
typedef struct TileTBDump::T_TileRecoCalib T_TileRecoCalib
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

void dump_data (const uint32_t *data, unsigned int size, unsigned int version, int verbosity)
void dump_digi (unsigned int subdet_id, const uint32_t *data, unsigned int size, unsigned int version, int verbosity, unsigned int robsourceid, const EventContext &ctx)
void dump_it (unsigned int nw, unsigned int *data)
void find_frag (const uint32_t *rod, unsigned int size, unsigned int version, int verbosity, const T_RodDataFrag *frag[], int &nfrag)
int tile_unpack_raw_comp (const T_RodDataFrag *frag, T_TileRawComp *rawcomp, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel, int *nsample)
int tile_unpack_digi (const T_RodDataFrag *frag, T_TileDigiChannel *channel, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel, int *nsample)
int tile_unpack_reco (const T_RodDataFrag *frag, T_TileRecoChannel *channel, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel)
int tile_unpack_reco_calib (const T_RodDataFrag *frag, T_TileRecoCalib *recocalib, int nchannel_max, unsigned int version, unsigned int unitunit, int verbosity, int *ngain, int *nchannel)
int tile_unpack_quality (const T_RodDataFrag *frag, T_TileRecoQuality &DQword)
void unpack_frag6 (const uint32_t *data, unsigned int size, FelixData_t &digitsHighGain, FelixData_t &digitsLowGain, FelixData_t &digitsMetaData) const
unsigned int tile_check_parity (const unsigned int *frame, int length)
unsigned int tile_check_startbit (const unsigned int *frame, int length, unsigned int startbit)
unsigned int tile_check_CRC (const unsigned int *frame, int framelen, int delta)
void tile_min_max (const unsigned short *frame, int frame_length, unsigned short *smin, unsigned short *smax)
std::vector< uint32_t > get_correct_data (const uint32_t *p, unsigned int size) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

int m_statFrag5 [200] {}
ServiceHandle< IROBDataProviderSvc > m_RobSvc
const TileCablingService * m_cabling {nullptr}
int m_runPeriod {0}
Gaudi::Property< std::vector< std::string > > m_drawerList {this, "drawerList", {"0x200", "0x201", "0x202", "0x100", "0x101", "0x102", "0x400", "0x401", "0x402"}}
Gaudi::Property< std::vector< int > > m_drawerType {this, "drawerType", {2, 2, 2, 1, 1, 1, 4, 4, 4}}
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerMap
PublicToolHandle< TileCondToolTiming > m_tileToolTiming {this, "TileCondToolTiming", "TileCondToolTiming"}
PublicToolHandle< TileCondToolOfcCool > m_tileCondToolOfcCool {this, "TileCondToolOfcCool", "TileCondToolOfcCool", "TileCondToolOfcCool"}
PublicToolHandle< TileCondToolEmscale > m_tileToolEmscale {this, "TileCondToolEmscale", "TileCondToolEmscale"}
Gaudi::Property< bool > m_dumpHeader {this, "dumpHeader", true}
Gaudi::Property< bool > m_dumpData {this, "dumpData", true}
Gaudi::Property< bool > m_dumpStatus {this, "dumpStatus", true}
Gaudi::Property< bool > m_dumpOnce {this, "dumpOnce", false}
Gaudi::Property< bool > m_dumpUnknown {this, "dumpUnknown", false}
Gaudi::Property< bool > m_showUnknown {this, "showUnknown", true}
bool m_v3Format {true}
bool m_frag5found {false}
unsigned int m_sizeOverhead {3}
int m_unit {-1}
Gaudi::Property< int > m_bc_time_seconds {this, "bc_time_seconds", -1}
Gaudi::Property< int > m_bc_time_nanoseconds {this, "bc_time_nanoseconds", -1}
Gaudi::Property< int > m_global_id {this, "global_id", -1}
Gaudi::Property< int > m_run_type {this, "run_type", -1}
Gaudi::Property< int > m_run_no {this, "run_no", -1}
Gaudi::Property< int > m_lumi_block {this, "lumi_block", -1}
Gaudi::Property< int > m_lvl1_id {this, "lvl1_id", -1}
Gaudi::Property< int > m_bc_id {this, "bc_id", -1}
Gaudi::Property< int > m_lvl1_trigger_type {this, "lvl1_trigger_type", -1}
Gaudi::Property< int > m_nlvl1_trigger_info {this, "nlvl1_trigger_info", -1}
int m_digi_mode {0}
std::vector< int > m_all_lvl1_trigger_types
TileRawChannel2Bytes2 m_rc2bytes2
TileRawChannel2Bytes4 m_rc2bytes4
TileRawChannel2Bytes5 m_rc2bytes5
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

TileTBDump produces formatted dump for both RawChannels and Digits Properties (JobOption Parameters): drawerList - vector of frag IDs present in data (hex numbers as strings) drawerType - type for every frag from drawerList 1=B+, 2=B-, 3=EB+, 4=EB- these parameters are needed only for 2003 data (when 0x102 and 0x202 were ext.barrel modules) correct values for 2004 are set by default.

Class to do a formatted dump of the TileCal ByteStream fragments

Definition at line 60 of file TileTBDump.h.

Member Typedef Documentation

◆ drawerMap_iterator

typedef std::map<unsignedint,unsignedint,std::less<unsignedint>>::iterator TileTBDump::drawerMap_iterator
private

Definition at line 85 of file TileTBDump.h.

◆ FelixData_t

typedef std::vector<std::vector<unsigned int> > TileTBDump::FelixData_t
private

Definition at line 86 of file TileTBDump.h.

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

◆ T_RodDataFrag

typedef struct TileTBDump::T_RodDataFrag TileTBDump::T_RodDataFrag
private

◆ T_TileDigiChannel

typedef struct TileTBDump::T_TileDigiChannel TileTBDump::T_TileDigiChannel
private

◆ T_TileRawComp

typedef struct TileTBDump::T_TileRawComp TileTBDump::T_TileRawComp
private

◆ T_TileRecoCalib

typedef struct TileTBDump::T_TileRecoCalib TileTBDump::T_TileRecoCalib
private

◆ T_TileRecoChannel

typedef struct TileTBDump::T_TileRecoChannel TileTBDump::T_TileRecoChannel
private

◆ T_TileRecoQuality

typedef struct TileTBDump::T_TileRecoQuality TileTBDump::T_TileRecoQuality
private

Constructor & Destructor Documentation

◆ TileTBDump()

TileTBDump::TileTBDump ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 106 of file TileTBDump.cxx.

107 : AthAlgorithm(name, pSvcLocator),
108 m_RobSvc("ROBDataProviderSvc", name)
109{
110}
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< IROBDataProviderSvc > m_RobSvc
Definition TileTBDump.h:77

◆ ~TileTBDump()

TileTBDump::~TileTBDump ( )
virtual

Definition at line 113 of file TileTBDump.cxx.

113 {
114}

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ dump_data()

void TileTBDump::dump_data ( const uint32_t * data,
unsigned int size,
unsigned int version,
int verbosity )
private

Definition at line 457 of file TileTBDump.cxx.

457 {
458
459 std::cout << "\n Fragment data as 4 byte words:";
460
461 for (unsigned int cnter = 0; cnter < size; ++cnter) {
462 if (!(cnter % 8)) std::cout << std::endl;
463 std::cout << std::format("{:08x} ", *data++);
464 }
465
466 std::cout << std::endl << std::endl;
467
468}
size_t size() const
Number of registered mappings.

◆ dump_digi()

void TileTBDump::dump_digi ( unsigned int subdet_id,
const uint32_t * data,
unsigned int size,
unsigned int version,
int verbosity,
unsigned int robsourceid,
const EventContext & ctx )
private

Definition at line 470 of file TileTBDump.cxx.

472 {
473
474 int s, c, f, nfrag, ngain, nchan, nsamp, size, ch, extra = 0, pmt, fragType, nhits = 0;
475 int id, type, rflag, unit, pulse, nsmpl, algor, niter;
476 const unsigned int* data;
477 unsigned short time, flag, prev, edge, chan, bad/*, res1,last,res2*/;
478 char fr[2] = { 'F', 'R' };
479 char gb[2] = { 'G', 'B' };
480 std::string unitName[4] = { "ADC count", "pCb", "Cs pCb", "MeV" };
481 std::string shapeName[4] = { "Phys", "Laser", "CIS", "Simul" };
482 std::string algName[8] = { "Unknown", "OF1", "OF2", "Fit", "ManyAmps", "Flat", "Alg6", "Alg7" };
483
484 std::vector<const T_RodDataFrag*> frag(MAX_ROD_FRAG);
485 std::vector<T_TileRawComp> rawcomp(MAX_DIGI_CHAN);
486 std::vector<T_TileDigiChannel> channel(MAX_DIGI_CHAN);
487 std::vector<T_TileRecoChannel> recochan(MAX_DIGI_CHAN);
488 std::vector<T_TileRecoCalib> recocalib(MAX_DIGI_CHAN);
489 T_TileRecoQuality DQword;
490
491 bool isFrag5 = false;
492 uint32_t* ofw = 0;
493 std::vector<unsigned int> OFC;
494
495 TileRawChannel2Bytes5::TileChanData Frag5Data[48];
496
497 bool beamROD = (subdet_id == 0x50 || subdet_id >= 0x60);
498 if (subdet_id >= 0x60) {
499 version = 0; // reset version in COMMON BEAM ROD
500 // don't expect different versions there
501 } else {
502 version &= 0xFFFF; // keep just minor version number
503 }
504
505 find_frag(roddata, rodsize, version, verbosity, frag.data(), nfrag);
506
507 if (verbosity > 9) return;
508
509 for (f = 0; f < nfrag; ++f) {
510
511 id = frag[f]->id & 0xFFFF;
512 type = (frag[f]->id >> 16) & 0xFF;
513 rflag = (frag[f]->id) >> 24;
514 unit = (rflag & 0xC0) >> 6;
515 pulse = (rflag & 0x30) >> 4;
516 nsmpl = (rflag & 0x08) >> 3;
517 algor = (rflag & 0x04) >> 2;
518 niter = (rflag & 0x03);
519 size = frag[f]->size - m_sizeOverhead;
520 data = frag[f]->data;
521
522 if (type==0x40 || type==0x41 || type==0x42){
523
524 const unsigned char * adc;
525 const unsigned short * result;
526 int tmdb_ch1 = std::min(5U,((robsourceid)>>16)&0xF);
527 bool EB = (tmdb_ch1>2);
528 int nmod = (EB)?8:4; // we have 8 modules per fragment in ext.barrel, 4 modules in barrel
529 int tmdb_ch2 = (((robsourceid))&0xF)*nmod;
530 const char * dr56EB[10] = { "D5-L","D5-R","D6-L","D6-R","D4-L","D4-R","XX-X","XX-X","XX-X","XX-X" };
531 const char * dr56LB[10] = { "D0-x","D1-L","D1-R","D2-L","D2-R","D3-L","D3-R","B8-L","B8-R","XX-X" };
532 const char ** dr56rl = (EB) ? dr56EB : dr56LB;
533 const char * ch11[6] = { "AUX","LBA","LBC","EBA","EBC","UNK" };
534 const char * ch12[6] = { "aux","lba","lbc","eba","ebc","unk" };
535 const char * dr56hlEB[4] = {" D6L "," D6H "," D56L"," D56H"};
536 const char * dr56hlLB[4] = {" DxL "," DxH "," DxxL"," DxxH"};
537
538 const char * dr56thEB[4] = {" D5 "," D6 "," D56 ", "BCID "};
539 const char * dr56thLB[4] = {" Dx "," Dy "," Dxy ", "BCID "};
540 const char ** dr56th = (m_runPeriod < 3) ? (EB ? dr56hlEB : dr56hlLB)
541 : (EB ? dr56thEB : dr56thLB);
542
543 const char * tit[4] = {"TMDB digits","TMDB energy","TMDB decision","Unknown"};
544
545 std::cout << std::hex << std::endl << tit[type&3] <<" fragment 0x" << type << " vers 0x"<< id << ", "
546 << std::dec << size << " words found"<< std::endl << std::endl;
547
548 int nchmod = 4;
549 int nsamp = 7;
550 int nch = 32;
551 int ntd = (EB) ? 3 : 1;
552 int ntdl = (EB) ? 9 : 5;
553 int count = 1;
554 switch (type) {
555
556 case 0x40:
557 //nsamp=4*size/nch; // here we assume that number of channels is fixed - doesn't work for simulated data
558 nch=4*size/nsamp; // instead of assuming fixed number of channels assume fixed number of samples
559 nchmod = nch/nmod;
560 std::cout << "ch cell ";
561 for (int ind=nsamp; ind>0; --ind) {
562 std::cout << " S"<<ind;
563 }
564 std::cout << std::endl;
565 adc = reinterpret_cast<const unsigned char *>(data);
566 for (int pword=0;pword<nch;++pword) {
567 int pword1=pword%nchmod;
568 if (!EB && nchmod==8) {
569 if (count&1) {
570 if (pword1==0) pword1=9;
571 else pword1 -= 1;
572 } else {
573 if (pword1>6) pword1=9;
574 }
575 } else {
576 if (pword1>9) pword1=9;
577 }
578 std::cout << std::setw(2) << pword << " | " << ch11[tmdb_ch1] <<std::setfill('0')<<std::setw(2) <<tmdb_ch2+count
579 << "-" <<std::setfill(' ')<<std::setw(4)<<dr56rl[pword1];
580 for (int ind=nsamp-1; ind>-1; --ind) {
581 std::cout << " | " << std::setw(3) << ( static_cast<unsigned>(adc[pword+nch*ind]) );
582 }
583 std::cout << std::endl;
584 if ((pword+1)%nchmod==0) count+=1;
585 }
586 break;
587
588 case 0x41:
589 nch = size; // one word per channel
590 nchmod = nch/nmod;
591 std::cout << "ch cell energy" << std::endl;
592 for (int pword=0;pword<size;++pword) {
593 int pword1=pword%nchmod;
594 if (!EB && nchmod==8) {
595 if (count&1) {
596 if (pword1==0) pword1=9;
597 else pword1 -= 1;
598 } else {
599 if (pword1>6) pword1=9;
600 }
601 } else {
602 if (pword1>9) pword1=9;
603 }
604 std::cout << std::setw(2) << pword<< " | " << ch11[tmdb_ch1] <<std::setfill('0')<<std::setw(2) <<tmdb_ch2+count
605 << "-" <<std::setfill(' ')<<std::setw(4)<<dr56rl[pword1]
606 << " | "<< std::setw(6) << static_cast<int>(data[pword])
607 << std::endl;
608 if ((pword+1)%nchmod==0) count+=1;
609 }
610 break;
611
612 case 0x42:
613 {
614 std::cout << "nn name TMDB SL_Board SL_Trigger_Sector "
615 << dr56th[3] << dr56th[2] << dr56th[1] << dr56th[0] << std::endl;
616 result = reinterpret_cast<const unsigned short *>(data);
617 if (size != 2) ntd = size * 2;
618 int nbits = m_runPeriod < 3 ? 4 : 3;
619 int tmdb = (tmdb_ch2) / 8 + 1;
620 int slb = tmdb * 3 - 1;
621 std::string tmdb_name = "TM0" + (EB ? std::to_string(tmdb) : "X");
622 for (int pword = 0; pword < ntd; ++pword) {
623 count = (EB) ? pword * 3 : pword * 4 + 1;
624 unsigned short r = result[pword];
625 int bcid = (m_runPeriod < 3) ? 0 : (r >> 12);
626 int slts1 = slb * 2 - 2;
627 int slts2 = slts1 + 1;
628 std::string slt_sectors = " - ";
629 if (EB) {
630 std::stringstream slts12;
631 slts12 << std::setfill(' ') << std::setw(2) << slts1 << "-"
632 << std::setfill(' ') << std::setw(2) << std::left << slts2;
633 slt_sectors = slts12.str();
634 }
635 std::stringstream slb_name;
636 slb_name << "SL_E" << std::setfill('0') << std::setw(2) << (EB ? std::to_string(slb) : "XX");
637 for(int pqword = 0; pqword < 4; ++pqword){
638 std::cout << std::setw(2) << pqword + pword * 4 << " | "
639 << ((count > 0 && count < ntdl) ? ch11[tmdb_ch1] : ch12[tmdb_ch1])
640 << std::setfill('0') << std::setw(2) << tmdb_ch2 + count
641 << std::setfill(' ') << std::setw(6) << tmdb_name
642 << std::setfill(' ') << std::setw(10) << slb_name.str()
643 << std::setfill(' ') << std::setw(15) << slt_sectors
644 << std::setfill(' ') << std::setw(11) << ((m_runPeriod < 3) ? ((r >> 3) & 1) : bcid)
645 << std::setw(5) << ((r >> 2) & 1) << std::setw(5) << ((r >> 1) & 1) << std::setw(5) << (r & 1) << std::endl;
646 r >>= nbits;
647 ++count;
648 }
649 ++slb;
650 if (slb > 24) slb = 1;
651 }
652 }
653 break;
654 default:
655 dump_data((uint32_t*) data, size, version, verbosity);
656 }
657
658 } else if (id < 0x100 || beamROD) { // BEAM fragments
659 id &= 0xFF; // set proper frag ID in Beam frag for old data
660
661 switch (id) {
662
663 case COMMON_TOF_FRAG:
664 case COMMON_TDC1_FRAG:
665 case COMMON_TDC2_FRAG: {
666 if ((type == 0x1) || (type == 0x2)) {
667 bool isLastChannelEOB = ((data[size - 1] >> 24) & 0x7) == 0x4;
668 if (id == COMMON_TOF_FRAG) {
669 std::cout << "\nBeam ToF TDC, ";
670 } else {
671 std::cout << "\nBeam TDC 0x" << std::setfill('0') << std::hex << std::setw(2) << id << setupDec << ", ";
672 }
673 std::cout << (isLastChannelEOB ? size - 1 : size) << " hits found";
674 prev = 0xFF;
675 for (c = 0; c < size; ++c) {
676 time = data[c] & 0x1FFF;
677 unsigned short res1 = (data[c] >> 13) & 0x1;
678
679 chan = (type == 0x1) ? (data[c] >> 17) & 0x3FF // take 10 bits, but 6 upper bits should be 0
680 : (data[c] >> 16) & 0x7FF; // take 11 bits, but 6 upper bits should be 0
681
682 if (chan > 31) {
683 int wordType = (data[c] >> 24) & 0x7;
684 if (wordType == 0x2) {
685 std::cout << "\n header, " << ((data[c] >> 8) & 0x3F) << " channels";
686 } else if (wordType == 0x4) {
687 std::cout << "\n end of block, event counter: " << (data[c] & 0xFFFFFF) << std::endl;
688 } else {
689 std::cout << "\n unknown word: 0x" << std::hex << data[c] << std::dec << std::endl;
690 }
691 continue;
692 }
693 if (prev != chan) {
694 std::cout << "\n ch" << std::setw(3) << chan << ":";
695 nhits = 0;
696 prev = chan;
697 } else if (nhits % 8 == 0) {
698 std::cout << "\n ";
699 }
700 ++nhits;
701 if (res1) {
702 std::cout << " U" << std::setw(4) << time;
703 } else {
704 std::cout << " " << std::setw(4) << time;
705 }
706 }
707 std::cout << std::endl;
708
709 break;
710 } else {
711 // Fall through to BEAM_TDC_FRAG
712 [[fallthrough]]; // silent the warning on fall through
713 }
714 }
715
716 case BEAM_TDC_FRAG:
717 std::cout << "\nBeam TDC 0x" << std::setfill('0') << std::hex << std::setw(2) << id << setupDec << ", " << size << " hits found";
718 prev = 0xFF;
719 for (c = 0; c < size; ++c) {
720 time = data[c] & 0xFFFF;
721 flag = data[c] >> 16;
722 edge = flag & 0x01;
723 chan = (flag >> 1) & 0x0F;
724 bad = (flag >> 5) & 0x01;
725 //res1 = (flag >> 6) & 0x01;
726 //last = (flag >> 7) & 0x01;
727 //res2 = (flag >> 8) & 0x0F;
728 if (prev != chan) {
729 std::cout << "\n ch" << std::setw(3) << chan << ":";
730 nhits = 0;
731 prev = chan;
732 } else if (nhits % 8 == 0) {
733 std::cout << "\n ";
734 }
735 ++nhits;
736 if (bad) {
737 std::cout << " " << gb[bad] << fr[edge] << std::setw(6) << time;
738 } else {
739 std::cout << " " << fr[edge] << std::setw(6) << time;
740 }
741 }
742 std::cout << std::endl;
743 break;
744
745 case COMMON_ADC1_FRAG:
746 case COMMON_ADC2_FRAG: {
747 if ((type == 0x1) || (type == 0x2)) { // CAEN V792N or V792
748 bool isLastChannelEOB = ((data[size - 1] >> 24) & 0x7) == 0x4;
749 std::cout << "\nBeam ADC, " << (isLastChannelEOB ? size - 1 : size) << " hits found";
750 prev = 0xFF;
751 for (c = 0; c < size; ++c) {
752 time = data[c] & 0x1FFF;
753 unsigned short res1 = (data[c] >> 13) & 0x1;
754 chan = (type == 0x1) ? (data[c] >> 17) & 0x3FF // take 10 bits, but 6 upper bits should be 0
755 : (data[c] >> 16) & 0x7FF; // take 11 bits, but 6 upper bits should be 0
756
757 if (chan > 31) {
758 int wordType = (data[c] >> 24) & 0x7;
759 if (wordType == 0x2) {
760 std::cout << "\n header, " << ((data[c] >> 8) & 0x3F) << " channels";
761 } else if (wordType == 0x4) {
762 std::cout << "\n end of block, event counter: " << (data[c] & 0xFFFFFF) << std::endl;
763 } else {
764 std::cout << "\n unknown word: 0x" << std::hex << data[c] << std::dec << std::endl;
765 }
766 continue;
767 }
768 if (prev != chan) {
769 std::cout << "\n ch" << std::setw(3) << chan << ":";
770 nhits = 0;
771 prev = chan;
772 } else if (nhits % 8 == 0) {
773 std::cout << "\n ";
774 }
775 ++nhits;
776 if (res1) {
777 std::cout << " U" << std::setw(4) << time;
778 } else {
779 std::cout << " " << std::setw(4) << time;
780 }
781 }
782 std::cout << std::endl;
783 break;
784 } else {
785 // Fall through to BEAM_ADC_FRAG
786 [[fallthrough]]; // silent the warning on fall through
787 }
788 }
789
790 case BEAM_ADC_FRAG:
791 if (BEAM_ADC_FRAG == id) {
792 std::cout << "\nTile Beam ADC, " << size << " channels found";
793 } else {
794 std::cout << "\nBeam ADC 0x" << std::hex << std::setfill('0') << std::setw(2) << id << setupDec << ", " << size << " channels found";
795 }
796 for (c = 0; c < size; ++c) {
797 if (c % 8 == 0) std::cout << setupMod << c / 8 << ":";
798 std::cout << std::setw(9) << data[c];
799 }
800 std::cout << std::endl;
801 break;
802
803 case MUON_ADC_FRAG:
804 std::cout << "\nMuon ADC, " << size << " channels found";
805 for (c = 0; c < size; ++c) {
806 if (c % 8 == 0) std::cout << setupMod << c / 8 << ":";
807 std::cout << std::setw(9) << data[c];
808 }
809 std::cout << std::endl;
810 break;
811
812 case ADDR_ADC_FRAG:
813 std::cout << "\nMuon2 ADC, " << size << " channels found";
814 for (c = 0; c < size; ++c) {
815 if (c % 8 == 0) std::cout << setupMod << c / 8 << ":";
816 std::cout << std::setw(9) << data[c];
817 }
818 std::cout << std::endl;
819 break;
820
821 case LASE_PTN_FRAG:
822 case COMMON_PTN_FRAG:
823 if (LASE_PTN_FRAG == id) {
824 std::cout<<"\nLaser Pattern Unit, " << size << " words found (hex)";
825 } else {
826 std::cout<<"\nCommon Pattern Unit, " << size << " words found (hex)";
827 }
828 for (c = 0; c < size; ++c) {
829 if (c % 8 == 0) std::cout << setupMod << c/8 << ":";
830 std::cout << " 0x" << setup0 << data[c] << setupDec << std::endl;
831 }
832 std::cout << std::endl;
833 break;
834
835 case LASER_OBJ_FRAG:
836
837 if (size !=25 && size != 26) {
838 std::cout<<"\nLASTROD Laser Object, " << size << " words found (hex)";
839 for (c = 0; c < size; ++c) {
840 if (c % 8 == 0) std::cout << setupMod << c/8 << ":";
841 std::cout << " 0x" << setup0 << data[c] << setupDec;
842 }
843 std::cout<<std::endl<<std::endl;
844
845 if (size != 31) {
846 std::cout<<"CRITICAL ERROR! Unknown format!"<<std::endl;
847 } else {
848 const unsigned int * p;
849 int Counter = 0;
850 int Filter = 0, ReqAmp = 0, MeasAmp = 0, Delay = 0, TDC1 = 0, TDC2 = 0;
851 p = data;
852 Counter = *p;
853 p++;
854 std::cout << " Laser Counter: " << std::setw(5) << Counter << std::endl;
855
856 if ((*p & 0xFF000000) == 0x20000000) {
857 ReqAmp = *p & 0xFFFF;
858 if (version > 1) {
859 Filter = (((*p >> 16) & 7) ^ 7) + 2;
860 if (Filter > 8) Filter -= 8;
861 std::cout << " Filter Wheel: " << std::setw(5) << Filter << std::endl;
862 }
863 std::cout << " Required Amp: " << std::setw(5) << ReqAmp << std::endl;
864 } else {
865 std::cout << "ERROR in Laser Fragment: decoding word 14." << std::endl;
866 }
867 p++;
868
869 if ((*p & 0xFF000000) == 0x21000000) {
870 Delay = (*p >> 12) & 0xFFF;
871 MeasAmp = *p & 0xFFF;
872 std::cout << " Measured Amp: " << std::setw(5) << MeasAmp << std::endl;
873 std::cout << " Delay: " << std::setw(5) << Delay << std::endl;
874 } else {
875 std::cout << "ERROR in Laser Fragment: decoding word 15." << std::endl;
876 }
877 p++;
878
879 bool TDCPrint = true;
880
881 if ((*p & 0xFF000000) == 0x22000000) {
882 if (version == 1) {
883 TDC1 = (*p >> 16) & 0xF;
884 TDC2 = (*p >> 20) & 0xF;
885 } else {
886 TDC1 = *p & 0xFFFF;
887 }
888 } else {
889 std::cout << "ERROR in Laser Fragment: decoding word 16." << std::endl;
890 TDCPrint = false;
891 }
892 p++;
893 if ((*p & 0xFF000000) == 0x23000000) {
894 if (version == 1) {
895 TDC1 = (TDC1 << 12) + (*p & 0xFFF);
896 TDC2 = (TDC2 << 12) + ((*p >> 12) & 0xFFF);
897 } else {
898 TDC2 = *p & 0xFFFF;
899 }
900 } else {
901 std::cout << "ERROR in Laser Fragment: decoding word 17." << std::endl;
902 TDCPrint = false;
903 }
904 p++;
905 if (TDCPrint) {
906 std::cout << " TDC1 data: " << std::setw(5) << TDC1 << std::endl;
907 std::cout << " TDC2 data: " << std::setw(5) << TDC2 << std::endl;
908 }
909
910 int chan0 = 0, chan1 = 0, chan2 = 0, chan3 = 0, chan4 = 0, chan5 = 0, chan6 = 0, chan7 = 0;
911
912 if ((*p & 0xFF000000) == 0x44000000) {
913 chan0 = (*p & 0xFFF) ^ 0xFFF;
914 chan1 = ((*p >> 12) & 0xFFF) ^ 0xFFF;
915 } else {
916 std::cout << "ERROR in Laser Fragment: decoding word 18." << std::endl;
917 }
918 p++;
919
920 if ((*p & 0xFF000000) == 0x45000000) {
921 chan2 = (*p & 0xFFF) ^ 0xFFF;
922 chan3 = ((*p >> 12) & 0xFFF) ^ 0xFFF;
923 } else {
924 std::cout << "ERROR in Laser Fragment: decoding word 19." << std::endl;
925 }
926 p++;
927
928 if ((*p & 0xFF000000) == 0x46000000) {
929 chan4 = (*p & 0xFFF) ^ 0xFFF;
930 chan5 = ((*p >> 12) & 0xFFF) ^ 0xFFF;
931 } else {
932 std::cout << "ERROR in Laser Fragment: decoding word 20." << std::endl;
933 }
934 p++;
935
936 if ((*p & 0xFF000000) == 0x47000000) {
937 chan6 = (*p & 0xFFF) ^ 0xFFF;
938 chan7 = ((*p >> 12) & 0xFFF) ^ 0xFFF;
939 } else {
940 std::cout << "ERROR in Laser Fragment: decoding word 21." << std::endl;
941 }
942 p++;
943
944 int diode1_Ped = 0, diode1_PedRMS = 0
945 , diode2_Ped = 0, diode2_PedRMS = 0
946 , diode3_Ped = 0, diode3_PedRMS = 0
947 , diode4_Ped = 0, diode4_PedRMS = 0
948 , PMT1_Ped = 0, PMT1_PedRMS = 0
949 , PMT2_Ped = 0, PMT2_PedRMS = 0;
950
951 diode1_Ped = (*p >> 16) & 0xFFFF;
952 diode1_PedRMS = *p & 0xFFFF;
953 p++;
954
955 diode2_Ped = (*p >> 16) & 0xFFFF;
956 diode2_PedRMS = *p & 0xFFFF;
957 p++;
958
959 diode3_Ped = (*p >> 16) & 0xFFFF;
960 diode3_PedRMS = *p & 0xFFFF;
961 p++;
962
963 diode4_Ped = (*p >> 16) & 0xFFFF;
964 diode4_PedRMS = *p & 0xFFFF;
965 p++;
966
967 PMT1_Ped = (*p >> 16) & 0xFFFF;
968 PMT1_PedRMS = *p & 0xFFFF;
969 p++;
970
971 PMT2_Ped = (*p >> 16) & 0xFFFF;
972 PMT2_PedRMS = *p & 0xFFFF;
973 p++;
974
975 time_t Ped_Last_Run = *p;
976 p++;
977
978 int diode1_alpha = 0, diode1_alphaRMS = 0
979 , diode2_alpha = 0, diode2_alphaRMS = 0
980 , diode3_alpha = 0, diode3_alphaRMS = 0
981 , diode4_alpha = 0, diode4_alphaRMS = 0;
982
983 diode1_alpha = (*p >> 16) & 0xFFFF;
984 diode1_alphaRMS = *p & 0xFFFF;
985 p++;
986
987 diode2_alpha = (*p >> 16) & 0xFFFF;
988 diode2_alphaRMS = *p & 0xFFFF;
989 p++;
990
991 diode3_alpha = (*p >> 16) & 0xFFFF;
992 diode3_alphaRMS = *p & 0xFFFF;
993 p++;
994
995 diode4_alpha = (*p >> 16) & 0xFFFF;
996 diode4_alphaRMS = *p & 0xFFFF;
997 p++;
998
999 time_t Alpha_Last_Run = *p;
1000 p++;
1001
1002 time_t PedAlpha_Last_Run(0);
1003
1004 int diode1_PedAlpha = 0, diode1_PedAlphaRMS = 0
1005 , diode2_PedAlpha = 0, diode2_PedAlphaRMS = 0
1006 , diode3_PedAlpha = 0, diode3_PedAlphaRMS = 0
1007 , diode4_PedAlpha = 0, diode4_PedAlphaRMS = 0;
1008
1009 if (version > 1) {
1010 diode1_PedAlpha = (*p >> 16) & 0xFFFF;
1011 diode1_PedAlphaRMS = *p & 0xFFFF;
1012 p++;
1013
1014 diode2_PedAlpha = (*p >> 16) & 0xFFFF;
1015 diode2_PedAlphaRMS = *p & 0xFFFF;
1016 p++;
1017
1018 diode3_PedAlpha = (*p >> 16) & 0xFFFF;
1019 diode3_PedAlphaRMS = *p & 0xFFFF;
1020 p++;
1021
1022 diode4_PedAlpha = (*p >> 16) & 0xFFFF;
1023 diode4_PedAlphaRMS = *p & 0xFFFF;
1024 p++;
1025
1026 PedAlpha_Last_Run = *p;
1027 p++;
1028 }
1029
1030 std::cout << std::endl << " | ADC | Pedestal(RMS) | Alpha (RMS) | PedAlpha(RMS) |" << std::endl;
1031 if (version == 1){
1032 std::cout << " Diode 1 | " << std::setw(5) << chan0 << " | " << setupPr1 << diode1_Ped / 10.0 << " (" << setupPr2 << diode1_PedRMS / 100.0 << ") | " << setupPr1 << diode1_alpha / 10.0 << " (" << setupPr2 << diode1_alphaRMS / 100.0 << ") |" << std::endl;
1033 std::cout << " Diode 2 | " << std::setw(5) << chan1 << " | " << setupPr1 << diode2_Ped / 10.0 << " (" << setupPr2 << diode2_PedRMS / 100.0 << ") | " << setupPr1 << diode2_alpha / 10.0 << " (" << setupPr2 << diode2_alphaRMS / 100.0 << ") |" << std::endl;
1034 std::cout << " Diode 3 | " << std::setw(5) << chan2 << " | " << setupPr1 << diode3_Ped / 10.0 << " (" << setupPr2 << diode3_PedRMS / 100.0 << ") | " << setupPr1 << diode3_alpha / 10.0 << " (" << setupPr2 << diode3_alphaRMS / 100.0 << ") |" << std::endl;
1035 std::cout << " Diode 4 | " << std::setw(5) << chan3 << " | " << setupPr1 << diode4_Ped / 10.0 << " (" << setupPr2 << diode4_PedRMS / 100.0 << ") | " << setupPr1 << diode4_alpha / 10.0 << " (" << setupPr2 << diode4_alphaRMS / 100.0 << ") |" << std::endl;
1036 } else {
1037 std::cout << " Diode 1 | " << std::setw(5) << chan0 << " | " << setupPr1 << diode1_Ped / 10.0 << " (" << setupPr2 << diode1_PedRMS / 100.0 << ") | " << setupPr1 << diode1_alpha / 10.0 << " (" << setupPr2 << diode1_alphaRMS / 100.0 << ") | " << setupPr1 << diode1_PedAlpha / 10.0 << " (" << setupPr2 << diode1_PedAlphaRMS / 100.0 << ") |" << std::endl;
1038 std::cout << " Diode 2 | " << std::setw(5) << chan1 << " | " << setupPr1 << diode2_Ped / 10.0 << " (" << setupPr2 << diode2_PedRMS / 100.0 << ") | " << setupPr1 << diode2_alpha / 10.0 << " (" << setupPr2 << diode2_alphaRMS / 100.0 << ") | " << setupPr1 << diode2_PedAlpha / 10.0 << " (" << setupPr2 << diode2_PedAlphaRMS / 100.0 << ") |" << std::endl;
1039 std::cout << " Diode 3 | " << std::setw(5) << chan2 << " | " << setupPr1 << diode3_Ped / 10.0 << " (" << setupPr2 << diode3_PedRMS / 100.0 << ") | " << setupPr1 << diode3_alpha / 10.0 << " (" << setupPr2 << diode3_alphaRMS / 100.0 << ") | " << setupPr1 << diode3_PedAlpha / 10.0 << " (" << setupPr2 << diode3_PedAlphaRMS / 100.0 << ") |" << std::endl;
1040 std::cout << " Diode 4 | " << std::setw(5) << chan3 << " | " << setupPr1 << diode4_Ped / 10.0 << " (" << setupPr2 << diode4_PedRMS / 100.0 << ") | " << setupPr1 << diode4_alpha / 10.0 << " (" << setupPr2 << diode4_alphaRMS / 100.0 << ") | " << setupPr1 << diode4_PedAlpha / 10.0 << " (" << setupPr2 << diode4_PedAlphaRMS / 100.0 << ") |" << std::endl;
1041 }
1042
1043 std::cout << " PMT 1 | " << std::setw(5) << chan4 << " | " << setupPr1 << PMT1_Ped / 10.0 <<" (" << setupPr2 << PMT1_PedRMS / 100.0 << ") | x | x |" << std::endl;
1044 std::cout << " PMT 2 | " << std::setw(5) << chan5 << " | " << setupPr1 << PMT2_Ped / 10.0 <<" (" << setupPr2 << PMT2_PedRMS / 100.0 << ") | x | x |" << std::endl;
1045 std::cout << " InjChrg | " << std::setw(5) << chan6 << " | x | x | x |" << std::endl;
1046 std::cout << " Spare | " << std::setw(5) << chan7 << " | x | x | x |" << std::endl;
1047
1048 std::cout << std::endl << " | Date & Time (GMT) | Date & Time (CERN)" << std::endl;
1049
1050 struct tm TimeInfo;
1051 char buf[80];
1052 gmtime_r(&Ped_Last_Run, &TimeInfo);
1053 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1054
1055 std::cout << " Pedestal | " << buf << " | " << cern_local_time(Ped_Last_Run) << std::endl;
1056
1057 gmtime_r(&Alpha_Last_Run, &TimeInfo);
1058 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1059
1060 std::cout << " Alpha | " << buf << " | " << cern_local_time(Alpha_Last_Run) << std::endl;
1061
1062 gmtime_r(&PedAlpha_Last_Run, &TimeInfo);
1063 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1064
1065 std::cout << " PedAlpha | " << buf << " | " << cern_local_time(PedAlpha_Last_Run) << std::endl;
1066
1067 int diodeTemp = 0, secsDiodeT = 0
1068 , boxTemp = 0, secsBoxT = 0
1069 , boxHum = 0, secsBoxH = 0
1070 , gasFlow = 0, secsGasF = 0;
1071
1072 diodeTemp = *p & 0xFFF;
1073 secsDiodeT = (*p >> 12) & 0xFFFFF;
1074 p++;
1075 boxTemp = *p & 0xFFF;
1076 secsBoxT = (*p >> 12) & 0xFFFFF;
1077 p++;
1078 boxHum = *p & 0xFFF;
1079 secsBoxH = (*p >> 12) & 0xFFFFF;
1080 p++;
1081 gasFlow = *p & 0xFFF;
1082 secsGasF = (*p >> 12) & 0xFFFFF;
1083 p++;
1084
1085 std::cout << std::endl << " | Time | Value |" << std::endl;
1086 std::cout << " Laser diode temp | " << std::setw(7) << secsDiodeT << " | " << setupPr3 << diodeTemp / 10.0 << " |" << std::endl;
1087 std::cout << " Laser box temp | " << std::setw(7) << secsBoxT << " | " << setupPr3 << boxTemp / 10.0 << " |" << std::endl;
1088 std::cout << " Laser box humidity | " << std::setw(7) << secsBoxH << " | " << setupPr3 << boxHum / 10.0 << " |" << std::endl;
1089 std::cout << " Laser box gas flow | " << std::setw(7) << secsGasF << " | " << setupPr3 << gasFlow / 10.0 << " |" << std::endl;
1090
1091 std::bitset<32> PLCstatus = *p;
1092 int PLCtime = (*p >> 12) & 0xFFFFF;
1093 p++;
1094
1095 int Alpha0 = PLCstatus[0];
1096 int Alpha1 = PLCstatus[1];
1097 int Alpha2 = PLCstatus[2];
1098 int LV = PLCstatus[3];
1099 int HV1 = PLCstatus[4];
1100 int HV2 = PLCstatus[5];
1101 int ShOpen = PLCstatus[6];
1102 int ShClose = PLCstatus[7];
1103 int Ilock = PLCstatus[8];
1104 int Alarm = PLCstatus[9];
1105 int Err = PLCstatus[11];
1106
1107 const char *YesNo[2] = {" No","Yes"};
1108 const char *OnOff[2] = {"Off"," On"};
1109
1110 std::cout << std::endl << " Time | Err | Alarm | Ilock | ShClose | ShOpen | HV2 | HV1 | LV | Alpha2 | Alpha1 | Alpha0 |"
1111 << std::endl << " " << std::setw(7) << PLCtime
1112 << " | " << YesNo[Err] << " | " << OnOff[Alarm] << " | " << OnOff[Ilock] << " | " << YesNo[ShClose]
1113 << " | " << YesNo[ShOpen] << " | " << OnOff[HV2] << " | " << OnOff[HV1] << " | " << OnOff[LV]
1114 << " | " << OnOff[Alpha2] << " | " << OnOff[Alpha1] << " | " << OnOff[Alpha0] << " |" << std::endl;
1115
1116 if (p != &data[size]) {
1117 std::cout << "CRITICAL ERROR! Wrong size" << std::endl;
1118 }
1119 }
1120 break;
1121 }
1122 /* FALLTHROUGH */
1123
1124 case LASERII_OBJ_FRAG:
1125
1126 {
1127 std::cout<<"\nLASTROD New Laser Object, " << size << " words found" << std::endl;
1128
1129 bool first_half_present = (size == 25 || size == 26 || size == 128 || size == 129);
1130 bool second_half_present = (size == 99 || size == 100 || size == 128 || size == 129);
1131
1132 if ( ! (first_half_present || second_half_present) ) {
1133 std::cout << "CRITICAL ERROR! Unknown format!" << std::endl;
1134 } else {
1135
1136 const char *name[17] = {" PhotoDiode 0",
1137 " PhotoDiode 1",
1138 " PhotoDiode 2",
1139 " PhotoDiode 3",
1140 " PhotoDiode 4",
1141 " PhotoDiode 5",
1142 " PhotoDiode 6",
1143 " PhotoDiode 7",
1144 " PhotoDiode 8",
1145 " PhotoDiode 9",
1146 " External CIS 0",
1147 " Internal CIS",
1148 " Diode Phocal",
1149 " External CIS 1",
1150 " PMT 0",
1151 " PMT 1",
1152 " TDC 1 & 0"
1153 };
1154
1155 time_t tim;
1156 struct tm TimeInfo;
1157 char buf[80];
1158
1159 const unsigned int * p = data;
1160
1161 if (first_half_present) {
1162
1163 // p[0] 00 00 00 tt Daq Type
1164 // p[1] nn nn nn nn Laser Count
1165 // p[2] rr rr mm mm rrrr = Requested Intensity mmmm = measured intensity
1166 // p[3] 00 0f dd dd f = filter dddd = Delay Slama
1167 // p[4] 00 00 ll ll Linearity DAC Value
1168
1169 std::cout << std::endl << " DAQ type: " << std::setw(5) << (data[0]%0xFF) << std::endl;
1170 std::cout << " Laser Counter: " << std::setw(5) << data[1] << std::endl;
1171 std::cout << " Required Amp: " << std::setw(5) << (data[2]>>16) << std::endl;
1172 std::cout << " Measured Amp: " << std::setw(5) << (data[2]&0xFFFF) << std::endl;
1173 std::cout << " Filter Wheel: " << std::setw(5) << (data[3]>>16 & 0x000F) << std::endl;
1174 std::cout << " Delay: " << std::setw(5) << (data[3]&0xFFFF) << std::endl;
1175 std::cout << " Linearity DAC: " << std::setw(5) << (data[4]&0xFFFF) << std::endl;
1176 std::cout << std::endl;
1177
1178 p = data+5;
1179 // decode 32 ADC half-words (16 low & high channels)
1180 std::cout << " HG LG" << std::endl;
1181 for (int n=0; n<17; ++n) {
1182 // ll ll hh hh ADC Channel 0 & 1 (Low & High Gain)
1183 std::cout << name[n] << ": " << std::setw(5) << ((*p)&0xFFFF) << std::setw(6) << ((*p)>>16) << " => " << std::setw(5) << (8500-((*p)&0xFFFF)) << std::setw(6) << (8500-((*p)>>16))<< std::endl;
1184 ++p;
1185 }
1186
1187 // status word
1188 // 27: 1 if HOLA link not full
1189 // 26: 1 if HOLA link not down
1190 // 24: 1 if bad clock from VME (16MHz)
1191 // 22: 1 if bad clock from TTC (40MHz)
1192 // 20: 1 if TTC double error
1193 // 19: 1 if TTC single error
1194 // 16: 1 if PLL locked for VME clock (16MHz)
1195 // 15: 1 if PLL locked for TTC clock (40MHz)
1196 // 10: 1 if fault from laser temperature sensor
1197 // 9: 1 if laser diode off
1198 // 8: 1 if interlock closed
1199 // 6: 1 if combined run finished
1200 // 1: 1 if busy
1201 // 0: 1 if busy for longer than 5s
1202
1203
1204 std::bitset<32> status = *(p++);
1205 const char *YesNo[2] = {" No","Yes"};
1206 std::cout << std::endl;
1207 std::cout << "| Link| Link| Bad | Bad | TTC | TTC | PLL | PLL |Laser|Laser|Inter| Comb| Busy| Long|" << std::endl;
1208 std::cout << "| not | not | VME | TTC |doubl|singl| lock| lock| temp| diod| lock| run | | busy|" << std::endl;
1209 std::cout << "| full| down|clock|clock|error|error| VME | TTC |fault| off |close| fini| |>5sec|" << std::endl;
1210 std::cout << "|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|-----|" << std::endl;
1211 std::cout << "| " << YesNo[status[27]] << " | " << YesNo[status[26]] << " | " << YesNo[status[24]] << " | " << YesNo[status[22]] << " | " << YesNo[status[20]] << " | " << YesNo[status[19]] << " | " << YesNo[status[16]] << " | " << YesNo[status[15]] << " | " << YesNo[status[10]] << " | " << YesNo[status[9]] << " | " << YesNo[status[8]] << " | " << YesNo[status[6]] << " | " << YesNo[status[1]] << " | " << YesNo[status[0]] << " |" << std::endl;
1212
1213 std::cout << std::endl << " FPGA Global Status: 0x" << std::hex
1214 << status.to_ulong() << " => " << status.to_string() << std::dec << std::endl;
1215 tim = *(p++);
1216 gmtime_r(&tim, &TimeInfo);
1217 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1218 std::cout << "DCS Time Stamp (GMT): " << buf << " => " << cern_local_time(tim) << std::endl;
1219 std::cout << " PhotoDiode Polarity: " << std::setw(5) << (*p++) << std::endl;
1220 p+=4; // skip 4 free words
1221 }
1222
1223 if (second_half_present) {
1224 std::cout << " Calibration Type: " << std::setw(5) << (*p++) << std::endl;
1225 tim = p[97];
1226 gmtime_r(&tim, &TimeInfo);
1227 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1228 std::cout << " Time Stamp (GMT): " << buf << " => " << cern_local_time(tim) << std::endl;
1229
1230 double nevt = double(p[96]);
1231 if (p[96]==0 || (p[96]==3072 && (*p)<21504000)) {
1232 std::cout << " Number of events: " << p[96] << " => assuming 1024" << std::endl << std::endl;
1233 nevt=1024.;
1234 } else {
1235 std::cout << " Number of events: " << std::setw(5) << p[96] << std::endl << std::endl;
1236 }
1237 std::cout << " pedHG rmsHG pedLG rmsLG" << std::endl;
1238 for (int n=0; n<16; ++n) {
1239
1240 uint32_t sum0 = *(p++);
1241 uint32_t sum1 = *(p++);
1242
1243 uint32_t lsb0 = *(p++);
1244 uint32_t msb0 = *(p++);
1245 uint32_t lsb1 = *(p++);
1246 uint32_t msb1 = *(p++);
1247 uint64_t ssq0 = ((uint64_t) msb0 << 32) | ((uint64_t) lsb0);
1248 uint64_t ssq1 = ((uint64_t) msb1 << 32) | ((uint64_t) lsb1);
1249
1250 // COMPUTE MEAN AND STANDARD DEVIATION
1251 double ped0 = double(sum0)/nevt;
1252 double ped1 = double(sum1)/nevt;
1253
1254 double rms0 = double(ssq0)/nevt - ped0*ped0;
1255 double rms1 = double(ssq1)/nevt - ped1*ped1;
1256 if (rms0>0.0) rms0 = sqrt(rms0);
1257 if (rms1>0.0) rms1 = sqrt(rms1);
1258
1259 std::cout << name[n] << ":" << std::setw(11) << sum0 << std::setw(11) << sum1 << std::setw(11) << msb0 << std::setw(11) << lsb0 << std::setw(11) << msb1 << std::setw(11) << lsb1 << " => " << std::setw(7) << std::setprecision(1) << 8500.-ped0 << " +/- " << std::setw(7) << std::setprecision(1) << rms0 << " " << std::setw(7) << std::setprecision(1) << 8500.-ped1 << " +/- " << std::setw(7) << std::setprecision(1) << rms1 << std::endl;
1260 }
1261 }
1262 }
1263 break;
1264 }
1265
1266 case LASE_ADC_FRAG:
1267 std::cout << "\nLaser ADC, " << size << " channels found";
1268 for (c = 0; c < size; ++c) {
1269 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1270 std::cout << std::setw(9) << data[c];
1271 }
1272 std::cout << std::endl;
1273 break;
1274
1275 case ECAL_ADC_FRAG:
1276 std::cout << "\nECAL ADC, " << size << " channels found";
1277 for (c = 0; c < size; ++c) {
1278 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1279 std::cout << std::setw(9) << data[c];
1280 }
1281 std::cout << std::endl;
1282 break;
1283
1284 case DIGI_PAR_FRAG:
1285 std::cout << "\nDigi parameters, " << size << " words found";
1286 for (c = 0; c < size; ++c) {
1287 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1288 std::cout << std::setw(11) << data[c];
1289 }
1290 std::cout << std::endl;
1291
1292 if (size == 4 || size == 16 || size == 110) {
1293 const unsigned int *p = data;
1294 int Counter = 0, Mode = 0, Samples = 0, Pipeline = 0, I3Delay = 0, Event = 0, Phase = 0,
1295 DAC = 0, Capacity = 0, Card = 0, RunType = 0, microsec = 0;
1296 time_t Time;
1297 bool DefFormat = true;
1298 if (size == 4) DefFormat = false;
1299 if (!DefFormat) {
1300 Counter = *(p++);
1301 Samples = *(p++);
1302 Pipeline = *(p++);
1303 RunType = *(p++);
1304 } else {
1305 Mode = *(p++);
1306 Samples = *(p++);
1307 Pipeline = *(p++);
1308 I3Delay = *(p++);
1309 Event = *(p++);
1310 Phase = *(p++);
1311 DAC = *(p++);
1312 Capacity = *(p++);
1313 Card = *(p++);
1314 p++; //Reserved
1315 Time = *(p++);
1316 microsec = *(p++);
1317 RunType = *(p++);
1318 p++; //Reserved
1319 p++; //Reserved
1320 Counter = *(p++);
1321 }
1322 const char *RunTypeText;
1323 switch (RunType) {
1324 case 1: RunTypeText = "Physics"; break;
1325 case 2: RunTypeText = "Laser"; break;
1326 case 4: RunTypeText = "Pedestals"; break;
1327 case 8: RunTypeText = "CIS mono"; break;
1328 case 16: RunTypeText = "CIS scan"; break;
1329 default: RunTypeText = "Unknown"; break;
1330 }
1331
1332 std::cout << "\n CIS Counter: " << std::setw(3) << Counter<< std::endl;
1333 std::cout << "\n Run Type: " << std::setw(3) << RunType << " (" << RunTypeText << ")";
1334 if (!DefFormat) {
1335 std::cout << "\n Samples: " << std::setw(3) << Samples;
1336 std::cout << "\n Pipeline: " << std::setw(3) << Pipeline << std::endl;
1337 } else {
1338 const char* ModeText;
1339 switch (Mode) {
1340 case 0:
1341 ModeText = "Normal";
1342 break;
1343 case 1: ModeText = "Calibration"; break;
1344 default: ModeText = "Unknown"; break;
1345 }
1346
1347 struct tm TimeInfo;
1348 char buf[80];
1349 gmtime_r(&Time, &TimeInfo);
1350 strftime(buf, 80, "%d.%m.%Y %H:%M:%S", &TimeInfo);
1351 std::cout << std::endl;
1352 std::cout << " Time (GMT): " << buf << " => " << cern_local_time(Time) << std::endl;
1353 std::cout << " Microsec.: " << microsec << std::endl << std::endl;
1354 std::cout << " Mode: " << std::setw(3) << Mode << " (" << ModeText << ")" << std::endl;
1355 std::cout << " Samples: " << std::setw(3) << Samples << std::endl;
1356 std::cout << " Pipeline: " << std::setw(3) << Pipeline << std::endl;
1357 std::cout << " I3Delay: " << std::setw(3) << I3Delay << std::endl;
1358 std::cout << " Event: " << std::setw(3) << Event << std::endl;
1359 std::cout << " Phase: " << std::setw(3) << Phase << std::endl;
1360 std::cout << " DAC: " << std::setw(3) << DAC << std::endl;
1361 std::cout << " Capacity: " << std::setw(3) << Capacity << " pF" << std::endl;
1362 std::cout << " Card: " << std::setw(3) << Card << std::endl;
1363
1364 if (size > 16) {
1365 int last = size - 1;
1366 for (; last > 15; --last) {
1367 if (data[last] != 0) break;
1368 }
1369 if (last > 15) {
1370 std::cout << "\n Remaing " << last - 15 << " non-zero words (hex):";
1371 for (c = 16; c <= last; ++c) {
1372 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1373 std::cout << std::hex << std::setw(11) << data[c] << std::dec;
1374 }
1375 std::cout << std:: endl;
1376 }
1377 }
1378 }
1379 } else {
1380 std::cout << "CRITICAL ERROR! Unknown format!" << std::endl;
1381 }
1382 break;
1383
1384 case ADD_FADC_FRAG:
1385 std::cout << "\nAdder FADC, " << size << " words found (hex)" ;
1386 for (c = 0; c < size; ++c) {
1387 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1388 std::cout << std::hex << std::setw(9) << data[c] << std::dec;
1389 }
1390 std::cout << std::endl;
1391 break;
1392
1393 case COIN_TRIG1_FRAG:
1394 case COIN_TRIG2_FRAG:
1395 case COIN_TRIG3_FRAG:
1396 case COIN_TRIG4_FRAG:
1397 case COIN_TRIG5_FRAG:
1398 case COIN_TRIG6_FRAG:
1399 case COIN_TRIG7_FRAG:
1400 case COIN_TRIG8_FRAG:
1401 std::cout << "\nCoincidence trigger frag " << id - COIN_TRIG1_FRAG + 1 << ", " << size << " words found (hex)";
1402 for (c = 0; c < size; ++c) {
1403 if (c % 8 == 0) std::cout << setupMod << c/8<< ":";
1404 std::cout << std::hex << std::setw(11) << data[c] << std::dec;
1405 }
1406 std::cout << std::endl;
1407 break;
1408
1409 default:
1410 std::cout << "\nUnknown fragment [0x" << std::hex << id << std::dec << "], " << size << " words found" << std::endl;
1411 break;
1412 }
1413 } else { // normal ROD fragments
1414
1415 drawerMap_iterator itr = m_drawerMap.find(id);
1416 if (itr != m_drawerMap.end()) {
1417 fragType = (*itr).second;
1418 } else {
1419 fragType = (id >> 8);
1420 if (fragType > 4 || fragType < 1) fragType = 2; // assume barrel negative for unknown types
1421 }
1422
1423 /* check for empty fragments */
1424 if (size > 0) {
1425
1426 int DQstat;
1427
1428 switch (type) {
1429 case 0: // digitizer fragment
1430 tile_unpack_digi(frag[f], channel.data(), MAX_DIGI_CHAN, version, verbosity, &ngain, &nchan, &nsamp);
1431 std::cout << "\nDigitizer fragment 0x" << std::hex << id << std::dec << ", " << size << " words found:"
1432 << "\t" << nchan / 3 << " chips, " << nsamp << "+2 samples" << std::endl;
1433
1434 if (ngain == 1) {
1435 extra = size - nchan * (nsamp + 2) / 3;
1436 } else if (ngain == 2) {
1437 extra = size - nchan / 2 * (2 * nsamp + 3) / 3;
1438 } else {
1439 extra = 0;
1440 }
1441
1442 if (version == 0x1 || version == 0x2) {
1443 std::cout << "\nfirst data word:" << std::setw(12) << data[0] << " (0x"<< setup0 << data[0] << setupDec << ")";
1444 --extra;
1445 }
1446
1447 if (extra > 0) {
1448 std::cout << "\n" << std::setw(3) << extra << " extra words:";
1449 for (c = size - extra; c < size; ++c) {
1450 std::cout << std::setw(12) << data[c] << " (0x"<< setup0 << data[c] << setupDec << ")";
1451 if ((c - size + extra) % 2 == 1 && c!=size-1) std::cout << "\n ";
1452 }
1453 std::cout << std::endl;
1454 }
1455
1456 std::cout << "\nPMT Ch | BCID M G";
1457 for (s = 0; s < nsamp; ++s) {
1458 std::cout << std::setw(4) << s << " ";
1459 }
1460
1461 std::cout << " Head/Data/CRC\n---|---|-------------------------";
1462 for (s = 0; s < nsamp; ++s) {
1463 std::cout << "-----";
1464 }
1465
1466 {
1467 bool OK = true;
1468 for (ch = 0; ch < nchan; ++ch) {
1469 pmt = m_cabling->channel2hole(fragType, ch % 48);
1470 if (extra == 0 && pmt < 0) pmt = -pmt;
1471
1472 if (pmt > 0) {
1473 std::cout << "\n" << std::setw(3) << pmt << std::setw(3) << ch << " |";
1474 } else {
1475 std::cout << "\n -- " << std::setw(2) << ch << " |";
1476 }
1477
1478 if (ch % 3 == 0) {
1479 std::cout << std::setw(5) << (channel[ch].bcid) << std::setw(2) << ((channel[ch].flag >> 3) & 3);
1480 } else {
1481 std::cout << " ";
1482 }
1483
1484 std::cout << std::setw(2) << (channel[ch].gain);
1485
1486 for (s = 0; s < nsamp; ++s) {
1487 std::cout << std::setw(5) << (channel[ch].sample[s]);
1488 }
1489
1490 if (ch % 3 == 0) {
1491 if (channel[ch].head != 0) {
1492 std::cout << " 0x" << setup0 << channel[ch].head << setupDec << " Head";
1493 } else {
1494 std::cout << " " << setup0 << channel[ch].head << setupDec << " Head";
1495 }
1496 }
1497
1498 if (ch % 3 == 1) {
1499 if (channel[ch].first != 0) {
1500 std::cout << " 0x" << setup0 << channel[ch].first << setupDec << " Data";
1501 } else {
1502 std::cout << " " << setup0 << channel[ch].first << setupDec << " Data";
1503 }
1504 }
1505
1506 if (ch % 3 == 2) {
1507 if (channel[ch].crc != 0) {
1508 std::cout << " 0x" << setup0 << channel[ch].crc << setupDec << " CRC ";
1509 } else {
1510 std::cout << " " << setup0 << channel[ch].crc << setupDec << " CRC ";
1511 }
1512 }
1513
1514 /*
1515 if (ch < 48) {
1516 int s[7];
1517 for (int i = 0; i < 7; i++) {
1518 s[i] = channel[ch].sample[i];
1519 }
1520 int gain = channel[ch].gain;
1521 int ene_ctrl = m_rc2bytes5.amplitude(ofw, unit, ch, gain, s);
1522 if (ene_ctrl < 0) ene_ctrl = 0;
1523 if (ene_ctrl > 0x7FFF) ene_ctrl = 0x7FFF;
1524 std::cout << " | " << std::setw(5) << ene_ctrl << std::setw(6) << recocalib[ch].amp);
1525 if (recocalib[ch].amp != ene_ctrl) { OK = false; std::cout << ": ERROR"; }
1526 }
1527 */
1528 if (isFrag5) {
1529 bool chOK = true;
1530 for (int i = 0; i < 7; i++) {
1531 if (Frag5Data[ch].s[i] != channel[ch].sample[i]) chOK = false;
1532 }
1533 if (!chOK) {
1534 std::cout << " RawERR ";
1535 m_rc2bytes5.print_code(Frag5Data[ch].code);
1536 std::cout << " | ";
1537 for (int i = 0; i < 7; i++) {
1538 std::cout << std::setw(5) << Frag5Data[ch].s[i] ;
1539 }
1540 }
1541 }
1542 }
1543 if (!OK) std::cout << "\nOF weights: ERROR";
1544 }
1545
1546 if (isFrag5) {
1547 std::cout << std::endl;
1548 bool OK = true;
1549 for (int ch = 0; ch < 48; ch++) {
1550 bool chOK = true;
1551 for (int i = 0; i < 7; i++) {
1552 if (Frag5Data[ch].s[i] != channel[ch].sample[i]) chOK = false;
1553 }
1554 //uint32_t* ofc = ofw + (ch*2 + channel[ch].gain)*22;
1555 //int16_t a4 = ofc[2] & 0xFFFF;
1556 //if (abs(a4) < 16000) chOK = true;
1557 //if (!chOK) {
1558 // OK = false;
1559 // std::cout <<" " << ch << std::hex << std::setfill('0');
1560 // for (int i = 0; i < 22; i++) {
1561 // std::cout << " 0x" << std::setw(8) << ofc[i] << ",";
1562 // }
1563 // std::cout << std::dec << std::setfill(' ') << std::endl;
1564 //}
1565 if (Frag5Data[ch].gain != (int) channel[ch].gain) chOK = false;
1566 if (!chOK) {
1567 OK = false;
1568 std::cout << " " << ch << ",";
1569 }
1570 }
1571 std::cout << "\nCompare Raw <=> Frag5: ";
1572 if (OK) {
1573 std::cout << "OK" << std::endl;
1574 } else {
1575 std::cout << "ERROR" << std::endl;
1576 }
1577 isFrag5 = false;
1578 }
1579 break;
1580
1581 case 1:
1582 if (tile_unpack_raw_comp(frag[f], rawcomp.data(), MAX_DIGI_CHAN, version, verbosity, &ngain, &nchan, &nsamp)) {
1583 std::cout << "\nRaw data compressed fragment 0x" << std::hex << id << std::dec << ", " << size << " words found" << std::endl;
1584 dump_data((uint32_t*) data, size, version, verbosity);
1585 break;
1586 }
1587
1588 std::cout << "\nRaw data compressed fragment 0x" << std::hex << id << std::dec << ", " << size << " words found:"
1589 << "\t" << ngain << " gain, " << nchan << " channels in total" << std::endl;
1590
1591 std::cout << "\nPMT Ch |";
1592 for (int j = 1; j <= ((nsamp / 2) + 1); j++) {
1593 std::cout << " HexWord" << j << " ";
1594 }
1595
1596 std::cout << "| G";
1597 for (int l = 1; l <= nsamp; l++) {
1598 std::cout << " Smp" << l;
1599 }
1600
1601 for (int i = 0; i < nchan && i < MAX_DIGI_CHAN; i++) {
1602 int ch = rawcomp[i].chan;
1603 pmt = m_cabling->channel2hole(fragType, ch % 48);
1604 if (pmt > 0) {
1605 std::cout << "\n" << std::setw(3) << pmt << std::setw(3) << ch << " |";
1606 } else {
1607 std::cout << "\n -- " << std::setw(2) << ch << " |";
1608 }
1609 std::cout << std::hex << std::setfill('0');
1610 for (int j = 0; j < ((nsamp / 2) + 1); j++) {
1611 std::cout << " " << std::setw(8) << rawcomp[i].words[j] << " ";
1612 }
1613 std::cout << setupDec << "| " << rawcomp[i].gain;
1614 for (int l = 0; l < nsamp; l++) {
1615 std::cout << std::setw(6) << rawcomp[i].samples[l];
1616 }
1617 if (!rawcomp[i].verif) std::cout << " Wrong Data";
1618 }
1619 break;
1620
1621 case 2: // fragment with gain/amp/time/quality in 32 bit words
1622 tile_unpack_reco(frag[f], recochan.data(), MAX_DIGI_CHAN, version, verbosity, &ngain, &nchan);
1623
1624 std::cout << "\nReco non calibrated energy fragment 0x" << std::hex << id << std::dec << ", " << size << " words found:"
1625 << "\t" << ngain << " gain, " << nchan << " channels in total" << std::endl
1626 << "\tATTENTION: HIGH gain amplitude is divided by 64" << std::endl;
1627
1628 std::cout << "\nPMT Ch | full word | G amp time q amp time qual";
1629 for (ch = 0; ch < nchan; ++ch) {
1630 pmt = m_cabling->channel2hole(fragType, ch % 48);
1631 if (pmt > 0) {
1632 std::cout << "\n" << std::setw(3) << pmt << std::setw(3) << ch << " |";
1633 } else {
1634 std::cout << "\n -- " << std::setw(2) << ch << " |";
1635 }
1636 std::cout << " 0x" << setup0 << recochan[ch].word << setupDec << " | "
1637 << std::setw(1) << recochan[ch].gain << std::setw(6) << recochan[ch].amp << std::setw(5) << recochan[ch].time
1638 << std::setw(3) << recochan[ch].quality << std::setw(10) << std::setprecision(1) << float (recochan[ch].gain ? recochan[ch].d_amp / 64. : recochan[ch].d_amp)
1639 << std::setw(11) << std::setprecision(4) << (float) recochan[ch].d_time << std::setw(8) << std::setprecision(1) << (float) recochan[ch].d_quality;
1640 }
1641
1642 break;
1643
1644 case 4: // fragment with gain/amp/time/bad/quality in 32 bit words
1645 m_unit = unit;
1646 tile_unpack_reco_calib(frag[f], recocalib.data(), MAX_DIGI_CHAN, version, unit, verbosity, &ngain,
1647 &nchan);
1648
1649 std::cout << "\nReco calibrated energy fragment 0x" << std::hex << id << std::dec << ", " << size << " words found:"
1650 << "\t" << ((nchan > 48 && nchan < 96) ? 1 : ngain) << " gain, " << unitName[unit] << " units, " << nchan << " channels in total" << std::endl;
1651
1652 if (pulse < 3) {
1653 std::cout << "Reco flags: 0x" << std::hex << std::setfill('0') << rflag << setupDec << " units: " << unitName[unit] << " pulse_shape: " << shapeName[pulse] << " nsamples: " << 7 + 2 * nsmpl << " algorithm: " << algName[algor + 1] << " niterations: " << niter << std::endl;
1654 } else {
1655 std::cout << "Reco flags: 0x" << std::hex << std::setfill('0') << rflag << setupDec << " units: " << unitName[unit] << " pulse_shape: " << shapeName[pulse] << " nsamples: " << 7 + 2 * nsmpl << " algorithm: " << algName[algor * 4 + niter] << std::endl;
1656 }
1657
1658 std::cout << "\nPMT Ch | full word | G amp time b q amp time qual";
1659 for (ch = 0; ch < nchan; ++ch) {
1660 pmt = m_cabling->channel2hole(fragType, ch % 48);
1661 if (pmt > 0) {
1662 std::cout << "\n" << std::setw(3) << pmt << std::setw(3) << ch << " |";
1663 } else {
1664 std::cout << "\n -- " << std::setw(2) << ch << " |";
1665 }
1666
1667 if (ch >= 48 && nchan < 96) { // sumE words
1668 std::cout << " 0x" << setup0 << recocalib[ch].word << setupDec << " | " << std::setw(11) << std::setprecision(4) << Frag5_unpack_bin2sum(unit, (int )recocalib[ch].word);
1669 } else {
1670 std::cout << " 0x" << setup0 << recocalib[ch].word << setupDec << " | " << std::setw(1) << recocalib[ch].gain << std::setw(6) << recocalib[ch].amp << std::setw(5) << recocalib[ch].time << std::setw(2) << recocalib[ch].bad << std::setw(3) << recocalib[ch].quality << std::setw(10) << std::setprecision(1) << recocalib[ch].d_amp << std::setw(11) << std::setprecision(4) << recocalib[ch].d_time << std::setw(8) << std::setprecision(1) << recocalib[ch].d_quality;
1671
1672 if (recocalib[ch].bad != 0) {
1673 std::cout << " Bad channel";
1674 }
1675 }
1676 }
1677
1678 break;
1679
1680 case 5: // compressed fragment
1681 {
1682 isFrag5 = true;
1683 m_frag5found = true;
1684 m_unit = unit;
1685 nchan = 48;
1686 OFC.clear();
1687
1688 std::cout << "\nFrag5 Compressed fragment 0x" << std::hex << id << std::dec << ", " << size << " words found:"
1689 << "\t" << 1 << " gain, " << unitName[unit] << " units, " << nchan << " channels in total" << std::endl;
1690
1691 dump_data((uint32_t*) data, size, version, verbosity);
1692
1693 { // fill OFC
1695 unsigned int drawerIdx = TileCalibUtils::getDrawerIdxFromFragId(id);
1696
1697 bool of2 = true;
1698 std::vector<double> a(7), b(7), c(7), g(7), dg(7);
1699
1700 for (ch = 0; ch < nchan; ++ch) {
1701 for (int gain = 0; gain < 2; ++gain) {
1702 float phase = -m_tileToolTiming->getSignalPhase(drawerIdx, ch, gain);
1703 TileOfcWeightsStruct weights;
1704 if (m_tileCondToolOfcCool->getOfcWeights(drawerIdx, ch, gain, phase, of2, weights, ctx).isFailure())
1705 {
1706 ATH_MSG_ERROR( "getOfcWeights failed.");
1707 continue;
1708 }
1709
1710 double calib = m_tileToolEmscale->channelCalibOnl(drawerIdx, ch, gain, 1.0, chan_unit);
1711
1712 if (unit != 0 && gain) calib = calib * 64.0;
1713
1714 for (int i = 0; i < 7; ++i) {
1715 a[i] = weights.w_a[i];
1716 b[i] = weights.w_b[i];
1717 c[i] = weights.w_c[i];
1718 g[i] = weights.g[i];
1719 dg[i] = weights.dg[i];
1720 }
1721
1722 Format6(a, b, c, g, dg, ch // channel
1723 , 0 // phase = 0 poskol'ku ne ponyal kak okruglyat'
1724 , calib // calibration
1725 , OFC, false );// verbose
1726
1727 } // gain
1728 } // ch
1729
1730 } // fill OFC
1731 ofw = &(OFC[0]);
1732
1733 int size_L2 = (*((const uint32_t*) data - 3 + 2) >> (32 - 2 - 3)) & 0x7;
1734 std::cout << "size_L2: " << size_L2 << " |";
1735 if (size_L2 == 3) {
1736 double SumEt = m_rc2bytes5.getSumEt((const uint32_t*) data - 3);
1737 double SumEz = m_rc2bytes5.getSumEz((const uint32_t*) data - 3);
1738 double SumE = m_rc2bytes5.getSumE((const uint32_t*) data - 3);
1739 std::cout << " SumEt: " << SumEt << ", SumEz: " << SumEz << ", SumE: " << SumE << std::endl;
1740 }
1741 std::cout << std::endl;
1742
1743 m_rc2bytes5.unpack(ofw, (uint32_t*) data - 3, Frag5Data);
1744
1745#define code_ped4 TileRawChannel2Bytes5::code_ped4
1746#define code_ped5 TileRawChannel2Bytes5::code_ped5
1747#define code_amp5 TileRawChannel2Bytes5::code_amp5
1748#define code_amp6 TileRawChannel2Bytes5::code_amp6
1749#define code_raws TileRawChannel2Bytes5::code_raws
1750#define code_rawf TileRawChannel2Bytes5::code_rawf
1751#define code_full TileRawChannel2Bytes5::code_full
1752#define code_dump TileRawChannel2Bytes5::code_dump
1753#define code_null TileRawChannel2Bytes5::code_null
1754
1755 int cnt_ped4, cnt_ped5, cnt_amp5, cnt_amp6, cnt_raws, cnt_rawf, cnt_full, cnt_dump, cnt_null;
1756 cnt_ped4 = cnt_ped5 = cnt_amp5 = cnt_amp6 = cnt_raws = cnt_rawf = cnt_full = cnt_dump = cnt_null = 0;
1757 std::cout << "PMT Ch | full word | Type G B ectrl ereco ebin ene time | s1 s2 s3 s4 s5 s6 s7";
1758
1759 const char *strcode_empty = "----";
1760 const char *strcode_ped4 = "ped4";
1761 const char *strcode_ped5 = "ped5";
1762 const char *strcode_amp5 = "amp5";
1763 const char *strcode_amp6 = "amp6";
1764 const char *strcode_raws = "raws";
1765 const char *strcode_rawf = "rawf";
1766 const char *strcode_full = "full";
1767 const char *strcode_dump = "dump";
1768 const char *strcode_null = "null";
1769 const char *strcode_error = "ERR ";
1770
1771 bool OK = true;
1772 for (ch = 0; ch < nchan; ++ch) {
1773 pmt = m_cabling->channel2hole(fragType, ch % 48);
1774 if (pmt > 0) {
1775 std::cout << "\n" << std::setw(3) << pmt << std::setw(3) << ch << " |";
1776 } else {
1777 std::cout << "\n -- " << std::setw(2) << ch << " |";
1778 }
1779
1780 uint32_t reco = data[ch];
1781 const char *scode = strcode_empty;
1782 int code = Frag5Data[ch].code;
1783 int gain = Frag5Data[ch].gain;
1784 int bad = Frag5Data[ch].bad;
1785 int ene_bin = Frag5Data[ch].ene_bin;
1786 float ene = Frag5Data[ch].ene;
1787 float time = Frag5Data[ch].time;
1788 int s[7];
1789 for (int i = 0; i < 7; i++) {
1790 s[i] = Frag5Data[ch].s[i];
1791 }
1792
1793 switch (code) {
1794 case code_ped4: scode = strcode_ped4; cnt_ped4++; break;
1795 case code_ped5: scode = strcode_ped5; cnt_ped5++; break;
1796 case code_amp5: scode = strcode_amp5; cnt_amp5++; break;
1797 case code_amp6: scode = strcode_amp6; cnt_amp6++; break;
1798 case code_raws: scode = strcode_raws; cnt_raws++; break;
1799 case code_rawf: scode = strcode_rawf; cnt_rawf++; break;
1800 case code_full: scode = strcode_full; cnt_full++; break;
1801 case code_dump: scode = strcode_dump; cnt_dump++; break;
1802 case code_null: scode = strcode_null; cnt_null++; break;
1803 default: scode = strcode_error; break;
1804 }
1805
1806 int ene_recobin = ene_bin + (gain == 0 ? 512 : 2048);
1807 switch (code) {
1808 case code_ped4:
1809 case code_ped5:
1810 ene_bin += 256;
1811 break;
1812 case code_amp5:
1813 case code_amp6:
1814 case code_raws:
1815 case code_rawf:
1816 ene_bin += (gain == 0 ? 512 : 2048);
1817 break;
1818 }
1819
1820 int ene_ctrl = m_rc2bytes5.amplitude(ofw, unit, ch, gain, s);
1821 if (ene_ctrl < 0) {
1822 ene_ctrl = 0;
1823 } else if (ene_ctrl > 0x7FFF) {
1824 ene_ctrl = 0x7FFF;
1825 }
1826
1827 std::cout << " 0x" << setup0 << reco << setupDec << " | " << std::setw(4) << scode << " " << gain << " " << bad;
1828
1829 switch (code) {
1830 case code_ped4:
1831 case code_ped5:
1832 case code_raws:
1833 case code_rawf:
1834 case code_dump:
1835 std::cout << std::setw(7) << ene_ctrl << std::setw(7) << ene_recobin << std::setw(6) << ene_bin << std::setw(10) << std::setprecision(4) << ene << " -- ";
1836 break;
1837 case code_amp5:
1838 case code_amp6:
1839 std::cout << std::setw(7) << ene_ctrl << std::setw(7) << ene_recobin << std::setw(6) << ene_bin << std::setw(10) << std::setprecision(4) << ene << std::setw(6) << std::setprecision(1) << time << " ";
1840 break;
1841 case code_full:
1842 case code_null:
1843 std::cout << " ----- ----- ---- --- -- ";
1844 break;
1845 default:;
1846 }
1847
1848 std::cout << "| " << std::setw(4) << s[0] << std::setw(5) << s[1] << std::setw(5) << s[2] << std::setw(5) << s[3] << std::setw(5) << s[4] << std::setw(5) << s[5] << std::setw(5) << s[6] << " " ;
1849 if (ene_ctrl != ene_recobin) {
1850 OK = false;
1851 std::cout << " ERR";
1852 }
1853 }
1854
1855 std::cout << "\n\nFrag5 Self-Consistency: ";
1856 if (OK) {
1857 std::cout << "OK" << std::endl;
1858 } else {
1859 std::cout << "ERROR" << std::endl;
1860 }
1861
1862 std::cout << "\nped4" << cnt_ped4 << ", ped5 " << cnt_ped5 << ", amp5 " << cnt_amp5 << ", amp6 " << cnt_amp6 << ", raws " << cnt_raws << ", rawf " << cnt_rawf << ", full " << cnt_full << ", dump " << cnt_dump << ", null " << cnt_null << std::endl;
1863
1864 break;
1865 }
1866
1867 case 6:
1868 {
1869 std::cout << "\nFELIX fragment 0x" << std::hex << id << std::dec << ", " << size << " words found" << std::endl;
1870 std::vector<uint32_t> correct_data = get_correct_data(data, size);
1871 // dump first few words of the first MD fragment
1872 int head = 9;
1873 std::cout << std::hex << std::endl;
1874 bool phase2format = (size>head && correct_data[2] == 0x12345678 && correct_data[size-1] == 0x87654321);
1875 if (phase2format) {
1876 int thisVersion = (((correct_data[3] >> 16) & 0xFFFF) == 0) ? 1 : 0;
1877 const char * namesV0[] = { "size_packet", "elink", "SOP", "runParam1", "runParam2", "runParam3", "runParam4", "BC_MD_ID", "L1ID" };
1878 const char * namesV1[] = { "size_packet", "elink", "SOP", "version", "MODULE_BC_MD", "L1ID", "BCR" , "runParam1", "runParam2", "runParam3"};
1879 const char ** names = (thisVersion) ? namesV1 : namesV0;
1880 if (thisVersion) head = 10;
1881 for (int i=0; i<head; ++i) {
1882 std::cout << std::setw(13) << names[i] << std::setw(10) << correct_data[i] << std::endl;
1883 }
1884 } else {
1885 if (head>size) head=size;
1886 for (int i=0; i<head; ++i) {
1887 std::cout << " Word" << std::setw(3) << i << std::setw(10) << correct_data[i] << std::endl;
1888 }
1889 }
1890 std::cout << std::dec << std::endl;
1891 FelixData_t digitsHighGain, digitsLowGain, digitsMetaData;
1892 unpack_frag6(correct_data.data(), size, digitsHighGain, digitsLowGain, digitsMetaData);
1893
1894 std::cout << " MD1 MD2 MD3 MD4" << std::endl;
1895 std::cout << "-----------------------------------------------------";
1896 const char * metaNamesV0[] = { "BCID", "L1ID", "ModuleID", "RunType", "RunNumber", "PedHi", "PedLo", "ChargeInj", "TimeInj", "Capacitor", "ECR" };
1897 const char * metaNamesV1[] = { "BCID", "L1ID", "ModuleID", "RunType", "RunNumber", "PedHi", "PedLo", "ChargeInj", "TimeInj", "Capacitor", "ECR", "BCR", "Version", "FragID" };
1898 const char ** metaNames = (version) ? metaNamesV1 : metaNamesV0;
1899 for (size_t i = 0; i < digitsMetaData.size(); ++i) {
1900 std::cout << std::endl << std::setw(13) << metaNames[i];
1901 for (size_t j = 0; j<digitsMetaData[i].size(); ++j) {
1902 std::cout << std::setw(10) << digitsMetaData[i][j];
1903 }
1904 }
1905 std::cout << std::endl << std::endl;
1906
1907 size_t nsamp = 7;
1908 if (digitsLowGain[0].size()>0)
1909 nsamp = std::max(nsamp,digitsLowGain[0].size());
1910 if (digitsHighGain[0].size()>0)
1911 nsamp =std::max(nsamp,digitsHighGain[0].size());
1912
1913 std::cout << " ch G ";
1914 for (size_t s = 0; s < nsamp; ++s) {
1915 std::cout << std::setw(5) << s;
1916 }
1917 std::string a(8+nsamp*5,'-');
1918 std::cout << std::endl << a;
1919
1920 for (size_t ch = 0; ch < digitsHighGain.size() ; ++ch) {
1921 std::cout << std::endl << std::setw(3) << ch << " HG ";
1922 for (size_t s = 0; s < digitsHighGain[ch].size(); ++s) {
1923 std::cout << std::setw(5) << (digitsHighGain[ch][s]);
1924 }
1925 }
1926
1927 for (size_t ch = 0; ch < digitsLowGain.size() ; ++ch) {
1928 std::cout << std::endl << std::setw(3) << ch << " LG ";
1929 for (size_t s = 0; s < digitsLowGain[ch].size(); ++s) {
1930 std::cout << std::setw(5) << (digitsLowGain[ch][s]);
1931 }
1932 }
1933 std::cout << std::endl << std::endl;
1934
1935 break;
1936 }
1937
1938 case 0xA: // fragment with data quality words
1939 DQstat = tile_unpack_quality(frag[f], DQword);
1940
1941 std::cout << "\nQuality fragment 0x" << std::hex << id << ", " << std::dec << size << " words found:" << std::endl;
1942
1943 if (DQstat) {
1944 std::cout << " ATTENTION: Error bits found in the Data Quality fragment 0xA" << std::endl;
1945 }
1946
1947 std::cout << " --------------------------------------" << std::endl;
1948 std::cout << " | Quality Block | Word (16bit)" << std::endl;
1949 if (DQword.dspbcid >> 15) {
1950 std::cout << " | DSP BCID | " << std::dec << (DQword.dspbcid & 0x7FFF) << std::endl;
1951 } else {
1952 std::cout << " | DSP BCID | not filled (" << std::dec << DQword.dspbcid << ")" << std::endl;
1953 }
1954 std::cout << " | Global CRC | " << std::hex << "0x" << std::setw(1) << DQword.global_crc << std::setfill('0') << std::endl;
1955 std::cout << " | BCID checks | " << setup0x4 << DQword.bcid << std::endl;
1956 std::cout << " | Mem parity err | " << setup0x4 << DQword.memory << std::endl;
1957 std::cout << " | Single strobe err | " << setup0x4 << DQword.Sstrobe << std::endl;
1958 std::cout << " | Double strobe err | " << setup0x4 << DQword.Dstrobe << std::endl;
1959 std::cout << " | Head format err | " << setup0x4 << DQword.headformat << std::endl;
1960 std::cout << " | Head parity err | " << setup0x4 << DQword.headparity << std::endl;
1961 std::cout << " | Sample format err | " << setup0x4 << DQword.sampleformat << std::endl;
1962 std::cout << " | Sample parity err | " << setup0x4 << DQword.sampleparity << std::endl;
1963 std::cout << " | FE chip mask err | " << setup0x4 << DQword.fe_chip_mask << std::endl;
1964 std::cout << " | ROD chip mask err | " << setup0x4 << DQword.rod_chip_mask << std::endl;
1965 std::cout << " --------------------------------------" << std::setfill(' ') << std::dec << std::endl;
1966 break;
1967
1968 default:
1969 std::cout << "\nUnknown (type " << type << ") fragment 0x" << std::hex << id << ", " << std::dec << size << " words found" << std::endl;
1970 dump_data((uint32_t*) data, size, version, verbosity); // Salukvadze
1971 }
1972 std::cout << std::endl;
1973 } else { /* empty fragment */
1974 std::cout << "\nType " << type << " fragment 0x" << std::hex << id << ", " << std::dec << size << " words found" << std::endl;
1975 std::cout << "\nEmpty Event" << std::endl;
1976 }
1977 }
1978 }
1979}
#define ATH_MSG_ERROR(x,...)
detray::unit< scalar_t > unit
static Double_t a
bool Format6(const std::vector< double > &a, const std::vector< double > &b, const std::vector< double > &c, const std::vector< double > &g, const std::vector< double > &h, unsigned int channel_index, int phase, double calibration, std::vector< unsigned int > &OFC, bool verbose)
Format6.
Definition TileOFC.cxx:270
#define code_null
#define code_dump
#define code_ped5
#define code_raws
#define code_full
#define code_amp5
#define code_ped4
#define code_amp6
#define code_rawf
#define Frag5_unpack_bin2sum(unit, amp_bin)
unpack_bin2sum
std::string cern_local_time(time_t unix_time)
std::ostream & setupPr1(std::ostream &stream)
std::ostream & setup0(std::ostream &stream)
std::ostream & setupPr2(std::ostream &stream)
std::ostream & setup0x4(std::ostream &stream)
std::ostream & setupMod(std::ostream &stream)
std::ostream & setupDec(std::ostream &stream)
std::ostream & setupPr3(std::ostream &stream)
#define COIN_TRIG4_FRAG
Definition TileTBFrag.h:35
#define COIN_TRIG2_FRAG
Definition TileTBFrag.h:33
#define MUON_ADC_FRAG
Definition TileTBFrag.h:25
#define LASER_OBJ_FRAG
Definition TileTBFrag.h:49
#define MAX_DIGI_CHAN
Definition TileTBFrag.h:53
#define COIN_TRIG7_FRAG
Definition TileTBFrag.h:38
#define COIN_TRIG5_FRAG
Definition TileTBFrag.h:36
#define LASERII_OBJ_FRAG
Definition TileTBFrag.h:50
#define COIN_TRIG8_FRAG
Definition TileTBFrag.h:39
#define COIN_TRIG6_FRAG
Definition TileTBFrag.h:37
#define LASE_ADC_FRAG
Definition TileTBFrag.h:28
#define LASE_PTN_FRAG
Definition TileTBFrag.h:27
#define COMMON_TDC2_FRAG
Definition TileTBFrag.h:47
#define COMMON_PTN_FRAG
Definition TileTBFrag.h:48
#define COMMON_ADC1_FRAG
Definition TileTBFrag.h:43
#define COMMON_ADC2_FRAG
Definition TileTBFrag.h:44
#define COMMON_TDC1_FRAG
Definition TileTBFrag.h:46
#define BEAM_TDC_FRAG
Definition TileTBFrag.h:23
#define COIN_TRIG3_FRAG
Definition TileTBFrag.h:34
#define MAX_ROD_FRAG
Definition TileTBFrag.h:21
#define DIGI_PAR_FRAG
Definition TileTBFrag.h:41
#define COMMON_TOF_FRAG
Definition TileTBFrag.h:45
#define COIN_TRIG1_FRAG
Definition TileTBFrag.h:32
#define ADDR_ADC_FRAG
Definition TileTBFrag.h:26
#define BEAM_ADC_FRAG
Definition TileTBFrag.h:24
#define ADD_FADC_FRAG
Definition TileTBFrag.h:29
#define ECAL_ADC_FRAG
Definition TileTBFrag.h:30
static unsigned int getDrawerIdxFromFragId(unsigned int fragId)
Returns a drawer hash from fragId This function assumes drawer context (i.e.
int tile_unpack_digi(const T_RodDataFrag *frag, T_TileDigiChannel *channel, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel, int *nsample)
void find_frag(const uint32_t *rod, unsigned int size, unsigned int version, int verbosity, const T_RodDataFrag *frag[], int &nfrag)
int tile_unpack_raw_comp(const T_RodDataFrag *frag, T_TileRawComp *rawcomp, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel, int *nsample)
int tile_unpack_quality(const T_RodDataFrag *frag, T_TileRecoQuality &DQword)
int m_runPeriod
Definition TileTBDump.h:80
void unpack_frag6(const uint32_t *data, unsigned int size, FelixData_t &digitsHighGain, FelixData_t &digitsLowGain, FelixData_t &digitsMetaData) const
const TileCablingService * m_cabling
Definition TileTBDump.h:79
std::vector< uint32_t > get_correct_data(const uint32_t *p, unsigned int size) const
std::vector< std::vector< unsigned int > > FelixData_t
Definition TileTBDump.h:86
PublicToolHandle< TileCondToolEmscale > m_tileToolEmscale
Definition TileTBDump.h:90
PublicToolHandle< TileCondToolOfcCool > m_tileCondToolOfcCool
Definition TileTBDump.h:89
bool m_frag5found
Definition TileTBDump.h:99
PublicToolHandle< TileCondToolTiming > m_tileToolTiming
Definition TileTBDump.h:88
std::map< unsigned int, unsigned int, std::less< unsigned int > > m_drawerMap
Definition TileTBDump.h:84
int tile_unpack_reco(const T_RodDataFrag *frag, T_TileRecoChannel *channel, int nchannel_max, unsigned int version, int verbosity, int *ngain, int *nchannel)
std::map< unsignedint, unsignedint, std::less< unsignedint > >::iterator drawerMap_iterator
Definition TileTBDump.h:85
void dump_data(const uint32_t *data, unsigned int size, unsigned int version, int verbosity)
unsigned int m_sizeOverhead
Definition TileTBDump.h:100
TileRawChannel2Bytes5 m_rc2bytes5
Definition TileTBDump.h:232
int tile_unpack_reco_calib(const T_RodDataFrag *frag, T_TileRecoCalib *recocalib, int nchannel_max, unsigned int version, unsigned int unit, int verbosity, int *ngain, int *nchannel)
std::string head(std::string s, const std::string &pattern)
head of a string
int r
Definition globals.cxx:22
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
time(flags, cells_name, *args, **kw)
struct Event_t Event
l
Printing final latex table to .tex output file.
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
bool flag
Definition master.py:29
status
Definition merge.py:16
setEventNumber setTimeStamp bcid
setEventNumber uint32_t

◆ dump_it()

void TileTBDump::dump_it ( unsigned int nw,
unsigned int * data )
private

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TileTBDump::execute ( const EventContext & ctx)
virtual

Execute method.

Implements AthAlgorithm.

Definition at line 172 of file TileTBDump.cxx.

172 {
173
174 static std::atomic<bool> notFirst = false;
175
176 ATH_MSG_DEBUG( "execute()" );
177
178 // take full event
179 const eformat::FullEventFragment<const uint32_t*> * event = m_RobSvc->getEvent(ctx);
180
181 if (m_dumpOnce) {
182 if (m_lvl1_trigger_type<0) {
183 // dump once all Level1 trigger types found in data
184 int lvl1tt = event->lvl1_trigger_type();
185 if (std::find(m_all_lvl1_trigger_types.begin(), m_all_lvl1_trigger_types.end(), lvl1tt) != m_all_lvl1_trigger_types.end()) {
186 return StatusCode::SUCCESS;
187 } else {
188 m_all_lvl1_trigger_types.push_back(lvl1tt);
189 notFirst = false;
190 }
191 }
192 }
193
194 if (m_bc_time_seconds >=0 && m_bc_time_seconds != (int32_t)event->bc_time_seconds()) return StatusCode::SUCCESS;
195 if (m_bc_time_nanoseconds >=0 && m_bc_time_nanoseconds != (int32_t)event->bc_time_nanoseconds()) return StatusCode::SUCCESS;
196 if (m_global_id >=0 && m_global_id != (int32_t)event->global_id()) return StatusCode::SUCCESS;
197 if (m_run_type >=0 && m_run_type != (int32_t)event->run_type()) return StatusCode::SUCCESS;
198 if (m_run_no >=0 && m_run_no != (int32_t)event->run_no()) return StatusCode::SUCCESS;
199 if (m_lumi_block >=0 && m_lumi_block != (int32_t)event->lumi_block()) return StatusCode::SUCCESS;
200 if (m_lvl1_id >=0 && m_lvl1_id != (int32_t)event->lvl1_id()) return StatusCode::SUCCESS;
201 if (m_bc_id >=0 && m_bc_id != (int32_t)event->bc_id()) return StatusCode::SUCCESS;
202 if (m_lvl1_trigger_type >=0 && m_lvl1_trigger_type != (int32_t)event->lvl1_trigger_type()) return StatusCode::SUCCESS;
203 if (m_nlvl1_trigger_info >=0 && m_nlvl1_trigger_info != (int32_t)event->nlvl1_trigger_info()) return StatusCode::SUCCESS;
204
205 if (m_dumpOnce && notFirst) return StatusCode::SUCCESS;
206 notFirst = true;
207
208 int verbosity = 0;
209 if ( msgLvl(MSG::NIL) ) {
210 verbosity = 7;
211 } else if ( msgLvl(MSG::VERBOSE) ) {
212 verbosity = 2;
213 } else if ( msgLvl(MSG::DEBUG) ) {
214 verbosity = 1;
215 }
216
217 std::cout << std::format(
218 "============================\n"
219 "Event time (sec): {}\n"
220 "Event time (ns): {}\n"
221 "Global ID: {}\n"
222 "Run Type: {}\n"
223 "Run Number: {}\n"
224 "Lumi Block: {}\n"
225 "Level1 ID: {}\n"
226 "BCID: {}\n"
227 "Level1 trig type: {}\n"
228 "Level1 Nwords: {}\n"
229 "============================\n",
230 (uint32_t)event->bc_time_seconds(),
231 (uint32_t)event->bc_time_nanoseconds(),
232 (uint32_t)event->global_id(),
233 (uint32_t)event->run_type(),
234 (uint32_t)event->run_no(),
235 (uint32_t)event->lumi_block(),
236 (uint32_t)event->lvl1_id(),
237 (uint32_t)event->bc_id(),
238 (uint32_t)event->lvl1_trigger_type(),
239 (uint32_t)event->nlvl1_trigger_info());
240
241 try {
242 event->check_tree();
243 } catch (...) {
244 std::cout << " Invalid event, some ROB fragments might be truncated" << std::endl << std::endl;
245 }
246
247 /*
248 unpacking the event down to ROD fragments
249 */
250
251 uint32_t nrob = event->nchildren();
252
253 for (size_t irob = 0; irob < nrob; ++irob) {
254 const uint32_t* fprob;
255 event->child(fprob, irob);
256 const eformat::ROBFragment<const uint32_t*> robf(fprob);
257
258 //
259 // get info on ROD
260 //
261 unsigned int version = robf.rod_version();
262 unsigned int source_id = robf.rod_source_id();
263 eformat::helper::SourceIdentifier id = eformat::helper::SourceIdentifier(source_id);
264 unsigned int subdet_id = id.subdetector_id();
265 unsigned int module_id = id.module_id();
266 int robsourceid = robf.source_id();
267
268 bool known = m_dumpUnknown || subdet_id == 0x70 // COMMON BEAM ROD in CTB2004
269 || (subdet_id >= 0x50 && subdet_id < 0x60) // TileCal IDs
270 || (robsourceid >= 0x510000 && robsourceid < 0x550000); // TileCal ROBs
271
272 if (!(known || m_showUnknown)) {
273 continue;
274 }
275
276 std::cout << std::format(" ROB frag ID 0x{:x} size {}\n",
277 robf.source_id(),
278 robf.fragment_size_word());
279
280 // Here we should unpack the fragment.
281 std::cout << std::format(" ROD frag ID 0x{:x} size {}\n",
282 robf.rod_source_id(),
283 robf.rod_fragment_size_word());
284
285 if (!known) {
286 std::cout << std::endl;
287 continue;
288 }
289
290 if ( m_dumpHeader ) {
291
292 std::cout << std::format(" Format Vers. 0x{:x}\n", robf.rod_version());
293 std::cout << std::format(" Source ID 0x{:x}\n", robf.rod_source_id());
294 std::cout << " Source ID str " << eformat::helper::SourceIdentifier(robf.source_id()).human().c_str() << std::endl;
295 std::cout << std::format(" SubDetect ID 0x{:x}\n", subdet_id);
296 std::cout << std::format(" Module ID 0x{:x}\n", module_id);
297 std::cout << " Run number " << (int) robf.rod_run_no() << std::endl;
298 std::cout << " Level1 ID " << robf.rod_lvl1_id() << std::endl;
299 std::cout << " BCID " << robf.rod_bc_id() << std::endl;
300 std::cout << " Lvl1 TrigType " << robf.rod_lvl1_trigger_type() << std::endl;
301 std::cout << " Event Type " << robf.rod_detev_type() << std::endl;
302 std::cout << " Fragment size " << robf.rod_fragment_size_word() << std::endl;
303 std::cout << " Header size " << robf.rod_header_size_word() << std::endl;
304 std::cout << " Trailer size " << robf.rod_trailer_size_word() << std::endl;
305 std::cout << " N data " << robf.rod_ndata() << std::endl;
306 std::cout << " N status " << robf.rod_nstatus() << std::endl;
307 std::cout << " Status pos " << robf.rod_status_position() << std::endl;
308 }
309
310 unsigned int max_allowed_size = robf.rod_fragment_size_word();
311 unsigned int delta = robf.rod_header_size_word() + robf.rod_trailer_size_word();
312 if (max_allowed_size >= delta) {
313 max_allowed_size -= delta;
314 } else {
315 std::cout << " Problem with ROD data: total length " << max_allowed_size
316 << " is less than " << delta << " - size of header+trailer" << std::endl;
317 max_allowed_size = 0;
318 }
319
320 unsigned int size = robf.rod_nstatus();
321 bool bad_status = (robf.rod_status_position()==0 && size > max_allowed_size);
322
323 if (robf.rod_status_position() > 1
324 || robf.rod_ndata() > max_allowed_size
325 || size > max_allowed_size - robf.rod_ndata()
326 || bad_status ) {
327 std::cout << " Problem with status words - assuming no status words" << std::endl;
328
329 } else if (m_dumpStatus) {
330
331 if (size > 0) {
332 const uint32_t * stat;
333 robf.rod_status(stat);
334 for (unsigned int ind = 0; ind < size; ++ind) {
335 std::cout << std::format(" Status[{}] = {}\t\t{}\n",
336 ind,
337 stat[ind],
338 stat[ind] / 1000000. - 1.);
339 }
340 } else {
341 std::cout << " No status words" << std::endl;
342 }
343 }
344
345 if ( m_dumpData ) {
346
347 unsigned int size = robf.rod_ndata();
348 if (size > max_allowed_size) {
349 if (size - robf.rod_trailer_size_word() < max_allowed_size) {
350 std::cout<<" Problem with data size - assuming that trailer size is " << robf.rod_trailer_size_word()-(size-max_allowed_size)
351 <<" words instead of " << robf.rod_trailer_size_word() << " and data size is " << size << " words " << std::endl;
352 max_allowed_size = size;
353 } else if (size - robf.rod_trailer_size_word() == max_allowed_size) {
354 std::cout<<" Problem with data size - assuming that trailer is absent "
355 << " ROD size " << robf.rod_fragment_size_word()
356 << " header size " << robf.rod_header_size_word()
357 << " data size " << size << std::endl;
358 max_allowed_size = size;
359 } else {
360 max_allowed_size += robf.rod_trailer_size_word();
361 size = max_allowed_size;
362 std::cout<<" Problem with data size - assuming " << size << " words and no trailer at all"<<std::endl;
363 }
364 std::cout << std::format("\nDump of whole ROB fragment 0x{:x} ({} words)\n",
365 robf.rod_source_id(),
366 robf.rod_fragment_size_word()+robf.header_size_word());
367 dump_data(fprob, robf.rod_fragment_size_word()+robf.header_size_word(), version, verbosity);
368 }
369
370 if ( size > 0 ) {
371
372 const uint32_t * data;
373 if (bad_status) {
374 robf.rod_status(data);
375 } else {
376 robf.rod_data(data);
377 }
378
379 if (subdet_id == 0) {
380 std::cout<<" Problem with ROD frag - SubDetector ID is 0" <<std::endl;
381 if (source_id >= 0x5100 && source_id < 0x5500 && robsourceid >= 0x510000 && robsourceid < 0x550000) { // buggy ROD fragment
382 std::cout << std::format(" Looks like ROD frag is in old format, ROD Source ID is 0x{:x}"
383 " assuming that ROD Source ID is 0x{:x}\n",
384 source_id,
385 robsourceid);
386 source_id = robsourceid;
387 subdet_id = robsourceid>>16;
388 dump_data(data, size, version, verbosity);
389 }
390 }
391 if ((subdet_id >= 0x50 && subdet_id < 0x60) || // TileCal IDs
392 subdet_id == 0x63 || // wrong id in first testbeam test runs
393 subdet_id == 0x70) { // COMMON BEAM ROD in CTB2004
394 dump_digi(subdet_id,data, size, version, verbosity, source_id, ctx);
395 } else if ( m_dumpUnknown ) {
396 if (!(subdet_id == 0 || size < 13
397 || data[5] == 0x12345678 || data[size-1] == 0x87654321
398 || data[5] == 0x34127856 || data[size-1] == 0x65872143)) {
399 dump_data(data, size, version, verbosity);
400 }
401 if (subdet_id == 0) { // try also to find normal fragments
402 dump_digi(subdet_id,data, size, version, verbosity, source_id, ctx);
403 }
404 }
405 } else {
406 std::cout << std::format("\nNO DATA in ROB fragment 0x{:x}\n\n", robf.rod_source_id());
407 }
408 std::cout << std::endl;
409 }
410 }
411
412 if (msgLvl(MSG::DEBUG)) {
413 /* end of unpacking */
414 msg(MSG::DEBUG) << "Found " << nrob << " ROB fragments, " << endmsg;
415
416 // Execution completed.
417 msg(MSG::DEBUG) << "execute() completed successfully" << endmsg;
418 }
419
420 return StatusCode::SUCCESS;
421}
#define endmsg
#define ATH_MSG_DEBUG(x,...)
bool msgLvl(const MSG::Level lvl) const
void dump_digi(unsigned int subdet_id, const uint32_t *data, unsigned int size, unsigned int version, int verbosity, unsigned int robsourceid, const EventContext &ctx)
Gaudi::Property< int > m_lvl1_id
Definition TileTBDump.h:109
Gaudi::Property< int > m_bc_time_seconds
Definition TileTBDump.h:103
Gaudi::Property< int > m_run_type
Definition TileTBDump.h:106
Gaudi::Property< int > m_lvl1_trigger_type
Definition TileTBDump.h:111
Gaudi::Property< bool > m_dumpData
Definition TileTBDump.h:93
Gaudi::Property< int > m_lumi_block
Definition TileTBDump.h:108
std::vector< int > m_all_lvl1_trigger_types
Definition TileTBDump.h:115
Gaudi::Property< int > m_bc_time_nanoseconds
Definition TileTBDump.h:104
Gaudi::Property< bool > m_showUnknown
Definition TileTBDump.h:97
Gaudi::Property< int > m_global_id
Definition TileTBDump.h:105
Gaudi::Property< bool > m_dumpUnknown
Definition TileTBDump.h:96
Gaudi::Property< int > m_bc_id
Definition TileTBDump.h:110
Gaudi::Property< int > m_run_no
Definition TileTBDump.h:107
Gaudi::Property< bool > m_dumpStatus
Definition TileTBDump.h:94
Gaudi::Property< bool > m_dumpOnce
Definition TileTBDump.h:95
Gaudi::Property< int > m_nlvl1_trigger_info
Definition TileTBDump.h:112
Gaudi::Property< bool > m_dumpHeader
Definition TileTBDump.h:92

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode TileTBDump::finalize ( )

Definition at line 148 of file TileTBDump.cxx.

148 {
149
150 std::string unitName[5]={"ADC counts","pCb","CspCb","MeV", "unknown"};
151
152 if (m_unit < 0) {
153 std::cout << std::endl << "DSP reco fragments not found" << std::endl;
154 m_unit = 4;
155 }
156 std::cout << std::endl << "Units in DSP reco fragments are " << unitName[std::min(m_unit,4)] << std::endl;
157
158 if (m_frag5found) {
159 std::cout << std::endl << "StatFrag5[40..129]";
160 for (int i = 40; i < 130; i++) {
161 if (i % 10 == 0) std::cout << std::endl << " [" << std::setw(3) << i << "] : ";
162 std::cout << std::setw(9) << m_statFrag5[i];
163 }
164 std::cout << std::endl;
165 }
166
167 ATH_MSG_INFO( "finalize() successfully" );
168
169 return StatusCode::SUCCESS;
170}
#define ATH_MSG_INFO(x,...)
int m_statFrag5[200]
Definition TileTBDump.h:75

◆ find_frag()

void TileTBDump::find_frag ( const uint32_t * rod,
unsigned int size,
unsigned int version,
int verbosity,
const T_RodDataFrag * frag[],
int & nfrag )
private

Definition at line 1993 of file TileTBDump.cxx.

1994 {
1995 unsigned int offset = 0;
1996 nfrag = 0;
1997 m_v3Format = (*(data) == 0xff1234ff); // additional frag marker since Sep 2005
1998 m_v3Format |= (*(data) == 0x00123400); // another possible frag marker (can appear in buggy ROD frags)
1999 if (m_v3Format || (version > 0xff)) {
2000 m_sizeOverhead = 3;
2001 ++offset; // skip frag marker
2002 std::cout << " *(p) = 0x" << std::hex << (*(data)) << std::dec << ((m_v3Format)?"":" => ERROR Corrupted frag separator") << std::endl;
2003 std::cout << " v3Format = true" << std::endl;
2004 if (!m_v3Format) {
2005 m_v3Format = true;
2006 std::cout << std::endl << "Dump of whole data fragment ("
2007 << size << " words)" << std::endl;
2008 dump_data(data, size, version, verbosity);
2009 }
2010 } else {
2011 m_sizeOverhead = 2;
2012 }
2013
2014 while (offset < size && nfrag < MAX_ROD_FRAG) {
2015 //std::cout << "nfrag="<<(nfrag) << " offset="<<offset<<" data[offset]="<<data[offset]<<std::endl;
2016 frag[nfrag] = reinterpret_cast<const T_RodDataFrag *> (data + offset);
2017
2018 if (frag[nfrag]->size < m_sizeOverhead
2019 || frag[nfrag]->size > size - offset + m_sizeOverhead - 2) {
2020
2021 std::cout << "\nWarning: garbage in frag " << nfrag << " of current ROD -> ignore it" << std::endl;
2022 std::cout << "Size: \t" << std::setw(10) << (frag[nfrag]->size) << "\tMin/Max Size: \t" << std::setw(10) << m_sizeOverhead << "\t" << std::setw(10) << size - offset + m_sizeOverhead - 2 << std::endl;
2023 std::cout << "Id: \t" << std::setw(10) << (frag[nfrag]->id) << std::endl;
2024 std::cout << "Bad data:" << std::endl;
2025 if (offset > 0)
2026 std::cout << "Before:\t" << offset-1 << "\t" << data[offset-1] << "\t0x" << std::hex << data[offset-1] << std::dec << std::endl;
2027
2028 for (; offset < size; ++offset) {
2029 std::cout << "\t" << offset << "\t" << data[offset] << "\t0x" << std::hex << data[offset] << std::dec << std::endl;
2030 if (data[offset] == 0xff1234ff || data[offset] == 0x00123400) break;
2031 }
2032 if (offset == size) {
2033 std::cout << "After:\t" << offset << "\t" << data[offset] << "\t0x" << std::hex << data[offset] << std::dec << std::endl;
2034 }
2035 if (m_v3Format) {
2036 ++offset; // go to next good frag or jump outside ROD, if at the end
2037 }
2038
2039 } else if (frag[nfrag]->size < size - offset && m_v3Format && data[offset + frag[nfrag]->size - 1] != 0xff1234ff && data[offset + frag[nfrag]->size - 1] != 0x00123400) {
2040
2041 std::cout << "\nWarning: frag " << nfrag << " of current ROD is damaged" << std::endl;
2042 std::cout << "Size: \t" << std::setw(10) << (frag[nfrag]->size) << "\tMin/Max Size: \t" << std::setw(10) << m_sizeOverhead << "\t" << std::setw(10) << size - offset + m_sizeOverhead - 2 << std::endl;
2043 std::cout << "Id: \t" << std::setw(10) << (frag[nfrag]->id) << std::endl;
2044 std::cout << "Bad data:" << std::endl;
2045 unsigned int newsize = 0;
2046 std::cout << "Before:\t" << offset-1 << "\t" << data[offset-1] << "\t0x" << std::hex << data[offset-1] << std::dec << std::endl;
2047 for (; offset < size; ++offset, ++newsize) {
2048 std::cout << "\t" << offset << "\t" << data[offset] << "\t0x" << std::hex << data[offset] << std::dec << std::endl;
2049 if (data[offset] == 0xff1234ff || data[offset] == 0x00123400) break;
2050 }
2051 if (offset == size) {
2052 std::cout << "After:\t" << offset << "\t" << data[offset] << "\t0x" << std::hex << data[offset] << std::dec << std::endl;
2053 }
2054 if (m_v3Format) {
2055 ++newsize;
2056 ++offset; // go to next good frag or jump outside ROD, if at the end
2057 }
2058 std::cout << "Correct size is:\t" << std::setw(10) << newsize << std::endl;
2059
2060 } else {
2061 offset += frag[nfrag]->size;
2062 // if (version == 0x1 && offset < size) offset += 7; // skip extra header - was needed for 2001-2003 TB data only
2063 ++nfrag;
2064 }
2065 }
2066
2067 if (m_v3Format) {
2068 --offset; // set offset back to correct value
2069 }
2070
2071 if (offset > size) {
2072 --nfrag;
2073 std::cout << "\nWarning: last fragment in current ROD is garbage -> ignore it" << std::endl;
2074 std::cout << "N good frag: \t" << std::setw(10) << nfrag << std::endl;
2075 std::cout << "Last frag:" << std::endl;
2076 for (unsigned int i = offset - frag[nfrag]->size; i < size; ++i) {
2077 std::cout << "\t" << i << "\t" << data[i] << "\t0x" << std::hex << data[i] << std::dec << std::endl;
2078 }
2079 }
2080}
bool m_v3Format
Definition TileTBDump.h:98

◆ get_correct_data()

std::vector< uint32_t > TileTBDump::get_correct_data ( const uint32_t * p,
unsigned int size ) const
private

Definition at line 3039 of file TileTBDump.cxx.

3039 {
3040
3041 std::vector<uint32_t> data;
3042 data.reserve(size);
3043 const uint32_t* data_end = p + size;
3044
3045 while (p < data_end) {
3046 uint32_t ppr_size = (*p) - 2; // The size of PPr packet
3047 // The first 2 words (FELIX header) of each MD fragment are correct (just copy)
3048 data.push_back(*(p));
3049 data.push_back(*(++p));
3050
3051 ++p;
3052
3053 std::for_each(p, p + ppr_size, [&data] (uint32_t v) {
3054 data.push_back((ntohs(v >> 16) << 16) | (ntohs(v & 0xFFFF)));
3055 });
3056
3057 p += ppr_size;
3058 }
3059
3060 return data;
3061}

◆ initialize()

StatusCode TileTBDump::initialize ( )

Definition at line 117 of file TileTBDump.cxx.

117 {
118
119 memset(m_statFrag5, 0, sizeof(m_statFrag5));
120
121 CHECK( m_RobSvc.retrieve() );
122
123 //=== get TileCondToolOfcCool
124 CHECK( m_tileCondToolOfcCool.retrieve() );
125
126 //=== get TileToolTiming
127 CHECK( m_tileToolTiming.retrieve() );
128
129 //=== get TileCondToolEmscale
130 CHECK( m_tileToolEmscale.retrieve() );
131
132 // find TileCablingService
134 m_runPeriod = m_cabling->runPeriod();
135
136 int size = m_drawerList.value().size();
137 for (int dr = 0; dr < size; ++dr) {
138 unsigned int frag = strtol(m_drawerList.value()[dr].data(), NULL, 0);
139 m_drawerMap[frag] = m_drawerType.value()[dr];
140 }
141
142 ATH_MSG_INFO( "initialization completed" );
143
144 return StatusCode::SUCCESS;
145}
#define CHECK(...)
Evaluate an expression and check for errors.
static const TileCablingService * getInstance()
get pointer to service instance
Gaudi::Property< std::vector< int > > m_drawerType
Definition TileTBDump.h:83
Gaudi::Property< std::vector< std::string > > m_drawerList
Definition TileTBDump.h:82

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_WARNING(x,...)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ tile_check_CRC()

unsigned int TileTBDump::tile_check_CRC ( const unsigned int * frame,
int framelen,
int delta )
private

Definition at line 2903 of file TileTBDump.cxx.

2903 {
2904/*--------------------------------------------------------------------------*/
2905/* Name: tile_check_CRC */
2906/* */
2907/* Author: Magnus Ramstedt Date: 04/10/99 */
2908/* */
2909/* Description: */
2910/* Calculate CRC and compare with input value */
2911/* return 0 if OK else 1,2,3 or 4 depending on the type of error */
2912/* */
2913/* Input arguments: array of data words its length and delta for the */
2914/* address af the second half of the data */
2915/* */
2916/* Output arguments: */
2917/* */
2918/* Libraries used: */
2919/* */
2920/* Routines called: */
2921/* */
2922/* Return Value: 0 if OK else 1,2,3 or 4 depending on the type of error */
2923/* */
2924/*--------------------------------------------------------------------------*/
2925
2926#define CRC_ok 0
2927#define CRC_error_0 1
2928#define CRC_error_1 2
2929#define CRC_do_not_match 4
2930#ifndef CRC_POLY
2931#define CRC_POLY 0x8005
2932#endif
2933
2934 unsigned int CRC_error = CRC_ok;
2935 static const unsigned int error[3] = { CRC_error_0, CRC_error_1, CRC_do_not_match };
2936
2937 int i, j, k, length;
2938 unsigned int word, CRC_word;
2939 unsigned short bit_in, bit_out, reg, reg1, reg2;
2940
2941 /* put all the data in one array with empty word at the end */
2942
2943 std::vector<unsigned int> data;
2944 if (delta != 0) { /* low gain and high gain in different places */
2945 length = 2 * framelen + 1;
2946 data.resize (length);
2947 int xdelta = std::max (delta, 0);
2948 auto pos = std::copy_n (frame, framelen, data.begin());
2949 std::copy_n (frame+delta, framelen, pos);
2950 CRC_word = frame[framelen + xdelta]; /* after second part of the data */
2951 } else {
2952 length = framelen + 1;
2953 data.resize (length);
2954 std::copy_n (frame, framelen, data.begin());
2955 CRC_word = frame[framelen]; /* just after the data */
2956 }
2957
2958 data[length - 1] = 0;
2959
2960 /* Calculates the CRC16 from *data */
2961
2962 for (i = 0; i < 2; i++) { /* odd and even bits separately */
2963
2964 reg = 0;
2965 for (j = 0; j < length; j++) { /* all datawords */
2966
2967 word = data[j];
2968 for (k = i; k < 32; k += 2) { /* 16 bits (odd or even) from one word */
2969
2970 bit_in = (word >> k) & 1; /* This is the incomming bit */
2971 bit_out = reg & 0x8000; /* Saving the kicked out bit */
2972 reg = ((reg << 1) | bit_in); /* Filling 'reg' with 'bit_in' */
2973
2974 if (bit_out) reg ^= CRC_POLY; /* xor reg with poly if bit_out!=0 */
2975 }
2976 }
2977
2978 /* there were a bus swaped */
2979
2980 reg1 = 0;
2981 for (k = 16; reg != 0; reg >>= 1) {
2982 reg1 |= (reg & 1) << (--k);
2983 }
2984
2985 /* reading the recived CRC (16 bit long) */
2986
2987 reg2 = 0;
2988 for (k = i; k < 32; k += 2) { /* 16 bits (odd or even) from one word */
2989
2990 bit_in = (CRC_word >> k) & 1; /* This is the incomming bit */
2991 reg2 = ((reg2 << 1) | bit_in); /* Filling 'reg2' with 'bit_in' */
2992 }
2993
2994 if (reg1 != reg2) CRC_error |= error[i];
2995 }
2996
2997 return CRC_error;
2998}
double length(const pvec &v)
#define CRC_POLY
#define CRC_error_0
#define CRC_ok
#define CRC_error_1
#define CRC_do_not_match

◆ tile_check_parity()

unsigned int TileTBDump::tile_check_parity ( const unsigned int * frame,
int length )
private

Definition at line 2815 of file TileTBDump.cxx.

2815 {
2816/*--------------------------------------------------------------------------*/
2817/* Name: tile_check_parity */
2818/* */
2819/* Author: Magnus Ramstedt Date: 10/09/99 */
2820/* */
2821/* Description: */
2822/* Checks the even parity on all data words for one channel */
2823/* data bits= |xp<---ch3--><---ch2--><---ch1-->| */
2824/* where x is any bit, */
2825/* where p is the parity bit, */
2826/* where ch1,ch2,ch3 - three channels, 10 bits each */
2827/* returns word with "length" status bits, one status bit per every word */
2828/* (0 - if OK else 1) */
2829/* */
2830/* Input arguments: array of data words and its length */
2831/* */
2832/* Output arguments: */
2833/* */
2834/* Libraries used: */
2835/* */
2836/* Routines called: */
2837/* */
2838/* Return Value: word with "length" status bits (0 if OK else 1) */
2839/* */
2840/*--------------------------------------------------------------------------*/
2841
2842 int i, j;
2843 unsigned int parity, data_word, answer = 0;
2844
2845 for (i = 0; i < length; ++i) {
2846
2847 data_word = *frame++;
2848
2849 parity = 0;
2850 for (j = 0; j < 32; j++) {
2851 parity ^= data_word;
2852 data_word >>= 1;
2853 }
2854
2855 if ((parity &= 1) == 0) answer |= 1 << i;
2856 }
2857
2858 return answer;
2859}

◆ tile_check_startbit()

unsigned int TileTBDump::tile_check_startbit ( const unsigned int * frame,
int length,
unsigned int startbit )
private

Definition at line 2862 of file TileTBDump.cxx.

2862 {
2863/*--------------------------------------------------------------------------*/
2864/* Name: tile_check_startbit */
2865/* */
2866/* Author: Alexandre Solodkov Date: 06/08/01 */
2867/* */
2868/* Description: */
2869/* Checks that first bit in all "length" words of "*frame" */
2870/* is equal to "startbit" */
2871/* where p is the parity bit, */
2872/* returns (0 - if OK else 1) */
2873/* */
2874/* Input arguments: array of data words, its length and startbit to compare */
2875/* */
2876/* Output arguments: */
2877/* */
2878/* Libraries used: */
2879/* */
2880/* Routines called: */
2881/* */
2882/* Return Value: 0 if OK else 1 */
2883/* */
2884/*--------------------------------------------------------------------------*/
2885
2886 int i;
2887 unsigned int data_word, answer = 0;
2888
2889 for (i = 0; i < length; ++i) {
2890
2891 data_word = *frame++;
2892
2893 if ((data_word >> 31) != startbit) {
2894 answer = 1;
2895 break;
2896 }
2897 }
2898
2899 return answer;
2900}

◆ tile_min_max()

void TileTBDump::tile_min_max ( const unsigned short * frame,
int frame_length,
unsigned short * smin,
unsigned short * smax )
private

Definition at line 3001 of file TileTBDump.cxx.

3001 {
3002/*--------------------------------------------------------------------------*/
3003/* Name: tile_min_max */
3004/* */
3005/* Author: Alexandre Solodkov Date: 12/07/01 */
3006/* */
3007/* Description: Tries to determine if there is some signal in the frame */
3008/* */
3009/* Input arguments: array of samples */
3010/* */
3011/* Output arguments: max and min sample */
3012/* */
3013/* Libraries used: */
3014/* */
3015/* Routines called: */
3016/* */
3017/* Return Value: */
3018/* */
3019/*--------------------------------------------------------------------------*/
3020
3021 int t;
3022 unsigned short val, Min = 0xFFFF, Max = 0;
3023
3024 for (t = 0; t < frame_length; ++t) {
3025 val = frame[t];
3026
3027 if (val < Min) {
3028 Min = val;
3029 }
3030 if (val > Max) {
3031 Max = val;
3032 }
3033 }
3034
3035 *smin = Min;
3036 *smax = Max;
3037}

◆ tile_unpack_digi()

int TileTBDump::tile_unpack_digi ( const T_RodDataFrag * frag,
T_TileDigiChannel * channel,
int nchannel_max,
unsigned int version,
int verbosity,
int * ngain,
int * nchannel,
int * nsample )
private

Definition at line 2602 of file TileTBDump.cxx.

2604 {
2605/*--------------------------------------------------------------------------*/
2606
2607 static std::atomic<bool> first = true;
2608 int m, c, s/*,id*/, size, ch, dm, dgm = 0, digim[5], digm[4] = { 0, 0, 0, 0 }, status = 0;
2609 int nchip, nchip2, nchan, nchan2, nsamp, nsamp1, nsamp2, gain_offs;
2610 const unsigned int *data;
2611 unsigned int val, headword, firstword, crcword;
2612 unsigned int hlflags, word1, word2, word3, word4, word5;
2613 unsigned short samp[3][MAX_CHAN_SAMP], smin, smax;
2614
2615 //id = frag->id & 0xFFFF; /* fragment ID in the range 0x000 - 0x3FF */
2616 size = frag->size - m_sizeOverhead; /* size of the data part in the fragment */
2617 data = frag->data; /* first word of data */
2618
2619 int dataoffset = 0;
2620 if (version == 0x2 || version == 0x1) { /* can not guess number of samples from size */
2621 if (size > 176 && size < 205) {
2622 size = 179; /* we expect this number (9+2)*16+1+2 */
2623 } else if (size > 272 && size < 405) {
2624 size = 275; /* we expect this number (7*2+3)*16+1+2 */
2625 }
2626 dataoffset = 1; // ignore first word
2627 }
2628
2629 nchip = 16; /* number of chips in the data, only 16 is expected */
2630 nchan = nchip*3; /* one chip contains 3 channles */
2631 nsamp2 = size/nchip; /* calculate number of data words per chip */
2632
2633
2634
2635 /* find digitizers mode (calibration or normal) */
2636 /* do not do this if fragment has bad length */
2637
2638 if (first || status == 0) {
2639 data = frag->data + dataoffset;
2640 dm = 0;
2641 for (m = 0; m < nchip; m++) {
2642 if (tile_check_parity(data, 1) == 0) { /* check parity to be sure */
2643 dgm = ((*data) >> 15) & 3; /* that mode is correct */
2644 if (verbosity > 3) {
2645 std::cout << "Good parity, chip" << std::setw(3) << m << ", mode" << std::setw(2) << (int) dgm << ", head 0x" << setup0 << data[0] << ", data 0x" << std::setw(8) << data[1] << setupDec << std::endl;
2646 }
2647
2648 if (((data[0] >> 31) == 1) && ((data[1] >> 31) == 0)) {
2649 digim[dm++] = dgm;
2650 if (dm == 5) break;
2651 }
2652 }
2653 data += nsamp2;
2654 }
2655
2656 if (m == nchip && dm == 0) { /* the same check, but ignore parity now */
2657 data = frag->data + dataoffset;
2658 for (m = 0; m < nchip; m++) {
2659 dgm = ((*data) >> 15) & 3;
2660 if (verbosity > 3) {
2661 std::cout << "Chip" << std::setw(3) << m << ", mode" << std::setw(2) << (int) dgm << ", head 0x" << setup0 << data[0] << ", data 0x" << std::setw(8) << data[1] << setupDec << std::endl;
2662 }
2663 if (((data[0] >> 31) == 1) && ((data[1] >> 31) == 0)) {
2664 digim[dm++] = dgm;
2665 if (dm == 5) break;
2666 }
2667 data += nsamp2;
2668 }
2669 }
2670
2671 if (m == nchip && dm == 0) {
2672 if (first) {
2673 first = false;
2674 if (nsamp2 == 17) {
2675 m_digi_mode = 1;
2676 std::cout << "Warning: No valid header found, calibration running mode(=1) assumed" << std::endl;
2677 } else {
2678 m_digi_mode = 0;
2679 std::cout << "Warning: No valid header found, normal running mode(=0) assumed" << std::endl;
2680 }
2681 } else {
2682 if (verbosity > 3) {
2683 std::cout << "Warning: No valid header found, keeping previous running mode(=" << (int) m_digi_mode << ")" << std::endl;
2684 }
2685 }
2686 status |= 2;
2687 } else {
2688 m_digi_mode = dgm; /* last found digi mode */
2689 if (dm > 2) { /* more than 2 good headers found */
2690 for (c = 0; c < dm; ++c) {
2691 ++digm[digim[c]]; /* count different digi_modes */
2692 }
2693 for (c = 0; c < 4; ++c) {
2694 if (digm[c] > digm[m_digi_mode]) {/* find most frequent digi_mode */
2695 m_digi_mode = c;
2696 }
2697 }
2698 }
2699 if (first) {
2700 first = false;
2701 if (m_digi_mode > 0) m <<= 1;
2702 if (tile_check_parity(data, 1) == 0) {
2703 std::cout << "\nMode=" << m_digi_mode << " found in header of chip " << m << std::endl;
2704 } else {
2705 std::cout << "\nMode=" << m_digi_mode << " found in header of chip " << m << " with bad parity" << std::endl;
2706 }
2707 if (m_digi_mode > 0) {
2708 std::cout << "\nCalibration mode selected, effective number of chips is twice bigger" << std::endl;
2709 }
2710 }
2711 }
2712 }
2713
2714 /* put offset in the gain_offs variable */
2715 if (m_digi_mode > 0) {
2716 nchip *= 2; /* number of chips is twice bigger in calib mode*/
2717 nchan = nchip * 3;
2718 nchan2 = nchan / 2; /* real number of channels is one half of total */
2719 nchip2 = nchip / 2; /* real number of chips is one half of total */
2720
2721 if (nsamp2 % 2 == 0) {
2722 /* old mode, all low gain channels and then all high gain channels
2723 CRC word is duplicated */
2724
2725 nsamp2 = size / nchip;
2726 nsamp1 = nsamp2 - 1; /* length of data with header and without CRC word */
2727 nsamp = nsamp1 - 1; /* length of data without header and without CRC word */
2728 gain_offs = size / 2; /* first header of high gain in the second half of the data */
2729
2730 } else {
2731 /* new mode, low gain + high gain + CRC word for one channel, then
2732 next channel etc */
2733
2734 nsamp1 = (nsamp2 - 1) / 2; /* length of data with header and without CRC word */
2735 nsamp = nsamp1 - 1; /* length of data without header and without CRC word */
2736 gain_offs = nsamp1; /* first header of high gain just after first low gain */
2737 }
2738 } else {
2739 nsamp1 = nsamp2 - 1; /* length of data with header and without CRC word */
2740 nsamp = nsamp1 - 1; /* length of data without header and without CRC word */
2741
2742 nchan2 = nchan;
2743 gain_offs = 0; /* only one low or high gain value from chip */
2744 nchip2 = nchip; /* all the chips are independent */
2745 }
2746
2747 data = frag->data + dataoffset;
2748 for (m = 0; m < nchip; m++) {
2749 if (m == nchip2) { /* another gain */
2750 data = frag->data + dataoffset;
2751 data += gain_offs;
2752 gain_offs *= -1;
2753 }
2754
2755 /* extract all samples for 3 channels in the chip */
2756 for (s = nsamp; s > 0;) { /* shifted by 1 due to header word */
2757 val = data[s--]; /* decrement s to be real sample number */
2758 for (c = 0; c < 3; c++) {
2759 samp[c][s] = val & 0x3FF;
2760 val = val >> 10;
2761 }
2762 }
2763
2764 headword = data[0];
2765 firstword = data[1];
2766 if (gain_offs > 0) {
2767 crcword = data[nsamp1 + gain_offs]; /* first gain */
2768 } else {
2769 crcword = data[nsamp1]; /* second gain */
2770 }
2771 hlflags = ((headword) >> 12) & 7;
2772
2773 /* check parity of all datawords in the frame, header and CRC */
2774 word5 = tile_check_parity(data + 1, nsamp); /* data parity (one bit per sample) */
2775 word4 = (word5 != 0) ? 32 : 0; /* just one bit (bad/good) for all data words */
2776 word4 |= (tile_check_parity(data, 1) << 4); /* header word parity */
2777 word4 |= (tile_check_startbit(data + 1, nsamp, 0) << 7); /* data words startbits */
2778 word4 |= (tile_check_startbit(data, 1, 1) << 6); /* header word startbit */
2779 word4 |= tile_check_CRC(data, nsamp1, gain_offs); /* bad/good CRC flag */
2780
2781 word3 = (headword) & 0xFFF; /* bunch crossing ID */
2782 word2 = (headword >> 12) & 0x3FFF; /* parity, mode, gain */
2783 word1 = (headword >> 26) & 0xF; /* derandomizer length */
2784 word1 = (word1 << 8) | (m << 2); /* insert chip number */
2785
2786 for (c = 0; c < 3; c++) {
2787 ch = m * 3 + c;
2788 if (ch < nchannel_max) {
2789 tile_min_max(samp[c], nsamp, &smin, &smax); /* find min and max sample */
2790 channel[ch].chan = ch % nchan2; /* the same for low gain and high gain */
2791 channel[ch].head = headword;
2792 channel[ch].first = firstword;
2793 channel[ch].crc = crcword;
2794 channel[ch].id = word1 | c; /* insert channel number */
2795 channel[ch].gain = (hlflags >> c) & 1;
2796 channel[ch].flag = word2;
2797 channel[ch].bcid = word3;
2798 channel[ch].err = word4 | ((smax == 1023) ? 256 : 0) /* overflow flag */
2799 | ((smin == 0) ? 512 : 0); /* underflow flag */
2800 channel[ch].par = word5;
2801 memcpy(channel[ch].sample, samp[c], nsamp * sizeof(short));
2802 }
2803 }
2804
2805 data += nsamp2;
2806 }
2807
2808 *ngain = (gain_offs != 0) ? 2 : 1;
2809 *nchannel = nchan;
2810 *nsample = nsamp;
2811
2812 return status;
2813}
#define MAX_CHAN_SAMP
Definition TileTBDump.h:125
unsigned int tile_check_startbit(const unsigned int *frame, int length, unsigned int startbit)
void tile_min_max(const unsigned short *frame, int frame_length, unsigned short *smin, unsigned short *smax)
unsigned int tile_check_parity(const unsigned int *frame, int length)
unsigned int tile_check_CRC(const unsigned int *frame, int framelen, int delta)
int m_digi_mode
Definition TileTBDump.h:113
bool first
Definition DeMoScan.py:534

◆ tile_unpack_quality()

int TileTBDump::tile_unpack_quality ( const T_RodDataFrag * frag,
T_TileRecoQuality & DQword )
private

Definition at line 2259 of file TileTBDump.cxx.

2259 {
2260 /*--------------------------------------------------------------------------*/
2261// Errors are defined by a bit value of 1, while 0 means OK
2262 unsigned int status = 0;
2263
2264 //int size = frag->size - m_sizeOverhead; /* size of the data part in the fragment */
2265 const unsigned int *data = frag->data; /* first word of data */
2266
2267 unsigned int w;
2268 w = (*data);
2269 // std::cout << " word is 0x" << std::hex << std::setw(8)<< std::setfill('0') << w << std::endl;
2270 DQword.dspbcid = w >> 16; /* if upper bit is set, remaining bits are BCID set by DSP */
2271 DQword.global_crc = w & 0x1;
2272 status = status + DQword.global_crc;
2273
2274 ++data;
2275 w = (*data);
2276
2277 // std::cout << " word is 0x" << std::hex << std::setw(8)<< std::setfill('0') << w << std::endl;
2278
2279 DQword.bcid = w & 0xFFFF; // least sign. bit means DMU00 versus TTC. The other 15 bits mean DMUXX versus DMU00
2280 DQword.memory = (w >> 16) & 0xFFFF;
2281
2282 /* std::cout << " bcid is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.bcid << std::endl;
2283 std::cout << " memory is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.memory << std::endl;
2284 */
2285 status = status + DQword.memory;
2286
2287 ++data;
2288 w = (*data);
2289 // std::cout << " word is 0x" << std::hex << std::setw(8)<< std::setfill('0') << w << std::endl;
2290 DQword.Sstrobe = w & 0xFFFF;
2291 DQword.Dstrobe = (w >> 16) & 0xFFFF;
2292 status = status + DQword.Dstrobe;
2293 /*
2294 std::cout << " Sstrobe is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.Sstrobe << std::endl;
2295 std::cout << " Dstrobe is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.Dstrobe << std::endl;
2296 */
2297
2298 ++data;
2299 w = (*data);
2300 // std::cout << " word is 0x" << std::hex << std::setw(8)<< std::setfill('0') << w << std::endl;
2301 DQword.headformat = w & 0xFFFF; //bit 31
2302 DQword.headparity = (w >> 16) & 0xFFFF; // bit30, parity must be odd
2303
2304 /*
2305 std::cout << " Head format is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.headformat << std::endl;
2306 std::cout << " Head parity is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.headparity << std::endl;
2307 */
2308
2309 ++data;
2310 w = (*data);
2311 // std::cout << " word is 0x" << std::hex << std::setw(8)<< std::setfill('0') << w << std::endl;
2312 DQword.sampleformat = w & 0xFFFF;
2313 DQword.sampleparity = (w >> 16) & 0xFFFF;
2314
2315 /*
2316 std::cout << " Sample format is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.sampleformat << std::endl;
2317 std::cout << " Sample parity is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.sampleparity << std::endl;
2318 */
2319
2320 ++data;
2321 w = (*data);
2322 DQword.fe_chip_mask = (w & 0xFFFF); //do not invert to get the error mask
2323 DQword.rod_chip_mask = (w >> 16) & 0xFFFF; //do not invert to get the error mask
2324
2325 /*
2326 std::cout << " fe mask is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.fe_chip_mask << std::endl;
2327 std::cout << " rod mask is 0x" << std::hex << std::setw(8)<< std::setfill('0') << DQword.rod_chip_mask << std::endl;
2328 */
2329
2330 return status;
2331}

◆ tile_unpack_raw_comp()

int TileTBDump::tile_unpack_raw_comp ( const T_RodDataFrag * frag,
T_TileRawComp * rawcomp,
int nchannel_max,
unsigned int version,
int verbosity,
int * ngain,
int * nchannel,
int * nsample )
private

Definition at line 2402 of file TileTBDump.cxx.

2404 {
2405/*--------------------------------------------------------------------------*/
2406
2407 int status = 0;
2408
2409 int size = frag->size - m_sizeOverhead; // size of the data part in the fragment
2410 unsigned int id = frag->id;
2411 int frag1version = (id >> 31) & 0x1;
2412 int nbchanformat1 = (id >> 24) & 0x3F;
2413
2414 if (frag1version == 0) { //Old version
2415
2416 if ((size % 4) != 0) {
2417 std::cout << " Format Type 1: Raw compressed : Wrong Size = " << size << std::endl;
2418 status = 1;
2419 return status;
2420 }
2421
2422 int nsamp = 7;
2423 int nchan = size / 4;
2424
2425 *ngain = 1;
2426 *nchannel = nchan;
2427 *nsample = nsamp;
2428
2429 const unsigned int *data = frag->data;
2430 int i = 0;
2431
2432 if (data != 0) {
2433 for (int ch = 0; ch < nchan && ch < nchannel_max; ch++) {
2434 unsigned int w = data[i++];
2435 rawcomp[ch].words[0] = w;
2436 nsamp = ((w >> 8) & 0x0F);
2437 rawcomp[ch].chan = (w & 0xFF);
2438 rawcomp[ch].gain = (w >> 15) & 0x1;
2439 rawcomp[ch].samples[0] = (w >> 16);
2440 for (int j = 1; j < ((nsamp / 2) + 1); j++) {
2441 rawcomp[ch].words[j] = w = data[i++];
2442 for (int l = 1; l < nsamp; l += 2) {
2443 rawcomp[ch].samples[l] = (w & 0xFFFF);
2444 rawcomp[ch].samples[l + 1] = (w >> 16);
2445 }
2446 }
2447 rawcomp[ch].verif = (((*nsample) == nsamp) && (rawcomp[ch].chan < 48));
2448 if (!rawcomp[ch].verif) {
2449 status = 1;
2450 std::cout << " Verification ERROR for channel # " << ch << " (ch=" << rawcomp[ch].chan << " g=" << rawcomp[ch].gain << " ns=" << nsamp << " 0x" << std::hex << (rawcomp[ch].words[0] & 0xFFFF) << std::dec << ")!" << std::endl;
2451 } else {
2452 unsigned short v = 0;
2453 for (int k = 0; k < nsamp; k++) {
2454 v |= rawcomp[ch].samples[k];
2455 }
2456 rawcomp[ch].verif = !(v & 0xFC00);
2457 }
2458 }
2459 }
2460
2461 } else if (frag1version == 1) { //New version
2462
2463 int nsamp = 7; // New frag1 only for 7 samples
2464 int SizeOfFrag1 = size * 2; // Number of 16 bit words
2465 int nbchanformat2 = (SizeOfFrag1 - (3 * nbchanformat1)) / 5;
2466
2467 int nchan = nbchanformat1 + nbchanformat2;
2468
2469 *ngain = 1;
2470 *nchannel = nchan;
2471 *nsample = nsamp;
2472 const unsigned int *p = frag->data;
2473
2474 if ((nchan) > 48 || ((nbchanformat1 * 3) + (nbchanformat2 * 5) > SizeOfFrag1)) {
2475 std::cout << " Format Type 1: Raw compressed : ERROR" << " fragId=0x" << std::hex
2476 << (id & 0xFFFF) << std::dec << " frag1Version=" << frag1version << " Nsamp=" << nsamp
2477 << " NchanFormat1=" << nbchanformat1 << " NchanFormat2=" << nbchanformat2
2478 << " Wrong Size=" << size << std::endl;
2479 status = 1;
2480
2481 } else {
2482
2483 int ptr16index = 1;
2484 int channel = 0;
2485 uint16_t word1 = 0;
2486 uint16_t word2 = 0;
2487 uint16_t word3 = 0;
2488 uint16_t word4 = 0;
2489 uint16_t word5 = 0;
2490 int ch = 0;
2491
2492 for (int chf1 = 0; chf1 < nbchanformat1; ++chf1) {
2493
2494 if (ptr16index) {
2495
2496 channel = ((*p >> 26) & 0x3F);
2497 word1 = (uint16_t) ((*p >> 16) & 0xFFFF);
2498 word2 = (uint16_t) (*p & 0xFFFF);
2499 word3 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
2500 ptr16index = 0;
2501
2502 rawcomp[ch].words[0] = (*p);
2503 rawcomp[ch].words[1] = (*p + 1) & 0xFFFF0000;
2504 rawcomp[ch].words[2] = 0;
2505 rawcomp[ch].words[3] = 0;
2506
2507 } else {
2508
2509 channel = ((*p >> 10) & 0x3F);
2510 word1 = (uint16_t) (*p & 0xFFFF);
2511 word2 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
2512 word3 = (uint16_t) (*(p + 1) & 0xFFFF);
2513 ptr16index = 1;
2514
2515 rawcomp[ch].words[0] = (*p) & 0xFFFF;
2516 rawcomp[ch].words[1] = (*p + 1);
2517 rawcomp[ch].words[2] = 0;
2518 rawcomp[ch].words[3] = 0;
2519
2520 }
2521
2522 int gain = 1;
2523 uint16_t Smin = (word1 & 0x3FF);
2524
2525 rawcomp[ch].samples[0] = ((word3 >> 4) & 0xF) + Smin;
2526 rawcomp[ch].samples[1] = ((word3 >> 0) & 0xF) + Smin;
2527 rawcomp[ch].samples[2] = ((word3 >> 8) & 0xF) + Smin;
2528 rawcomp[ch].samples[3] = ((word3 >> 12) & 0xF) + Smin;
2529 rawcomp[ch].samples[4] = ((word2 >> 4) & 0xF) + Smin;
2530 rawcomp[ch].samples[5] = ((word2 >> 0) & 0xF) + Smin;
2531 rawcomp[ch].samples[6] = ((word2 >> 8) & 0xF) + Smin;
2532
2533 rawcomp[ch].chan = channel;
2534 rawcomp[ch].gain = gain;
2535 rawcomp[ch].verif = true;
2536
2537 p += 1 + ptr16index;
2538 ++ch;
2539 }
2540
2541 for (int chf2 = 0; chf2 < nbchanformat2; ++chf2) {
2542
2543 if (ptr16index) {
2544
2545 channel = ((*p) & 0x3F);
2546 word1 = (uint16_t) ((*p >> 16) & 0xFFFF);
2547 word2 = (uint16_t) ((*p) & 0xFFFF);
2548 word3 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
2549 word4 = (uint16_t) (*(p + 1) & 0xFFFF);
2550 word5 = (uint16_t) ((*(p + 2) >> 16) & 0xFFFF);
2551 ptr16index = 0;
2552
2553 rawcomp[ch].words[0] = (*p);
2554 rawcomp[ch].words[1] = (*p + 1);
2555 rawcomp[ch].words[2] = (*p + 2) & 0xFFFF0000;
2556 rawcomp[ch].words[3] = 0;
2557
2558 } else {
2559
2560 channel = ((*(p + 1) >> 16) & 0x3F);
2561 word1 = (uint16_t) ((*p) & 0xFFFF);
2562 word2 = (uint16_t) ((*(p + 1) >> 16) & 0xFFFF);
2563 word3 = (uint16_t) (*(p + 1) & 0xFFFF);
2564 word4 = (uint16_t) ((*(p + 2) >> 16) & 0xFFFF);
2565 word5 = (uint16_t) (*(p + 2) & 0xFFFF);
2566 ptr16index = 1;
2567
2568 rawcomp[ch].words[0] = (*p) & 0xFFFF;
2569 rawcomp[ch].words[1] = (*p + 1);
2570 rawcomp[ch].words[2] = (*p + 2);
2571 rawcomp[ch].words[3] = 0;
2572
2573 }
2574
2575 int gain = ((word2 >> 6) & 0x1);
2576
2577 rawcomp[ch].samples[0] = ((word1 << 9) & 0x200) + ((word2 >> 7) & 0x1FF);
2578 rawcomp[ch].samples[1] = (word1 >> 1) & 0x3FF;
2579 rawcomp[ch].samples[2] = (word4 << 5 & 0x3E0) + ((word1 >> 11) & 0x1F);
2580 rawcomp[ch].samples[3] = (word4 >> 5) & 0x3FF;
2581 rawcomp[ch].samples[4] = ((word3 << 1) & 0x3FE) + ((word4 >> 15) & 0x1);
2582 rawcomp[ch].samples[5] = ((word5 << 7) & 0x380) + ((word3 >> 9) & 0x7F);
2583 rawcomp[ch].samples[6] = (word5 >> 3) & 0x3FF;
2584
2585 rawcomp[ch].chan = channel;
2586 rawcomp[ch].gain = gain;
2587 rawcomp[ch].verif = true;
2588
2589 p += (2 + ptr16index);
2590 ++ch;
2591 }
2592 }
2593//} else {
2594// status = 1; // Logically dead code
2595 }
2596 return status;
2597}
setWord1 uint16_t

◆ tile_unpack_reco()

int TileTBDump::tile_unpack_reco ( const T_RodDataFrag * frag,
T_TileRecoChannel * channel,
int nchannel_max,
unsigned int version,
int verbosity,
int * ngain,
int * nchannel )
private

Definition at line 2335 of file TileTBDump.cxx.

2337 {
2338/*--------------------------------------------------------------------------*/
2339
2340 int status = 0;
2341
2342 int size = frag->size - m_sizeOverhead; /* size of the data part in the fragment */
2343 const unsigned int *data = frag->data; /* first word of data */
2344
2345 int ch = 0;
2346 for (; ch < size && ch < nchannel_max; ++ch) {
2347 unsigned int w = data[ch];
2348 channel[ch].chan = ch % 48;
2349 channel[ch].word = w;
2350 channel[ch].gain = (w >> GAIN_SHIFT2) & GAIN_RANGE2;
2352 channel[ch].time = (w >> TIME_SHIFT2) & TIME_RANGE2;
2353 channel[ch].quality = (w >> QUALITY_SHIFT2) & QUALITY_RANGE2;
2354 channel[ch].d_amp = m_rc2bytes2.amplitude(w);
2355 channel[ch].d_time = m_rc2bytes2.time(w);
2356 channel[ch].d_quality = m_rc2bytes2.quality(w);
2357 }
2358
2359 *ngain = (size - 1) / 48 + 1;
2360 *nchannel = ch;
2361
2362 return status;
2363}
const int TIME_RANGE2
const int GAIN_SHIFT2
const int TIME_SHIFT2
const int AMPLITUDE_RANGE2
const int QUALITY_SHIFT2
const unsigned int GAIN_RANGE2
const int QUALITY_RANGE2
const int AMPLITUDE_SHIFT2
TileRawChannel2Bytes2 m_rc2bytes2
Definition TileTBDump.h:230

◆ tile_unpack_reco_calib()

int TileTBDump::tile_unpack_reco_calib ( const T_RodDataFrag * frag,
T_TileRecoCalib * recocalib,
int nchannel_max,
unsigned int version,
unsigned int unit,
int verbosity,
int * ngain,
int * nchannel )
private

Definition at line 2368 of file TileTBDump.cxx.

2371 {// Baxo
2372 /*--------------------------------------------------------------------------*/
2373
2374 int status = 0;
2375
2376 int size = frag->size - m_sizeOverhead; // size of the data part in the fragment
2377 const unsigned int *data = frag->data; // first word of data
2378
2379 int ch = 0;
2380 for (; ch < size && ch < nchannel_max; ++ch) {
2381 unsigned int w = data[ch];
2382 recocalib[ch].chan = ch % 48;
2383 recocalib[ch].word = w;
2384 recocalib[ch].gain = (w >> GAIN_SHIFT4) & GAIN_RANGE4;
2385 recocalib[ch].amp = (w >> AMPLITUDE_SHIFT4) & AMPLITUDE_RANGE4;
2386 recocalib[ch].time = (w >> TIME_SHIFT4) & TIME_RANGE4;
2387 recocalib[ch].bad = ((w >> QUALITY_SHIFT4) & QUALITY_RANGE4 & 0x10) >> 4;
2388 recocalib[ch].quality = ((w >> QUALITY_SHIFT4) & QUALITY_RANGE4 & 0xF);
2389 recocalib[ch].d_amp = m_rc2bytes4.amplitude(w, unit);
2390 recocalib[ch].d_time = m_rc2bytes4.time(w);
2391 recocalib[ch].d_quality = m_rc2bytes4.quality(w);
2392 }
2393
2394 *ngain = (size - 1) / 48 + 1;
2395 *nchannel = ch;
2396
2397 return status;
2398}
const int QUALITY_RANGE4
const unsigned int GAIN_RANGE4
const int TIME_SHIFT4
const int AMPLITUDE_SHIFT4
const int TIME_RANGE4
const int QUALITY_SHIFT4
const int AMPLITUDE_RANGE4
const int GAIN_SHIFT4
TileRawChannel2Bytes4 m_rc2bytes4
Definition TileTBDump.h:231

◆ unpack_frag6()

void TileTBDump::unpack_frag6 ( const uint32_t * data,
unsigned int size,
FelixData_t & digitsHighGain,
FelixData_t & digitsLowGain,
FelixData_t & digitsMetaData ) const
private

Definition at line 2083 of file TileTBDump.cxx.

2087{
2088
2089 using Tile = TileCalibUtils;
2090 std::vector<unsigned int> bcid(Tile::MAX_MINIDRAWER);
2091 std::vector<unsigned int> l1id(Tile::MAX_MINIDRAWER);
2092 std::vector<unsigned int> moduleID(Tile::MAX_MINIDRAWER);
2093 std::vector<unsigned int> runType (Tile::MAX_MINIDRAWER);
2094 std::vector<unsigned int> runNumber(Tile::MAX_MINIDRAWER);
2095 std::vector<unsigned int> pedestalHi(Tile::MAX_MINIDRAWER);
2096 std::vector<unsigned int> pedestalLo(Tile::MAX_MINIDRAWER);
2097 std::vector<unsigned int> chargeInjected(Tile::MAX_MINIDRAWER);
2098 std::vector<unsigned int> timeInjected(Tile::MAX_MINIDRAWER);
2099 std::vector<unsigned int> capacitor(Tile::MAX_MINIDRAWER);
2100 std::vector<unsigned int> ecr(Tile::MAX_MINIDRAWER);
2101 std::vector<unsigned int> bcr(Tile::MAX_MINIDRAWER);
2102 std::vector<unsigned int> packetVersion(Tile::MAX_MINIDRAWER);
2103 std::vector<unsigned int> fragmentID(Tile::MAX_MINIDRAWER);
2104
2105 digitsHighGain.clear();
2106 digitsLowGain.clear();
2107 digitsMetaData.clear();
2108
2109 int version = 0;
2110 int mdFragmentSize = (*data) & 0xFFFF;
2111 int sampleNumber = mdFragmentSize / Tile::MAX_MINIDRAWER_CHAN;
2112
2113 const uint32_t* const end_data = data + size;
2114 while (data < end_data) {
2115 if (*data == 0x12345678 ) {
2116 mdFragmentSize = (*(data - 2)) & 0xFFFF;
2117
2118 if ((++data < end_data)) {
2119 version = (((*data >> 16) & 0xFFFF) == 0) ? 1 : 0;
2120
2121 int mdSizeOverhead = (version == 0) ? 10 : 11;
2122 int delta = mdFragmentSize - (sampleNumber * Tile::MAX_MINIDRAWER_CHAN + mdSizeOverhead);
2123 if (delta != 0) {
2124 ATH_MSG_WARNING( "FRAG6: Unexpected MD fragment size " << mdFragmentSize << " => "
2125 << sampleNumber << " samples will be unpacked and last "
2126 << delta << " words will be ignored ");
2127 }
2128 unsigned int miniDrawer = -1;
2129
2130 // find MD trailer
2131 const uint32_t* trailer = data + mdFragmentSize - 4;
2132 if (trailer < end_data && *trailer == 0x87654321) {
2133 unsigned int paramsSize = 3;
2134
2135 if (version == 0) {
2136 unsigned int fragSize = *data & 0xFF;
2137 paramsSize = (*data >> 8 ) & 0xFF;
2138
2139 miniDrawer = *(data + 4) & 0xFF;
2140 moduleID[miniDrawer ] = (*data >> 16) & 0xFF;
2141 runType[miniDrawer] = (*data >> 24) & 0xFF;
2142
2143 if (fragSize != sampleNumber * Tile::MAX_MINIDRAWER_CHAN) {
2144 std::cout << "Minidrawer [" << miniDrawer
2145 << "] has unexpected fragment size: " << fragSize
2146 << " correct value for " << sampleNumber
2147 << " samples is " << sampleNumber * Tile::MAX_MINIDRAWER_CHAN << std::endl;
2148 }
2149
2150 if (paramsSize == 3){
2151 runNumber[miniDrawer] = *(++data);
2152
2153 pedestalLo[miniDrawer] = *(++data) & 0xFFF;
2154 pedestalHi[miniDrawer] = (*data >> 12 ) & 0xFFF;
2155
2156 chargeInjected[miniDrawer] = *(++data) & 0xFFF;
2157 timeInjected[miniDrawer] = (*data >> 12) & 0xFF;
2158 capacitor[miniDrawer] = (*data >> 20) & 0x1;
2159 } else {
2160
2161 std::cout << "Minidrawer [" << miniDrawer
2162 << "] has unexpected number of parameter words: " << paramsSize
2163 << " => ignore them !!!" << std::endl;
2164 data += paramsSize;
2165 }
2166
2167 bcid[miniDrawer] = (*(++data) >> 16) & 0xFFFF;
2168 l1id[miniDrawer] = *(++data) & 0xFFFFFF;
2169 ecr[miniDrawer] = (*data >> 24) & 0xFF;
2170 } else {
2171 miniDrawer = *(data + 1) & 0xFF;
2172
2173 packetVersion[miniDrawer] = (*data) & 0xFF;
2174 fragmentID[miniDrawer] = (*data >> 8) & 0xFF;
2175
2176 bcid[miniDrawer] = (*(++data) >> 8) & 0xFFF;
2177 moduleID[miniDrawer] = (*data >> 20) & 0xFFF;
2178
2179 l1id[miniDrawer] = *(++data) & 0xFFFFFF;
2180 ecr[miniDrawer] = (*data >> 24) & 0xFF;
2181
2182 bcr[miniDrawer] = *(++data);
2183
2184 if (packetVersion[miniDrawer] == 1) {
2185 pedestalLo[miniDrawer] = *(++data) & 0xFFF;
2186 pedestalHi[miniDrawer] = (*data >> 12 ) & 0xFFF;
2187 runType[miniDrawer] = (*data >> 24) & 0xFF;
2188
2189 runNumber[miniDrawer] = *(++data);
2190 } else {
2191 runNumber[miniDrawer] = *(++data);
2192
2193 pedestalLo[miniDrawer] = *(++data) & 0xFFF;
2194 pedestalHi[miniDrawer] = (*data >> 12 ) & 0xFFF;
2195 runType[miniDrawer] = (*data >> 24) & 0xFF;
2196 }
2197
2198 chargeInjected[miniDrawer] = *(++data) & 0xFFF;
2199 timeInjected[miniDrawer] = (*data >> 12) & 0xFF;
2200 capacitor[miniDrawer] = (*data >> 20) & 0x1;
2201 }
2202
2203
2204
2205 const uint16_t* sample = reinterpret_cast<const uint16_t *> (++data);
2206
2207 size_t start_channel(miniDrawer * Tile::MAX_MINIDRAWER_CHAN);
2208 size_t end_channel(start_channel + Tile::MAX_MINIDRAWER_CHAN);
2209
2210 if (end_channel > digitsHighGain.size()) digitsHighGain.resize(end_channel);
2211 for (size_t channel = start_channel; channel < end_channel; ++channel) {
2212 digitsHighGain[channel].resize(sampleNumber);
2213 for (int samplesIdx = 0; samplesIdx<sampleNumber; ++samplesIdx) {
2214 digitsHighGain[channel][samplesIdx] = (*sample & 0x0FFF);
2215 ++sample;
2216 }
2217 }
2218
2219 if (end_channel > digitsLowGain.size()) digitsLowGain.resize(end_channel);
2220 for (size_t channel = start_channel; channel < end_channel; ++channel) {
2221 digitsLowGain[channel].resize(sampleNumber);
2222 for (int samplesIdx = 0; samplesIdx<sampleNumber; ++samplesIdx) {
2223 digitsLowGain[channel][samplesIdx] = (*sample & 0x0FFF);
2224 ++sample;
2225 }
2226 }
2227
2228 data = ++trailer;
2229
2230 } else {
2231 std::cout << "Wrong trailer for MD[" << miniDrawer << "] => skip MD fragment !!!" << std::endl;
2232 }
2233 }
2234 } else {
2235 ++data;
2236 }
2237 }
2238
2239 digitsMetaData.push_back(std::move(bcid));
2240 digitsMetaData.push_back(std::move(l1id));
2241 digitsMetaData.push_back(std::move(moduleID));
2242 digitsMetaData.push_back(std::move(runType));
2243 digitsMetaData.push_back(std::move(runNumber));
2244 digitsMetaData.push_back(std::move(pedestalHi));
2245 digitsMetaData.push_back(std::move(pedestalLo));
2246 digitsMetaData.push_back(std::move(chargeInjected));
2247 digitsMetaData.push_back(std::move(timeInjected));
2248 digitsMetaData.push_back(std::move(capacitor));
2249 digitsMetaData.push_back(std::move(ecr));
2250 if (version) {
2251 digitsMetaData.push_back(std::move(bcr));
2252 digitsMetaData.push_back(std::move(packetVersion));
2253 digitsMetaData.push_back(std::move(fragmentID));
2254 }
2255}
constexpr std::initializer_list< int > Tile
Definition HIEventDefs.h:70

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_all_lvl1_trigger_types

std::vector<int> TileTBDump::m_all_lvl1_trigger_types
private

Definition at line 115 of file TileTBDump.h.

◆ m_bc_id

Gaudi::Property<int> TileTBDump::m_bc_id {this, "bc_id", -1}
private

Definition at line 110 of file TileTBDump.h.

110{this, "bc_id", -1};

◆ m_bc_time_nanoseconds

Gaudi::Property<int> TileTBDump::m_bc_time_nanoseconds {this, "bc_time_nanoseconds", -1}
private

Definition at line 104 of file TileTBDump.h.

104{this, "bc_time_nanoseconds", -1};

◆ m_bc_time_seconds

Gaudi::Property<int> TileTBDump::m_bc_time_seconds {this, "bc_time_seconds", -1}
private

Definition at line 103 of file TileTBDump.h.

103{this, "bc_time_seconds", -1};

◆ m_cabling

const TileCablingService* TileTBDump::m_cabling {nullptr}
private

Definition at line 79 of file TileTBDump.h.

79{nullptr};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_digi_mode

int TileTBDump::m_digi_mode {0}
private

Definition at line 113 of file TileTBDump.h.

113{0};

◆ m_drawerList

Gaudi::Property<std::vector<std::string> > TileTBDump::m_drawerList {this, "drawerList", {"0x200", "0x201", "0x202", "0x100", "0x101", "0x102", "0x400", "0x401", "0x402"}}
private

Definition at line 82 of file TileTBDump.h.

82{this, "drawerList", {"0x200", "0x201", "0x202", "0x100", "0x101", "0x102", "0x400", "0x401", "0x402"}}; // list of frag IDs in correct order

◆ m_drawerMap

std::map<unsigned int, unsigned int, std::less<unsigned int> > TileTBDump::m_drawerMap
private

Definition at line 84 of file TileTBDump.h.

◆ m_drawerType

Gaudi::Property<std::vector<int> > TileTBDump::m_drawerType {this, "drawerType", {2, 2, 2, 1, 1, 1, 4, 4, 4}}
private

Definition at line 83 of file TileTBDump.h.

83{this, "drawerType", {2, 2, 2, 1, 1, 1, 4, 4, 4}}; // type of every drawer 1-4: B+, B-, EB+, EB-

◆ m_dumpData

Gaudi::Property<bool> TileTBDump::m_dumpData {this, "dumpData", true}
private

Definition at line 93 of file TileTBDump.h.

93{this, "dumpData", true};

◆ m_dumpHeader

Gaudi::Property<bool> TileTBDump::m_dumpHeader {this, "dumpHeader", true}
private

Definition at line 92 of file TileTBDump.h.

92{this, "dumpHeader", true};

◆ m_dumpOnce

Gaudi::Property<bool> TileTBDump::m_dumpOnce {this, "dumpOnce", false}
private

Definition at line 95 of file TileTBDump.h.

95{this, "dumpOnce", false};

◆ m_dumpStatus

Gaudi::Property<bool> TileTBDump::m_dumpStatus {this, "dumpStatus", true}
private

Definition at line 94 of file TileTBDump.h.

94{this, "dumpStatus", true};

◆ m_dumpUnknown

Gaudi::Property<bool> TileTBDump::m_dumpUnknown {this, "dumpUnknown", false}
private

Definition at line 96 of file TileTBDump.h.

96{this, "dumpUnknown", false};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_frag5found

bool TileTBDump::m_frag5found {false}
private

Definition at line 99 of file TileTBDump.h.

99{false};

◆ m_global_id

Gaudi::Property<int> TileTBDump::m_global_id {this, "global_id", -1}
private

Definition at line 105 of file TileTBDump.h.

105{this, "global_id", -1};

◆ m_lumi_block

Gaudi::Property<int> TileTBDump::m_lumi_block {this, "lumi_block", -1}
private

Definition at line 108 of file TileTBDump.h.

108{this, "lumi_block", -1};

◆ m_lvl1_id

Gaudi::Property<int> TileTBDump::m_lvl1_id {this, "lvl1_id", -1}
private

Definition at line 109 of file TileTBDump.h.

109{this, "lvl1_id", -1};

◆ m_lvl1_trigger_type

Gaudi::Property<int> TileTBDump::m_lvl1_trigger_type {this, "lvl1_trigger_type", -1}
private

Definition at line 111 of file TileTBDump.h.

111{this, "lvl1_trigger_type", -1};

◆ m_nlvl1_trigger_info

Gaudi::Property<int> TileTBDump::m_nlvl1_trigger_info {this, "nlvl1_trigger_info", -1}
private

Definition at line 112 of file TileTBDump.h.

112{this, "nlvl1_trigger_info", -1};

◆ m_rc2bytes2

TileRawChannel2Bytes2 TileTBDump::m_rc2bytes2
private

Definition at line 230 of file TileTBDump.h.

◆ m_rc2bytes4

TileRawChannel2Bytes4 TileTBDump::m_rc2bytes4
private

Definition at line 231 of file TileTBDump.h.

◆ m_rc2bytes5

TileRawChannel2Bytes5 TileTBDump::m_rc2bytes5
private

Definition at line 232 of file TileTBDump.h.

◆ m_RobSvc

ServiceHandle<IROBDataProviderSvc> TileTBDump::m_RobSvc
private

Definition at line 77 of file TileTBDump.h.

◆ m_run_no

Gaudi::Property<int> TileTBDump::m_run_no {this, "run_no", -1}
private

Definition at line 107 of file TileTBDump.h.

107{this, "run_no", -1};

◆ m_run_type

Gaudi::Property<int> TileTBDump::m_run_type {this, "run_type", -1}
private

Definition at line 106 of file TileTBDump.h.

106{this, "run_type", -1};

◆ m_runPeriod

int TileTBDump::m_runPeriod {0}
private

Definition at line 80 of file TileTBDump.h.

80{0};

◆ m_showUnknown

Gaudi::Property<bool> TileTBDump::m_showUnknown {this, "showUnknown", true}
private

Definition at line 97 of file TileTBDump.h.

97{this, "showUnknown", true};

◆ m_sizeOverhead

unsigned int TileTBDump::m_sizeOverhead {3}
private

Definition at line 100 of file TileTBDump.h.

100{3};

◆ m_statFrag5

int TileTBDump::m_statFrag5[200] {}
private

Definition at line 75 of file TileTBDump.h.

75{};

◆ m_tileCondToolOfcCool

PublicToolHandle<TileCondToolOfcCool> TileTBDump::m_tileCondToolOfcCool {this, "TileCondToolOfcCool", "TileCondToolOfcCool", "TileCondToolOfcCool"}
private

Definition at line 89 of file TileTBDump.h.

89{this, "TileCondToolOfcCool", "TileCondToolOfcCool", "TileCondToolOfcCool"};

◆ m_tileToolEmscale

PublicToolHandle<TileCondToolEmscale> TileTBDump::m_tileToolEmscale {this, "TileCondToolEmscale", "TileCondToolEmscale"}
private

Definition at line 90 of file TileTBDump.h.

90{this, "TileCondToolEmscale", "TileCondToolEmscale"};

◆ m_tileToolTiming

PublicToolHandle<TileCondToolTiming> TileTBDump::m_tileToolTiming {this, "TileCondToolTiming", "TileCondToolTiming"}
private

Definition at line 88 of file TileTBDump.h.

88{this, "TileCondToolTiming", "TileCondToolTiming"};

◆ m_unit

int TileTBDump::m_unit {-1}
private

Definition at line 101 of file TileTBDump.h.

101{-1};

◆ m_v3Format

bool TileTBDump::m_v3Format {true}
private

Definition at line 98 of file TileTBDump.h.

98{true};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: