![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
An AlgTool class to provide conversion ByteStream <-> TestBeam Instrumentation Data created Feb 2004 Walter Lampl.
More...
#include <TBByteStreamCnvTool.h>
|
| TBByteStreamCnvTool (const std::string &type, const std::string &name, const IInterface *parent) |
| constructor More...
|
|
virtual StatusCode | initialize () |
|
virtual StatusCode | finalize () |
|
StatusCode | WriteFragment () |
|
StatusCode | ReadFragment (int unrec_code) |
|
StatusCode | ReadFragment (TBTDC *&tdc, const std::string &key) |
|
StatusCode | ReadFragment (TBTDCRawCont *&tdcrawCont, const std::string &key) |
|
StatusCode | ReadFragment (TBADCRawCont *&adcrawCont, const std::string &key) |
|
StatusCode | ReadFragment (TBBPCRawCont *&bpcrawCont, const std::string &key) |
|
StatusCode | ReadFragment (TBMWPCRawCont *&mwpcrawCont, const std::string &key) |
|
StatusCode | ReadFragment (TBTriggerPatternUnit *&trigpat, const std::string &key) |
|
StatusCode | ReadFragment (TBScintillatorRawCont *&scintrawCont, const std::string &key) |
|
StatusCode | ReadFragment (TBTailCatcherRaw *&tailcatchraw, const std::string &key) |
|
StatusCode | ReadFragment (TBEventInfo *&tbeventinfo, const std::string &key) |
|
StatusCode | ReadFragment (TBLArDigitContainer *&tblardigitcont, const std::string &key) |
|
StatusCode | ReadFragment (TBLArCalibDigitContainer *&tblarcalibdigitcont, const std::string &key) |
|
StatusCode | BuildRODBlock (std::vector< uint32_t > *theRODBlock) |
|
StatusCode | GetRODBlock (eformat::SubDetector subdet_id, eformat::SubDetector subdet_rod_id=m_DontCheckRodSubDetID) |
|
StatusCode | H6BuildObjects (int unrec_code) |
|
StatusCode | H6RecordObjects (int unrec_code) |
|
StatusCode | H8BuildObjects (int unrec_code) |
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
An AlgTool class to provide conversion ByteStream <-> TestBeam Instrumentation Data created Feb 2004 Walter Lampl.
Definition at line 47 of file TBByteStreamCnvTool.h.
◆ StoreGateSvc_t
◆ TBByteStreamCnvTool()
TBByteStreamCnvTool::TBByteStreamCnvTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ BuildRODBlock()
StatusCode TBByteStreamCnvTool::BuildRODBlock |
( |
std::vector< uint32_t > * |
theRODBlock | ) |
|
Build a ROD data block for all Beam detector classes found in SG. Working only with TBTDC class for testing
Definition at line 221 of file TBByteStreamCnvTool.cxx.
231 const TBTDC* tbtdc =
nullptr;
232 std::string tbtdc_Key(
"TBTDC");
234 if (
sc!=StatusCode::SUCCESS)
235 {logstr << MSG::ERROR <<
"Can't retrieve TBTDC with key "<< tbtdc_Key <<
" from StoreGate" <<
endmsg;
239 theRodBlock->push_back(4);
240 theRodBlock->push_back(0x03);
241 theRodBlock->push_back(tbtdc->
tdc());
242 theRodBlock->push_back(tbtdc->
tdcmin());
280 return StatusCode::SUCCESS;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
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
◆ finalize()
StatusCode TBByteStreamCnvTool::finalize |
( |
| ) |
|
|
virtual |
◆ firstnbit()
unsigned short TBByteStreamCnvTool::firstnbit |
( |
int |
n, |
|
|
unsigned short |
w |
|
) |
| |
|
inlineprivate |
◆ firstword()
unsigned short TBByteStreamCnvTool::firstword |
( |
unsigned int |
w | ) |
|
|
inlineprivate |
◆ getCaloGain()
◆ GetRODBlock()
StatusCode TBByteStreamCnvTool::GetRODBlock |
( |
eformat::SubDetector |
subdet_id, |
|
|
eformat::SubDetector |
subdet_rod_id = m_DontCheckRodSubDetID |
|
) |
| |
Definition at line 425 of file TBByteStreamCnvTool.cxx.
431 {logstr << MSG::ERROR <<
"ROBDataProviderSvc not loaded. Can't read ByteStream" <<
endmsg;
432 return StatusCode::FAILURE;
439 return StatusCode::FAILURE;
442 const size_t MAX_ROBFRAGMENTS = 2048*1024;
444 size_t robcount =
re->children(robF,MAX_ROBFRAGMENTS);
446 if (robcount == MAX_ROBFRAGMENTS)
449 return StatusCode::FAILURE;
452 for (
size_t irob=0; irob<robcount; ++irob)
458 MSG::hex(logstr) <<
MSG::DEBUG <<
"Frag Size : " << rob.fragment_size_word() <<
endmsg;
459 MSG::hex(logstr) <<
MSG::DEBUG <<
"Header Size: " << rob.header_size_word() <<
endmsg;
460 MSG::hex(logstr) <<
MSG::DEBUG <<
"Source ID : " << rob.source_id() <<
endmsg;
468 logstr << MSG::ERROR <<
"Got invalid ROB fragment!" <<
endmsg;
469 return StatusCode::FAILURE;
473 MSG::hex(logstr) <<
MSG::DEBUG <<
"Frag Size : " << rob.rod_fragment_size_word() <<
endmsg;
474 MSG::hex(logstr) <<
MSG::DEBUG <<
"Header Size: " << rob.rod_header_size_word() <<
endmsg;
475 MSG::hex(logstr) <<
MSG::DEBUG <<
"Source ID : " << rob.rod_source_id() <<
endmsg;
476 MSG::hex(logstr) <<
MSG::DEBUG <<
"Run num : " << rob.rod_run_no() <<
endmsg;
477 MSG::hex(logstr) <<
MSG::DEBUG <<
"Version : " << rob.rod_version() <<
endmsg;
479 eformat::helper::SourceIdentifier rod_sid(rob.rod_source_id());
482 MSG::hex(logstr) <<
MSG::DEBUG <<
"Found requested ROD (id="
483 << rod_sid.subdetector_id() <<
")" <<
endmsg;
487 logstr<< MSG::INFO <<
"Guessing from ROD header -> " ;
488 if (rob.rod_detev_type()&1)
490 logstr<<
" H6 !" <<
endmsg;
496 logstr<<
" H8 !" <<
endmsg;
507 rob.rod_data(rodPointer);
509 for(
size_t i=0;
i<rob.rod_ndata(); ++
i)
517 logstr <<
MSG::FATAL <<
"Error reading bytestream event: "
518 <<
"Empty ROD block" <<
endmsg;
519 return StatusCode::FAILURE;
521 logstr <<
MSG::DEBUG <<
"Got Rod Block for Test Beam Instrumentation data from ByteStream" <<
endmsg;
522 return StatusCode::SUCCESS;
526 MSG::hex(logstr) << MSG::WARNING <<
" Didn't find SubDet ID for Beam Instruments. Should be "<< subdet_id<<
endmsg;
527 return StatusCode::FAILURE;
◆ H6BuildObjects()
StatusCode TBByteStreamCnvTool::H6BuildObjects |
( |
int |
unrec_code | ) |
|
Build all beam detectors raw objects from m_rodBlock using H6 convention. Objects are recorded in SG if they do not correspond to unrec_code Will return faillure if : -one of the object could not be recorded in SG -the requested object (unrec_code) was not found
Definition at line 532 of file TBByteStreamCnvTool.cxx.
546 const EventContext& ctx = Gaudi::Hive::currentContext();
553 std::ostringstream
os;
557 if (
sc!=StatusCode::SUCCESS)
561 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock too small!" <<
endmsg;
562 return StatusCode::FAILURE;
577 std::string
name1,name2;
626 short m_feedthrough[8] = {0,0,0,0,1,1,1,1};
627 int m_sampleOrder[32] = {
628 0,1,2,3,4,5,6,7,8,9,10,
629 11,12,13,14,15,16,17,18,19,20,
630 21,22,23,24,25,26,27,28,29,30,
632 int m_sort[64] = { 55, 39, 23, 7, 119, 103, 87, 71,
633 54, 38, 22, 6, 118, 102, 86, 70,
634 53, 37, 21, 5, 117, 101, 85, 69,
635 52, 36, 20, 4, 116, 100, 84, 68,
636 51, 35, 19, 3, 115, 99, 83, 67,
637 50, 34, 18, 2, 114, 98, 82, 66,
638 49, 33, 17, 1, 113, 97, 81, 65,
639 48, 32, 16, 0, 112, 96, 80, 64
643 constexpr
short m_slot[8]={5,7,9,11,3,4,5,6};
645 constexpr
int NWREC = 8;
647 for(
unsigned int nfeb=0;nfeb<
m_boards.size();nfeb++){
666 if((m_sampleOrder[0]=
m_febgain[nfeb])!=0){
667 for(
int j=0;j<
m_febgain[nfeb];j++) {m_sampleOrder[j+1]=j;}
670 samp=m_sampleOrder[
s];
673 for(
int i= 0 ;
i<64;
i++){
677 unsigned short gain1 = ((tmp1>>12)&3) - 1;
681 unsigned short gain2 = ((
tmp2>>12)&3) - 1;
708 for(
int i=0;
i<128;
i++) {
718 const std::vector<HWIdentifier>& calibChannelIDs=calibLine->calibSlotLine(hwid);
719 if (calibChannelIDs.size() != 0) {
749 name1=
"word1frag0x03chan";
750 name2=
"word2frag0x03chan";
754 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x03) has not expected size" <<
endmsg;
755 sc=StatusCode::FAILURE;
764 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
774 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
784 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
795 name1=
"word1frag0x06chan";
796 name2=
"word2frag0x06chan";
797 std::string tcname=
"tc";
798 std::vector<TBScintillatorRaw *> theScints;
800 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x04) has not expected size" <<
endmsg;
801 sc=StatusCode::FAILURE;
805 for(
unsigned int i=0;
i<24;
i++){
828 os << tcname << 2*
i+1;
830 theScints.push_back(
s1);
831 theScints.push_back(
s2);
841 name1=
"word1frag0x05chan";
842 name2=
"word2frag0x05chan";
845 logstr <<
MSG::DEBUG <<
"H6BuildObject : number of BPCRaw "<< bpcnum <<
endmsg;
847 for(
int i=0;
i<bpcnum;
i++){
848 std::string bpcname =
"BPC";
852 std::vector<const TBTDCRaw*> theTDCs;
853 std::vector<const TBADCRaw*> theADCs;
856 unsigned int tmp1,
tmp2;
863 os << name2 << (
i*3);
872 os << name2 << (
i*3+1);
880 MSG::hex(logstr) <<
MSG::DEBUG << bpcname<<
" "<< tmp1;
881 MSG::hex(logstr) <<
" "<<
tmp2<<
" ";
889 os << name2 << (
i*3+2);
894 MSG::hex(logstr) <<
MSG::DEBUG << bpcname<<
" "<< tmp1;
898 theTDCs.push_back(tbtdcL);
899 theTDCs.push_back(tbtdcR);
900 theTDCs.push_back(tbtdcU);
901 theTDCs.push_back(tbtdcD);
902 theADCs.push_back(tbadcH);
903 theADCs.push_back(tbadcV);
914 name1=
"word1frag0x06chan";
915 name2=
"word2frag0x06chan";
917 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x06) has not expected size" <<
endmsg;
918 sc=StatusCode::FAILURE;
932 logstr <<
MSG::DEBUG <<
" building muon counters:";
933 for(
int i=0;
i<8;
i++) {
934 std::string scintname=
"muon";
936 os << scintname << (
i+1);
972 for(
int i=0;
i<4;
i++) {
979 os << name2 << (0+3+
i);
984 if(
testbit(10,word2)) adc2->setOverflow();
1031 for(
int i=0;
i<8;
i++) {
1035 logstr <<
MSG::DEBUG <<
" Should I record TBScintillatorRawCont with key " <<
m_keys[6] <<
" ? " <<
endmsg;
1044 logstr <<
MSG::DEBUG <<
" Found MWPC subfragment. Nword= "<<nword <<
endmsg;
1046 std::string mwpcnames[8]= {
"X2",
"Y2",
"X3",
"Y3",
"X4",
"Y4",
"X5",
"Y5"};
1047 bool isX[9]={
true,
false,
true,
false,
true,
false,
true,
false};
1049 for(
int i=0;
i<8;
i++){
1098 w = (
int) (word2>>12);
c = (
int) ((0xfff & word2) -
w/2 + !(
w&1));
1113 for(
int i=0;
i<8;
i++){
1128 logstr << MSG::ERROR <<
"bad number of lines. nwords=" << nword <<
endmsg;
1131 int nline= nword / 16;
1133 for(
int i=0;
i<nline;
i++){
1135 std::string sline=
"";
1136 std::string skey=
"";
1137 for(
int j=0;j<63;j++) {
1138 if(strw[
i*64+j]==0)
break;
1139 sline+=strw[
i*64+j];
1142 std::istringstream iss (sline);
1144 if(skey==
"RunNumber") {
1148 if(skey==
"BeamMomentum") {
1152 if(skey==
"BeamParticle") {
1160 if(skey==
"CryoAngle") {
1164 if(skey==
"TableY") {
1168 if(skey==
"miniROD") {
1173 while(iss.good()) {iss>>board;
m_boards.push_back(board);}
1178 if(skey==
"FebSamples") {
1188 if(skey==
"FebGains") {
1200 if(skey==
"FebAuto") {
1210 if(skey==
"FebFirstSample") {
1215 while(iss.good()) {iss>>firstsample;
m_firstsamples.push_back(firstsample);}
1247 logstr <<
MSG::DEBUG <<
" Found Calib_ID subfragment. Nword= "<<nword <<
endmsg;
1249 logstr<<MSG::ERROR<<
"Calibration subfrag (0xff) has not expected size" <<
endmsg;
1250 sc=StatusCode::FAILURE;
1256 for(
int i=0;
i<4;
i++){
1268 for(
int byte=0;
byte<16;
byte++) {
1269 logstr <<
MSG::DEBUG <<
" byte " <<
byte <<
" : " ;
1270 for(
int bit=0; bit<8; bit++) {
◆ H6RecordObjects()
StatusCode TBByteStreamCnvTool::H6RecordObjects |
( |
int |
unrec_code | ) |
|
Definition at line 1942 of file TBByteStreamCnvTool.cxx.
1947 logstr <<
MSG::DEBUG <<
"About to try recording. unrec_code = " << unrec_code <<
endmsg;
1950 logstr <<
MSG::DEBUG <<
" WARNING! Did not find TailCatcher. Returning an empty one : this may crash every attempt to use it" <<
endmsg;
1957 if (
sc.isFailure( ) ) {
1958 logstr << MSG::ERROR <<
"Cannot record TBTrigPat " <<
endmsg;
1965 if (
sc.isFailure( ) ) {
1966 logstr << MSG::ERROR <<
"Cannot record TailCatcherRaw " <<
endmsg;
1974 if (
sc.isFailure( ) ) {
1975 logstr << MSG::ERROR <<
"Cannot record BPCRawCont" <<
endmsg;
1986 if (
sc.isFailure( ) ) {
1987 logstr << MSG::ERROR <<
"Cannot record ScintRawCont " <<
endmsg;
1998 if (
sc.isFailure( ) ) {
1999 logstr << MSG::ERROR <<
"Cannot record MWPCRawCont " <<
endmsg;
2013 if (
sc.isFailure( ) ) {
2014 logstr << MSG::ERROR <<
"Cannot record TDCCont " <<
endmsg;
2026 if (
sc.isFailure( ) ) {
2034 for(
int c=10;
c<14;
c++){
2039 if (
sc.isFailure( ) ) {
2045 for(
int c=10;
c<14;
c++){
2050 if (
sc.isFailure( ) ) {
2058 if (
sc.isFailure( ) ) {
◆ H8BuildObjects()
StatusCode TBByteStreamCnvTool::H8BuildObjects |
( |
int |
unrec_code | ) |
|
Build all beam detectors raw objects from m_rodBlock using H8 convention. Objects are recorded in SG if they do not correspond to unrec_code Will return faillure if : -one of the object could not be recorded in SG -the requested object (unrec_code) was not found
Definition at line 1309 of file TBByteStreamCnvTool.cxx.
1322 logstr <<
MSG::DEBUG <<
"H8BuildObject invoked for code " << unrec_code<<
endmsg;
1325 bool gotobject=
false;
1326 bool recordfailure=
false;
1328 bool goodRodBlock=
true;
1337 if (
sc!=StatusCode::SUCCESS) {
1339 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock error! Will try to fill SG with empty objects." <<
endmsg;
1343 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock too small! Will try to fill SG with empty objects." <<
endmsg;
1405 short tdc_order[4] = {2,3,0,1};
1406 for(
int i=0;
i<BPCNum;
i++){
1408 for(
int j=0;j<4;j++) BPCtdc[
i][j]=0;
1417 std::ostringstream
os;
1430 name=
"frag0x10chan";
1495 logstr << MSG::INFO <<
" DUMP : ";
1497 logstr <<
" " << S3rightadc->
getADC()<<
" " << muTagadc->
getADC() <<
" " << C1adc->
getADC();
1506 name=
"frag0x11chan";
1530 logstr << MSG::INFO <<
" DUMP : ";
1538 name=
"frag0x12chan";
1554 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc <<
", OV=" << overflow
1555 <<
", UN=" <<underthresh <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1561 if (!endofdata && !corrup) {
1566 ClockPhasetdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1570 S1tdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1574 S2downtdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1578 S3lefttdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1582 S2uptdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1586 S3righttdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1590 S0tdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1603 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1606 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x12 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1614 name=
"frag0x13chan";
1625 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc
1626 <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1628 if (!endofdata && !corrup) {
1633 const short bpc_ind =
chan / 4 ;
1635 logstr<<
MSG::DEBUG <<
"Error in 0x13 : found chan="<<
chan<<
" corresponding to bpc "<<bpc_ind<<
endmsg;
1638 const short signaltype = tdc_order[
chan % 4];
1639 if (BPCtdc[bpc_ind][signaltype]==NULL)
1640 BPCtdc[bpc_ind][signaltype] = tbtdc;
1647 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1650 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x13 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1658 name=
"frag0x14chan";
1676 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc
1677 <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1680 if (!endofdata && !corrup) {
1685 const short bpc_ind =
chan / 4 + 3;
1686 if(bpc_ind>4) { logstr<<
MSG::DEBUG <<
"Error in 0x14 : found chan="<<
chan<<
" corresponding to bpc "<<bpc_ind<<
endmsg;
continue;}
1687 const short signaltype = tdc_order[
chan % 4];
1688 if (BPCtdc[bpc_ind][signaltype]==NULL)
1689 BPCtdc[bpc_ind][signaltype] = tbtdc;
1696 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1699 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x14 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1706 logstr << MSG::INFO <<
"Found trigger word fragment" <<
endmsg;
1768 for(
int i=0;
i<BPCNum;
i++){
1769 std::vector<const TBTDCRaw*> listtdc;
1770 std::vector<const TBADCRaw*> listadc;
1771 for(
int j=0;j<4;j++){
1772 if(BPCtdc[
i][j]==0) listtdc.push_back(dummytdc);
1773 else listtdc.push_back(BPCtdc[
i][j]);
1775 listadc.push_back(dummyadc); listadc.push_back(dummyadc);
1787 if (
sc!=StatusCode::SUCCESS) {
1789 goodRodBlock =
false;
1790 logstr << MSG::ERROR <<
"Tile laser crate ROD block error! Nothing valid in SG." <<
endmsg;
1793 logstr << MSG::ERROR <<
"Tile laser crate ROD block too small! Nothing valid in SG" <<
endmsg;
1795 goodRodBlock =
false;
1828 for(
int i=0;
i<8;
i++){
1830 std::stringstream RawName;
1831 RawName <<
"frag0x1chan"<<
i;
1835 std::stringstream MuWallName;
1836 MuWallName <<
"MuWall"<<
i;
1849 for(
int i=0;
i<4;
i++){
1851 std::stringstream RawName;
1852 RawName <<
"frag0x1chan"<<(
i+8);
1856 std::stringstream MuWallName;
1857 MuWallName <<
"MuWall"<<
i+8;
1890 if (
sc.isFailure( ) ) {recordfailure=
true;
1893 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1898 if (
sc.isFailure( ) ) {recordfailure=
true;
1901 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1906 if (
sc.isFailure( ) ) {recordfailure=
true;
1909 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1913 if (
sc.isFailure( ) ) {recordfailure=
true;
1916 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1925 if (
sc.isFailure( ) ) {
1926 logstr << MSG::ERROR <<
"Cannot record TBTrigPat " <<
endmsg;
1929 sc=StatusCode::SUCCESS;
1935 if(!gotobject) {logstr<< MSG::ERROR<<
" Could not find object of type "<<unrec_code <<
endmsg;
sc=StatusCode::FAILURE;}
1936 if(recordfailure) {logstr<< MSG::ERROR<<
" One object could not be recorded "<<
endmsg;
sc=StatusCode::FAILURE;}
◆ initialize()
StatusCode TBByteStreamCnvTool::initialize |
( |
| ) |
|
|
virtual |
Definition at line 57 of file TBByteStreamCnvTool.cxx.
59 if (
sc!=StatusCode::SUCCESS)
65 sc =
detStore()->retrieve(online_id,
"LArOnlineID");
68 return StatusCode::FAILURE;
76 sc=service(
"ToolSvc",toolSvc );
78 logstr << MSG::ERROR <<
"Unable to retrieve ToolSvc" <<
endmsg;
79 return StatusCode::FAILURE;
83 sc= service(
"ByteStreamCnvSvc",
svc);
84 if (
sc!=StatusCode::SUCCESS)
85 {logstr << MSG::ERROR <<
" Can't get ByteStreamEventAccess interface " <<
endmsg;
86 return StatusCode::FAILURE;
92 logstr <<MSG::ERROR<<
" Can't cast to ByteStreamCnvSvc " <<
endmsg;
93 return StatusCode::FAILURE ;
96 sc=service(
"ROBDataProviderSvc",
svc);
97 if (
sc!=StatusCode::SUCCESS)
98 {logstr << MSG::WARNING <<
" Can't get ROBDataProviderSvc. Reading of ByteStream Data not possible " <<
endmsg;
104 {logstr <<MSG::ERROR<<
"Can't cast to ROBDataProviderSvc " <<
endmsg;
105 return StatusCode::FAILURE;
110 std::vector<std::string>::const_iterator
it =
m_keys.begin();
111 std::vector<std::string>::const_iterator it_e =
m_keys.end();
112 std::vector<std::string>
keys;
114 for(;
it!=it_e;++
it) {
115 const ListItem &
item(*
it);
116 const std::string &
t =
item.type();
117 const std::string &
nm =
item.name();
120 if(
t==
"TBTriggerPatternUnit")
keys[1]=
nm;
121 if(
t==
"TBTDCRawCont")
keys[2]=
nm;
122 if(
t==
"TBADCRawCont")
keys[3]=
nm;
123 if(
t==
"TBTailCatcherRaw")
keys[4]=
nm;
124 if(
t==
"TBBPCRawCont")
keys[5]=
nm;
125 if(
t==
"TBScintillatorRawCont")
keys[6]=
nm;
126 if(
t==
"TBMWPCRawCont")
keys[7]=
nm;
149 return StatusCode::SUCCESS;
◆ inputHandles()
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.
◆ interfaceID()
const InterfaceID & TBByteStreamCnvTool::interfaceID |
( |
| ) |
|
|
static |
Definition at line 31 of file TBByteStreamCnvTool.cxx.
33 static const InterfaceID IID_ITBByteStreamCnvTool
34 (
"TBByteStreamCnvTool", 1, 0);
35 return IID_ITBByteStreamCnvTool;
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ NextSubFrag()
bool TBByteStreamCnvTool::NextSubFrag |
( |
| ) |
|
|
inlineprivate |
◆ outputHandles()
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.
◆ ReadFragment() [1/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
int |
unrec_code | ) |
|
◆ ReadFragment() [2/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBADCRawCont *& |
adcrawCont, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [3/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBBPCRawCont *& |
bpcrawCont, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [4/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBEventInfo *& |
tbeventinfo, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [5/12]
Definition at line 404 of file TBByteStreamCnvTool.cxx.
417 logstr << MSG::ERROR <<
" Can not create a LArCalibDigitContainer with key="<<
key<<
endmsg;
418 tblarcalibdigitcont =0;
419 return StatusCode::FAILURE;
◆ ReadFragment() [6/12]
Definition at line 385 of file TBByteStreamCnvTool.cxx.
398 logstr << MSG::ERROR <<
" Can not create a LArDigitContainer with key="<<
key<<
endmsg;
400 return StatusCode::FAILURE;
◆ ReadFragment() [7/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBMWPCRawCont *& |
mwpcrawCont, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [8/12]
◆ ReadFragment() [9/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBTailCatcherRaw *& |
tailcatchraw, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [10/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBTDC *& |
tdc, |
|
|
const std::string & |
key |
|
) |
| |
This method is used only for testing
Definition at line 300 of file TBByteStreamCnvTool.cxx.
306 if (
sc!=StatusCode::SUCCESS)
310 logstr <<
"ReadRodBlock: RodBlock too small!" <<
endmsg;
311 return StatusCode::FAILURE;
318 return StatusCode::SUCCESS;
◆ ReadFragment() [11/12]
StatusCode TBByteStreamCnvTool::ReadFragment |
( |
TBTDCRawCont *& |
tdcrawCont, |
|
|
const std::string & |
key |
|
) |
| |
◆ ReadFragment() [12/12]
◆ renounce()
◆ renounceArray()
◆ secondword()
unsigned short TBByteStreamCnvTool::secondword |
( |
unsigned int |
w | ) |
|
|
inlineprivate |
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ testbit()
bool TBByteStreamCnvTool::testbit |
( |
int |
n, |
|
|
unsigned short |
w |
|
) |
| |
|
inlineprivate |
◆ updateVHKA()
◆ WriteFragment()
StatusCode TBByteStreamCnvTool::WriteFragment |
( |
| ) |
|
This creates the fragment for beam detectors calling BuildRodBlock method
Definition at line 163 of file TBByteStreamCnvTool.cxx.
173 if (
sc!=StatusCode::SUCCESS)
174 {logstr << MSG::WARNING <<
"No EventInfo object found!" <<
endmsg;
179 {logstr << MSG::WARNING <<
"LArByteStrem persistency representation for Event #"<<thisEvent->event_number()
180 <<
" already created!" <<
endmsg;
181 return StatusCode::SUCCESS;
198 if (
sc!=StatusCode::SUCCESS)
207 const bool status_place=eformat::STATUS_BACK;
211 eformat::helper::SourceIdentifier robsid(
m_subdet_id, module_id);
213 (robsid.code(),run_no,lvl1_id,bc_id,lvl1_type,detev_type,
m_theRodBlock->size(),
217 logstr <<
MSG::DEBUG <<
"Appended TestBeam fragment to ByteStream" <<
endmsg;
218 return StatusCode::SUCCESS;
◆ m_adcrawCont
◆ m_arrayofgain
◆ m_arrayofsample
std::vector<short> TBByteStreamCnvTool::m_arrayofsample[128][4] |
|
private |
◆ m_beam_moment
float TBByteStreamCnvTool::m_beam_moment |
|
private |
◆ m_beam_part
std::string TBByteStreamCnvTool::m_beam_part |
|
private |
◆ m_boards
std::vector<int> TBByteStreamCnvTool::m_boards |
|
private |
◆ m_bpcrawCont
◆ m_ByteStreamEventAccess
◆ m_calib_dac
uint16_t TBByteStreamCnvTool::m_calib_dac |
|
private |
◆ m_calib_delay
uint16_t TBByteStreamCnvTool::m_calib_delay |
|
private |
◆ m_calib_error
bool TBByteStreamCnvTool::m_calib_error |
|
private |
◆ m_calib_pattern
unsigned char TBByteStreamCnvTool::m_calib_pattern[16] |
|
private |
◆ m_CLKey
◆ m_cryoAngle
float TBByteStreamCnvTool::m_cryoAngle |
|
private |
◆ m_cryoX
float TBByteStreamCnvTool::m_cryoX |
|
private |
◆ m_detStore
◆ m_DontCheckRodSubDetID
const eformat::SubDetector TBByteStreamCnvTool::m_DontCheckRodSubDetID =(eformat::SubDetector)0xff |
|
staticprivate |
◆ m_dump
bool TBByteStreamCnvTool::m_dump |
|
private |
◆ m_ev_number
int TBByteStreamCnvTool::m_ev_number |
|
private |
◆ m_eventinfo
◆ m_evtStore
◆ m_febgain
std::vector<int> TBByteStreamCnvTool::m_febgain |
|
private |
◆ m_firstsamples
std::vector<int> TBByteStreamCnvTool::m_firstsamples |
|
private |
◆ m_force_Hchoice
bool TBByteStreamCnvTool::m_force_Hchoice |
|
private |
◆ m_gains
std::vector<int> TBByteStreamCnvTool::m_gains |
|
private |
◆ m_H6run
bool TBByteStreamCnvTool::m_H6run |
|
private |
◆ m_h8_triggword
unsigned int TBByteStreamCnvTool::m_h8_triggword |
|
private |
◆ m_H8run
bool TBByteStreamCnvTool::m_H8run |
|
private |
◆ m_isCalib
bool TBByteStreamCnvTool::m_isCalib |
|
private |
◆ m_keys
std::vector<std::string> TBByteStreamCnvTool::m_keys |
|
private |
◆ m_lastEventID
EventID TBByteStreamCnvTool::m_lastEventID |
|
private |
◆ m_mwpcrawCont
◆ m_onlineHelper
◆ m_rdpSvc
◆ m_rodBlock
std::vector<uint32_t> TBByteStreamCnvTool::m_rodBlock |
|
private |
◆ m_run_num
unsigned int TBByteStreamCnvTool::m_run_num |
|
private |
◆ m_samples
std::vector<int> TBByteStreamCnvTool::m_samples |
|
private |
◆ m_scintrawCont
◆ m_subdet_id
eformat::SubDetector TBByteStreamCnvTool::m_subdet_id |
|
private |
◆ m_subdet_key
int TBByteStreamCnvTool::m_subdet_key |
|
private |
◆ m_subfrag_firstdata
int TBByteStreamCnvTool::m_subfrag_firstdata |
|
private |
◆ m_subfrag_id
int TBByteStreamCnvTool::m_subfrag_id |
|
private |
◆ m_subfrag_size
int TBByteStreamCnvTool::m_subfrag_size |
|
private |
◆ m_summary_path
std::string TBByteStreamCnvTool::m_summary_path |
|
private |
◆ m_tableY
float TBByteStreamCnvTool::m_tableY |
|
private |
◆ m_tailcatchraw
◆ m_tblarcalibdigitcont
◆ m_tblardigitcont
◆ m_tbtdc
TBTDC* TBByteStreamCnvTool::m_tbtdc |
|
private |
◆ m_tdcrawCont
◆ m_theROB
◆ m_theRodBlock
std::vector<uint32_t>* TBByteStreamCnvTool::m_theRodBlock |
|
private |
◆ m_trigpat
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
struct TBPatternUnitContext S1
raw data class for BPC measurement
void addNwires(int nwire)
struct TBPatternUnitContext Veto
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
struct TBPatternUnitContext S3
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
virtual RawEventWrite * getRawEvent() override
Implementation of IByteStreamEventAccess: Get RawEvent.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual void setOwner(IDataHandleHolder *o)=0
virtual void setOverflow()
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Interface class for managing ROB for both online and offline.
Liquid Argon Calibration Digit Container
const DataType * PointerType
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Gaudi Conversion Service class for ByteStream Persistency.
virtual void setDetectorName(const std::string &tbBeamDetectorName)
msgSvc
Provide convenience handles for various services.
Liquid Argon digit base class.
::StatusCode StatusCode
StatusCode definition for legacy code.
EventID * event_ID()
the unique identification of the event.
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
AthROOTErrorHandlerSvc * svc
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void setTriggerWord(unsigned int word)
virtual const RawEvent * getEvent()=0
Retrieve the whole event.
Base class for LArDigits taken during calibration runs.
This class provides general information about an event. Event information is provided by the accessor...
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
void addCwireno(int cwire)
eformat::write::ROBFragment ROBFragment
const boost::regex re(r_e)
struct TBPatternUnitContext S2
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
signal_type getADC() const
void setXchambers(bool isX)
size_type size() const noexcept
Returns the number of elements in the collection.
void setSignals(const TBTDCRawCont *tdcCont, TBTDCRaw *tbtdc, const TBADCRawCont *adcCont, TBADCRaw *tbadc)
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
void setSignals(const TBTDCRawCont *theTDCCont, const std::vector< const TBTDCRaw * > &theTDCs, const TBADCRawCont *theADCCont, const std::vector< const TBADCRaw * > &theADCs)