ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::RecJetRoI Class Reference

This class defines the reconstructed em/tau hadron ROI. More...

#include <RecJetRoI.h>

Inheritance diagram for LVL1::RecJetRoI:
Collaboration diagram for LVL1::RecJetRoI:

Public Member Functions

 RecJetRoI ()
 RecJetRoI (unsigned int RoIWord, const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
 The constructor doesn't do much - all the work is in the "construct" methods.
 RecJetRoI (unsigned int RoIWord, const TrigConf::L1Menu *const l1menu)
 constructor using Run 3 configuration
 RecJetRoI (const RecJetRoI &obj)
RecJetRoIoperator= (RecJetRoI const &obj)
 ~RecJetRoI ()
virtual unsigned int roiWord () const
 returns roi word
virtual double phi () const
 returns phi coord of ROI
virtual double eta () const
 returns eta coord of ROI
virtual unsigned int crate () const
 returns JEP crate number
virtual unsigned int module () const
 returns JEM number
virtual unsigned int frame () const
 returns RoI frame number
virtual unsigned int localcoord () const
 returns local coordinate within frame
virtual unsigned int etLarge () const
 returns roi ET in larger cluster.
virtual unsigned int etSmall () const
 returns roi ET in smaller cluster.
bool passedThreshold (unsigned int thresholdNumber) const
 returns TRUE if threshold number threshold_number has been passed by this ROI.
bool passedFwdThreshold (unsigned int thresholdNumber) const
 Same for forward jets.
const CoordinateRangecoord () const
 returns the CoordinateRange.
std::vector< unsigned int > thresholdsPassed () const
 returns a vector of thresholds passed.
unsigned int triggerThreshold (unsigned int thresh) const
 returns the value of the trigger threshold for the threshold passed.
unsigned int windowSize (unsigned int thresh) const
 returns the size of the window.
unsigned int thresholdPattern () const
 returns bitmask of passed thresholds
bool isValidThreshold (unsigned int thresh) const
 returns true if thresh is a valid threshold number
bool isForwardJet () const
 returns true if the RoI is a forward jet RoI.

Private Member Functions

void constructRun1 (const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
 The "construct" calls unpack the RoIWord and copy information about the passed thresholds from the vector of TriggerThresholds into maps for later retrieval.
void constructRun2 (const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
 construct call for Run 2 Jet RoIs
void constructRun3 (const TrigConf::L1Menu *const l1menu)

Private Attributes

unsigned long int m_roiWord { 0 }
 this is the actual format of the data sent from the LVL1 hardware.
JEPRoIDecoderm_decoder { 0 }
 Used for decoding RoI word.
int m_version { 0 }
 Store the RoI format version.
CoordinateRange m_coordRange
 this contains the coordinate range worked out from the RoIWord hardware coord (i.e.
unsigned long int m_thresholdMask { 0 }
 Information on trigger thresholds passed by RoI.
std::map< unsigned int, unsigned int > m_triggerThresholdValue
std::map< unsigned int, unsigned int > m_windowSize

Detailed Description

This class defines the reconstructed em/tau hadron ROI.

It is generated from the Slink output of TrigT1Calo.

Author
Edward Moyse

Definition at line 39 of file RecJetRoI.h.

Constructor & Destructor Documentation

◆ RecJetRoI() [1/4]

LVL1::RecJetRoI::RecJetRoI ( )
inline

Definition at line 43 of file RecJetRoI.h.

43{}

◆ RecJetRoI() [2/4]

LVL1::RecJetRoI::RecJetRoI ( unsigned int RoIWord,
const std::vector< TrigConf::TriggerThreshold * > * caloThresholds )

The constructor doesn't do much - all the work is in the "construct" methods.

Definition at line 29 of file RecJetRoI.cxx.

30 {
31
32 m_roiWord = RoIWord;
33 m_decoder = new JEPRoIDecoder();
34 m_version = m_decoder->jetRoIVersion(m_roiWord);
35 m_coordRange = m_decoder->coordinate(m_roiWord);
36
37 if (m_version > 1)
38 this->constructRun2(caloThresholds);
39 else
40 this->constructRun1(caloThresholds);
41}
void constructRun2(const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
construct call for Run 2 Jet RoIs
int m_version
Store the RoI format version.
Definition RecJetRoI.h:137
void constructRun1(const std::vector< TrigConf::TriggerThreshold * > *caloThresholds)
The "construct" calls unpack the RoIWord and copy information about the passed thresholds from the ve...
Definition RecJetRoI.cxx:90
CoordinateRange m_coordRange
this contains the coordinate range worked out from the RoIWord hardware coord (i.e.
Definition RecJetRoI.h:142
JEPRoIDecoder * m_decoder
Used for decoding RoI word.
Definition RecJetRoI.h:134
unsigned long int m_roiWord
this is the actual format of the data sent from the LVL1 hardware.
Definition RecJetRoI.h:131

◆ RecJetRoI() [3/4]

LVL1::RecJetRoI::RecJetRoI ( unsigned int RoIWord,
const TrigConf::L1Menu *const l1menu )

constructor using Run 3 configuration

Definition at line 43 of file RecJetRoI.cxx.

44 :
45 m_roiWord(RoIWord),
46 m_decoder(new JEPRoIDecoder()),
47 m_version(m_decoder->jetRoIVersion(m_roiWord)),
48 m_coordRange(m_decoder->coordinate(m_roiWord))
49{
50 constructRun3(l1menu);
51}
void constructRun3(const TrigConf::L1Menu *const l1menu)

◆ RecJetRoI() [4/4]

LVL1::RecJetRoI::RecJetRoI ( const RecJetRoI & obj)

Definition at line 54 of file RecJetRoI.cxx.

54 :
55 m_roiWord(obj.m_roiWord),
56 m_decoder(new JEPRoIDecoder()),
57 m_version(obj.m_version),
58 m_coordRange(obj.m_coordRange),
59 m_triggerThresholdValue(obj.m_triggerThresholdValue),
60 m_windowSize(obj.m_windowSize)
61{}
std::map< unsigned int, unsigned int > m_triggerThresholdValue
Definition RecJetRoI.h:147
std::map< unsigned int, unsigned int > m_windowSize
Definition RecJetRoI.h:148

◆ ~RecJetRoI()

LVL1::RecJetRoI::~RecJetRoI ( )

Definition at line 79 of file RecJetRoI.cxx.

79{ delete m_decoder; }

Member Function Documentation

◆ constructRun1()

void LVL1::RecJetRoI::constructRun1 ( const std::vector< TrigConf::TriggerThreshold * > * caloThresholds)
private

The "construct" calls unpack the RoIWord and copy information about the passed thresholds from the vector of TriggerThresholds into maps for later retrieval.

One warning here: the methods of the RecRoI classes assume threshold numbering starts at 1, rather than 0 in the calorimeter trigger simulation and Lvl1ConfigSvc. Hence the odd "-1" in a couple of places in these classes construct call for Run 1 Jet RoIs

Definition at line 90 of file RecJetRoI.cxx.

91{
92
93 m_thresholdMask = m_roiWord & 0xfff;
94
95 std::string jetTriggerType = L1DataDef::typeAsString(L1DataDef::JET);
96 if (this->isForwardJet())
97 jetTriggerType =
98 ((this->eta() > 0) ? L1DataDef::typeAsString(L1DataDef::JF) : L1DataDef::typeAsString(L1DataDef::JB));
99
100 //
101 // Copy the thresholds into a map - makes matching up the passed ones very
102 // easy
103 //
104
105 std::map<unsigned int, TriggerThreshold *> thrMap;
106 for (std::vector<TriggerThreshold *>::const_iterator it =
107 caloThresholds->begin();
108 it != caloThresholds->end(); ++it)
109 {
110 if ((*it)->type() == jetTriggerType)
111 {
112 unsigned int num = static_cast<unsigned int>((*it)->thresholdNumber());
113 thrMap.insert(std::map<unsigned int, TriggerThreshold *>::value_type(num, (*it)));
114 }
115 }
116
117 //
118 // Extract the properties of the passed thresholds:
119 //
120 const vector<unsigned int> passed_thresholds =
121 (this->isForwardJet() ? m_decoder->fwdThresholdsPassed(m_roiWord)
122 : m_decoder->thresholdsPassed(m_roiWord));
123
124 int iphi = int((m_coordRange.phiRange().min() + 0.025) * 32 / M_PI);
125 int ieta =
126 int((this->eta() + ((this->eta() > 0.01) ? 0.025 : -0.025)) / 0.1) - 1;
127 // Adjustment due to irregular geometries
128 if (ieta > 24)
129 ieta += 2;
130
131 for (vector<unsigned int>::const_iterator itp = passed_thresholds.begin();
132 itp != passed_thresholds.end(); ++itp)
133 {
134 std::map<unsigned int, TriggerThreshold *>::const_iterator thr =
135 thrMap.find(*itp - 1);
136 if (thr != thrMap.end())
137 {
138 TriggerThresholdValue *ttv =
139 thr->second->triggerThresholdValue(ieta, iphi);
140 JetThresholdValue *jtv = dynamic_cast<JetThresholdValue *>(ttv);
141 if (jtv)
142 {
143 m_triggerThresholdValue.insert(std::map<unsigned int, unsigned int>::value_type(
144 *itp, jtv->thresholdValueCount()));
145 m_windowSize.insert(
146 std::map<unsigned int, unsigned int>::value_type(*itp, jtv->window()));
147 }
148 } // end "found threshold in map"
149 } // end loop through passed thresholds
150
151 return;
152}
#define M_PI
virtual double eta() const
returns eta coord of ROI
unsigned long int m_thresholdMask
Information on trigger thresholds passed by RoI.
Definition RecJetRoI.h:145
bool isForwardJet() const
returns true if the RoI is a forward jet RoI.
virtual int thresholdValueCount() const override
static std::string & typeAsString(TriggerType tt)
Definition L1DataDef.h:53

◆ constructRun2()

void LVL1::RecJetRoI::constructRun2 ( const std::vector< TrigConf::TriggerThreshold * > * caloThresholds)
private

construct call for Run 2 Jet RoIs

Definition at line 156 of file RecJetRoI.cxx.

157{
158
159 m_thresholdMask = 0;
161 m_windowSize.clear();
162
163 int ieta =
164 int((this->eta() + ((this->eta() > 0.01) ? 0.025 : -0.025)) / 0.1) - 1;
165 // Adjustment due to irregular geometries
166 if (ieta > 24)
167 ieta += 2;
168 int iphi = int((m_coordRange.phiRange().min() + 0.025) * 32 / M_PI);
169 //
170 // Iterate through vector of thresholds and see which ones this RoI satisfies
171 //
172 for (std::vector<TriggerThreshold *>::const_iterator it =
173 caloThresholds->begin();
174 it != caloThresholds->end(); ++it) {
175 if ((*it)->type() == L1DataDef::typeAsString(L1DataDef::JET)) {
176 // Does it satisfy this one?
177 // Start by extracting threshold values
178 TriggerThresholdValue *ttv = (*it)->triggerThresholdValue(ieta, iphi);
179 JetThresholdValue *jtv = dynamic_cast<JetThresholdValue *>(ttv);
180 if (jtv) {
181 float scale = jtv->caloInfo().globalJetScale();
182 unsigned int etCut = jtv->ptcut();
183 unsigned int threshold = etCut * scale;
184 JetWindowSize::Size window = jtv->windowSize();
185 unsigned int roiET =
186 (window == JetWindowSize::LARGE ? etLarge() : etSmall());
187 if (roiET > threshold) {
188 unsigned int num = static_cast<unsigned int>((*it)->thresholdNumber());
190 std::map<unsigned int, unsigned int>::value_type(num, etCut));
191 m_windowSize.insert(
192 std::map<unsigned int, unsigned int>::value_type(num, window));
193 m_thresholdMask |= (1 << num);
194 } // passes cuts
195 } // JetThresholdValue pointer valid
196 } // correct threshold type
197 } // Loop over thresholds
198}
virtual unsigned int etLarge() const
returns roi ET in larger cluster.
virtual unsigned int etSmall() const
returns roi ET in smaller cluster.
float globalJetScale() const
Definition CaloInfo.h:44
virtual JetWindowSize::Size windowSize() const override

◆ constructRun3()

void LVL1::RecJetRoI::constructRun3 ( const TrigConf::L1Menu *const l1menu)
private

Definition at line 201 of file RecJetRoI.cxx.

202{
203 int ieta = int((this->eta() + ((this->eta() > 0.01) ? 0.025 : -0.025)) / 0.1) - 1;
204 // Adjustment due to irregular geometries
205 if (ieta > 24)
206 {
207 ieta += 2;
208 }
209
210 // Iterate through vector of thresholds and see which ones this RoI satisfies
211 for (const shared_ptr<TrigConf::L1Threshold> &thr : l1menu->thresholds("JET"))
212 {
213 // Does it satisfy this one?
214 // Start by extracting threshold values
215 auto jetThr = dynamic_cast<TrigConf::L1Threshold_JET*>(thr.get());
216 if (!jetThr)
217 {
218 continue;
219 }
220
221 // test eT
222 unsigned int etCut = std::round(jetThr->thrValue(ieta)); // threshold value in GeV (integer for legacy thr)
223 unsigned int etCounts = jetThr->thrValueCounts(ieta); // threshold counts (threshold value * emscale)
225 unsigned int roiET = (window == TrigConf::JetWindowSize::LARGE) ? RecJetRoI::etLarge() : RecJetRoI::etSmall();
226 bool eTPassed = (roiET > etCounts);
227
228 if (eTPassed)
229 {
230 const unsigned int num = thr->mapping();
232 m_windowSize[num] = window;
233 m_thresholdMask |= (1 << num);
234 } // passes cuts
235 } // Loop over thresholds
236}

◆ coord()

const LVL1::CoordinateRange & LVL1::RecJetRoI::coord ( ) const

returns the CoordinateRange.

This is worked out from the RoIWord's hardware coords (i.e. crate number, CPM number etc.) by the RoIDecoder class.

Definition at line 348 of file RecJetRoI.cxx.

348{ return m_coordRange; }

◆ crate()

unsigned int LVL1::RecJetRoI::crate ( ) const
virtual

returns JEP crate number

returns crate number of ROI

Definition at line 257 of file RecJetRoI.cxx.

257{ return m_decoder->crate(m_roiWord); }

◆ eta()

double LVL1::RecJetRoI::eta ( ) const
virtual

returns eta coord of ROI

Implements iRecCoordRoI.

Definition at line 253 of file RecJetRoI.cxx.

253{ return m_coordRange.eta(); }

◆ etLarge()

unsigned int LVL1::RecJetRoI::etLarge ( ) const
virtual

returns roi ET in larger cluster.

returns ET of ROI large cluster.

Only valid for Run 2 data. Will return highest threshold passed if called for Run 1 data.

For Run 1 will return highest threshold passed irrespective of size

Definition at line 282 of file RecJetRoI.cxx.

282 {
283 if (m_version > 1) {
284 return m_decoder->etLarge(m_roiWord);
285 } else {
286 float highest = 0;
287 std::map<unsigned int, unsigned int>::const_iterator it =
289 for (; it != m_triggerThresholdValue.end(); ++it)
290 if (it->second > highest)
291 highest = it->second;
292 return highest;
293 }
294}

◆ etSmall()

unsigned int LVL1::RecJetRoI::etSmall ( ) const
virtual

returns roi ET in smaller cluster.

returns ET of ROI small cluster.

Only valid for Run 2 data. Will return highest threshold passed if called for Run 1 data.

For Run 1 will return highest threshold passed irrespective of size

Definition at line 299 of file RecJetRoI.cxx.

299 {
300 if (m_version > 1) {
301 return m_decoder->etSmall(m_roiWord);
302 } else {
303 float highest = 0;
304 std::map<unsigned int, unsigned int>::const_iterator it =
306 for (; it != m_triggerThresholdValue.end(); ++it)
307 if (it->second > highest)
308 highest = it->second;
309 return highest;
310 }
311}

◆ frame()

unsigned int LVL1::RecJetRoI::frame ( ) const
virtual

returns RoI frame number

returns frame number of ROI

Definition at line 265 of file RecJetRoI.cxx.

265 {
266 unsigned int row = m_decoder->row(m_roiWord);
267 unsigned int col = m_decoder->column(m_roiWord);
268 return ((col & 2) << 1) + (row >> 1);
269}
row
Appending html table to final .html summary file.

◆ isForwardJet()

bool LVL1::RecJetRoI::isForwardJet ( ) const

returns true if the RoI is a forward jet RoI.

A forward jet is defined as one that passes ANY forward jet threshold. For legacy compatibility with Run 1 only. Deprecated in Run 2

A forward jet is defined as one that passes ANY forward jet threshold. Always false in Run 2 + 3

Definition at line 413 of file RecJetRoI.cxx.

414{
415 if (m_version <= 1 && ((1 << 18) & m_roiWord))
416 return true;
417 return false;
418}

◆ isValidThreshold()

bool LVL1::RecJetRoI::isValidThreshold ( unsigned int thresh) const

returns true if thresh is a valid threshold number

Definition at line 400 of file RecJetRoI.cxx.

401{
402 if (!this->isForwardJet()) {
403 return (thresh <= TrigT1CaloDefs::numOfJetThresholds);
404 } else {
405 return (thresh <= TrigT1CaloDefs::numOfFwdJetThresholds);
406 }
407}
static const unsigned int numOfJetThresholds
static const unsigned int numOfFwdJetThresholds

◆ localcoord()

unsigned int LVL1::RecJetRoI::localcoord ( ) const
virtual

returns local coordinate within frame

Definition at line 273 of file RecJetRoI.cxx.

273 {
274 unsigned int row = m_decoder->row(m_roiWord);
275 unsigned int col = m_decoder->column(m_roiWord);
276 return (col & 1) + ((row & 1) << 1);
277}

◆ module()

unsigned int LVL1::RecJetRoI::module ( ) const
virtual

returns JEM number

returns module number of ROI

Definition at line 261 of file RecJetRoI.cxx.

261{ return m_decoder->module(m_roiWord); }

◆ operator=()

LVL1::RecJetRoI & LVL1::RecJetRoI::operator= ( RecJetRoI const & obj)

Definition at line 65 of file RecJetRoI.cxx.

65 {
66 if(this != &rhs) {
67 m_roiWord = rhs.m_roiWord;
68 delete m_decoder;
69 m_decoder = new JEPRoIDecoder();
70 m_version = rhs.m_version;
71 m_coordRange = rhs.m_coordRange;
72 m_thresholdMask = rhs.m_thresholdMask;
73 m_triggerThresholdValue = rhs.m_triggerThresholdValue;
74 m_windowSize = rhs.m_windowSize;
75 }
76 return *this;
77}

◆ passedFwdThreshold()

bool LVL1::RecJetRoI::passedFwdThreshold ( unsigned int thresholdNumber) const

Same for forward jets.

returns TRUE if threshold number threshold_number has been pass ed by this ROI.

Deprecated in Run 2, will always return false.

Returns FALSE if used in Run 2, where forward jet is not defined

Definition at line 336 of file RecJetRoI.cxx.

336 {
337
338 if ((m_version < 2) && this->isValidThreshold(thresholdNumber)) {
339 return (((1 << (thresholdNumber + 7)) & m_roiWord) > 0);
340 }
341 return false;
342}
bool isValidThreshold(unsigned int thresh) const
returns true if thresh is a valid threshold number

◆ passedThreshold()

bool LVL1::RecJetRoI::passedThreshold ( unsigned int thresholdNumber) const

returns TRUE if threshold number threshold_number has been passed by this ROI.

returns TRUE if threshold number threshold_number has been pass ed by this ROI.

Definition at line 320 of file RecJetRoI.cxx.

320 {
321
322 bool value = false;
323
324 std::map<unsigned int, unsigned int>::const_iterator it =
325 m_triggerThresholdValue.find(thresholdNumber);
326 if (it != m_triggerThresholdValue.end())
327 value = true;
328
329 return value;
330}

◆ phi()

double LVL1::RecJetRoI::phi ( ) const
virtual

returns phi coord of ROI

Implements iRecCoordRoI.

Definition at line 243 of file RecJetRoI.cxx.

244{
245 double roiPhi = m_coordRange.phi();
246 if (roiPhi > M_PI)
247 roiPhi -= 2 * M_PI;
248 return roiPhi;
249}
constexpr float roiPhi(const AnyRoIPointer &roi)

◆ roiWord()

unsigned int LVL1::RecJetRoI::roiWord ( ) const
virtual

returns roi word

Implements iRecCoordRoI.

Definition at line 239 of file RecJetRoI.cxx.

239{ return m_roiWord; }

◆ thresholdPattern()

unsigned int LVL1::RecJetRoI::thresholdPattern ( ) const

returns bitmask of passed thresholds

returns mask of thresholds passed

Definition at line 315 of file RecJetRoI.cxx.

315{ return m_thresholdMask; }

◆ thresholdsPassed()

std::vector< unsigned int > LVL1::RecJetRoI::thresholdsPassed ( ) const

returns a vector of thresholds passed.

Definition at line 352 of file RecJetRoI.cxx.

352 {
353
354 std::vector<unsigned int> newVec;// = new std::vector<unsigned int>;
355
356 unsigned int nThresh = TrigT1CaloDefs::numOfJetCMXThresholds;
357 if (m_version == 1) {
358 if (this->isForwardJet())
360 else
362 }
363
364 for (unsigned int iTh = 0; iTh <= nThresh; ++iTh) {
365 std::map<unsigned int, unsigned int>::const_iterator it =
366 m_triggerThresholdValue.find(iTh);
367 if (it != m_triggerThresholdValue.end())
368 newVec.push_back(iTh);
369 }
370
371 return newVec;
372}
static const unsigned int numOfJetCMXThresholds

◆ triggerThreshold()

unsigned int LVL1::RecJetRoI::triggerThreshold ( unsigned int thresh) const

returns the value of the trigger threshold for the threshold passed.

Thresholds can vary by coordinate. Return value which matches coord of RecRoI

The trigger threshold is also sometimes called the cluster threshold.

Definition at line 379 of file RecJetRoI.cxx.

379 {
380 map<unsigned int, unsigned int>::const_iterator it =
381 m_triggerThresholdValue.find(thresh);
382 if (it != m_triggerThresholdValue.end()) {
383 return it->second;
384 }
386}
static const unsigned int Error

◆ windowSize()

unsigned int LVL1::RecJetRoI::windowSize ( unsigned int thresh) const

returns the size of the window.

returns the value of the jet cluster for the threshold passed.

For Run 1 this should be 4, 6 or 8, for 4x4, 6x6, 8x8 jets. For Run 2 this should be 0 or 1, denoting large or small

Definition at line 390 of file RecJetRoI.cxx.

390 {
391 map<unsigned int, unsigned int>::const_iterator it = m_windowSize.find(thresh);
392 if (it != m_windowSize.end()) {
393 return it->second;
394 }
396}

Member Data Documentation

◆ m_coordRange

CoordinateRange LVL1::RecJetRoI::m_coordRange
private

this contains the coordinate range worked out from the RoIWord hardware coord (i.e.

crate number, CPM number etc.)

Definition at line 142 of file RecJetRoI.h.

◆ m_decoder

JEPRoIDecoder* LVL1::RecJetRoI::m_decoder { 0 }
private

Used for decoding RoI word.

Definition at line 134 of file RecJetRoI.h.

134{ 0 };

◆ m_roiWord

unsigned long int LVL1::RecJetRoI::m_roiWord { 0 }
private

this is the actual format of the data sent from the LVL1 hardware.

Definition at line 131 of file RecJetRoI.h.

131{ 0 };

◆ m_thresholdMask

unsigned long int LVL1::RecJetRoI::m_thresholdMask { 0 }
private

Information on trigger thresholds passed by RoI.

Definition at line 145 of file RecJetRoI.h.

145{ 0 };

◆ m_triggerThresholdValue

std::map< unsigned int, unsigned int > LVL1::RecJetRoI::m_triggerThresholdValue
private

Definition at line 147 of file RecJetRoI.h.

◆ m_version

int LVL1::RecJetRoI::m_version { 0 }
private

Store the RoI format version.

Definition at line 137 of file RecJetRoI.h.

137{ 0 };

◆ m_windowSize

std::map< unsigned int, unsigned int > LVL1::RecJetRoI::m_windowSize
private

Definition at line 148 of file RecJetRoI.h.


The documentation for this class was generated from the following files: