9#include "cdc/modules/cdcDQM/cdcDQM7.h"
11#include <framework/core/HistoModule.h>
14#include <framework/logging/Logger.h>
16#include <TDirectory.h>
45TH1D* h_nhits_L[56] = {0};
47TH1D* h_tdc_sL[9] = {0};
48TH1D* h_adc_sL[9] = {0};
59TH1D* h_EoccAfterInjLER;
60TH1D* h_EoccAfterInjHER;
61TH1D* h_occAfterInjLER;
62TH1D* h_occAfterInjHER;
68 TDirectory* oldDir = gDirectory;
69 TDirectory* dirDAQ = oldDir->mkdir(
"CDC");
75 const int ndiv[9] = {160, 160, 192, 224, 256, 288, 320, 352, 384};
77 for (
int b = 0; b < 56; b++) {
100 h_nhits_L[b] =
new TH1D(Form(
"nhits_L%d", b), Form(
"nhits Layer %d", b), bmax - bmin, bmin, bmax);
104 h_occ_L[b] =
new TH1D(Form(
"h_occ_L%d", b),
"occ. each layer", 100, 0, 1);
111 for (
int s = 0; s < 9; s++) {
112 h_tdc_sL[s] =
new TH1D(Form(
"tdc_sL%d", s), Form(
"tdc sLayer %d", s), 250, 4200, 5200);
116 h_adc_sL[s] =
new TH1D(Form(
"adc_sL%d", s), Form(
"adc sLayer %d", s), 100, 0, 500);
121 h_fast_tdc =
new TH1D(
"fast_tdc",
"fastest TDC", 50, 4800, 5000);
124 h_board_out_tdc =
new TH1D(
"h_board_out_tdc",
"out of range TDC", 300, 0, 300);
128 h_occ =
new TH1D(
"occ",
"occ. total", 100, 0, 1.);
129 h_occ->SetFillColor(95);
132 h_hit_cell =
new TH1D(
"h_hit_cell",
"Hit of each cell", 14336, 0, 14335);
135 bmap_2 =
new TH2D(
"bmap_2",
"", 75, 0, 75, 4, 0, 4);
143 bmap_2->SetOption(
"zcol");
146 h_EoccAfterInjLER =
new TH1D(
"EoccAfterInjLer",
"Eocc after LER injection", 4000, 0, 20000);
150 h_EoccAfterInjHER =
new TH1D(
"EoccAfterInjHer",
"Eocc after HER injection", 4000, 0, 20000);
154 h_occAfterInjLER =
new TH1D(
"occAfterInjLer",
"occupancy after LER injection", 4000, 0, 20000);
158 h_occAfterInjHER =
new TH1D(
"occAfterInjHer",
"occupancy after HER injection", 4000, 0, 20000);
177 for (
int i = 0; i < 56; i++) {
183 for (
int j = 0; j < 9; j++) {
207 double occ_total = nent / 14336.;
208 h_occ->Fill(occ_total);
211 int whits_L[56] = {};
212 double occ_L[56] = {};
214 const int ndiv[9] = {160, 160, 192, 224, 256, 288, 320, 352, 384};
216 for (
int i = 0; i < nent; i++) {
225 if (sL > 8)
continue;
226 if (iL > 8)
continue;
228 int num = sL * 6 + iL + 2;
229 if (num > 55)
continue;
247 if (vtdc > ftdc && adcsum > 20) {
257 cid = iL * ndiv[sL] + wid;
259 for (
int isl = 0; isl < sL; isl ++) {
260 cid += 6 * ndiv[isl];
262 cid += 2 * ndiv[0] + iL * ndiv[sL] + wid;
271 for (
int b = 0; b < 56; b++) {
294 occ_L[b] = (double)whits_L[b] / n_wire;
303 for (
int j = 0; j < r_nent; j++) {
307 int v_adc = cdcrawhit->
getFADC();
308 int v_tdc = cdcrawhit->
getTDC();
309 int n_tot = cdcrawhit->
getTOT();
310 int n_node = cdcrawhit->
getNode();
313 bmap_2->Fill(n_node, n_fns);
315 if (v_tdc > 5200 || v_tdc < 4200) {
320 if (brd > 299)
continue;
321 if (n_tot < 4)
continue;
322 if (v_adc < 35)
continue;
328 }
else if (brd < 48) {
331 }
else if (brd < 72) {
334 }
else if (brd < 100) {
337 }
else if (brd < 132) {
340 }
else if (brd < 168) {
343 }
else if (brd < 208) {
346 }
else if (brd < 252) {
358 B2DEBUG(29,
"TTD FTSW : " << hex << it.GetTTUtime(0) <<
" " << it.GetTTCtime(0) <<
" EvtNr " << it.GetEveNo(0) <<
" Type " <<
359 (it.GetTTCtimeTRGType(0) & 0xF) <<
" TimeSincePrev " << it.GetTimeSincePrevTrigger(0) <<
" TimeSinceInj " <<
360 it.GetTimeSinceLastInjection(0) <<
" IsHER " << it.GetIsHER(0) <<
" Bunch " << it.GetBunchNumber(0));
361 auto difference = it.GetTimeSinceLastInjection(0);
362 if (difference != 0x7FFFFFFF) {
364 float diff2 = difference / 127.;
365 if (it.GetIsHER(0)) {
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
unsigned short getIWire() const
Getter for iWire.
short getTDCCount() const
Getter for TDC count.
unsigned short getADCCount() const
Getter for integrated charge.
unsigned short getISuperLayer() const
Getter for iSuperLayer.
unsigned short getILayer() const
Getter for iLayer.
The CDCRawHit (suppressed mode) class.
unsigned short getTOT(void) const
Getter for TOT value.
unsigned short getBoardId(void) const
Getter for boar ID.
unsigned short getTDC(void) const
Getter for TDC value.
unsigned short getNode(void) const
Getter for Node ID.
unsigned short getFiness(void) const
Getter for Finess ID.
unsigned short getFADC(void) const
Getter for FADC value.
HistoModule()
Constructor.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
TH1D * h_board_out_tdc
board w/ out of range TDC
TH1D * h_fast_tdc
fastest TDC in each event
TH1D * h_tdc_sL[9]
tdc each super layer
TH1D * h_occAfterInjLER
occupancy after LER injection.
void initialize() override
Module functions.
void event() override
action per each event
StoreArray< CDCRawHit > m_CDCRawHits
CDC raw hits.
void endRun() override
action at run end
StoreArray< RawFTSW > m_rawFTSW
Input array for DAQ Status.
virtual ~cdcDQM7Module()
Destructor.
void terminate() override
termination action
TH2D * bmap_2
board status map 2D
TH1D * h_EoccAfterInjLER
nhits after LER injection.
TH1D * h_EoccAfterInjHER
nhits after HER injection.
TH1D * h_nhits_L[56]
histogram hit in each layer
void beginRun() override
action at runbegin
TH1D * h_occAfterInjHER
occupancy after HER injection.
TH1D * h_adc_sL[9]
adc each super layer
TH1D * h_occ_L[56]
occupancy-layer-dep.
cdcDQM7Module()
Constructor.
TH1D * h_hit_cell
hits-of-cell
void defineHisto() override
function to define histograms
StoreArray< CDCHit > m_CDCHits
CDC hits.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.