ATLAS Offline Software
Loading...
Searching...
No Matches
RingerReFex::RingSet Class Reference

#include <RingerReFex.h>

Collaboration diagram for RingerReFex::RingSet:

Public Member Functions

 RingSet (unsigned int maxRings, double deta, double dphi, const std::vector< int > &detectors, const std::vector< int > &samplings, const std::vector< int > &samples, bool doQuarter, bool doEtaAxesDivision, bool doPhiAxesDivision)
 ~RingSet ()=default
void buildRings (const double eta_hot, const double phi_hot, const CaloNoise *noiseCDO, const double m_noiseFactor, const bool m_doNoiseThrRings)
 =================================================================================
const std::vector< double > & rings () const
 =================================================================================
const std::vector< std::pair< int, int > > detectors () const
 =================================================================================
bool isValid (const CaloCell *) const
 =================================================================================
void push_back (const CaloCell *)
 =================================================================================
void clear ()
 =================================================================================
void fill_cells_info (std::vector< float > &cells_eta, std::vector< float > &cells_phi, std::vector< float > &cells_et, std::vector< int > &cells_sampling, std::vector< int > &cells_size, std::vector< double > &rings_sum, std::vector< int > &cells_id, std::vector< float > &cells_gain)
 =================================================================================

Private Attributes

double m_deltaEta
double m_deltaPhi
std::vector< int > m_detectors
std::vector< int > m_samplings
std::vector< int > m_samples
bool m_doQuarter
bool m_doEtaAxesDivision
bool m_doPhiAxesDivision
std::vector< const CaloCell * > m_cells
std::vector< double > m_rings

Detailed Description

Definition at line 28 of file RingerReFex.h.

Constructor & Destructor Documentation

◆ RingSet()

RingerReFex::RingSet::RingSet ( unsigned int maxRings,
double deta,
double dphi,
const std::vector< int > & detectors,
const std::vector< int > & samplings,
const std::vector< int > & samples,
bool doQuarter,
bool doEtaAxesDivision,
bool doPhiAxesDivision )

=================================================================================

Definition at line 384 of file RingerReFex.cxx.

392 : m_deltaEta(deta),
393 m_deltaPhi(dphi),
395 m_samplings(samplings),
396 m_samples(samples),
397 m_doQuarter(doQuarter),
398 m_doEtaAxesDivision(doEtaAxesDivision),
399 m_doPhiAxesDivision(doPhiAxesDivision)
400{
401
402 if(doQuarter){
403 if(doEtaAxesDivision && doPhiAxesDivision){
404 m_rings.resize( (maxRings-1)*4 + 1 );
405 }else{
406 m_rings.resize( (maxRings-1)*2 + 2 );
407 }
408 }else{
409 m_rings.resize( maxRings );
410 }
411
412
413}
std::vector< double > m_rings
Definition RingerReFex.h:55
std::vector< int > m_samples
Definition RingerReFex.h:51
std::vector< int > m_detectors
Definition RingerReFex.h:51
const std::vector< std::pair< int, int > > detectors() const
=================================================================================
std::vector< int > m_samplings
Definition RingerReFex.h:51

◆ ~RingSet()

RingerReFex::RingSet::~RingSet ( )
default

Member Function Documentation

◆ buildRings()

void RingerReFex::RingSet::buildRings ( const double eta_hot,
const double phi_hot,
const CaloNoise * noiseCDO,
const double m_noiseFactor,
const bool m_doNoiseThrRings )

=================================================================================

Definition at line 460 of file RingerReFex.cxx.

461{
462 // cache cosh eta value
463 const double cosh_eta = std::cosh(std::abs(eta_center));
464
465 //are we, possibly at the wrap-around region for phi?
466 const bool wrap = Ringer::check_wrap_around(phi_center, false);
467 const bool reverse_wrap = Ringer::check_wrap_around(phi_center, true);
468
469 // Loop over all cells
470 for (std::vector<const CaloCell*>::const_iterator it=m_cells.begin(); it!=m_cells.end(); ++it) {
471
472 if( !(*it) )
473 continue;
474
475 double phi_use = (*it)->phi(); //use this value for phi (wrap protection)
476 if (wrap) phi_use = Ringer::fix_wrap_around(phi_use, false);
477 else if (reverse_wrap) phi_use = Ringer::fix_wrap_around(phi_use, true);
478
479 // Measure delta eta and delta phi to find out on which ring we are
480 const double deltaEta = ((*it)->eta() - eta_center)/m_deltaEta;
481 const double deltaPhi = (phi_use - phi_center)/m_deltaPhi;
482
483 // ring index
484 unsigned int i = 0;
485
486
487 const double deltaGreater = std::max(std::abs(deltaEta), std::abs(deltaPhi));
488 i = static_cast<unsigned int>( std::floor (deltaGreater) );
489 // Certain compilers have problems with round(), so let's do it ourselves
490 if ( (deltaGreater - (double) i) > 0.5) ++i;
491
492 if(m_doQuarter){ // only for i>0, the central ring is not divided
493 bool etaPositive = ( deltaEta > 0 )?true:false;
494 bool phiPositive = ( deltaPhi > 0)?true:false;
495 // i > 0 (not central ring)
496 // Correct position in which we shall fill the ring:
498 if (phiPositive){
499 if (etaPositive){
500 i = (i * 4) - 3;
501 }
502 else{
503 i = (i * 4) - 2;
504 }
505 }
506 else if (etaPositive){
507 i = (i * 4) - 1;
508 }
509 else{
510 i = (i * 4);
511 }
512 } else if ((m_doEtaAxesDivision || m_doPhiAxesDivision) && i){
514 i = (etaPositive)?(i * 2):((i * 2) - 1);
515 }
516 else {
517 i = (phiPositive)?(i * 2):((i * 2) - 1);
518 }
519 }
520 }// Do quarter?
521
522 // Fill
523 if (i < m_rings.size()) {
524 if (doNoiseThrRings){
525 float noiseSigma = noiseCDO->getNoise((*it)->ID(),(*it)->gain());
526 if ( (*it)->energy() > noiseSigma*noiseFactor){
527 m_rings[i] += (*it)->energy() / cosh_eta;
528 }
529 }else{ // Building Rings with sigmaNoise constraint? / in the constructor , rings already resized with your respect rings quantities
530 m_rings[i] += (*it)->energy() / cosh_eta;
531 }
532 }
533 }// Loop over each
534
535}
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:34
std::vector< const CaloCell * > m_cells
Definition RingerReFex.h:54
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition P4Helpers.h:66
bool check_wrap_around(const double phi_center, const bool reverse_wrap)
Helper function to identify wrap around cases.
Definition PhiComps.h:17
double fix_wrap_around(const double phi_value, const bool reverse_wrap)
Helper function to fix wrap around cases.
Definition PhiComps.h:26

◆ clear()

void RingerReFex::RingSet::clear ( )

=================================================================================

Definition at line 453 of file RingerReFex.cxx.

453 {
454 m_rings.clear();
455 m_cells.clear();
456}

◆ detectors()

const std::vector< std::pair< int, int > > RingerReFex::RingSet::detectors ( ) const

=================================================================================

Definition at line 417 of file RingerReFex.cxx.

418{
419 std::vector< std::pair<int,int> > vec;
420 for ( unsigned i=0; i<m_detectors.size(); ++i )
421 vec.push_back( std::make_pair( m_detectors[i], m_samplings[i] ) );
422 return vec;
423}
std::vector< size_t > vec

◆ fill_cells_info()

void RingerReFex::RingSet::fill_cells_info ( std::vector< float > & cells_eta,
std::vector< float > & cells_phi,
std::vector< float > & cells_et,
std::vector< int > & cells_sampling,
std::vector< int > & cells_size,
std::vector< double > & rings_sum,
std::vector< int > & cells_id,
std::vector< float > & cells_gain )

=================================================================================

Definition at line 307 of file RingerReFex.cxx.

307 {
308 for (std::vector<const CaloCell*>::const_iterator it=m_cells.begin(); it!=m_cells.end(); ++it) {
309 cells_eta.push_back((*it)->eta());
310 cells_phi.push_back((*it)->phi());
311 cells_et.push_back((*it)->energy());
312 auto sampling = (*it)->caloDDE()->getSampling();
313 cells_sampling.push_back((int) sampling);
314 cells_id.push_back((*it)->ID().get_identifier32().get_compact());
315 cells_gain.push_back((*it)->gain());
316 }
317 cells_size.push_back(m_cells.size());
318 double sum = 0;
319 for (auto ring : m_rings) sum+=ring;
320 rings_sum.push_back(sum);
321}

◆ isValid()

bool RingerReFex::RingSet::isValid ( const CaloCell * cell) const

=================================================================================

Definition at line 427 of file RingerReFex.cxx.

428{
429 for (std::vector<int>::const_iterator it=m_samples.begin(); it!=m_samples.end(); ++it)
430 {
431 if ( cell->caloDDE()->getSampling() == static_cast<CaloSampling::CaloSample>(*it) )
432 return true;
433
434 }
435 return false;
436}

◆ push_back()

void RingerReFex::RingSet::push_back ( const CaloCell * cell)

=================================================================================

Definition at line 447 of file RingerReFex.cxx.

447 {
448 m_cells.push_back(cell);
449}

◆ rings()

const std::vector< double > & RingerReFex::RingSet::rings ( ) const

=================================================================================

Definition at line 440 of file RingerReFex.cxx.

441{
442 return m_rings;
443}

Member Data Documentation

◆ m_cells

std::vector<const CaloCell*> RingerReFex::RingSet::m_cells
private

Definition at line 54 of file RingerReFex.h.

◆ m_deltaEta

double RingerReFex::RingSet::m_deltaEta
private

Definition at line 50 of file RingerReFex.h.

◆ m_deltaPhi

double RingerReFex::RingSet::m_deltaPhi
private

Definition at line 50 of file RingerReFex.h.

◆ m_detectors

std::vector<int> RingerReFex::RingSet::m_detectors
private

Definition at line 51 of file RingerReFex.h.

◆ m_doEtaAxesDivision

bool RingerReFex::RingSet::m_doEtaAxesDivision
private

Definition at line 52 of file RingerReFex.h.

◆ m_doPhiAxesDivision

bool RingerReFex::RingSet::m_doPhiAxesDivision
private

Definition at line 52 of file RingerReFex.h.

◆ m_doQuarter

bool RingerReFex::RingSet::m_doQuarter
private

Definition at line 52 of file RingerReFex.h.

◆ m_rings

std::vector<double> RingerReFex::RingSet::m_rings
private

Definition at line 55 of file RingerReFex.h.

◆ m_samples

std::vector<int> RingerReFex::RingSet::m_samples
private

Definition at line 51 of file RingerReFex.h.

◆ m_samplings

std::vector<int> RingerReFex::RingSet::m_samplings
private

Definition at line 51 of file RingerReFex.h.


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