ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
LArSamples::EventData Class Reference

#include <EventData.h>

Collaboration diagram for LArSamples::EventData:

Public Member Functions

 EventData ()
 Constructor
More...
 
 EventData (int event, int runIndex, int lumiBlock, int bunchId)
 
 EventData (const EventData &other, int newRunIndex=-1)
 
virtual ~EventData ()
 Destructor. More...
 
int event () const
 
unsigned int lumiBlock () const
 
unsigned int bunchId () const
 
int runIndex () const
 
int run () const
 
unsigned int nTriggerWords () const
 
unsigned int triggerWord (unsigned int i) const
 
unsigned int l1Word (unsigned int i) const
 
unsigned int nRoIs () const
 
RoIPosition roI (unsigned int i) const
 
std::vector< unsigned int > triggerData () const
 
bool isPassed (const TString &bitName) const
 
double footprint () const
 
void setTriggerData (const std::vector< unsigned int > &words)
 
void addRoI (float eta, float phi, const char *name="", const char *label="")
 
void setRunData (const RunData *runData)
 
const RunDatarunData () const
 
bool bit (unsigned int pos) const
 
TString triggers () const
 
TString roIs () const
 
TString description (unsigned int verbosity) const
 
void drawDRRoIs (double roISize=0.1) const
 
void drawBoxRoIs (double etaSize=0.2, double phiSize=0.2) const
 
void removeRoIs ()
 

Static Public Member Functions

static void drawBoxRoI (double eta, double phi, double etaSize=0.2, double phiSize=0.2)
 

Private Member Functions

void setRunIndex (int idx)
 
EventDataoperator= (const EventData &)
 

Private Attributes

std::vector< unsigned int > m_eventData
 
std::vector< RoIPositionm_rois
 
const RunDatam_runData
 

Detailed Description

Definition at line 29 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

Constructor & Destructor Documentation

◆ EventData() [1/3]

EventData::EventData ( )

Constructor

Definition at line 21 of file EventData.cxx.

21  :
22  m_runData(nullptr)
23 {
25  m_eventData.push_back(0); // event
26  m_eventData.push_back(0); // run
27  m_eventData.push_back(0); // LB
28  m_eventData.push_back(0); // BCID
29 }

◆ EventData() [2/3]

EventData::EventData ( int  event,
int  runIndex,
int  lumiBlock,
int  bunchId 
)

Definition at line 42 of file EventData.cxx.

42  :
43  m_runData(nullptr)
44 {
46  m_eventData.push_back(event);
47  m_eventData.push_back(run);
48  m_eventData.push_back(lumiBlock);
49  m_eventData.push_back(bunchId);
50 }

◆ EventData() [3/3]

EventData::EventData ( const EventData other,
int  newRunIndex = -1 
)

Definition at line 32 of file EventData.cxx.

33  : m_eventData(other.m_eventData),
34  m_rois(other.m_rois),
35  m_runData(other.m_runData)
36 {
38  if (newRunIndex != -1) setRunIndex(newRunIndex);
39 }

◆ ~EventData()

EventData::~EventData ( )
virtual

Destructor.

Definition at line 53 of file EventData.cxx.

54 {
56 }

Member Function Documentation

◆ addRoI()

void LArSamples::EventData::addRoI ( float  eta,
float  phi,
const char *  name = "",
const char *  label = "" 
)
inline

Definition at line 73 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

73 { m_rois.push_back(RoIPosition(eta, phi, name, label)); }

◆ bit()

bool EventData::bit ( unsigned int  pos) const

Definition at line 98 of file EventData.cxx.

99 {
100  unsigned int word = pos/32;
101  unsigned int bpos = pos%32;
102  if (word >= nTriggerWords()) return false;
103  return ((triggerWord(word) >> bpos) & 0x1);
104 }

◆ bunchId()

unsigned int LArSamples::EventData::bunchId ( ) const
inline
Returns
bunch crossing id

Definition at line 50 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

50 { return m_eventData[3]; }

◆ description()

TString EventData::description ( unsigned int  verbosity) const

Definition at line 131 of file EventData.cxx.

132 {
133  TString printout = "";
134  if (verbosity & 1)
135  printout += Form("run %6d, event %8d, lb = %4d", run(), event(), lumiBlock());
136  if (verbosity & 2)
137  printout += Form(", triggers = %40s", triggers().Data());
138  if (verbosity & 4) {
139  printout += ", RoIs = ";
140  for (unsigned int i = 0; i < nRoIs(); i++)
141  printout += Form("%-20s(%5.2f, %5.2f) ", roI(i).name.Data(), roI(i).eta, roI(i).phi);
142  }
143  return printout;
144 }

◆ drawBoxRoI()

void EventData::drawBoxRoI ( double  eta,
double  phi,
double  etaSize = 0.2,
double  phiSize = 0.2 
)
static

Definition at line 165 of file EventData.cxx.

166 {
167  TBox box;
168  box.SetFillStyle(0);
169 
170  box.DrawBox(eta - etaSize/2, phi - phiSize/2, eta + etaSize/2, phi + phiSize/2);
171 }

◆ drawBoxRoIs()

void EventData::drawBoxRoIs ( double  etaSize = 0.2,
double  phiSize = 0.2 
) const

Definition at line 156 of file EventData.cxx.

157 {
158  TBox box;
159  box.SetFillStyle(0);
160 
161  for (unsigned int i = 0; i < nRoIs(); i++) drawBoxRoI(roI(i).eta, roI(i).phi, etaSize, phiSize);
162 }

◆ drawDRRoIs()

void EventData::drawDRRoIs ( double  roISize = 0.1) const

Definition at line 147 of file EventData.cxx.

148 {
149  TEllipse ell;
150  ell.SetFillStyle(0);
151 
152  for (unsigned int i = 0; i < nRoIs(); i++)
153  ell.DrawEllipse(roI(i).eta, roI(i).phi, roISize, roISize, 0, 360, 0);
154 }

◆ event()

int LArSamples::EventData::event ( ) const
inline
Returns
event

Definition at line 44 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

44 { return m_eventData[0]; }

◆ footprint()

double LArSamples::EventData::footprint ( ) const
inline

Definition at line 70 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

70 { return sizeof(*this) + m_eventData.size()*sizeof(unsigned int); }

◆ isPassed()

bool EventData::isPassed ( const TString &  bitName) const

Definition at line 88 of file EventData.cxx.

89 {
90  if (!runData()) return false;
91  int index = runData()->triggerBitPosition(bitName);
92  if (index < 0 && bitName == "L1_MBTS_1_1") index = 228;
93  if (index < 0) return false;
94  return bit((unsigned int)index);
95 }

◆ l1Word()

unsigned int LArSamples::EventData::l1Word ( unsigned int  i) const
inline

Definition at line 61 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

61 { return triggerWord(i); }

◆ lumiBlock()

unsigned int LArSamples::EventData::lumiBlock ( ) const
inline
Returns
lumi block

Definition at line 47 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

47 { return m_eventData[2]; }

◆ nRoIs()

unsigned int LArSamples::EventData::nRoIs ( ) const
inline

Definition at line 63 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

63 { return m_rois.size(); }

◆ nTriggerWords()

unsigned int LArSamples::EventData::nTriggerWords ( ) const
inline
Returns
event

Definition at line 59 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

59 { return m_eventData.size() - 4; }

◆ operator=()

EventData& LArSamples::EventData::operator= ( const EventData )
private

◆ removeRoIs()

void LArSamples::EventData::removeRoIs ( )
inline

Definition at line 85 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

85 { m_rois.clear(); }

◆ roI()

RoIPosition LArSamples::EventData::roI ( unsigned int  i) const
inline

Definition at line 64 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

64 { if (i < nRoIs()) return m_rois[i]; return RoIPosition(); }

◆ roIs()

TString EventData::roIs ( ) const

Definition at line 122 of file EventData.cxx.

123 {
124  TString str = "";
125  for (unsigned int i = 0; i < nRoIs(); i++)
126  str += Form("(%4.2f, %4.2f) ", roI(i).eta, roI(i).phi);
127  return str;
128 }

◆ run()

int EventData::run ( ) const
Returns
run

Definition at line 59 of file EventData.cxx.

60 {
61  if (!runData()) return -1;
62  return runData()->run();
63 }

◆ runData()

const RunData* LArSamples::EventData::runData ( ) const
inline

Definition at line 76 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

76 { return m_runData; }

◆ runIndex()

int LArSamples::EventData::runIndex ( ) const
inline
Returns
event

Definition at line 53 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

53 { return m_eventData[1]; }

◆ setRunData()

void LArSamples::EventData::setRunData ( const RunData runData)
inline

Definition at line 75 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

75 { m_runData = runData; }

◆ setRunIndex()

void LArSamples::EventData::setRunIndex ( int  idx)
inlineprivate

Definition at line 91 of file LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h.

91 { m_eventData[1] = idx; }

◆ setTriggerData()

void EventData::setTriggerData ( const std::vector< unsigned int > &  words)

Definition at line 75 of file EventData.cxx.

76 {
77  m_eventData.insert(m_eventData.end(), l1Words.begin(), l1Words.end());
78 }

◆ triggerData()

std::vector< unsigned int > EventData::triggerData ( ) const

Definition at line 66 of file EventData.cxx.

67 {
68  std::vector<unsigned int> trigData;
69  if (m_eventData.size() < 4) return trigData; // should never happen
70  trigData.insert(trigData.end(), m_eventData.begin() + 4, m_eventData.end());
71  return trigData;
72 }

◆ triggers()

TString EventData::triggers ( ) const

Definition at line 107 of file EventData.cxx.

108 {
109  TString triggers = "";
110  if (!runData()) return triggers;
111  for (const std::pair<const TString, unsigned int>& p : runData()->triggerConfig())
112  {
113  if (isPassed(p.first)) {
114  if (triggers != "") triggers += " ";
115  triggers += p.first;
116  }
117  }
118  return triggers;
119 }

◆ triggerWord()

unsigned int EventData::triggerWord ( unsigned int  i) const

Definition at line 81 of file EventData.cxx.

82 {
83  if (i >= nTriggerWords()) return 0;
84  return m_eventData[i + 4];
85 }

Member Data Documentation

◆ m_eventData

std::vector<unsigned int> LArSamples::EventData::m_eventData
private

◆ m_rois

std::vector<RoIPosition> LArSamples::EventData::m_rois
private

◆ m_runData

const RunData* LArSamples::EventData::m_runData
mutableprivate

The documentation for this class was generated from the following files:
LArSamples::EventData::triggers
TString triggers() const
Definition: EventData.cxx:107
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
LArSamples::EventData::nTriggerWords
unsigned int nTriggerWords() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:59
LArSamples::RoIPosition::name
TString name
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:26
LArSamples::EventData::bit
bool bit(unsigned int pos) const
Definition: EventData.cxx:98
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArSamples::EventData::event
int event() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:44
index
Definition: index.py:1
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
Data
@ Data
Definition: BaseObject.h:11
LArSamples::EventData::m_runData
const RunData * m_runData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:96
LArSamples::RunData::triggerBitPosition
int triggerBitPosition(const TString &triggerBitName) const
Definition: RunData.cxx:37
LArSamples::EventData::isPassed
bool isPassed(const TString &bitName) const
Definition: EventData.cxx:88
runZdcNtuple.triggerConfig
triggerConfig
Definition: runZdcNtuple.py:28
LArSamples::EventData::roI
RoIPosition roI(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:64
LArSamples::EventData::nRoIs
unsigned int nRoIs() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:63
LArSamples::EventData::bunchId
unsigned int bunchId() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:50
LArSamples::EventData::m_eventData
std::vector< unsigned int > m_eventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:93
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::ClassCounts::decrementInstanceCount
void decrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:33
LArSamples::EventData::setRunIndex
void setRunIndex(int idx)
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:91
LArSamples::EventData::run
int run() const
Definition: EventData.cxx:59
run
Definition: run.py:1
LArSamples::EventData::triggerWord
unsigned int triggerWord(unsigned int i) const
Definition: EventData.cxx:81
LArSamples::EventData::drawBoxRoI
static void drawBoxRoI(double eta, double phi, double etaSize=0.2, double phiSize=0.2)
Definition: EventData.cxx:165
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
LArSamples::ClassCounts::incrementInstanceCount
void incrementInstanceCount() const
Definition: LArCafJobs/LArCafJobs/ClassCounts.h:32
covarianceTool.verbosity
verbosity
Definition: covarianceTool.py:513
LArSamples::RoIPosition::phi
double phi
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:25
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
LArSamples::RunData::run
int run() const
Definition: RunData.h:36
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
LArSamples::EventData::m_rois
std::vector< RoIPosition > m_rois
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:94
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LArSamples::RoIPosition::eta
double eta
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:25
str
Definition: BTagTrackIpAccessor.cxx:11
LArSamples::EventData::lumiBlock
unsigned int lumiBlock() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:47
LArSamples::EventData::runData
const RunData * runData() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:76