9#include "cdc/modules/cdcDQM/cdcDQM7.h"
11#include <framework/core/HistoModule.h>
14#include <framework/gearbox/Unit.h>
15#include <framework/gearbox/Const.h>
16#include <framework/logging/Logger.h>
18#include <TDirectory.h>
47TH1D* h_nhits_L[56] = {0};
49TH1D* h_tdc_sL[9] = {0};
50TH1D* h_adc_sL[9] = {0};
61TH1D* h_EoccAfterInjLER;
62TH1D* h_EoccAfterInjHER;
63TH1D* h_occAfterInjLER;
64TH1D* h_occAfterInjHER;
70 TDirectory* oldDir = gDirectory;
71 TDirectory* dirDAQ = oldDir->mkdir(
"CDC");
77 const int ndiv[9] = {160, 160, 192, 224, 256, 288, 320, 352, 384};
79 for (
int b = 0; b < 56; b++) {
102 h_nhits_L[b] =
new TH1D(Form(
"nhits_L%d", b), Form(
"nhits Layer %d", b), bmax - bmin, bmin, bmax);
106 h_occ_L[b] =
new TH1D(Form(
"h_occ_L%d", b),
"occ. each layer", 100, 0, 1);
113 for (
int s = 0; s < 9; s++) {
114 h_tdc_sL[s] =
new TH1D(Form(
"tdc_sL%d", s), Form(
"tdc sLayer %d", s), 250, 4200, 5200);
118 h_adc_sL[s] =
new TH1D(Form(
"adc_sL%d", s), Form(
"adc sLayer %d", s), 100, 0, 500);
123 h_fast_tdc =
new TH1D(
"fast_tdc",
"fastest TDC", 50, 4800, 5000);
126 h_board_out_tdc =
new TH1D(
"h_board_out_tdc",
"out of range TDC", 300, 0, 300);
130 h_occ =
new TH1D(
"occ",
"occ. total", 100, 0, 1.);
131 h_occ->SetFillColor(95);
134 h_hit_cell =
new TH1D(
"h_hit_cell",
"Hit of each cell", 14336, 0, 14335);
137 bmap_2 =
new TH2D(
"bmap_2",
"", 75, 0, 75, 4, 0, 4);
145 bmap_2->SetOption(
"zcol");
148 h_EoccAfterInjLER =
new TH1D(
"EoccAfterInjLer",
"Eocc after LER injection", 4000, 0, 20000);
152 h_EoccAfterInjHER =
new TH1D(
"EoccAfterInjHer",
"Eocc after HER injection", 4000, 0, 20000);
156 h_occAfterInjLER =
new TH1D(
"occAfterInjLer",
"occupancy after LER injection", 4000, 0, 20000);
160 h_occAfterInjHER =
new TH1D(
"occAfterInjHer",
"occupancy after HER injection", 4000, 0, 20000);
179 for (
int i = 0; i < 56; i++) {
185 for (
int j = 0; j < 9; j++) {
209 double occ_total = nent / 14336.;
210 h_occ->Fill(occ_total);
213 int whits_L[56] = {};
214 double occ_L[56] = {};
216 const int ndiv[9] = {160, 160, 192, 224, 256, 288, 320, 352, 384};
218 for (
int i = 0; i < nent; i++) {
227 if (sL > 8)
continue;
228 if (iL > 8)
continue;
230 int num = sL * 6 + iL + 2;
231 if (num > 55)
continue;
249 if (vtdc > ftdc && adcsum > 20) {
259 cid = iL * ndiv[sL] + wid;
261 for (
int isl = 0; isl < sL; isl ++) {
262 cid += 6 * ndiv[isl];
264 cid += 2 * ndiv[0] + iL * ndiv[sL] + wid;
273 for (
int b = 0; b < 56; b++) {
296 occ_L[b] = (double)whits_L[b] / n_wire;
305 for (
int j = 0; j < r_nent; j++) {
309 int v_adc = cdcrawhit->
getFADC();
310 int v_tdc = cdcrawhit->
getTDC();
311 int n_tot = cdcrawhit->
getTOT();
312 int n_node = cdcrawhit->
getNode();
315 bmap_2->Fill(n_node, n_fns);
317 if (v_tdc > 5200 || v_tdc < 4200) {
322 if (brd > 299)
continue;
323 if (n_tot < 4)
continue;
324 if (v_adc < 35)
continue;
330 }
else if (brd < 48) {
333 }
else if (brd < 72) {
336 }
else if (brd < 100) {
339 }
else if (brd < 132) {
342 }
else if (brd < 168) {
345 }
else if (brd < 208) {
348 }
else if (brd < 252) {
360 B2DEBUG(29,
"TTD FTSW : " << hex << it.GetTTUtime(0) <<
" " << it.GetTTCtime(0) <<
" EvtNr " << it.GetEveNo(0) <<
" Type " <<
361 (it.GetTTCtimeTRGType(0) & 0xF) <<
" TimeSincePrev " << it.GetTimeSincePrevTrigger(0) <<
" TimeSinceInj " <<
362 it.GetTimeSinceLastInjection(0) <<
" IsHER " << it.GetIsHER(0) <<
" Bunch " << it.GetBunchNumber(0));
363 auto difference = it.GetTimeSinceLastInjection(0);
364 if (difference != 0x7FFFFFFF) {
366 float diff2 = difference / 127.;
367 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 fot Finess ID.
unsigned short getFADC(void) const
Getter for FADC value.
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
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.