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++) {
226 if (sL > 8)
continue;
227 if (iL > 8)
continue;
229 int num = sL * 6 + iL + 2;
230 if (num > 55)
continue;
248 if (vtdc > ftdc && adcsum > 20) {
258 cid = iL * ndiv[sL] + wid;
260 for (
int isl = 0; isl < sL; isl ++) {
261 cid += 6 * ndiv[isl];
263 cid += 2 * ndiv[0] + iL * ndiv[sL] + wid;
272 for (
int b = 0; b < 56; b++) {
295 occ_L[b] = (double)whits_L[b] / n_wire;
304 for (
int j = 0; j < r_nent; j++) {
308 int v_adc = cdcrawhit->
getFADC();
309 int v_tdc = cdcrawhit->
getTDC();
310 int n_tot = cdcrawhit->
getTOT();
311 int n_node = cdcrawhit->
getNode();
314 bmap_2->Fill(n_node, n_fns);
316 if (v_tdc > 5200 || v_tdc < 4200) {
321 if (brd > 299)
continue;
322 if (n_tot < 4)
continue;
323 if (v_adc < 35)
continue;
329 }
else if (brd < 48) {
332 }
else if (brd < 72) {
335 }
else if (brd < 100) {
338 }
else if (brd < 132) {
341 }
else if (brd < 168) {
344 }
else if (brd < 208) {
347 }
else if (brd < 252) {
359 B2DEBUG(29,
"TTD FTSW : " << hex << it.GetTTUtime(0) <<
" " << it.GetTTCtime(0) <<
" EvtNr " << it.GetEveNo(0) <<
" Type " <<
360 (it.GetTTCtimeTRGType(0) & 0xF) <<
" TimeSincePrev " << it.GetTimeSincePrevTrigger(0) <<
" TimeSinceInj " <<
361 it.GetTimeSinceLastInjection(0) <<
" IsHER " << it.GetIsHER(0) <<
" Bunch " << it.GetBunchNumber(0));
362 auto difference = it.GetTimeSinceLastInjection(0);
363 if (difference != 0x7FFFFFFF) {
365 float diff2 = difference / 127.;
366 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.
StoreArray< RawFTSW > m_rawFTSW
Input array for DAQ Status.
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.
virtual ~cdcDQM7Module() override
Destructor.
cdcDQM7Module()
Constructor.
TH1D * h_hit_cell
hits-of-cell
void defineHisto() override
action at run end termination action
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.