QwAnalysis
QwF1TDContainer Class Reference

F1TDCs configuration and reference siganls container. More...

#include <QwF1TDContainer.h>

Inherits TObject.

+ Collaboration diagram for QwF1TDContainer:

Public Member Functions

 QwF1TDContainer ()
 
virtual ~QwF1TDContainer ()
 
void SetSystemName (const TString name)
 
const TString GetSystemName () const
 
void AddQwF1TDC (QwF1TDC *in)
 
void Print (const Option_t *options=0) const
 
Int_t GetSize () const
 
Int_t Size () const
 
Int_t HowManyF1TDCs () const
 
EQwDetectorType GetDetectorType () const
 
EQwRegionID GetRegion () const
 
QwF1TDCGetF1TDC (Int_t roc, Int_t slot)
 
QwF1TDCGetF1TDCwithIndex (Int_t tdc_index)
 
QwF1TDCGetF1TDCwithBankIndexSLOT (Int_t bank_index, Int_t slot)
 
Double_t GetF1TDCOneResolution () const
 
Double_t DoneF1TDCsConfiguration ()
 
Double_t ReturnTimeCalibration (Double_t time_arb_unit)
 
Int_t GetF1TDCChannelNumber ()
 Double_t GetF1TDCResolution();. More...
 
const TH2F * GetF1TDCErrorHist ()
 
void AddSYN (Int_t roc, Int_t slot, Int_t channel)
 
void AddEMM (Int_t roc, Int_t slot, Int_t channel)
 
void AddSEU (Int_t roc, Int_t slot, Int_t channel)
 
void AddTFO (Int_t roc, Int_t slot, Int_t channel)
 
void AddRLF (Int_t roc, Int_t slot, Int_t channel)
 
void AddHFO (Int_t roc, Int_t slot, Int_t channel)
 
void AddOFO (Int_t roc, Int_t slot, Int_t channel)
 
void AddFDF (Int_t roc, Int_t slot, Int_t channel)
 
void AddS30 (Int_t roc, Int_t slot, Int_t channel)
 
Bool_t CheckDataIntegrity (const UInt_t roc_id, UInt_t *buffer, UInt_t num_words)
 
const MQwF1TDC GetF1TDCDecoder () const
 
Double_t ReferenceSignalCorrection (Double_t raw_time, Double_t ref_time, Int_t bank_index, Int_t slot)
 
void PrintErrorSummary ()
 
void WriteErrorSummary (Bool_t hist_flag=true)
 

Data Fields

Int_t fNQwF1TDCs
 
TObjArray * fQwF1TDCList
 
EQwDetectorType fDetectorType
 
EQwRegionID fRegion
 
TString fSystemName
 
TH2F * fError2DHist
 

Private Member Functions

Double_t GetF1TDCsResolution ()
 
TList * GetErrorSummary ()
 
TString PrintNoF1TDC (Int_t roc, Int_t slot)
 
TString PrintNoF1TDC (Int_t tdc_index)
 
Bool_t CheckRegisteredF1 (Int_t roc, Int_t slot)
 
Double_t GetF1TDCTriggerRollover ()
 
void SetErrorHistOptions ()
 
Bool_t CheckSlot20Chan30 (Int_t slot, Int_t chan)
 
 ClassDef (QwF1TDContainer, 1)
 

Private Attributes

MQwF1TDC fF1TDCDecoder
 
Bool_t fLocalF1RawDecodeDebug
 
Bool_t fLocalF1DecodeDebug
 
Bool_t fLocalDebug
 
Bool_t fLocalF1ErrorDebug
 
Double_t fF1TDCOneResolutionNS
 
Double_t fF1TDCTriggerRollover
 

Detailed Description

F1TDCs configuration and reference siganls container.

This would be used to be a configuration and reference signal(s) container for F1TDCs which are used in one subsystem. The subsystem has one QwF1TDContaier that have DetectorType, Region, and QwF1TDC(s)

Definition at line 266 of file QwF1TDContainer.h.

Constructor & Destructor Documentation

QwF1TDContainer::QwF1TDContainer ( )

Definition at line 770 of file QwF1TDContainer.cc.

References fDetectorType, fError2DHist, fLocalDebug, fLocalF1DecodeDebug, fLocalF1ErrorDebug, fLocalF1RawDecodeDebug, fNQwF1TDCs, fQwF1TDCList, fRegion, kRegionIDNull, and kTypeNull.

771 {
772  fQwF1TDCList = new TObjArray();
773 
774  fQwF1TDCList -> Clear();
775  fQwF1TDCList -> SetOwner(kTRUE);
776 
777  fError2DHist = new TH2F;
778  fError2DHist -> SetBins(3,0,3,2,0,2);
779 
780  // kCanRebin removed in ROOT 6
781  // Ref: https://root.cern.ch/content/main-histogram-changes-root-6
782 #if ROOT_VERSION_CODE < ROOT_VERSION(5,90,0)
783  fError2DHist -> SetBit(TH1::kCanRebin);
784 #else
785  fError2DHist -> SetCanExtend(TH1::kAllAxes);
786 #endif
787  fError2DHist -> SetStats(0);
788 
789  fNQwF1TDCs = 0;
792 
793 
794  fLocalF1RawDecodeDebug = false; // Before checking "subsystem"
795  fLocalF1DecodeDebug = false; // After cheking "subsystem"
796  //level 0
797 
798  fLocalDebug = false; // level 1 // not well defined...
799  fLocalF1ErrorDebug = false; // Error logs
800 
801 }
EQwRegionID fRegion
Bool_t fLocalF1RawDecodeDebug
Bool_t fLocalF1DecodeDebug
TObjArray * fQwF1TDCList
EQwDetectorType fDetectorType
QwF1TDContainer::~QwF1TDContainer ( )
virtual

Definition at line 804 of file QwF1TDContainer.cc.

References fError2DHist, and fQwF1TDCList.

805 {
806  if(fQwF1TDCList) delete fQwF1TDCList; fQwF1TDCList = NULL;
807  if(fError2DHist) delete fError2DHist; fError2DHist = NULL;
808 }
TObjArray * fQwF1TDCList

Member Function Documentation

void QwF1TDContainer::AddEMM ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 932 of file QwF1TDContainer.cc.

References QwF1TDC::AddEMM(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

933 {
934  QwF1TDC* F1 = NULL;
935  F1 = this->GetF1TDC(roc, slot);
936 
937  if(F1) {
938  F1->AddEMM(channel);
940  }
941  else {
942  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddEMM : " << PrintNoF1TDC(roc,slot) << std::endl;
943  }
944  return;
945 }
void AddEMM(Int_t channel)
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddFDF ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 1033 of file QwF1TDContainer.cc.

References QwF1TDC::AddFDF(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

1034 {
1035  QwF1TDC* F1 = NULL;
1036  F1 = this->GetF1TDC(roc, slot);
1037 
1038  if(F1) {
1039  F1->AddFDF(channel);
1041  }
1042  else {
1043  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddFDF : " << PrintNoF1TDC(roc,slot) << std::endl;
1044  }
1045  return;
1046 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddFDF(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddHFO ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 1000 of file QwF1TDContainer.cc.

References QwF1TDC::AddHFO(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

1001 {
1002  QwF1TDC* F1 = NULL;
1003  F1 = this->GetF1TDC(roc, slot);
1004 
1005  if(F1) {
1006  F1->AddHFO(channel);
1008  }
1009  else {
1010  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddHFO : " << PrintNoF1TDC(roc,slot) << std::endl;
1011  }
1012  return;
1013 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddHFO(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddOFO ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 1016 of file QwF1TDContainer.cc.

References QwF1TDC::AddOFO(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

1017 {
1018  QwF1TDC* F1 = NULL;
1019  F1 = this->GetF1TDC(roc, slot);
1020 
1021  if(F1) {
1022  F1->AddOFO(channel);
1024  }
1025  else {
1026  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddOFO : " << PrintNoF1TDC(roc,slot) << std::endl;
1027  }
1028  return;
1029 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddOFO(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddQwF1TDC ( QwF1TDC in)

Definition at line 813 of file QwF1TDContainer.cc.

References fLocalDebug, fNQwF1TDCs, and fQwF1TDCList.

Referenced by QwTriggerScintillator::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessConfigurationBuffer(), QwMainDetector::ProcessConfigurationBuffer(), QwDriftChamber::ProcessConfigurationBuffer(), and QwScanner::ProcessConfigurationBuffer().

814 {
815  Int_t pos = 0;
816 
817  pos = fQwF1TDCList -> AddAtFree(in);
818  if(fLocalDebug) {
819  printf("AddQwF1TDC at pos %d\n", pos);
820  }
821 
822  fNQwF1TDCs++;
823  return;
824 }
TObjArray * fQwF1TDCList

+ Here is the caller graph for this function:

void QwF1TDContainer::AddRLF ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 983 of file QwF1TDContainer.cc.

References QwF1TDC::AddRLF(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

984 {
985  QwF1TDC* F1 = NULL;
986  F1 = this->GetF1TDC(roc, slot);
987 
988  if(F1) {
989  F1->AddRLF(channel);
991  }
992  else {
993  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddRLF : " << PrintNoF1TDC(roc,slot) << std::endl;
994  }
995  return;
996 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddRLF(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddS30 ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 1051 of file QwF1TDContainer.cc.

References QwF1TDC::AddS30(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

1052 {
1053  QwF1TDC* F1 = NULL;
1054  F1 = this->GetF1TDC(roc, slot);
1055  if(F1) {
1056  F1->AddS30(channel);
1058  }
1059  else {
1060  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddS30 : " << PrintNoF1TDC(roc,slot) << std::endl;
1061  }
1062  return;
1063 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void AddS30(Int_t channel)
void PrintChannelErrorCounter(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

void QwF1TDContainer::AddSEU ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 949 of file QwF1TDContainer.cc.

References QwF1TDC::AddSEU(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

950 {
951  QwF1TDC* F1 = NULL;
952  F1 = this->GetF1TDC(roc, slot);
953 
954  if(F1) {
955  F1->AddSEU(channel);
957  }
958  else {
959  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddSEU : " << PrintNoF1TDC(roc,slot) << std::endl;
960  }
961  return;
962 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddSEU(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddSYN ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 916 of file QwF1TDContainer.cc.

References QwF1TDC::AddSYN(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

917 {
918  QwF1TDC* F1 = NULL;
919  F1 = this->GetF1TDC(roc, slot);
920 
921  if(F1) {
922  F1->AddSYN(channel);
924  }
925  else {
926  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddSYN : " << PrintNoF1TDC(roc,slot) << std::endl;
927  }
928  return;
929 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void AddSYN(Int_t channel)
void PrintChannelErrorCounter(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::AddTFO ( Int_t  roc,
Int_t  slot,
Int_t  channel 
)

Definition at line 966 of file QwF1TDContainer.cc.

References QwF1TDC::AddTFO(), fLocalF1ErrorDebug, GetF1TDC(), QwF1TDC::PrintChannelErrorCounter(), and PrintNoF1TDC().

Referenced by CheckDataIntegrity().

967 {
968  QwF1TDC* F1 = NULL;
969  F1 = this->GetF1TDC(roc, slot);
970 
971  if(F1) {
972  F1->AddTFO(channel);
974  }
975  else {
976  if(fLocalF1ErrorDebug) std::cout << "QwF1TDContainer::AddTFO : " << PrintNoF1TDC(roc,slot) << std::endl;
977  }
978  return;
979 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder
void PrintChannelErrorCounter(Int_t channel)
void AddTFO(Int_t channel)
TString PrintNoF1TDC(Int_t roc, Int_t slot)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t QwF1TDContainer::CheckDataIntegrity ( const UInt_t  roc_id,
UInt_t *  buffer,
UInt_t  num_words 
)

Definition at line 1405 of file QwF1TDContainer.cc.

References AddEMM(), AddFDF(), AddHFO(), AddOFO(), AddRLF(), AddSEU(), AddSYN(), AddTFO(), CheckRegisteredF1(), CheckSlot20Chan30(), MQwF1TDC::DecodeTDCWord(), QwLog::endl(), fError2DHist, fF1TDCDecoder, fLocalDebug, fLocalF1DecodeDebug, fLocalF1RawDecodeDebug, GetF1TDCTriggerRollover(), GetSystemName(), MQwF1TDC::GetTDCChannelAddress(), MQwF1TDC::GetTDCChannelNumber(), MQwF1TDC::GetTDCChipAddress(), MQwF1TDC::GetTDCEventNumber(), MQwF1TDC::GetTDCHeaderEventNumber(), MQwF1TDC::GetTDCHeaderTriggerTime(), MQwF1TDC::GetTDCSlotNumber(), MQwF1TDC::GetTDCTriggerTime(), MQwF1TDC::IsFakeData(), MQwF1TDC::IsHeaderword(), MQwF1TDC::IsHeaderXorSetup(), MQwF1TDC::IsHitFIFOOverFlow(), MQwF1TDC::IsNotHeaderTrigFIFO(), MQwF1TDC::IsOutputFIFOOverFlow(), MQwF1TDC::IsResolutionLock(), MQwF1TDC::IsValidDataSlot(), and QwMessage.

Referenced by QwSciFiDetector::ProcessEvBuffer(), QwTriggerScintillator::ProcessEvBuffer(), QwDriftChamber::ProcessEvBuffer(), QwMainDetector::ProcessEvBuffer(), and QwScanner::ProcessEvBuffer().

1406 {
1407 
1408 
1409 
1410  // three counter flags
1411  Bool_t hit_fifo_overflow_flag = kFALSE;
1412  Bool_t output_fifo_overflow_flag = kFALSE;
1413  Bool_t chip_resolution_lock_flag = kTRUE;
1414 
1415  // real DataIntegrity Check
1416  Bool_t event_ok_flag = kFALSE;
1417  Bool_t trig_time_ok_flag = kFALSE;
1418  Bool_t trig_fifo_ok_flag = kFALSE;
1419 
1420  // data integrity flags
1421  Bool_t data_integrity_flag = kFALSE;
1422  Bool_t data_integrity_unlock_flag = kTRUE; // unlock first
1423 
1424 
1425  // SEU
1426  Bool_t xor_setup_flag = kFALSE;
1427  Bool_t fake_data_flag = kFALSE;
1428 
1429 
1430  UInt_t slot_number = 0;
1431  UInt_t channel_number = 0;
1432  UInt_t chip_address = 0;
1433  UInt_t channel_address = 0;
1434 
1435  UInt_t reference_trig_time = 0;
1436  UInt_t reference_event_num = 0;
1437 
1438 
1439  Double_t trigger_rollover = 0.0;
1440  Int_t rounded_trigger_rollover = 0;
1441  Int_t diff_trigger_time = 0;
1442 
1443  trigger_rollover = GetF1TDCTriggerRollover();
1444  rounded_trigger_rollover = (Int_t) trigger_rollover;
1445 
1446  // fLocalDebug = true;
1447  if(fLocalDebug) printf("roc_id %d trigger rollover %f, %d\n", roc_id, trigger_rollover, rounded_trigger_rollover);
1448 
1449 
1450  const Int_t valid_trigger_time_offset[3] = {0, 1, rounded_trigger_rollover};
1451 
1452 
1453  if(fLocalF1DecodeDebug) {
1454  QwMessage << "\n\n" << QwLog::endl;
1456  << " ROC " << roc_id
1457  << " num_words (buffer size) " << num_words
1458  << QwLog::endl;
1459  }
1460 
1461  Int_t subsystem_cnt = 0;
1462  TString roc_idx;
1463 
1465  printf("%s at %s nwrds %d\n",
1466  __PRETTY_FUNCTION__, GetSystemName().Data(), num_words);
1467  }
1468 
1469  for (UInt_t i=0; i<num_words ; i++)
1470  {
1471  fF1TDCDecoder.DecodeTDCWord(buffer[i], roc_id);
1472  // without any further process
1473  // check the decoding....
1474 
1476  std::cout << "[" << std::setw(3) << i
1477  << "," << std::setw(3) << i
1478  << "] "
1479  << fF1TDCDecoder << std::endl;
1480  }
1481 
1482 
1483  slot_number = fF1TDCDecoder.GetTDCSlotNumber();
1484 
1486  // Check F1TDC slot, provided by buffer[i], is valid (1<=slot<=21)
1487  //, because sometimes, slot 30 data (junk) is placed in the first one
1488  // or two buffers.
1489 
1490  chip_address = fF1TDCDecoder.GetTDCChipAddress();
1491  channel_address = fF1TDCDecoder.GetTDCChannelAddress();
1492  channel_number = fF1TDCDecoder.GetTDCChannelNumber();
1493 
1494 
1495  // if(fLocalDebug) {
1496  // // this is for tracking down missing wires in Region 2
1497  // // a quick and dirty way to check
1498  // // Monday, December 20 10:38:38 EST 2010, jhlee
1499  // it turned out "loosing cabling....
1500  // Saturday, January 8 01:54:02 EST 2011, jhlee
1501 
1502  // if( (slot_number==10) and (roc_id==3) ) {
1503  // if( (channel_number == 19) || (channel_number == 21) || (channel_number == 23) || (channel_number == 25)
1504  // || (channel_number == 27) || (channel_number == 29) || (channel_number == 31) || (channel_number == 17)
1505  // )
1506  // {
1507  // printf("Roc %2d Slot%2d Ch %2d \n", roc_id, slot_number, channel_number);
1508  // }
1509  // }
1510  // }
1511 
1512  roc_idx = Form("R%2d-S%2d", roc_id, slot_number);
1513 
1514  // We use the multiblock data transfer for F1TDC, thus
1515  // we must get the event number and the trigger time from the first buffer
1516  // (buffer[0]), and these valuse can be used to check "data" integrity
1517  // over all F1TDCs.
1518  // Each Subsystem uses the same buffer[0] even if their interesting F1
1519  // is not in the SLOT 4
1520 
1521  if ( i ==0 ) {
1522  if ( fF1TDCDecoder.IsHeaderword() ) {
1523  reference_event_num = fF1TDCDecoder.GetTDCEventNumber();
1524  reference_trig_time = fF1TDCDecoder.GetTDCTriggerTime();
1525 
1526  trig_fifo_ok_flag = fF1TDCDecoder.IsNotHeaderTrigFIFO();
1527  if(not trig_fifo_ok_flag) {
1528  // temp solution ....
1529  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1530  this -> AddTFO(roc_id, slot_number, channel_number);
1531  fError2DHist -> Fill(roc_idx.Data(), "TFO",1);
1532  }
1533  }
1534 
1535  }
1536  else {
1537  printf("The first word of F1TDC must be header word. Check CODA stream and QwF1TDContainer::CheckDataIntegrity fucntion.\n");
1538  return false;
1539  }
1540  }
1541 
1542  // Check F1TDC status is inside a subsystem
1543 
1544  if( CheckRegisteredF1(roc_id, slot_number) ) {
1545 
1546  // Check F1TDC data, provided by buffer[i], is valid in each subsystem
1547  // subsystem_cnt = 0;
1548 
1549  if(fLocalF1DecodeDebug) {
1550 
1551  std::cout << "[" << std::setw(3) << i
1552  << "," << std::setw(3) << subsystem_cnt
1553  << "] "
1554  << fF1TDCDecoder << std::endl;
1555  }
1556  subsystem_cnt++;
1557  // Both header and data words have HFO, OFO, and RLF
1558  hit_fifo_overflow_flag = fF1TDCDecoder.IsHitFIFOOverFlow();
1559  output_fifo_overflow_flag = fF1TDCDecoder.IsOutputFIFOOverFlow();
1560  chip_resolution_lock_flag = fF1TDCDecoder.IsResolutionLock();
1561 
1562 
1563  if(hit_fifo_overflow_flag) {
1564  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1565  this->AddHFO(roc_id, slot_number, channel_number);
1566  // one event creates the maximum 9 HFOs
1567  // but the number is within the range of 1 - 9
1568 
1569  fError2DHist -> Fill(roc_idx.Data(), "HFO",1);
1570 
1571  if(fLocalDebug) {
1572  std::cout << "There is the Hit FIFO Overflow on the F1TDC board at"
1573  << " ROC " << roc_id
1574  << " Slot " << slot_number
1575  << " Ch " << std::setw(3) << channel_number
1576  << "[" << chip_address
1577  << "," << channel_address
1578  << "]\n";
1579  }
1580  }
1581  }
1582 
1583  if(output_fifo_overflow_flag) {
1584  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1585  this->AddOFO(roc_id, slot_number, channel_number);
1586  fError2DHist -> Fill(roc_idx.Data(), "OFO",1);
1587  if(fLocalDebug) {
1588  std::cout << "There is the Output FIFO Overflow on the F1TDC board at"
1589  << " ROC " << roc_id
1590  << " Slot " << slot_number
1591  << " Ch " << std::setw(3) << channel_number
1592  << "[" << chip_address
1593  << "," << channel_address
1594  << "]\n";
1595 
1596  }
1597  }
1598  }
1599 
1600  if(not chip_resolution_lock_flag) {
1601  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1602  this->AddRLF(roc_id, slot_number, channel_number);
1603  fError2DHist -> Fill(roc_idx.Data(), "RLF",1);
1604  if(fLocalDebug) {
1605  std::cout << "There is the Resolution Lock Failed on the F1TDC board at"
1606  << " ROC " << roc_id
1607  << " Slot " << slot_number
1608  << " Ch " << std::setw(3) << channel_number
1609  << "[" << chip_address
1610  << "," << channel_address
1611  << "]\n";
1612  }
1613  }
1614  }
1615 
1616  // check only header word
1617 
1618  if ( fF1TDCDecoder.IsHeaderword() ) {
1619 
1620 
1621  xor_setup_flag = fF1TDCDecoder.IsHeaderXorSetup();
1622  trig_fifo_ok_flag = fF1TDCDecoder.IsNotHeaderTrigFIFO();
1623  event_ok_flag = ( reference_event_num==fF1TDCDecoder.GetTDCHeaderEventNumber() );
1624  diff_trigger_time = abs( int(reference_trig_time)-int(fF1TDCDecoder.GetTDCHeaderTriggerTime()) );
1625 
1626  trig_time_ok_flag =
1627  (diff_trigger_time == valid_trigger_time_offset[0])
1628  ||
1629  (diff_trigger_time == valid_trigger_time_offset[1])
1630  ||
1631  (diff_trigger_time == valid_trigger_time_offset[2]);
1632 
1633  // trig_time_ok_flag = abs( reference_trig_time-fF1TDCDecoder.GetTDCHeaderTriggerTime() ) <= valid_trigger_time_offset;
1634 
1635  // if no SEU, check Trigger FIFO Overflow, Trigger Time, and Event Number
1636 
1637  if (xor_setup_flag) {
1638 
1639  if(not trig_fifo_ok_flag) {
1640  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1641  this -> AddTFO(roc_id, slot_number, channel_number);
1642  fError2DHist -> Fill(roc_idx.Data(), "TFO",1);
1643  if(fLocalDebug) {
1644  std::cout << "There is the Trigger FIFO overflow at"
1645  << " ROC " << roc_id
1646  << " Slot " << slot_number
1647  << " Ch " << std::setw(3) << channel_number
1648  << "[" << chip_address
1649  << "," << channel_address
1650  << "]\n";
1651 
1652  }
1653  }
1654  }
1655 
1656  // Trigger Time difference of up to 1 count among the chips is acceptable
1657  // For the Trigger Time, this assumes that an external SYNC_RESET signal has
1658  // been successfully applied at the start of the run
1659 
1660  if (not trig_time_ok_flag) {
1661  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1662  this->AddSYN(roc_id, slot_number, channel_number);
1663  fError2DHist -> Fill(roc_idx.Data(), "SYN",1);
1664  if(fLocalDebug) {
1665  std::cout << "There is the Trigger Time Mismatch on the F1TDC board at"
1666  << " ROC " << roc_id
1667  << " Slot " << slot_number
1668  << " Ch " << std::setw(3) << channel_number
1669  << "[" << chip_address
1670  << "," << channel_address
1671  << "]\n";
1672  }
1673  }
1674 
1675  }
1676  // Any difference in the Event Number among the chips indicates a serious error
1677  // that requires a reset of the board.
1678 
1679  if (not event_ok_flag) {
1680  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1681  this->AddEMM(roc_id, slot_number, channel_number);
1682  fError2DHist -> Fill(roc_idx.Data(), "EMM",1);
1683  if(fLocalDebug) {
1684  std::cout << "There is the Event Number Mismatch issue on the F1TDC board at"
1685  << " ROC " << roc_id
1686  << " Slot " << slot_number
1687  << " Ch " << std::setw(3) << channel_number
1688  << "[" << chip_address
1689  << "," << channel_address
1690  << "]\n";
1691  }
1692  }
1693  }
1694 
1695 
1696  if(data_integrity_unlock_flag) {
1697  // check data_integrity_flag = false once (not initial value),
1698  // if so, we skip the further process to check
1699  // data integrity, because it is alreay invalid
1700  // data we have.
1701 
1702  data_integrity_flag = (event_ok_flag) && (trig_time_ok_flag) && (trig_fifo_ok_flag) ;
1703  if(data_integrity_flag) data_integrity_unlock_flag = true; // true -> not lock -> check it again
1704  else data_integrity_unlock_flag = false; // false -> lock -> no check it again -> return false;
1705  }
1706  } // if(xor_setup_flag) {
1707 
1708 
1709  // ignore SEU first, then we count them how frequently they are,
1710  // because there is no way to seperate SEU and the data integrity.
1711  // data integrity is valid within all buffer, but SEU is valid
1712  // for only when it is (header and dataword)
1713 
1714  else {
1715  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1716  this->AddSEU(roc_id, slot_number, channel_number);
1717  fError2DHist -> Fill(roc_idx.Data(), "SEU",1);
1718  if (fLocalDebug) {
1719  std::cout << "There is the Single Event Upset (SEU) on the F1TDC board at"
1720  << " ROC " << roc_id
1721  << " Slot " << slot_number
1722  << " Ch " << std::setw(3) << channel_number
1723  << "[" << chip_address
1724  << "," << channel_address
1725  << "]\n";
1726  }
1727  }
1728  }
1729  } // if ( fF1TDCDecoder.IsHeaderword() ) {
1730  else {
1731  // fF1TDCDecoder.Print(true);
1732  fake_data_flag = fF1TDCDecoder.IsFakeData();
1733  if(fake_data_flag) {
1734  if(not CheckSlot20Chan30(slot_number, channel_number)) {
1735  this->AddFDF(roc_id, slot_number, channel_number);
1736  fError2DHist -> Fill(roc_idx.Data(), "FDF",1);
1737  if(fLocalDebug) {
1738  std::cout << "There is the Fake Data on the F1TDC board at"
1739  << " ROC " << roc_id
1740  << " Slot " << slot_number
1741  << " Ch " << std::setw(3) << channel_number
1742  << "[" << chip_address
1743  << "," << channel_address
1744  << "]\n";
1745  }
1746  }
1747  }
1748 
1749  // dataword
1750 
1751  // if(!fF1TDCDecoder.IsOverFlowEntry()) fF1TDCDecoder.PrintTDCData(fLocalDebug);
1752  }//;;
1753 
1754  } // if( CheckRegisteredF1(roc_id, slot_number) ) {
1755 
1756 
1757 
1758 
1759  }//if(fF1TDCDecoder.IsValidDataSlot()) {
1760  else {
1761 
1762  // slot_number = fF1TDCDecoder.GetTDCSlotNumber();
1763  if( slot_number == 0 ) {
1764  if(fLocalDebug) {
1765  std::cout << "Slot " << slot_number << " is a filler word,"
1766  << " then we ignore it." << std::endl;
1767  }
1768  }
1769  else if( slot_number == 30 ) {
1770  // Slot 30 is not in the list of F1TDCs in a subsystem.
1771  // we cannot add this counter into QwF1TDC.
1772  // Now just leave what I wrote for a possible future release.
1773  // Tuesday, September 21 15:19:34 EDT 2010, jhlee
1774  // this->AddS30(roc_id, slot_number);
1775  if(fLocalDebug) {
1776  std::cout << "Slot " << slot_number << " is a junk word,"
1777  << " then we ignore it." << std::endl;
1778  }
1779  }
1780  else {
1781  std::cout << "Slot " << slot_number << " is not in the reasonable slot,"
1782  << " then we ignore it, but it is better to check what it is going on CODA stream." << std::endl;
1783  }
1784  }
1785 
1786 
1787 
1788  }//for (UInt_t i=0; i<num_words ; i++) {
1789 
1790  if(fLocalF1RawDecodeDebug) printf("\n");
1791  return (data_integrity_flag);
1792 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
void AddSYN(Int_t roc, Int_t slot, Int_t channel)
void AddRLF(Int_t roc, Int_t slot, Int_t channel)
UInt_t GetTDCHeaderTriggerTime() const
Definition: MQwF1TDC.h:74
Bool_t fLocalF1RawDecodeDebug
const UInt_t & GetTDCChipAddress() const
Definition: MQwF1TDC.h:46
Bool_t fLocalF1DecodeDebug
Double_t GetF1TDCTriggerRollover()
Bool_t IsValidDataSlot() const
Definition: MQwF1TDC.h:77
Bool_t IsHeaderXorSetup() const
Definition: MQwF1TDC.h:79
const Bool_t & IsHeaderword() const
Definition: MQwF1TDC.h:42
void AddSEU(Int_t roc, Int_t slot, Int_t channel)
Bool_t IsHitFIFOOverFlow() const
Definition: MQwF1TDC.h:83
UInt_t GetTDCTriggerTime() const
Definition: MQwF1TDC.h:54
const TString GetSystemName() const
MQwF1TDC fF1TDCDecoder
Bool_t CheckSlot20Chan30(Int_t slot, Int_t chan)
Bool_t IsNotHeaderTrigFIFO() const
Definition: MQwF1TDC.h:80
const UInt_t & GetTDCSlotNumber() const
Definition: MQwF1TDC.h:44
UInt_t GetTDCEventNumber() const
Definition: MQwF1TDC.h:53
const UInt_t & GetTDCChannelNumber() const
Definition: MQwF1TDC.h:45
const UInt_t & GetTDCChannelAddress() const
Definition: MQwF1TDC.h:47
void AddTFO(Int_t roc, Int_t slot, Int_t channel)
void AddHFO(Int_t roc, Int_t slot, Int_t channel)
UInt_t GetTDCHeaderEventNumber() const
Definition: MQwF1TDC.h:73
Bool_t IsResolutionLock() const
Definition: MQwF1TDC.h:85
Bool_t IsOutputFIFOOverFlow() const
Definition: MQwF1TDC.h:84
void AddFDF(Int_t roc, Int_t slot, Int_t channel)
void AddOFO(Int_t roc, Int_t slot, Int_t channel)
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
Bool_t CheckRegisteredF1(Int_t roc, Int_t slot)
Bool_t IsFakeData() const
Definition: MQwF1TDC.h:87
void DecodeTDCWord(UInt_t &word, const UInt_t roc_id)
Definition: MQwF1TDC.cc:84
void AddEMM(Int_t roc, Int_t slot, Int_t channel)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t QwF1TDContainer::CheckRegisteredF1 ( Int_t  roc,
Int_t  slot 
)
private

Definition at line 1887 of file QwF1TDContainer.cc.

References GetF1TDC().

Referenced by CheckDataIntegrity().

1888 {
1889  QwF1TDC* F1 = NULL;
1890  F1 = this->GetF1TDC(roc, slot);
1891 
1892  if(F1) return true;
1893  else return false;
1894 }
QwF1TDC * GetF1TDC(Int_t roc, Int_t slot)
one F1TDC configuration and reference signal(s) holder

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool_t QwF1TDContainer::CheckSlot20Chan30 ( Int_t  slot,
Int_t  chan 
)
private

Definition at line 1898 of file QwF1TDContainer.cc.

Referenced by CheckDataIntegrity().

1899 {
1900  return ( (slot==20) and (chan==30) );
1901 }

+ Here is the caller graph for this function:

QwF1TDContainer::ClassDef ( QwF1TDContainer  ,
 
)
private
Double_t QwF1TDContainer::DoneF1TDCsConfiguration ( )

Definition at line 1907 of file QwF1TDContainer.cc.

References fF1TDCOneResolutionNS, and GetF1TDCsResolution().

Referenced by QwTriggerScintillator::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessConfigurationBuffer(), QwMainDetector::ProcessConfigurationBuffer(), QwDriftChamber::ProcessConfigurationBuffer(), and QwScanner::ProcessConfigurationBuffer().

1908 {
1909  //
1910  // reduce call "GetF1TDCsResolution" inside subsystem...
1911  //
1913  return fF1TDCOneResolutionNS;
1914 }
Double_t GetF1TDCsResolution()
Double_t fF1TDCOneResolutionNS

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

EQwDetectorType QwF1TDContainer::GetDetectorType ( ) const
inline

Definition at line 288 of file QwF1TDContainer.h.

References fDetectorType.

Referenced by Print().

288 {return fDetectorType;}
EQwDetectorType fDetectorType

+ Here is the caller graph for this function:

TList * QwF1TDContainer::GetErrorSummary ( )
private

Definition at line 1368 of file QwF1TDContainer.cc.

References fQwF1TDCList, and QwF1TDC::GetErrorCounter().

Referenced by WriteErrorSummary().

1369 {
1370 
1371  TList *error_list = new TList;
1372  error_list->SetOwner(true);
1373 
1374  TObjArrayIter next(fQwF1TDCList);
1375  TObject* obj = NULL;
1376 
1377  while ( (obj = next()) )
1378  {
1379  QwF1TDC* F1 = (QwF1TDC*) obj;
1380  TString error = F1->GetErrorCounter();
1381  error_list -> Add(new TObjString(error));
1382  }
1383 
1384  return error_list;
1385 }
TString GetErrorCounter()
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QwF1TDC * QwF1TDContainer::GetF1TDC ( Int_t  roc,
Int_t  slot 
)

Definition at line 828 of file QwF1TDContainer.cc.

References fQwF1TDCList, QwF1TDC::GetROCNumber(), and QwF1TDC::GetSlotNumber().

Referenced by AddEMM(), AddFDF(), AddHFO(), AddOFO(), AddRLF(), AddS30(), AddSEU(), AddSYN(), AddTFO(), and CheckRegisteredF1().

829 {
830  Int_t roc_num = 0;
831  Int_t slot_num = 0;
832 
833  // Int_t unique_id = 0;
834 
835 
836  QwF1TDC* F1 = NULL;
837 
838  TObjArrayIter next(fQwF1TDCList);
839  TObject* obj = NULL;
840 
841 
842  while ( (obj = next()) )
843  {
844 
845  F1 = (QwF1TDC*) obj;
846  // unique_id = F1->GetUniqueID();
847  roc_num = F1->GetROCNumber();
848  slot_num = F1->GetSlotNumber();
849  if((roc_num == roc) && (slot_num == slot) ) {
850  // if(fLocalDebug) {
851  // std::cout << "System " << F1->GetF1SystemName()
852  // << " QwF1TDContainer::GetF1TDC F1TDC address at" << F1 << std::endl;
853  // }
854  return F1;
855  }
856  }
857 
858  return NULL;
859 }
Int_t GetROCNumber() const
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder
Int_t GetSlotNumber() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Int_t QwF1TDContainer::GetF1TDCChannelNumber ( )

Double_t GetF1TDCResolution();.

Definition at line 1310 of file QwF1TDContainer.cc.

References fQwF1TDCList, QwF1TDC::GetChannelNumber(), GetSystemName(), QwF1TDC::PrintContact(), and QwF1TDC::PrintF1TDCConfigure().

1311 {
1312 
1313  // F1TDC max channel number must be the same
1314  // among VME crates and among F1TDC boards
1315  // We cannot change it on each F1TDC board.
1316  // Thus, this function return one value of them. (32 or 64)
1317  // Friday, September 3 13:09:01 EDT 2010, jhlee
1318 
1319  Int_t old_c = 0;
1320  Int_t new_c = 0;
1321  Int_t cnt = 0;
1322 
1323  TObjArrayIter next(fQwF1TDCList);
1324  TObject* obj = NULL;
1325 
1326  while ( (obj = next()) )
1327  {
1328  QwF1TDC* F1 = (QwF1TDC*) obj;
1329  new_c = F1->GetChannelNumber();
1330  // printf("QwF1TDContainer::GetF1TDCChannelNumber() cnt %d, new %d , old %d\n", cnt, new_c, old_c);
1331  if(cnt not_eq 0) {
1332  if(old_c not_eq new_c) {
1333  F1->PrintContact();
1334  printf("%s : QwF1TDContainer::GetF1TDCChannelNumber(): F1TDC configurations are corrupted!\n",
1335  GetSystemName().Data());
1336  F1->PrintF1TDCConfigure();
1337  return 0;
1338  }
1339 
1340  }
1341  old_c = new_c;
1342  cnt++;
1343  }
1344 
1345  return old_c;
1346 }
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder
void PrintContact()
const TString GetSystemName() const
Int_t GetChannelNumber() const
void PrintF1TDCConfigure()

+ Here is the call graph for this function:

const MQwF1TDC QwF1TDContainer::GetF1TDCDecoder ( ) const
inline
const TH2F * QwF1TDContainer::GetF1TDCErrorHist ( )

Definition at line 1811 of file QwF1TDContainer.cc.

References fError2DHist, and SetErrorHistOptions().

1812 {
1813  this->SetErrorHistOptions();
1814  return fError2DHist;
1815 }

+ Here is the call graph for this function:

Double_t QwF1TDContainer::GetF1TDCOneResolution ( ) const
inline

Definition at line 295 of file QwF1TDContainer.h.

References fF1TDCOneResolutionNS.

295 {return fF1TDCOneResolutionNS;};
Double_t fF1TDCOneResolutionNS
Double_t QwF1TDContainer::GetF1TDCsResolution ( )
private

Definition at line 1231 of file QwF1TDContainer.cc.

References fQwF1TDCList, QwF1TDC::GetF1TDC_resolution(), GetSystemName(), QwF1TDC::PrintContact(), and QwF1TDC::PrintF1TDCConfigure().

Referenced by DoneF1TDCsConfiguration().

1232 {
1233 
1234  // F1TDC resolution must be the same
1235  // among VME crates and among F1TDC boards
1236  // We cannot change it on each F1TDC board.QwF1TDContainer::GetF1TDCResolution()
1237  // Thus, this function return one value of them.
1238  // Wednesday, September 1 16:52:05 EDT 2010, jhlee
1239 
1240  Double_t old_r = 0.0;
1241  Double_t new_r = 0.0;
1242  Int_t cnt = 0;
1243 
1244  TObjArrayIter next(fQwF1TDCList);
1245  TObject* obj = NULL;
1246 
1247  while ( (obj = next()) )
1248  {
1249  QwF1TDC* F1 = (QwF1TDC*) obj;
1250  new_r = F1->GetF1TDC_resolution();
1251  if(cnt not_eq 0) {
1252  if(old_r not_eq new_r) {
1253  F1->PrintContact();
1254  printf("%s : QwF1TDContainer::GetF1TDCResolution(): F1TDC configurations are corrupted!\n",
1255  GetSystemName().Data());
1256  F1->PrintF1TDCConfigure();
1257 
1258  return 0.0;
1259  }
1260 
1261  }
1262  old_r = new_r;
1263  cnt++;
1264  }
1265 
1266  return old_r;
1267 }
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder
void PrintContact()
const TString GetSystemName() const
void PrintF1TDCConfigure()
Double_t GetF1TDC_resolution() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Double_t QwF1TDContainer::GetF1TDCTriggerRollover ( )
private

Definition at line 1272 of file QwF1TDContainer.cc.

References fLocalDebug, fQwF1TDCList, QwF1TDC::GetF1TDC_trig_t_offset(), GetSystemName(), QwF1TDC::PrintContact(), and QwF1TDC::PrintF1TDCConfigure().

Referenced by CheckDataIntegrity().

1273 {
1274 
1275  Double_t old_r = 0.0;
1276  Double_t new_r = 0.0;
1277  Int_t cnt = 0;
1278 
1279  TObjArrayIter next(fQwF1TDCList);
1280  TObject* obj = NULL;
1281 
1282  if(fLocalDebug) printf("\nHow many F1TDC in %s : %d\n", GetSystemName().Data(), fQwF1TDCList->GetEntriesFast());
1283 
1284  while ( (obj = next()) )
1285  {
1286  QwF1TDC* F1 = (QwF1TDC*) obj;
1287  new_r = F1->GetF1TDC_trig_t_offset();
1288  // printf("QwF1TDContainer::GetF1TDCTriggerRollover():: cnt %d, new %f , old %f\n", cnt, new_r, old_r);
1289  if(cnt not_eq 0) {
1290  if(old_r not_eq new_r) {
1291  F1->PrintContact();
1292  printf("%s : QwF1TDContainer::GetF1TDCTriggerRollover(): F1TDC configurations are corrupted!\n",
1293  GetSystemName().Data());
1294  F1->PrintF1TDCConfigure();
1295  return 0.0;
1296  }
1297 
1298  }
1299  old_r = new_r;
1300  cnt++;
1301  }
1302 
1303  return old_r;
1304 }
TObjArray * fQwF1TDCList
Double_t GetF1TDC_trig_t_offset() const
one F1TDC configuration and reference signal(s) holder
void PrintContact()
const TString GetSystemName() const
void PrintF1TDCConfigure()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QwF1TDC * QwF1TDContainer::GetF1TDCwithBankIndexSLOT ( Int_t  bank_index,
Int_t  slot 
)

Definition at line 888 of file QwF1TDContainer.cc.

References fQwF1TDCList, QwF1TDC::GetF1BankIndex(), and QwF1TDC::GetSlotNumber().

Referenced by ReferenceSignalCorrection().

889 {
890  Int_t bank_idx = 0;
891  Int_t slot_num = 0;
892 
893  TObjArrayIter next(fQwF1TDCList);
894  TObject* obj = NULL;
895  QwF1TDC* F1 = NULL;
896 
897  while ( (obj = next()) )
898  {
899  F1 = (QwF1TDC*) obj;
900  bank_idx = F1->GetF1BankIndex();
901  slot_num = F1->GetSlotNumber();
902  if((bank_idx == bank_index) && (slot_num == slot) ) {
903  // if(fLocalDebug) {
904  // std::cout << "System " << F1->GetF1SystemName()
905  // << " QwF1TDContainer::GetF1TDC F1TDC address at" << F1 << std::endl;
906  // }
907  return F1;
908  }
909  }
910 
911  return NULL;
912 }
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder
Int_t GetF1BankIndex() const
Int_t GetSlotNumber() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QwF1TDC * QwF1TDContainer::GetF1TDCwithIndex ( Int_t  tdc_index)

Definition at line 863 of file QwF1TDContainer.cc.

References fQwF1TDCList, and QwF1TDC::GetF1TDCIndex().

864 {
865  Int_t f1_idx = 0;
866 
867  TObjArrayIter next(fQwF1TDCList);
868  TObject* obj = NULL;
869  QwF1TDC* F1 = NULL;
870 
871  while ( (obj = next()) )
872  {
873  F1 = (QwF1TDC*) obj;
874  f1_idx = F1->GetF1TDCIndex();
875  if( f1_idx == tdc_index ) {
876  // if(fLocalDebug) {
877  // std::cout << "System " << F1->GetF1SystemName()
878  // << " QwF1TDContainer::GetF1TDCIndex F1TDC address at" << F1 << std::endl;
879  // }
880  return F1;
881  }
882  }
883 
884  return NULL;
885 }
Int_t GetF1TDCIndex() const
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder

+ Here is the call graph for this function:

EQwRegionID QwF1TDContainer::GetRegion ( ) const
inline

Definition at line 289 of file QwF1TDContainer.h.

References fRegion.

Referenced by Print().

289 {return fRegion;};
EQwRegionID fRegion

+ Here is the caller graph for this function:

Int_t QwF1TDContainer::GetSize ( ) const
inline

Definition at line 285 of file QwF1TDContainer.h.

References fNQwF1TDCs.

Referenced by Print().

285 {return fNQwF1TDCs;};

+ Here is the caller graph for this function:

const TString QwF1TDContainer::GetSystemName ( ) const
inline

Definition at line 280 of file QwF1TDContainer.h.

References fSystemName.

Referenced by CheckDataIntegrity(), GetF1TDCChannelNumber(), GetF1TDCsResolution(), GetF1TDCTriggerRollover(), Print(), PrintNoF1TDC(), and WriteErrorSummary().

280 {return fSystemName;};

+ Here is the caller graph for this function:

Int_t QwF1TDContainer::HowManyF1TDCs ( ) const
inline

Definition at line 287 of file QwF1TDContainer.h.

References fNQwF1TDCs.

287 {return fNQwF1TDCs;};
void QwF1TDContainer::Print ( const Option_t *  options = 0) const

Definition at line 1139 of file QwF1TDContainer.cc.

References QwLog::endl(), fQwF1TDCList, GetDetectorType(), GetRegion(), GetSize(), GetSystemName(), and QwMessage.

Referenced by QwTriggerScintillator::ProcessConfigurationBuffer(), QwSciFiDetector::ProcessConfigurationBuffer(), QwMainDetector::ProcessConfigurationBuffer(), QwDriftChamber::ProcessConfigurationBuffer(), and QwScanner::ProcessConfigurationBuffer().

1140 {
1141 
1142  Int_t size = 0;
1143  size = this->GetSize();
1144 
1145  QwMessage << "\nQwF1TDContainer::Print() "
1146  << " QwF1TDContainer in System : "
1147  << this->GetSystemName()
1148  << ", DetectorType "
1149  << this->GetDetectorType()
1150  << ", RegionType "
1151  << this->GetRegion()
1152  << ", How many F1TDCs are : "
1153  << size
1154  << QwLog::endl;
1155 
1156  TObjArrayIter next(fQwF1TDCList);
1157  TObject* obj;
1158  while ( (obj = next()) )
1159  {
1160  QwF1TDC* F1 = (QwF1TDC*) obj;
1161  QwMessage << "F1TDC object " << F1 << QwLog::endl;
1162  F1 -> PrintF1TDCBuffer();
1163  F1 -> PrintF1TDCConfigure();
1164  }
1165 
1166  return;
1167 }
#define QwMessage
Predefined log drain for regular messages.
Definition: QwLog.h:50
Int_t GetSize() const
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder
const TString GetSystemName() const
EQwRegionID GetRegion() const
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
EQwDetectorType GetDetectorType() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void QwF1TDContainer::PrintErrorSummary ( )

Definition at line 1351 of file QwF1TDContainer.cc.

References fQwF1TDCList.

Referenced by QwScanner::FillHardwareErrorSummary().

1352 {
1353  printf("-----------------------\n");
1354  TObjArrayIter next(fQwF1TDCList);
1355  TObject* obj = NULL;
1356  while ( (obj = next()) )
1357  {
1358  QwF1TDC* F1 = (QwF1TDC*) obj;
1359 
1360  F1 -> PrintTotalErrorCounter();
1361  }
1362  printf("-----------------------\n");
1363  return;
1364 }
TObjArray * fQwF1TDCList
one F1TDC configuration and reference signal(s) holder

+ Here is the caller graph for this function:

TString QwF1TDContainer::PrintNoF1TDC ( Int_t  roc,
Int_t  slot 
)
private

Definition at line 1171 of file QwF1TDContainer.cc.

References GetSystemName().

Referenced by AddEMM(), AddFDF(), AddHFO(), AddOFO(), AddRLF(), AddS30(), AddSEU(), AddSYN(), and AddTFO().

1172 {
1173  TString tmp = Form("There is no F1TDC with ROC%2d and SLOT%2d in System %s\n",
1174  roc, slot, GetSystemName().Data());
1175  return tmp;
1176 
1177 }
const TString GetSystemName() const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TString QwF1TDContainer::PrintNoF1TDC ( Int_t  tdc_index)
private

Definition at line 1180 of file QwF1TDContainer.cc.

References GetSystemName().

1181 {
1182  TString tmp = Form("There is no F1TDC with TDCINDEX%2d in System %s\n",
1183  tdc_index, GetSystemName().Data());
1184 
1185  return tmp;
1186 }
const TString GetSystemName() const

+ Here is the call graph for this function:

Double_t QwF1TDContainer::ReferenceSignalCorrection ( Double_t  raw_time,
Double_t  ref_time,
Int_t  bank_index,
Int_t  slot 
)

Definition at line 1068 of file QwF1TDContainer.cc.

References GetF1TDCwithBankIndexSLOT(), and QwF1TDC::ReferenceSignalCorrection().

Referenced by QwTriggerScintillator::ProcessEvent(), QwMainDetector::ProcessEvent(), QwScanner::ProcessEvent(), QwDriftChamberHDC::SubtractReferenceTimes(), QwDriftChamberVDC::SubtractReferenceTimes(), QwSciFiDetector::SubtractReferenceTimes(), QwMainDetector::SubtractReferenceTimes(), QwTriggerScintillator::SubtractReferenceTimes(), and QwScanner::SubtractReferenceTimes().

1074 {
1075  QwF1TDC* F1 = NULL;
1076  F1 = this->GetF1TDCwithBankIndexSLOT(bank_index, slot_num);
1077 
1078  if(F1) {
1079  return F1->ReferenceSignalCorrection(raw_time, ref_time);
1080  }
1081  else {
1082  // printf("There is no F1TDC with Bank index %2d slot %2d\n", bank_index, slot_num);
1083  return -1.0;
1084  }
1085 }
QwF1TDC * GetF1TDCwithBankIndexSLOT(Int_t bank_index, Int_t slot)
one F1TDC configuration and reference signal(s) holder
Double_t ReferenceSignalCorrection(Double_t raw_time, Double_t ref_time)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Double_t QwF1TDContainer::ReturnTimeCalibration ( Double_t  time_arb_unit)
inline

Definition at line 298 of file QwF1TDContainer.h.

References fF1TDCOneResolutionNS.

Referenced by QwTriggerScintillator::ProcessEvent(), QwMainDetector::ProcessEvent(), and QwScanner::ProcessEvent().

298 {return fF1TDCOneResolutionNS*time_arb_unit;};
Double_t fF1TDCOneResolutionNS

+ Here is the caller graph for this function:

void QwF1TDContainer::SetErrorHistOptions ( )
private

Definition at line 1795 of file QwF1TDContainer.cc.

References fError2DHist.

Referenced by GetF1TDCErrorHist(), and WriteErrorSummary().

1796 {
1797  const char* opt = "TEXT";
1798  fError2DHist->SetMarkerSize(1.4);
1799  fError2DHist->SetOption(opt);
1800  fError2DHist->LabelsDeflate("X");
1801  fError2DHist->LabelsDeflate("Y");
1802  fError2DHist->LabelsOption("a", "X");
1803  fError2DHist->LabelsOption("a", "Y");
1804  return;
1805 }

+ Here is the caller graph for this function:

void QwF1TDContainer::SetSystemName ( const TString  name)

Definition at line 1089 of file QwF1TDContainer.cc.

References QwLog::endl(), fDetectorType, fError2DHist, fRegion, fSystemName, kRegionID1, kRegionID2, kRegionID3, kRegionIDCer, kRegionIDNull, kRegionIDScanner, kRegionIDTrig, kTypeCerenkov, kTypeDriftHDC, kTypeDriftVDC, kTypeNull, kTypeScanner, kTypeSciFiber, kTypeTrigscint, and QwWarning.

1090 {
1091  // Types are defined in QwType.h
1092  if(fSystemName.IsNull()) {
1093  fSystemName = name;
1094  if(fSystemName == "R1") {
1096  fRegion = kRegionID1;
1097  }
1098  else if(fSystemName == "R2") {
1100  fRegion = kRegionID2;
1101  }
1102  else if(fSystemName == "R3") {
1104  fRegion = kRegionID3;
1105  }
1106 
1107  else if(fSystemName == "MD" ) {
1110  }
1111  else if(fSystemName == "TS" ) {
1114  }
1115  else if(fSystemName == "FPS") {
1118  }
1119  else {
1122  }
1123  }
1124  else {
1125  QwWarning << "QwF1TDContainer::SetSystemName "
1126  << fSystemName
1127  << " is already registered."
1128  << QwLog::endl;
1129  }
1130 
1131  fError2DHist -> SetNameTitle(
1132  Form("%s_F1ErrorHist",fSystemName.Data()),
1133  Form("%s F1TDC Board Error Status Histogram", fSystemName.Data())
1134  );
1135  return;
1136 }
EQwRegionID fRegion
EQwDetectorType fDetectorType
static std::ostream & endl(std::ostream &)
End of the line.
Definition: QwLog.cc:299
#define QwWarning
Predefined log drain for warnings.
Definition: QwLog.h:45

+ Here is the call graph for this function:

Int_t QwF1TDContainer::Size ( ) const
inline

Definition at line 286 of file QwF1TDContainer.h.

References fNQwF1TDCs.

286 {return fNQwF1TDCs;};
void QwF1TDContainer::WriteErrorSummary ( Bool_t  hist_flag = true)

Definition at line 1821 of file QwF1TDContainer.cc.

References fError2DHist, fLocalDebug, GetErrorSummary(), GetSystemName(), and SetErrorHistOptions().

Referenced by QwScanner::FillHardwareErrorSummary().

1822 {
1823  if (fError2DHist->GetEntries() not_eq 0) {
1824 
1825  TSeqCollection *file_list = gROOT->GetListOfFiles();
1826 
1827  if (file_list) {
1828 
1829  Int_t size = file_list->GetSize();
1830 
1831  TString error_summary_name = this-> GetSystemName();
1832  error_summary_name += "_F1TDCs_Status";
1833 
1834  for (Int_t i=0; i<size; i++)
1835  {
1836  TFile *file = (TFile*) file_list->At(i);
1837  if(hist_flag) {
1838  TString hist_name = fError2DHist->GetName();
1839  TH2F *error_hist = (TH2F*) file->FindObjectAny(hist_name);
1840  if (not error_hist) {
1841  this->SetErrorHistOptions();
1842  file->WriteObject(fError2DHist, hist_name);
1843  }
1844  }
1845  else {
1846  TList *error_summary = (TList*) file->FindObjectAny(error_summary_name);
1847  if (not error_summary) {
1848  file->WriteObject(this->GetErrorSummary(), error_summary_name);
1849  }
1850  }
1851  if(fLocalDebug) {
1852  std::cout << "i " << i
1853  << " size " << size
1854  << " error_summary_name " << error_summary_name
1855  << std::endl;
1856  }
1857  }
1858  }
1859  }
1860  return;
1861 }
const TString GetSystemName() const
TList * GetErrorSummary()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

EQwDetectorType QwF1TDContainer::fDetectorType

Definition at line 338 of file QwF1TDContainer.h.

Referenced by GetDetectorType(), QwF1TDContainer(), and SetSystemName().

MQwF1TDC QwF1TDContainer::fF1TDCDecoder
private

Definition at line 347 of file QwF1TDContainer.h.

Referenced by CheckDataIntegrity(), and GetF1TDCDecoder().

Double_t QwF1TDContainer::fF1TDCOneResolutionNS
private
Double_t QwF1TDContainer::fF1TDCTriggerRollover
private

Definition at line 366 of file QwF1TDContainer.h.

Bool_t QwF1TDContainer::fLocalDebug
private
Bool_t QwF1TDContainer::fLocalF1DecodeDebug
private

Definition at line 350 of file QwF1TDContainer.h.

Referenced by CheckDataIntegrity(), and QwF1TDContainer().

Bool_t QwF1TDContainer::fLocalF1ErrorDebug
private
Bool_t QwF1TDContainer::fLocalF1RawDecodeDebug
private

Definition at line 349 of file QwF1TDContainer.h.

Referenced by CheckDataIntegrity(), and QwF1TDContainer().

Int_t QwF1TDContainer::fNQwF1TDCs

Definition at line 270 of file QwF1TDContainer.h.

Referenced by AddQwF1TDC(), GetSize(), HowManyF1TDCs(), QwF1TDContainer(), and Size().

EQwRegionID QwF1TDContainer::fRegion

Definition at line 339 of file QwF1TDContainer.h.

Referenced by GetRegion(), QwF1TDContainer(), and SetSystemName().

TString QwF1TDContainer::fSystemName

Definition at line 340 of file QwF1TDContainer.h.

Referenced by GetSystemName(), and SetSystemName().


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