AlcapDAQ  1
Functions | Variables
MOctalFADCBufferOverflow.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <map>
#include <utility>
#include "midas.h"
#include <TH1.h>
#include "TOctalFADCIsland.h"
#include "TOctalFADCBankReader.h"
#include "TGlobalData.h"
#include "TSetupData.h"

Go to the source code of this file.

Functions

INT MOctalFADCBufferOverflow_init (void)
 
INT MOctalFADCBufferOverflow (EVENT_HEADER *, void *)
 
static INT module_bor (INT run_number)
 

Variables

HNDLE hDB
 
TGlobalDatagData
 
TSetupDatagSetup
 
static TH1 * hNOctalFADCBufferOverflow
 
static TH1 * hNOctalFADCBufferOverflowPercent
 
static int midas_events
 
ANA_MODULE MOctalFADCBufferOverflow_module
 

Function Documentation

INT MOctalFADCBufferOverflow ( 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 100 of file MOctalFADCBufferOverflow.cpp.

References hNOctalFADCBufferOverflow, hNOctalFADCBufferOverflowPercent, i, midas_events, and SUCCESS.

101 {
102  // Get the event number
103 
104  unsigned int* raw; // Points at the raw data
105  int bankSize = bk_locate(pevent,"NBUF",&raw);
106 
107  if (bankSize != 0) {
108  for (int i = 0; i < bankSize; i++) {
109  hNOctalFADCBufferOverflow->Fill(*(raw+i));
110  int bin = hNOctalFADCBufferOverflowPercent->FindBin(*(raw+i));
111  hNOctalFADCBufferOverflowPercent->SetBinContent(bin, hNOctalFADCBufferOverflow->GetBinContent(bin) / midas_events);
112  }
113  }
114  ++midas_events;
115 
116  return SUCCESS;
117 }
INT MOctalFADCBufferOverflow_init ( )

This method initializes histograms.

Definition at line 63 of file MOctalFADCBufferOverflow.cpp.

References hNOctalFADCBufferOverflow, hNOctalFADCBufferOverflowPercent, and SUCCESS.

64 {
65  // This histogram has the bank names labeled on the X-axis, and the midas
66  // block number on the Y-axis.
67  // This uses the TH1::kCanRebin mechanism to expand automatically to the
68  // number of FADC banks.
69  hNOctalFADCBufferOverflow = new TH1F(
70  "hNOctalFADCBufferOverflow",
71  "Total Number of Events in which the FADC Overflowed",
72  4,128, 132);
73  hNOctalFADCBufferOverflow->SetBit(TH1::kCanRebin);
74  hNOctalFADCBufferOverflow->GetXaxis()->SetTitle("FADC Board Number");
75  hNOctalFADCBufferOverflow->GetYaxis()->SetTitle("Total Number of Buffer Overflows");
76 
78  "hNOctalFADCBufferOverflowPercent",
79  "Fraction of MIDAS Events in which the FADC Overflowed",
80  4,128, 132);
81  hNOctalFADCBufferOverflowPercent->GetXaxis()->SetTitle("FADC Board Number");
82  hNOctalFADCBufferOverflowPercent->GetYaxis()->SetTitle("Fraction of events with Buffer Overflows");
83 
84  return SUCCESS;
85 }
INT module_bor ( INT  run_number)
static

This method executes at the start of each run

Definition at line 90 of file MOctalFADCBufferOverflow.cpp.

References midas_events, and SUCCESS.

91 {
92  midas_events = 1;
93 
94  return SUCCESS;
95 }

Variable Documentation

TGlobalData* gData

Definition at line 54 of file analyzer.cpp.

TSetupData* gSetup

Definition at line 55 of file analyzer.cpp.

HNDLE hDB

Definition at line 11 of file mucap_compress.cpp.

TH1* hNOctalFADCBufferOverflow
static
TH1* hNOctalFADCBufferOverflowPercent
static
int midas_events
static

Definition at line 45 of file MOctalFADCBufferOverflow.cpp.

Referenced by MOctalFADCBufferOverflow(), and module_bor().

ANA_MODULE MOctalFADCBufferOverflow_module
Initial value:
=
{
"MOctalFADCBufferOverflow",
"Andrew Edmonds",
NULL,
NULL,
NULL,
0,
NULL,
}

Definition at line 47 of file MOctalFADCBufferOverflow.cpp.