|
ATLAS Offline Software
|
Go to the documentation of this file.
26 #include "GaudiKernel/ThreadLocalContext.h"
27 #include "CaloDetDescr/CaloDetDescrElement.h"
47 ATH_MSG_FATAL(
"Wrong eta range configuration. Size must be equal or more than two." );
59 ATH_MSG_FATAL(
"Could not initialize base tool IReAlgToolCalo." );
60 return StatusCode::FAILURE;
64 return StatusCode::FAILURE;
79 ATH_MSG_DEBUG(
"Ringer algorithm initialization completed successfully." );
89 return StatusCode::SUCCESS;
97 const EventContext& context)
const{
101 for (
unsigned rs = 0; rs <
m_nRings.size(); ++rs) {
112 vec_rs.push_back(
obj );
115 std::vector<const CaloCell*> vec_tile_cells;
117 std::vector<const TileCell*>
sel;
118 std::vector<const TileCell*>::const_iterator
it, itBegin, itEnd;
120 if(
m_dataSvc->loadCollections( context, roi,
sel ).isFailure() ){
122 return StatusCode::FAILURE;
125 itBegin =
sel.begin();
127 for(
it = itBegin;
it != itEnd; ++
it)
130 vec_tile_cells.push_back(
static_cast<const CaloCell *
>(*
it));
134 for(
auto& rs : vec_rs ){
139 for (
auto det : rs.detectors() ){
142 int sampling =
det.second;
144 if( det_id ==
TILE ){
146 for (std::vector<const CaloCell *>::const_iterator
it = vec_tile_cells.begin();
it != vec_tile_cells.end(); ++
it)
148 if( !rs.isValid(*
it) )
continue;
163 if(
m_dataSvc->loadCollections( context, roi, det_id, sampling,
sel ).isFailure() )
165 ATH_MSG_ERROR(
"Failure while trying to retrieve cell information for the "<< det_id <<
" calorimeter." );
166 return StatusCode::FAILURE;
174 for(
it = itBegin;
it != itEnd; ++
it)
181 if( !rs.isValid( it_tmp ) )
continue;
182 rs.push_back(it_tmp);
203 return StatusCode::SUCCESS;
212 const EventContext& context)
const
225 ATH_CHECK( ringsCollection.
record( std::make_unique<xAOD::TrigRingerRingsContainer>(),
226 std::make_unique<xAOD::TrigRingerRingsAuxContainer>() ) );
239 ringsCollection->
push_back( dummyRinger );
240 return StatusCode::SUCCESS;
244 std::vector<RingerReFex::RingSet> vec_rs;
245 load_cells_time.start();
247 load_cells_time.stop();
249 std::vector<float> ref_rings;
252 auto rings =
it->rings();
253 ref_rings.insert(ref_rings.end(), rings.begin(), rings.end());
257 ringsCollection->
push_back( ptrigRingerRings );
258 ptrigRingerRings->setRings(ref_rings);
261 std::vector<float> cells_eta;
262 std::vector<float> cells_et;
263 std::vector<float> cells_phi;
264 std::vector<int> cells_sampling;
265 std::vector<int> cells_size;
266 std::vector<double> rings_sum;
267 std::vector<int> cells_id;
268 std::vector<float> cells_gain;
270 for(
auto& rs : vec_rs )
271 rs.fill_cells_info(cells_eta, cells_phi, cells_et, cells_sampling, cells_size, rings_sum, cells_id, cells_gain);
282 cells_etaDec(*ptrigRingerRings) = cells_eta;
283 cells_etDec(*ptrigRingerRings) = cells_et;
284 cells_phiDec(*ptrigRingerRings) = cells_phi;
285 cells_samplingDec(*ptrigRingerRings) = cells_sampling;
286 cells_sizeDec(*ptrigRingerRings) = cells_size;
287 cells_idDec(*ptrigRingerRings) = cells_id;
288 cells_gainDec(*ptrigRingerRings) = cells_gain;
290 if (
m_doQuarter[0]) asym_rings_sumDec(*ptrigRingerRings) = rings_sum;
291 else rings_sumDec(*ptrigRingerRings) = rings_sum;
295 ptrigRingerRings->setEmClusterLink( clusLink );
302 return StatusCode::SUCCESS;
307 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 ){
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());
317 cells_size.push_back(
m_cells.size());
320 rings_sum.push_back(
sum);
334 if(!
cell)
return false;
335 double this_eta =
cell->eta();
336 double this_phi =
cell->phi();
337 if (this_eta >
etamin && this_eta < etamax){
338 double phi_use = this_phi;
341 if (phi_use > phimin && phi_use < phimax){
357 ATH_MSG_INFO(
"--------------- Cluster Information (2) ----------------");
360 ATH_MSG_INFO(
"et = "<<
cl.et() <<
" eta = " <<
cl.eta() <<
" roiword = " <<
cl.RoIword());
363 for(
unsigned rs=0; rs<vec_rs.size(); ++rs){
367 ATH_MSG_INFO(
"Pattern has size equal than: " << vec_rs.at(rs).rings().size());
370 for(
unsigned i=0;
i<vec_rs.at(rs).rings().
size();++
i){
371 tot+=vec_rs.at(rs).rings()[
i];
372 ATH_MSG_INFO(
" Ring " <<
i <<
" energy: " << vec_rs.at(rs).rings()[
i] <<
" MeVs.");
374 ATH_MSG_INFO(
"RingSet = " << rs <<
" Total energy = " << tot );
376 ATH_MSG_INFO(
"---------------- End of information -----------------");
386 const std::vector<int> &samplings,
387 const std::vector<int> &samples,
389 bool doEtaAxesDivision,
390 bool doPhiAxesDivision
403 if(doEtaAxesDivision && doPhiAxesDivision){
404 m_rings.resize( (maxRings-1)*4 + 1 );
406 m_rings.resize( (maxRings-1)*2 + 2 );
419 std::vector< std::pair<int,int> >
vec;
448 m_cells.push_back(
cell);
463 const double cosh_eta = std::cosh(std::abs(eta_center));
470 for (std::vector<const CaloCell*>::const_iterator
it=m_cells.begin();
it!=m_cells.end(); ++
it) {
475 double phi_use = (*it)->phi();
488 i =
static_cast<unsigned int>( std::floor (deltaGreater) );
490 if ( (deltaGreater - (
double)
i) > 0.5) ++
i;
493 bool etaPositive = (
deltaEta > 0 )?
true:
false;
494 bool phiPositive = (
deltaPhi > 0)?
true:
false;
506 else if (etaPositive){
514 i = (etaPositive)?(
i * 2):((
i * 2) - 1);
517 i = (phiPositive)?(
i * 2):((
i * 2) - 1);
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;
530 m_rings[
i] += (*it)->energy() / cosh_eta;
JetConstituentVector::iterator iterator
void buildRings(const double eta_hot, const double phi_hot, const CaloNoise *noiseCDO, const double m_noiseFactor, const bool m_doNoiseThrRings)
=================================================================================
StatusCode prepareRinger(std::vector< RingerReFex::RingSet > &vec_rs, const xAOD::TrigEMCluster &emCluster, const IRoiDescriptor &roi, const EventContext &context) const
Group
Properties of a chain group.
virtual double phi() const override final
get phi (through CaloDetDescrElement)
float eta() const
get Eta (calibrated)
Gaudi::Property< double > m_noiseFactor
Gaudi::Property< double > m_phiSearchWindowSize
const_iterator end() const
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
StatusCode accept(const xAOD::Muon *mu)
Gaudi::Property< std::vector< bool > > m_doPhiAxesDivision
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
void push_back(const CaloCell *)
=================================================================================
Gaudi::Property< bool > m_doNoiseThrRings
bool msgLvl(const MSG::Level lvl) const
Gaudi::Property< std::vector< bool > > m_doQuarter
std::vector< size_t > vec
std::vector< const CaloCell * > m_cells
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
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)
const std::vector< double > & rings() const
=================================================================================
DETID
An enum to define subdetector names.
Gaudi::Property< double > m_etaSearchWindowSize
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
bool maxCell(const CaloCell *cell, double &energy, const double eta_ref, const double phi_ref) const
void printRings(std::vector< RingSet > &, const xAOD::TrigEMCluster &) const
=================================================================================
float phi() const
get Phi (calibrated)
Helper class to provide type-safe access to aux data.
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Gaudi::Property< std::vector< std::vector< int > > > m_detectors
Generic monitoring tool for athena components.
Gaudi::Property< bool > m_globalCenter
::StatusCode StatusCode
StatusCode definition for legacy code.
Describes the API of the Region of Ineterest geometry.
bool check_wrap_around(const double phi_center, const bool reverse_wrap)
Helper function to identify wrap around cases.
virtual StatusCode execute(xAOD::TrigEMCluster &emCluster, const IRoiDescriptor &roi, const CaloDetDescrElement *&, const EventContext &context) const override
=================================================================================
const_iterator begin() const
#define CHECK(...)
Evaluate an expression and check for errors.
Gaudi::Property< bool > m_dumpCells
bool configurationInvalid()
=================================================================================
SG::WriteHandleKey< xAOD::TrigRingerRingsContainer > m_ringerContainerKey
Header file to be included by clients of the Monitored infrastructure.
ToolHandle< GenericMonitoringTool > m_monTool
ElementLink implementation for ROOT usage.
TrigRingerRings_v2 TrigRingerRings
Define the latest version of the TrigRingerRings class.
Gaudi::Property< std::vector< std::vector< int > > > m_samplings
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)
=================================================================================
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
Gaudi::Property< std::vector< float > > m_etaBins
Gaudi::Property< std::vector< float > > m_deltaPhi
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
Data object for each calorimeter readout cell.
std::vector< double > m_rings
SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_clusterContainerKey
void clear()
=================================================================================
RingerReFex(const std::string &type, const std::string &name, const IInterface *parent)
=================================================================================
Gaudi::Property< bool > m_useTile
SG::ReadCondHandleKey< CaloNoise > m_noiseCDOKey
bool isValid(const CaloCell *) const
=================================================================================
Gaudi::Property< std::vector< float > > m_deltaEta
Gaudi::Property< std::vector< std::vector< int > > > m_samples
Description of a trigger EM cluster.
double fix_wrap_around(const double phi_value, const bool reverse_wrap)
Helper function to fix wrap around cases.
Gaudi::Property< std::vector< unsigned int > > m_nRings
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Helper class to provide type-safe access to aux data.
const std::vector< std::pair< int, int > > detectors() const
=================================================================================
virtual StatusCode initialize() override
=================================================================================
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Gaudi::Property< std::vector< bool > > m_doEtaAxesDivision
RingSet_v1 RingSet
Definition of the current "RingSet version".