|
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 191 of file TBByteStreamCnvTool.cxx.
201 const TBTDC* tbtdc =
nullptr;
202 std::string tbtdc_Key(
"TBTDC");
204 if (
sc!=StatusCode::SUCCESS)
205 {logstr << MSG::ERROR <<
"Can't retrieve TBTDC with key "<< tbtdc_Key <<
" from StoreGate" <<
endmsg;
209 theRodBlock->push_back(4);
210 theRodBlock->push_back(0x03);
211 theRodBlock->push_back(tbtdc->
tdc());
212 theRodBlock->push_back(tbtdc->
tdcmin());
250 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);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ 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.
338 return PBASE::declareProperty(
name, property,
doc);
◆ 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 395 of file TBByteStreamCnvTool.cxx.
401 {logstr << MSG::ERROR <<
"ROBDataProviderSvc not loaded. Can't read ByteStream" <<
endmsg;
402 return StatusCode::FAILURE;
409 return StatusCode::FAILURE;
412 const size_t MAX_ROBFRAGMENTS = 2048*1024;
414 size_t robcount =
re->children(robF,MAX_ROBFRAGMENTS);
416 if (robcount == MAX_ROBFRAGMENTS)
419 return StatusCode::FAILURE;
422 for (
size_t irob=0; irob<robcount; ++irob)
428 MSG::hex(logstr) <<
MSG::DEBUG <<
"Frag Size : " << rob.fragment_size_word() <<
endmsg;
429 MSG::hex(logstr) <<
MSG::DEBUG <<
"Header Size: " << rob.header_size_word() <<
endmsg;
430 MSG::hex(logstr) <<
MSG::DEBUG <<
"Source ID : " << rob.source_id() <<
endmsg;
438 logstr << MSG::ERROR <<
"Got invalid ROB fragment!" <<
endmsg;
439 return StatusCode::FAILURE;
443 MSG::hex(logstr) <<
MSG::DEBUG <<
"Frag Size : " << rob.rod_fragment_size_word() <<
endmsg;
444 MSG::hex(logstr) <<
MSG::DEBUG <<
"Header Size: " << rob.rod_header_size_word() <<
endmsg;
445 MSG::hex(logstr) <<
MSG::DEBUG <<
"Source ID : " << rob.rod_source_id() <<
endmsg;
446 MSG::hex(logstr) <<
MSG::DEBUG <<
"Run num : " << rob.rod_run_no() <<
endmsg;
447 MSG::hex(logstr) <<
MSG::DEBUG <<
"Version : " << rob.rod_version() <<
endmsg;
449 eformat::helper::SourceIdentifier rod_sid(rob.rod_source_id());
452 MSG::hex(logstr) <<
MSG::DEBUG <<
"Found requested ROD (id="
453 << rod_sid.subdetector_id() <<
")" <<
endmsg;
457 logstr<< MSG::INFO <<
"Guessing from ROD header -> " ;
458 if (rob.rod_detev_type()&1)
460 logstr<<
" H6 !" <<
endmsg;
466 logstr<<
" H8 !" <<
endmsg;
477 rob.rod_data(rodPointer);
479 for(
size_t i=0;
i<rob.rod_ndata(); ++
i)
487 logstr <<
MSG::FATAL <<
"Error reading bytestream event: "
488 <<
"Empty ROD block" <<
endmsg;
489 return StatusCode::FAILURE;
491 logstr <<
MSG::DEBUG <<
"Got Rod Block for Test Beam Instrumentation data from ByteStream" <<
endmsg;
492 return StatusCode::SUCCESS;
496 MSG::hex(logstr) << MSG::WARNING <<
" Didn't find SubDet ID for Beam Instruments. Should be "<< subdet_id<<
endmsg;
497 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 502 of file TBByteStreamCnvTool.cxx.
516 const EventContext& ctx = Gaudi::Hive::currentContext();
523 std::ostringstream
os;
527 if (
sc!=StatusCode::SUCCESS)
531 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock too small!" <<
endmsg;
532 return StatusCode::FAILURE;
547 std::string
name1,name2;
596 short m_feedthrough[8] = {0,0,0,0,1,1,1,1};
597 int m_sampleOrder[32] = {
598 0,1,2,3,4,5,6,7,8,9,10,
599 11,12,13,14,15,16,17,18,19,20,
600 21,22,23,24,25,26,27,28,29,30,
602 int m_sort[64] = { 55, 39, 23, 7, 119, 103, 87, 71,
603 54, 38, 22, 6, 118, 102, 86, 70,
604 53, 37, 21, 5, 117, 101, 85, 69,
605 52, 36, 20, 4, 116, 100, 84, 68,
606 51, 35, 19, 3, 115, 99, 83, 67,
607 50, 34, 18, 2, 114, 98, 82, 66,
608 49, 33, 17, 1, 113, 97, 81, 65,
609 48, 32, 16, 0, 112, 96, 80, 64
613 constexpr
short m_slot[8]={5,7,9,11,3,4,5,6};
615 constexpr
int NWREC = 8;
617 for(
unsigned int nfeb=0;nfeb<
m_boards.size();nfeb++){
636 if((m_sampleOrder[0]=
m_febgain[nfeb])!=0){
637 for(
int j=0;j<
m_febgain[nfeb];j++) {m_sampleOrder[j+1]=j;}
640 samp=m_sampleOrder[
s];
643 for(
int i= 0 ;
i<64;
i++){
647 unsigned short gain1 = ((tmp1>>12)&3) - 1;
651 unsigned short gain2 = ((
tmp2>>12)&3) - 1;
678 for(
int i=0;
i<128;
i++) {
688 const std::vector<HWIdentifier>& calibChannelIDs=calibLine->calibSlotLine(hwid);
689 if (calibChannelIDs.size() != 0) {
719 name1=
"word1frag0x03chan";
720 name2=
"word2frag0x03chan";
724 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x03) has not expected size" <<
endmsg;
725 sc=StatusCode::FAILURE;
734 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
744 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
754 if(
m_dump) logstr << MSG::INFO <<
" sub frag 0x03 : word1="<<tmp1<<
" word2="<<
tmp2 <<
endmsg;
765 name1=
"word1frag0x06chan";
766 name2=
"word2frag0x06chan";
767 std::string tcname=
"tc";
768 std::vector<TBScintillatorRaw *> theScints;
770 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x04) has not expected size" <<
endmsg;
771 sc=StatusCode::FAILURE;
775 for(
unsigned int i=0;
i<24;
i++){
798 os << tcname << 2*
i+1;
800 theScints.push_back(
s1);
801 theScints.push_back(
s2);
811 name1=
"word1frag0x05chan";
812 name2=
"word2frag0x05chan";
815 logstr <<
MSG::DEBUG <<
"H6BuildObject : number of BPCRaw "<< bpcnum <<
endmsg;
817 for(
int i=0;
i<bpcnum;
i++){
818 std::string bpcname =
"BPC";
822 std::vector<const TBTDCRaw*> theTDCs;
823 std::vector<const TBADCRaw*> theADCs;
826 unsigned int tmp1,
tmp2;
833 os << name2 << (
i*3);
842 os << name2 << (
i*3+1);
850 MSG::hex(logstr) <<
MSG::DEBUG << bpcname<<
" "<< tmp1;
851 MSG::hex(logstr) <<
" "<<
tmp2<<
" ";
859 os << name2 << (
i*3+2);
864 MSG::hex(logstr) <<
MSG::DEBUG << bpcname<<
" "<< tmp1;
868 theTDCs.push_back(tbtdcL);
869 theTDCs.push_back(tbtdcR);
870 theTDCs.push_back(tbtdcU);
871 theTDCs.push_back(tbtdcD);
872 theADCs.push_back(tbadcH);
873 theADCs.push_back(tbadcV);
884 name1=
"word1frag0x06chan";
885 name2=
"word2frag0x06chan";
887 logstr<<MSG::ERROR<<
"Beam counter subfrag (0x06) has not expected size" <<
endmsg;
888 sc=StatusCode::FAILURE;
902 logstr <<
MSG::DEBUG <<
" building muon counters:";
903 for(
int i=0;
i<8;
i++) {
904 std::string scintname=
"muon";
906 os << scintname << (
i+1);
942 for(
int i=0;
i<4;
i++) {
949 os << name2 << (0+3+
i);
954 if(
testbit(10,word2)) adc2->setOverflow();
1001 for(
int i=0;
i<8;
i++) {
1005 logstr <<
MSG::DEBUG <<
" Should I record TBScintillatorRawCont with key " <<
m_keys[6] <<
" ? " <<
endmsg;
1014 logstr <<
MSG::DEBUG <<
" Found MWPC subfragment. Nword= "<<nword <<
endmsg;
1016 std::string mwpcnames[8]= {
"X2",
"Y2",
"X3",
"Y3",
"X4",
"Y4",
"X5",
"Y5"};
1017 bool isX[9]={
true,
false,
true,
false,
true,
false,
true,
false};
1019 for(
int i=0;
i<8;
i++){
1068 w = (
int) (word2>>12);
c = (
int) ((0xfff & word2) -
w/2 + !(
w&1));
1083 for(
int i=0;
i<8;
i++){
1098 logstr << MSG::ERROR <<
"bad number of lines. nwords=" << nword <<
endmsg;
1101 int nline= nword / 16;
1103 for(
int i=0;
i<nline;
i++){
1105 std::string sline=
"";
1106 std::string skey=
"";
1107 for(
int j=0;j<63;j++) {
1108 if(strw[
i*64+j]==0)
break;
1109 sline+=strw[
i*64+j];
1112 std::istringstream iss (sline);
1114 if(skey==
"RunNumber") {
1118 if(skey==
"BeamMomentum") {
1122 if(skey==
"BeamParticle") {
1130 if(skey==
"CryoAngle") {
1134 if(skey==
"TableY") {
1138 if(skey==
"miniROD") {
1143 while(iss.good()) {iss>>board;
m_boards.push_back(board);}
1148 if(skey==
"FebSamples") {
1158 if(skey==
"FebGains") {
1170 if(skey==
"FebAuto") {
1180 if(skey==
"FebFirstSample") {
1185 while(iss.good()) {iss>>firstsample;
m_firstsamples.push_back(firstsample);}
1217 logstr <<
MSG::DEBUG <<
" Found Calib_ID subfragment. Nword= "<<nword <<
endmsg;
1219 logstr<<MSG::ERROR<<
"Calibration subfrag (0xff) has not expected size" <<
endmsg;
1220 sc=StatusCode::FAILURE;
1226 for(
int i=0;
i<4;
i++){
1238 for(
int byte=0;
byte<16;
byte++) {
1239 logstr <<
MSG::DEBUG <<
" byte " <<
byte <<
" : " ;
1240 for(
int bit=0; bit<8; bit++) {
◆ H6RecordObjects()
StatusCode TBByteStreamCnvTool::H6RecordObjects |
( |
int |
unrec_code | ) |
|
Definition at line 1912 of file TBByteStreamCnvTool.cxx.
1917 logstr <<
MSG::DEBUG <<
"About to try recording. unrec_code = " << unrec_code <<
endmsg;
1920 logstr <<
MSG::DEBUG <<
" WARNING! Did not find TailCatcher. Returning an empty one : this may crash every attempt to use it" <<
endmsg;
1927 if (
sc.isFailure( ) ) {
1928 logstr << MSG::ERROR <<
"Cannot record TBTrigPat " <<
endmsg;
1935 if (
sc.isFailure( ) ) {
1936 logstr << MSG::ERROR <<
"Cannot record TailCatcherRaw " <<
endmsg;
1944 if (
sc.isFailure( ) ) {
1945 logstr << MSG::ERROR <<
"Cannot record BPCRawCont" <<
endmsg;
1956 if (
sc.isFailure( ) ) {
1957 logstr << MSG::ERROR <<
"Cannot record ScintRawCont " <<
endmsg;
1968 if (
sc.isFailure( ) ) {
1969 logstr << MSG::ERROR <<
"Cannot record MWPCRawCont " <<
endmsg;
1983 if (
sc.isFailure( ) ) {
1984 logstr << MSG::ERROR <<
"Cannot record TDCCont " <<
endmsg;
1996 if (
sc.isFailure( ) ) {
2004 for(
int c=10;
c<14;
c++){
2009 if (
sc.isFailure( ) ) {
2015 for(
int c=10;
c<14;
c++){
2020 if (
sc.isFailure( ) ) {
2028 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 1279 of file TBByteStreamCnvTool.cxx.
1292 logstr <<
MSG::DEBUG <<
"H8BuildObject invoked for code " << unrec_code<<
endmsg;
1295 bool gotobject=
false;
1296 bool recordfailure=
false;
1298 bool goodRodBlock=
true;
1307 if (
sc!=StatusCode::SUCCESS) {
1309 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock error! Will try to fill SG with empty objects." <<
endmsg;
1313 logstr << MSG::ERROR <<
"ReadRodBlock: RodBlock too small! Will try to fill SG with empty objects." <<
endmsg;
1375 short tdc_order[4] = {2,3,0,1};
1376 for(
int i=0;
i<BPCNum;
i++){
1378 for(
int j=0;j<4;j++) BPCtdc[
i][j]=0;
1387 std::ostringstream
os;
1400 name=
"frag0x10chan";
1465 logstr << MSG::INFO <<
" DUMP : ";
1467 logstr <<
" " << S3rightadc->
getADC()<<
" " << muTagadc->
getADC() <<
" " << C1adc->
getADC();
1476 name=
"frag0x11chan";
1500 logstr << MSG::INFO <<
" DUMP : ";
1508 name=
"frag0x12chan";
1524 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc <<
", OV=" << overflow
1525 <<
", UN=" <<underthresh <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1531 if (!endofdata && !corrup) {
1536 ClockPhasetdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1540 S1tdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1544 S2downtdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1548 S3lefttdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1552 S2uptdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1556 S3righttdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1560 S0tdc =
new TBTDCRaw(
os.str(),overflow,tdc,underthresh);
1573 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1576 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x12 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1584 name=
"frag0x13chan";
1595 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc
1596 <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1598 if (!endofdata && !corrup) {
1603 const short bpc_ind =
chan / 4 ;
1605 logstr<<
MSG::DEBUG <<
"Error in 0x13 : found chan="<<
chan<<
" corresponding to bpc "<<bpc_ind<<
endmsg;
1608 const short signaltype = tdc_order[
chan % 4];
1609 if (BPCtdc[bpc_ind][signaltype]==NULL)
1610 BPCtdc[bpc_ind][signaltype] = tbtdc;
1617 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1620 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x13 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1628 name=
"frag0x14chan";
1646 logstr <<
MSG::DEBUG << MSG::dec <<
"Pos=" <<
pos <<
" Chan "<<
chan <<
"=" << tdc
1647 <<
" EOD="<< endofdata <<
", corrupt=" << corrup
1650 if (!endofdata && !corrup) {
1655 const short bpc_ind =
chan / 4 + 3;
1656 if(bpc_ind>4) { logstr<<
MSG::DEBUG <<
"Error in 0x14 : found chan="<<
chan<<
" corresponding to bpc "<<bpc_ind<<
endmsg;
continue;}
1657 const short signaltype = tdc_order[
chan % 4];
1658 if (BPCtdc[bpc_ind][signaltype]==NULL)
1659 BPCtdc[bpc_ind][signaltype] = tbtdc;
1666 logstr << MSG::ERROR <<
" Unexpected end-of-data word found at pos " <<
pos <<
endmsg;
1669 logstr<< MSG::ERROR <<
"Corrupted data in SubFragment 0x14 pos=" <<
pos <<
"channel=" <<
chan <<
" [0x" <<
1676 logstr << MSG::INFO <<
"Found trigger word fragment" <<
endmsg;
1738 for(
int i=0;
i<BPCNum;
i++){
1739 std::vector<const TBTDCRaw*> listtdc;
1740 std::vector<const TBADCRaw*> listadc;
1741 for(
int j=0;j<4;j++){
1742 if(BPCtdc[
i][j]==0) listtdc.push_back(dummytdc);
1743 else listtdc.push_back(BPCtdc[
i][j]);
1745 listadc.push_back(dummyadc); listadc.push_back(dummyadc);
1757 if (
sc!=StatusCode::SUCCESS) {
1759 goodRodBlock =
false;
1760 logstr << MSG::ERROR <<
"Tile laser crate ROD block error! Nothing valid in SG." <<
endmsg;
1763 logstr << MSG::ERROR <<
"Tile laser crate ROD block too small! Nothing valid in SG" <<
endmsg;
1765 goodRodBlock =
false;
1798 for(
int i=0;
i<8;
i++){
1800 std::stringstream RawName;
1801 RawName <<
"frag0x1chan"<<
i;
1805 std::stringstream MuWallName;
1806 MuWallName <<
"MuWall"<<
i;
1819 for(
int i=0;
i<4;
i++){
1821 std::stringstream RawName;
1822 RawName <<
"frag0x1chan"<<(
i+8);
1826 std::stringstream MuWallName;
1827 MuWallName <<
"MuWall"<<
i+8;
1860 if (
sc.isFailure( ) ) {recordfailure=
true;
1863 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1868 if (
sc.isFailure( ) ) {recordfailure=
true;
1871 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1876 if (
sc.isFailure( ) ) {recordfailure=
true;
1879 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1883 if (
sc.isFailure( ) ) {recordfailure=
true;
1886 }
else {
sc=StatusCode::SUCCESS; gotobject=
true;}
1895 if (
sc.isFailure( ) ) {
1896 logstr << MSG::ERROR <<
"Cannot record TBTrigPat " <<
endmsg;
1899 sc=StatusCode::SUCCESS;
1905 if(!gotobject) {logstr<< MSG::ERROR<<
" Could not find object of type "<<unrec_code <<
endmsg;
sc=StatusCode::FAILURE;}
1906 if(recordfailure) {logstr<< MSG::ERROR<<
" One object could not be recorded "<<
endmsg;
sc=StatusCode::FAILURE;}
◆ initialize()
StatusCode TBByteStreamCnvTool::initialize |
( |
| ) |
|
|
virtual |
Definition at line 59 of file TBByteStreamCnvTool.cxx.
61 if (
sc!=StatusCode::SUCCESS)
67 sc =
detStore()->retrieve(online_id,
"LArOnlineID");
70 return StatusCode::FAILURE;
80 std::vector<std::string>::const_iterator
it =
m_keys.begin();
81 std::vector<std::string>::const_iterator it_e =
m_keys.end();
82 std::vector<std::string>
keys;
84 for(;
it!=it_e;++
it) {
85 const Gaudi::Utils::TypeNameString &
item(*
it);
86 const std::string &
t =
item.type();
87 const std::string &
nm =
item.name();
90 if(
t==
"TBTriggerPatternUnit")
keys[1]=
nm;
91 if(
t==
"TBTDCRawCont")
keys[2]=
nm;
92 if(
t==
"TBADCRawCont")
keys[3]=
nm;
93 if(
t==
"TBTailCatcherRaw")
keys[4]=
nm;
94 if(
t==
"TBBPCRawCont")
keys[5]=
nm;
95 if(
t==
"TBScintillatorRawCont")
keys[6]=
nm;
96 if(
t==
"TBMWPCRawCont")
keys[7]=
nm;
119 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 30 of file TBByteStreamCnvTool.cxx.
32 static const InterfaceID IID_ITBByteStreamCnvTool
33 (
"TBByteStreamCnvTool", 1, 0);
34 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 374 of file TBByteStreamCnvTool.cxx.
387 logstr << MSG::ERROR <<
" Can not create a LArCalibDigitContainer with key="<<
key<<
endmsg;
388 tblarcalibdigitcont =0;
389 return StatusCode::FAILURE;
◆ ReadFragment() [6/12]
Definition at line 355 of file TBByteStreamCnvTool.cxx.
368 logstr << MSG::ERROR <<
" Can not create a LArDigitContainer with key="<<
key<<
endmsg;
370 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 270 of file TBByteStreamCnvTool.cxx.
276 if (
sc!=StatusCode::SUCCESS)
280 logstr <<
"ReadRodBlock: RodBlock too small!" <<
endmsg;
281 return StatusCode::FAILURE;
288 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 133 of file TBByteStreamCnvTool.cxx.
143 if (
sc!=StatusCode::SUCCESS)
144 {logstr << MSG::WARNING <<
"No EventInfo object found!" <<
endmsg;
149 {logstr << MSG::WARNING <<
"LArByteStrem persistency representation for Event #"<<thisEvent->event_number()
150 <<
" already created!" <<
endmsg;
151 return StatusCode::SUCCESS;
168 if (
sc!=StatusCode::SUCCESS)
177 const bool status_place=eformat::STATUS_BACK;
181 eformat::helper::SourceIdentifier robsid(
m_subdet_id, module_id);
183 (robsid.code(),run_no,lvl1_id,bc_id,lvl1_type,detev_type,
m_theRodBlock->size(),
187 logstr <<
MSG::DEBUG <<
"Appended TestBeam fragment to ByteStream" <<
endmsg;
188 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
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.
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.
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)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
void setTriggerWord(unsigned int word)
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)