ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::EventData Class Reference

#include <EventData.h>

Collaboration diagram for LArSamples::EventData:

Public Member Functions

 EventData ()
 Constructor.
 EventData (int event, int runIndex, int lumiBlock, int bunchId)
 EventData (const EventData &other, int newRunIndex=-1)
virtual ~EventData ()
 Destructor.
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

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.

◆ 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.

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)); }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::string label(const std::string &format, int i)
Definition label.h:19

◆ 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}
unsigned int triggerWord(unsigned int i) const
Definition EventData.cxx:81

◆ 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}
@ Data
Definition BaseObject.h:11
TString triggers() const

◆ 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}
static void drawBoxRoI(double eta, double phi, double etaSize=0.2, double phiSize=0.2)

◆ 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}
bool bit(unsigned int pos) const
Definition EventData.cxx:98
int triggerBitPosition(const TString &triggerBitName) const
Definition RunData.cxx:37
str index
Definition DeMoScan.py:362

◆ 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}
int run() const
Definition RunData.h:36

◆ 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

◆ setRunIndex()

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

◆ 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}
bool isPassed(const TString &bitName) const
Definition EventData.cxx:88

◆ 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: