Plots information related to loss of FADC packets over the network. More...
Functions | |
INT | MDQ_FADCPacketLoss_init (void) |
INT | MDQ_FADCPacketLoss_BOR (INT run_number) |
INT | MDQ_FADCPacketLoss_EOR (INT run_number) |
INT | MDQ_FADCPacketLoss (EVENT_HEADER *, void *) |
Variables | |
HNDLE | hDB |
TGlobalData * | gData |
Object to hold data used and produced by modules throughout alcapana stage of analysis. | |
TSetupData * | gSetup |
Hardware information about digitizers and detectors to be used during alcapana stage of analysis. | |
static TH1 * | hDQ_FADCPacketLoss_Total |
Plots the total number of MIDAS events that had a packet loss per board. | |
static TH1 * | hDQ_FADCPacketLoss_Fraction |
Plots the fraction of MIDAS events that had a packet loss per board. | |
static TH2 * | hDQ_FADCPacketLoss_TotalByEvent |
static int | n_total_midas_events |
ANA_MODULE | MDQ_FADCPacketLoss_module |
Plots information related to loss of FADC packets over the network.
Creates hDQ_FADCPacketLoss_Total, hDQ_FADCPacketLoss_Fraction, and hDQ_FADCPacketLoss_TotalByEvent.
INT MDQ_FADCPacketLoss | ( | EVENT_HEADER * | pheader, | |
void * | pevent | |||
) |
This method processes one MIDAS block, producing a vector of TOctalFADCIsland objects from the raw Octal FADC data.
Definition at line 150 of file MDQ_FADCPacketLoss.cpp.
References hDQ_FADCPacketLoss_Fraction, hDQ_FADCPacketLoss_Total, hDQ_FADCPacketLoss_TotalByEvent, and n_total_midas_events.
00151 { 00152 // Get the event number 00153 int midas_event_number = pheader->serial_number; 00154 00155 // Get the NLSS bank and get a pointer to the raw data 00156 unsigned int* raw; // points at the raw data 00157 int bankSize = bk_locate(pevent,"NLSS",&raw); 00158 00159 int board_number = 0; 00160 int packet_lost = 0; 00161 int n_packets_lost = 0; 00162 00163 bool Boards[256]; // We can have maximally 256 FADC boards due to the address space 00164 for(int i=0; i<256; ++i) Boards[i] = false; 00165 00166 for (int i = 0; i < bankSize; i+=2) { 00167 board_number = *(raw+i); 00168 00169 //printf(" event number %d i %d bank size %d board number %d\n",midas_event_number,i,bankSize,board_number); 00170 00171 packet_lost = *(raw+i+1); 00172 00173 if(*(raw+i) >= 0 && *(raw+i) < 255) Boards[i] = true; 00174 00175 n_packets_lost++; 00176 //printf("Event #%d: Board %d lost packet #%d n packets lost %d\n", midas_event_number, board_number, packet_lost,n_packets_lost); 00177 00178 // Fill Diagnostic histogram 00179 hDQ_FADCPacketLoss_Total->Fill(board_number, 1); 00180 hDQ_FADCPacketLoss_Fraction->Fill(board_number, 1); 00181 hDQ_FADCPacketLoss_TotalByEvent->Fill(board_number,midas_event_number, 1); 00182 00183 } 00184 00185 ++n_total_midas_events; 00186 00187 return SUCCESS; 00188 }
INT MDQ_FADCPacketLoss_BOR | ( | INT | run_number | ) |
This method executes at the start of each run
Definition at line 140 of file MDQ_FADCPacketLoss.cpp.
References n_total_midas_events.
00141 { 00142 n_total_midas_events = 1; 00143 00144 return SUCCESS; 00145 }
INT MDQ_FADCPacketLoss_EOR | ( | INT | run_number | ) |
Definition at line 190 of file MDQ_FADCPacketLoss.cpp.
References hDQ_FADCPacketLoss_Fraction, and n_total_midas_events.
00191 { 00192 00193 hDQ_FADCPacketLoss_Fraction->Scale(1.0 / n_total_midas_events); 00194 00195 return SUCCESS; 00196 }
INT MDQ_FADCPacketLoss_init | ( | ) |
This method initializes histograms.
Definition at line 90 of file MDQ_FADCPacketLoss.cpp.
References hDB, hDQ_FADCPacketLoss_Fraction, hDQ_FADCPacketLoss_Total, and hDQ_FADCPacketLoss_TotalByEvent.
00091 { 00092 // See if the DataQuality_LowLevel/ directory already exists 00093 if (!gDirectory->Cd("DataQuality_LowLevel")) { 00094 00095 std::string dir_name("DataQuality_LowLevel/"); 00096 gDirectory->mkdir(dir_name.c_str()); 00097 gDirectory->Cd(dir_name.c_str()); 00098 } 00099 00100 // Get run number 00101 char key_name[80]; 00102 int size,run_number; 00103 sprintf(key_name, "Runinfo/Run number"); 00104 size=sizeof(int); 00105 db_get_value(hDB,0,key_name, &run_number, &size, TID_INT,1); 00106 00107 // Create the histograms 00108 hDQ_FADCPacketLoss_Total = new TH1F( 00109 "hDQ_FADCPacketLoss_Total", 00110 Form("Total number of MIDAS Events with FADC packet loss per board, run %d",run_number), 00111 4,128, 132); 00112 hDQ_FADCPacketLoss_Total->SetBit(TH1::kCanRebin); 00113 hDQ_FADCPacketLoss_Total->GetXaxis()->SetTitle("FADC Board Number"); 00114 hDQ_FADCPacketLoss_Total->GetYaxis()->SetTitle("Number of Events with lost packets"); 00115 00116 hDQ_FADCPacketLoss_Fraction = new TH1F( 00117 "hDQ_FADCPacketLoss_Fraction", 00118 Form("Fraction of MIDAS Events with FADC packet loss per board, run %d",run_number), 00119 4,128, 132); 00120 hDQ_FADCPacketLoss_Fraction->SetBit(TH1::kCanRebin); 00121 hDQ_FADCPacketLoss_Fraction->GetXaxis()->SetTitle("FADC Board Number"); 00122 hDQ_FADCPacketLoss_Fraction->GetYaxis()->SetTitle("Fraction of Events with lost packets"); 00123 00124 hDQ_FADCPacketLoss_TotalByEvent = new TH2F( 00125 "hDQ_FADCPacketLoss_TotalByEvent", 00126 Form("FADC packet losses by board and event, run %d",run_number), 00127 4,128, 132,5000,0,5000); 00128 hDQ_FADCPacketLoss_TotalByEvent->SetBit(TH2::kCanRebin); 00129 hDQ_FADCPacketLoss_TotalByEvent->GetXaxis()->SetTitle("FADC Board Number"); 00130 hDQ_FADCPacketLoss_TotalByEvent->GetYaxis()->SetTitle("MIDAS event"); 00131 00132 gDirectory->Cd("/MidasHists/"); 00133 00134 return SUCCESS; 00135 }
Object to hold data used and produced by modules throughout alcapana stage of analysis.
Definition at line 76 of file analyzer.cpp.
Hardware information about digitizers and detectors to be used during alcapana stage of analysis.
Definition at line 80 of file analyzer.cpp.
HNDLE hDB |
hDQ_FADCPacketLoss_Fraction [static] |
Plots the fraction of MIDAS events that had a packet loss per board.
Plots the total number of packet losses per board on an event-by-event basis.
Definition at line 69 of file MDQ_FADCPacketLoss.cpp.
Referenced by MDQ_FADCPacketLoss(), MDQ_FADCPacketLoss_EOR(), and MDQ_FADCPacketLoss_init().
hDQ_FADCPacketLoss_Total [static] |
Plots the total number of MIDAS events that had a packet loss per board.
Definition at line 68 of file MDQ_FADCPacketLoss.cpp.
Referenced by MDQ_FADCPacketLoss(), and MDQ_FADCPacketLoss_init().
TH2* hDQ_FADCPacketLoss_TotalByEvent [static] |
Definition at line 70 of file MDQ_FADCPacketLoss.cpp.
Referenced by MDQ_FADCPacketLoss(), and MDQ_FADCPacketLoss_init().
ANA_MODULE MDQ_FADCPacketLoss_module |
{ "MDQ_FADCPacketLoss", "Andrew Edmonds", MDQ_FADCPacketLoss, MDQ_FADCPacketLoss_BOR, MDQ_FADCPacketLoss_EOR, MDQ_FADCPacketLoss_init, NULL, NULL, 0, NULL, }
Definition at line 74 of file MDQ_FADCPacketLoss.cpp.
int n_total_midas_events [static] |
Definition at line 71 of file MDQ_FADCPacketLoss.cpp.
Referenced by MDQ_FADCPacketLoss(), MDQ_FADCPacketLoss_BOR(), and MDQ_FADCPacketLoss_EOR().