Belle II Software development
PXDGatedModeInfo.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <TObject.h>
12#include <vxd/dataobjects/VxdID.h>
13#include <framework/logging/Logger.h>
14
15namespace Belle2 {
33 class PXDGatedModeInfo : public TObject {
34 public:
35
38
39
43 void setFullGated(bool b) { m_fullGated = b; }
44
48 bool isFullGated() const { return m_fullGated; }
49
53 void setReadoutGated(bool b) { m_readoutGated = b; }
54
58 bool isReadoutGated() const { return m_readoutGated; }
59
63 bool isGateOK(VxdID id, int gate) const
64 {
65 if (m_fullGated) {
66 return false;
67 } else {
68 if (m_readoutGated) {
69 if (id.getLayerNumber() == 1) {
70 gate = 192 - 1 - gate;
71 }
72 if (gate < 0 || gate >= 192) {
73 B2ERROR("Invalid Gate");
74 return false;
75 }
76 return !m_gateStatus[gate];
77 } else {
78 return true;
79 }
80 }
81 }
82
84 bool isVCellOK(VxdID id, int vCellId) const { return isGateOK(id, vCellId / 4); }
85
87 void setGateGatedL2(int gate, bool gated)
88 {
89 if (gate < 0 || gate >= 192) {
90 B2ERROR("Invalid Gate");
91 } else {
92 m_gateStatus[gate] = gated;
93 }
94 }
95
96 private:
100 std::vector <bool>
104 ClassDef(PXDGatedModeInfo, 1)
105
106 }; // class PXDGatedModeInfo
107
109} // end namespace Belle2
The PXD Gated Info Class.
bool isFullGated() const
Return if data was recorded while detector was gated.
void setGateGatedL2(int gate, bool gated)
set gate status of specific gate
void setReadoutGated(bool b)
Set flag that we triggered while detector was gated.
PXDGatedModeInfo()
Default constructor for the ROOT IO.
void setFullGated(bool b)
Set flag that we triggered while detector was gated.
bool m_readoutGated
Sensor switched to gated mode during readout.
bool isGateOK(VxdID id, int gate) const
Return if gate is ok.
bool isVCellOK(VxdID id, int vCellId) const
is the VCELL valid
bool isReadoutGated() const
Return if data was readout while detector was gated.
bool m_fullGated
Sensor was in gated mode while triggered.
std::vector< bool > m_gateStatus
Status of Gates (true=gated), the gates are numbered as (VCellID/4) for Layer 2 (as rolling shutter r...
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
Abstract base class for different kinds of events.