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 383 of file RingerReFex.cxx.

391 : m_deltaEta(deta),
392 m_deltaPhi(dphi),
394 m_samplings(samplings),
395 m_samples(samples),
396 m_doQuarter(doQuarter),
397 m_doEtaAxesDivision(doEtaAxesDivision),
398 m_doPhiAxesDivision(doPhiAxesDivision)
399{
400
401 if(doQuarter){
402 if(doEtaAxesDivision && doPhiAxesDivision){
403 m_rings.resize( (maxRings-1)*4 + 1 );
404 }else{
405 m_rings.resize( (maxRings-1)*2 + 2 );
406 }
407 }else{
408 m_rings.resize( maxRings );
409 }
410
411
412}
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 459 of file RingerReFex.cxx.

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

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

◆ detectors()

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

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

Definition at line 416 of file RingerReFex.cxx.

417{
418 std::vector< std::pair<int,int> > vec;
419 for ( unsigned i=0; i<m_detectors.size(); ++i )
420 vec.push_back( std::make_pair( m_detectors[i], m_samplings[i] ) );
421 return vec;
422}
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 306 of file RingerReFex.cxx.

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

◆ isValid()

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

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

Definition at line 426 of file RingerReFex.cxx.

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

◆ push_back()

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

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

Definition at line 446 of file RingerReFex.cxx.

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

◆ rings()

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

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

Definition at line 439 of file RingerReFex.cxx.

440{
441 return m_rings;
442}

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: