ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::CaloRings_v1 Class Reference

Class summarizing the particle interaction throughout the Calorimeter (its shower shape). More...

#include <CaloRings_v1.h>

Inheritance diagram for xAOD::CaloRings_v1:
Collaboration diagram for xAOD::CaloRings_v1:

Public Member Functions

CaloRings_v1 ctors
 CaloRings_v1 ()
 Default empty ctor.
 CaloRings_v1 (const CaloRings_v1 &cr)
 Default copy ctor.
CaloRings_v1 dtors
 ~CaloRings_v1 ()
RingSet Collection direct interation methods:
unsigned nRingSets () const
 Number of RingSets ElementLinks available.
unsigned size () const
 Number of RingSets ElementLinks available.
void addRingSetEL (const ElementLink< RingSetContainer_v1 > &rsEL)
 Add ElementLink to holden vector.
void clear ()
 Clear RingSet EL Collection.
RingSetLinks::iterator begin ()
 returns iterator to the beginning of RingSet Collection.
RingSetLinks::iterator end ()
 returns iterator to the ending of RingSet EL Collection.
RingSetLinks::const_iterator begin () const
 returns const_iterator to the beginning of RingSet Collection.
RingSetLinks::const_iterator end () const
 returns const_iterator to the ending of RingSet EL Collection.
const RingSetat (const unsigned index) const
 Return ith RingSet.
const RingSetoperator[] (const unsigned index) const
 Return ith RingSet.
const RingSetLinksringSetLinks () const
 Returns constant ringsets collection.
void setRingSetLinks (const RingSetLinks &ringsets)
 Set this CaloRings RingSet Collection.
CaloRings_v1 operators overload:
CaloRings_v1operator= (const CaloRings_v1 &clrings)
 Assignment Operator.
float ringAt (const unsigned int rsIdx, const unsigned int ringIdx) const
 Navigate through eT rings methods.
float ringAt (const unsigned int ringIdx) const
 Returns the ringIdx'th ring eT value from the vectorized representation.
void exportRingsTo (std::vector< float > &ringStrip) const
 Export rings eT in vectorized representation.
rsIdx.

Returns the eT rings for RingSet index

void exportRingsTo (std::vector< float > &ringStrip, const unsigned rsIdx) const
rsIdxStart to @name rsIdxEnd.

Returns the eT rings from RingSet index

void exportRingsTo (std::vector< float > &ringStrip, const unsigned rsIdxStart, const unsigned rsIdxEnd) const
 Export rings eT in vectorized representation.
layerTypeIdx to @name layerEnd.

Returns the eT rings from Ringer::CalJointLayer

void exportRingsTo (std::vector< float > &ringStrip, const RingSetConf_v1::RawConfCollection &clRingsRawConfCol, const Ringer::CalJointLayer layerTypeIdx) const
void exportRingsTo (std::vector< float > &ringStrip, const RingSetConf_v1::RawConfCollection &clRingsRawConfCol, const Ringer::CalJointLayer layerTypeStart, const Ringer::CalJointLayer layerTypeEnd) const
sectionIdx

Returns the eT rings from Ringer::CalJointSection

void exportRingsTo (std::vector< float > &ringStrip, const RingSetConf_v1::RawConfCollection &clRingsRawConfCol, const Ringer::CalJointSection sectionType) const
CaloRings_v1 using ostream:

Print

void print (std::ostream &stream) const
 Print-out methods:

Private Member Functions

void checkRingSetIndexWithinRange (unsigned index) const
 Check if index is within range, otherwise throws overflow_error:

Detailed Description

Class summarizing the particle interaction throughout the Calorimeter (its shower shape).

Definition at line 51 of file CaloRings_v1.h.

Constructor & Destructor Documentation

◆ CaloRings_v1() [1/2]

xAOD::CaloRings_v1::CaloRings_v1 ( )
inline

Default empty ctor.

Definition at line 60 of file CaloRings_v1.h.

60{;}

◆ CaloRings_v1() [2/2]

xAOD::CaloRings_v1::CaloRings_v1 ( const CaloRings_v1 & cr)
inline

Default copy ctor.

Definition at line 206 of file CaloRings_v1.h.

206 :
207 SG::AuxElement(clrings)
208{
209 this->makePrivateStore(clrings);
210}
void makePrivateStore()
Create a new (empty) private store for this object.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.

◆ ~CaloRings_v1()

xAOD::CaloRings_v1::~CaloRings_v1 ( )
inline

Definition at line 69 of file CaloRings_v1.h.

69{;}

Member Function Documentation

◆ addRingSetEL()

void xAOD::CaloRings_v1::addRingSetEL ( const ElementLink< RingSetContainer_v1 > & rsEL)

Add ElementLink to holden vector.

◆ at()

const RingSet * xAOD::CaloRings_v1::at ( const unsigned index) const

Return ith RingSet.

Definition at line 85 of file CaloRings_v1.cxx.

86{
87 if ( i > nRingSets() )
88 return nullptr;
90 constAccRingSetLinks( *this ).at(i);
91 if ( !rsEL.isValid() ) {
92 return nullptr;
93 }
94 return *rsEL;
95}
unsigned nRingSets() const
Number of RingSets ElementLinks available.
static const SG::AuxElement::ConstAccessor< RingSetLinks > constAccRingSetLinks("ringSetLinks")

◆ begin() [1/2]

RingSetLinks::iterator xAOD::CaloRings_v1::begin ( )

returns iterator to the beginning of RingSet Collection.

Definition at line 53 of file CaloRings_v1.cxx.

54{
55 return (accRingSetLinks.isAvailable( *this ) )?
56 (accRingSetLinks( *this ).begin()):
58}
static const SG::AuxElement::Accessor< RingSetLinks > accRingSetLinks("ringSetLinks")
std::vector< ElementLink< RingSetContainer > > RingSetLinks
Declare element links vector.
JetConstituentVector::iterator iterator

◆ begin() [2/2]

RingSetLinks::const_iterator xAOD::CaloRings_v1::begin ( ) const

returns const_iterator to the beginning of RingSet Collection.

Definition at line 69 of file CaloRings_v1.cxx.

70{
71 return (constAccRingSetLinks.isAvailable( *this ) )?
72 (constAccRingSetLinks( *this ).begin()):
74}
void const_iterator

◆ checkRingSetIndexWithinRange()

void xAOD::CaloRings_v1::checkRingSetIndexWithinRange ( unsigned index) const
private

Check if index is within range, otherwise throws overflow_error:

Utilities methods:

Definition at line 298 of file CaloRings_v1.cxx.

299{
300 if ( index >= this->nRingSets() ) {
301 throw std::overflow_error("Out of RingSet ElementLink vector range.");
302 }
303}

◆ clear()

void xAOD::CaloRings_v1::clear ( )

Clear RingSet EL Collection.

Definition at line 47 of file CaloRings_v1.cxx.

48{
49 accRingSetLinks( *this ).clear();
50}

◆ end() [1/2]

RingSetLinks::iterator xAOD::CaloRings_v1::end ( )

returns iterator to the ending of RingSet EL Collection.

Definition at line 61 of file CaloRings_v1.cxx.

62{
63 return (accRingSetLinks.isAvailable( *this ) )?
64 (accRingSetLinks( *this ).end()):
66}

◆ end() [2/2]

RingSetLinks::const_iterator xAOD::CaloRings_v1::end ( ) const

returns const_iterator to the ending of RingSet EL Collection.

Definition at line 77 of file CaloRings_v1.cxx.

78{
79 return (constAccRingSetLinks.isAvailable( *this ) )?
80 (constAccRingSetLinks( *this ).end()):
82}

◆ exportRingsTo() [1/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip) const
inline

Export rings eT in vectorized representation.

Returns the eT rings for all RingSets.

Definition at line 221 of file CaloRings_v1.h.

222{
223 exportRingsTo(ringStrip, 0, size()-1);
224}
unsigned size() const
Number of RingSets ElementLinks available.
void exportRingsTo(std::vector< float > &ringStrip) const
Export rings eT in vectorized representation.

◆ exportRingsTo() [2/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip,
const RingSetConf_v1::RawConfCollection & clRingsRawConfCol,
const Ringer::CalJointLayer layerTypeIdx ) const
inline

Definition at line 237 of file CaloRings_v1.h.

241{
242 exportRingsTo(ringStrip, clRingsRawConfCol, layerTypeIdx, layerTypeIdx);
243}

◆ exportRingsTo() [3/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip,
const RingSetConf_v1::RawConfCollection & clRingsRawConfCol,
const Ringer::CalJointLayer layerTypeStart,
const Ringer::CalJointLayer layerTypeEnd ) const

Definition at line 176 of file CaloRings_v1.cxx.

181{
182
183 if ( layerTypeEnd < layerTypeStart ) {
184 throw std::invalid_argument( std::string(
185 "Input layerTypeStart greater than layerTypeEnd") );
186 }
187
188 unsigned nRingSets = this->nRingSets();
189
190 if ( nRingSets && clRingsRawConfCol.size() != nRingSets ) {
191 throw std::invalid_argument( std::string(
192 "The configuration struct seems not to be valid."));
193 }
194
195 // Prepare RingStrip vector to receive Rings energy vectorized representation
196 ringStrip.clear();
197
198 bool foundStartLayer = false;
199
200 for ( unsigned rsIdx = 0; rsIdx < nRingSets; ++rsIdx ) {
201 const RingSet* rs = this->at(rsIdx);
202 if ( !rs ) {
203 throw std::runtime_error( std::string(
204 "Found invalid ElementLink") );
205 }
206 if ( !foundStartLayer ) {
207 // Check if we found start layer:
208 if ( clRingsRawConfCol[rsIdx].calJointLayer == layerTypeStart )
209 {
210 foundStartLayer = true;
211 rs->copyTo(ringStrip);
212 }
213 } else {
214 rs->copyTo(ringStrip);
215 }
216 // Check if we are at the last requested layer:
217 if ( clRingsRawConfCol[rsIdx].calJointLayer == layerTypeEnd ) {
218 break;
219 }
220 }
221}
static Double_t rs
const RingSet * at(const unsigned index) const
Return ith RingSet.
RingSet_v1 RingSet
Definition of the current "RingSet version".
Definition RingSet.h:15

◆ exportRingsTo() [4/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip,
const RingSetConf_v1::RawConfCollection & clRingsRawConfCol,
const Ringer::CalJointSection sectionType ) const

Definition at line 224 of file CaloRings_v1.cxx.

228{
229
230 unsigned nRingSets = this->nRingSets();
231
232 if ( nRingSets && clRingsRawConfCol.size() != nRingSets ) {
233 throw std::invalid_argument( std::string(
234 "The configuration struct seems not to be valid."));
235 }
236
237 // Prepare RingStrip vector to receive Rings energy vectorized representation
238 ringStrip.clear();
239
240 bool foundSection = false;
241
242 for ( unsigned rsIdx = 0; rsIdx < nRingSets; ++rsIdx) {
243 if ( clRingsRawConfCol[rsIdx].calJointSection == sectionType) {
244 foundSection = true;
245 const RingSet* rs = this->at(rsIdx);
246 if ( !rs ) {
247 throw std::runtime_error( std::string(
248 "Found invalid ElementLink") );
249 }
250 rs->copyTo(ringStrip);
251 } else if (foundSection) {
252 break;
253 }
254 }
255
256}

◆ exportRingsTo() [5/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip,
const unsigned rsIdx ) const
inline

Definition at line 228 of file CaloRings_v1.h.

231{
232 exportRingsTo(ringStrip, rsIdx, rsIdx);
233}

◆ exportRingsTo() [6/6]

void xAOD::CaloRings_v1::exportRingsTo ( std::vector< float > & ringStrip,
const unsigned rsIdxStart,
const unsigned rsIdxEnd ) const

Export rings eT in vectorized representation.

Definition at line 153 of file CaloRings_v1.cxx.

157{
158
159 // Check if arguments are within range:
162
163 // Prepare RingStrip vector to receive ring strip information:
164 ringStrip.clear();
165
166 for ( unsigned idx = rsIdxStart; idx <= rsIdxEnd ; ++idx ) {
167 const RingSet *rs = this->at( idx );
168 if ( !rs ) {
169 throw std::runtime_error("Found invalid ElementLink");
170 }
171 rs->copyTo(ringStrip);
172 }
173}
void checkRingSetIndexWithinRange(unsigned index) const
Check if index is within range, otherwise throws overflow_error:

◆ nRingSets()

unsigned xAOD::CaloRings_v1::nRingSets ( ) const

Number of RingSets ElementLinks available.

◆ operator=()

CaloRings_v1 & xAOD::CaloRings_v1::operator= ( const CaloRings_v1 & clrings)

Assignment Operator.

Using the assignment of SG::AuxElement.

Definition at line 262 of file CaloRings_v1.cxx.

263{
264 if (this != &cl_rings){ // protect against invalid self-assignment
265 if (!this->container() && !this->hasStore() ) {
267 }
268 this->SG::AuxElement::operator=( cl_rings );
269 }
270 // by convention, always return *this
271 return *this;
272}
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.

◆ operator[]()

const RingSet * xAOD::CaloRings_v1::operator[] ( const unsigned index) const

Return ith RingSet.

Definition at line 98 of file CaloRings_v1.cxx.

99{
100 if ( i > nRingSets() )
101 return nullptr;
103 constAccRingSetLinks( *this )[i];
104 if ( !rsEL.isValid() ) {
105 return nullptr;
106 }
107 return *rsEL;
108}

◆ print()

void xAOD::CaloRings_v1::print ( std::ostream & stream) const

Print-out methods:

Definition at line 280 of file CaloRings_v1.cxx.

281{
282 stream << "CaloRings are : " << std::endl;
283 for (unsigned rsIdx = 0; rsIdx < this->nRingSets(); ++rsIdx) {
284 stream << "Ringset #" << rsIdx << " : ";
285 const RingSet* rs = this->at(rsIdx);
286 if ( !rs ) {
287 throw std::runtime_error( std::string(
288 "Found invalid ElementLink") );
289 }
290 rs->print(stream);
291 }
292}

◆ ringAt() [1/2]

float xAOD::CaloRings_v1::ringAt ( const unsigned int ringIdx) const

Returns the ringIdx'th ring eT value from the vectorized representation.

◆ ringAt() [2/2]

float xAOD::CaloRings_v1::ringAt ( const unsigned int rsIdx,
const unsigned int ringIdx ) const

Navigate through eT rings methods.

Returns ring eT at RingSet rsIdx and its ringIdx value.

◆ ringSetLinks()

const RingSetLinks & xAOD::CaloRings_v1::ringSetLinks ( ) const

Returns constant ringsets collection.

Set via AUXSTORE_OBJECT_SETTER_AND_GETTER marcro.

◆ setRingSetLinks()

void xAOD::CaloRings_v1::setRingSetLinks ( const RingSetLinks & ringsets)

Set this CaloRings RingSet Collection.

Set via AUXSTORE_OBJECT_SETTER_AND_GETTER marcro.

◆ size()

unsigned xAOD::CaloRings_v1::size ( ) const
inline

Number of RingSets ElementLinks available.

Definition at line 215 of file CaloRings_v1.h.

215 {
216 return nRingSets();
217}

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