diff --git a/TileCalorimeter/TileEvent/TileEvent/TileL2.h b/TileCalorimeter/TileEvent/TileEvent/TileL2.h index deb7b1af5e77609412ef85be576dab21d770cf80..98eaa5bdf956f4904bd905bdbaa5685d056900cd 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileL2.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileL2.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //*************************************************************************** @@ -49,12 +49,12 @@ class TileL2 { /* Set methods */ /** Set Muon Info in TileL2 */ - void setMu(std::vector<float>& eta, - std::vector<float>& enemu0, - std::vector<float>& enemu1, - std::vector<float>& enemu2, - std::vector<unsigned int>& qual, - std::vector<unsigned int>& val) + void setMu(const std::vector<float>& eta, + const std::vector<float>& enemu0, + const std::vector<float>& enemu1, + const std::vector<float>& enemu2, + const std::vector<unsigned int>& qual, + const std::vector<unsigned int>& val) { m_eta = eta; m_enemu0 = enemu0; @@ -64,6 +64,21 @@ class TileL2 { m_val = val; } + void setMu(std::vector<float>&& eta, + std::vector<float>&& enemu0, + std::vector<float>&& enemu1, + std::vector<float>&& enemu2, + std::vector<unsigned int>&& qual, + std::vector<unsigned int>&& val) + { + m_eta = std::move(eta); + m_enemu0 = std::move(enemu0); + m_enemu1 = std::move(enemu1); + m_enemu2 = std::move(enemu2); + m_quality_factor = std::move(qual); + m_val = std::move(val); + } + /** Set sumE vector in TileL2 */ inline void setEt(const std::vector<float>& sumE) {m_sumE = sumE; } @@ -77,12 +92,14 @@ class TileL2 { /** Return Data */ inline unsigned int val(unsigned int i) const { return m_val[i]; } + inline const std::vector<unsigned int>& val() const { return m_val; } /** Return number of muons */ inline unsigned int NMuons() const { return m_eta.size(); } /** Return eta (computed as the average of the eta values of the TileCal cells where the muon goes through) */ inline float eta(unsigned int ind) const { return m_eta[ind]; } + inline const std::vector<float>& eta() const { return m_eta; } /** Return phi (average value at the TileCal radius) */ inline float phi(unsigned int /* ind=0 */) const { return m_phi; } @@ -95,18 +112,22 @@ class TileL2 { /** Return energy deposited in innermost layer (A cells) */ inline float enemu0(unsigned int ind) const { return m_enemu0[ind]; } + inline const std::vector<float>& enemu0() const { return m_enemu0; } /** Return energy deposited in central layer (BC cells) */ inline float enemu1(unsigned int ind) const { return m_enemu1[ind]; } + inline const std::vector<float>& enemu1() const { return m_enemu1; } /** Return energy deposited in outermost layer (D cells) */ inline float enemu2(unsigned int ind) const { return m_enemu2[ind]; } + inline const std::vector<float>& enemu2() const { return m_enemu2; } /** Return quality flag (0 or 1): * set to 0 if the "energy deposition path" is MIP like in all three samples, * set to 1 if the "energy deposition path" is MIP like in two samples and a larger energy deposition is found in the remaining cell */ inline unsigned int qual(unsigned int ind) const { return m_quality_factor[ind]; } + inline const std::vector<unsigned int>& qual() const { return m_quality_factor; } /** Return number of sumE words */ inline unsigned int NsumE() const { return m_sumE.size(); } @@ -132,6 +153,7 @@ class TileL2 { /** Return sumE i-th element */ inline float sumE(unsigned int ind) const { return m_sumE[ind]; } + inline const std::vector<float>& sumEVec() const { return m_sumE; } /** Return identification */ std::string whoami (void) const { return "TileL2"; } @@ -148,6 +170,7 @@ class TileL2 { inline void setzero() { clear(); } private: + friend class TileL2Cnv_p1; /** Drawer ID: 0x100-0x13F, 0x200-0x23F, 0x300-0x33F, 0x400-0x43F */ int m_ID; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileMu.h b/TileCalorimeter/TileEvent/TileEvent/TileMu.h index eed434ea58047306b123793f287ad1409ac21134..c0d867a0d584c1f1cb9c7b14d78b9e1ea38fce90 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileMu.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileMu.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //============================================== @@ -34,12 +34,12 @@ class TileMu { {} /** Constructor */ - TileMu ( float eta, float phi, std::vector<float> & ener, float qual ); + TileMu ( float eta, float phi, const std::vector<float> & ener, float qual ); /** Destructor */ ~TileMu() {} - void Set( float eta, float phi, std::vector<float> & ener, float qual ); + void Set( float eta, float phi, const std::vector<float> & ener, float qual ); /** Eta (computed as the average of the eta values of the TileCal cells where the muon goes through) */ float eta() const { return m_eta; } @@ -53,7 +53,7 @@ class TileMu { * 3rd component: energy deposited in outermost layer (D cells), * 4th component: energy deposited in the surrounding cells */ - std::vector<float> enedep() const { return m_energy_deposited; } + const std::vector<float>& enedep() const { return m_energy_deposited; } /** Quality flag (0 or 1): * set to 0 if the "energy deposition path" is MIP like in all three samples (tight muon), diff --git a/TileCalorimeter/TileEvent/TileEvent/TileMuonReceiverObj.h b/TileCalorimeter/TileEvent/TileEvent/TileMuonReceiverObj.h index 576ce6fe6601c680be32709058328a450909f9bb..d4cb98e5eb018ef58c56dd331820e8d517b35f69 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileMuonReceiverObj.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileMuonReceiverObj.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -41,17 +41,46 @@ class TileMuonReceiverObj { TileMuonReceiverObj( int id ) { m_id=id; } - TileMuonReceiverObj( int id, std::vector<bool> &decision) - { m_id=id; m_TileMuRcvDecision=decision; } - - TileMuonReceiverObj( int id, std::vector<float> &thresholds) - { m_id=id; m_TileMuRcvThresholds=thresholds; } - - TileMuonReceiverObj( int id, std::vector<float> &ene, std::vector<float> &time) - { m_id=id; m_TileMuRcvEne=ene; m_TileMuRcvTime=time; } - - TileMuonReceiverObj( int id, std::vector<float> &ene, std::vector<float> &time, std::vector<bool> &decision) - { m_id=id; m_TileMuRcvEne=ene; m_TileMuRcvTime=time; m_TileMuRcvDecision=decision; } + TileMuonReceiverObj( int id, const std::vector<bool> &decision) + : m_id(id), + m_TileMuRcvDecision(decision) + { + } + + TileMuonReceiverObj( int id, const std::vector<float> &thresholds) + : m_id(id), + m_TileMuRcvThresholds(thresholds) + { + } + + TileMuonReceiverObj( int id, const std::vector<float> &ene, const std::vector<float> &time) + : m_id(id), + m_TileMuRcvEne(ene), + m_TileMuRcvTime(time) + { + } + + TileMuonReceiverObj( int id, const std::vector<float> &ene, const std::vector<float> &time, const std::vector<bool> &decision) + : m_id(id), + m_TileMuRcvDecision(decision), + m_TileMuRcvEne(ene), + m_TileMuRcvTime(time) + + { + } + + TileMuonReceiverObj( int id, + std::vector<float>&& ene, + std::vector<float>&& time, + std::vector<bool>&& decision, + std::vector<float>&& thresholds) + : m_id(id), + m_TileMuRcvDecision(std::move(decision)), + m_TileMuRcvThresholds(std::move(thresholds)), + m_TileMuRcvEne(std::move(ene)), + m_TileMuRcvTime(std::move(time)) + { + } // destructor // @@ -59,16 +88,16 @@ class TileMuonReceiverObj { // set methods // - void Set(int id, std::vector<bool> &decision) + void Set(int id, const std::vector<bool> &decision) { m_id=id; m_TileMuRcvDecision=decision; } - void Set(int id, std::vector<float> &thresholds) + void Set(int id, const std::vector<float> &thresholds) { m_id=id; m_TileMuRcvThresholds=thresholds; } - void Set(int id, std::vector<float> &ene, std::vector<float> &time) + void Set(int id, const std::vector<float> &ene, const std::vector<float> &time) { m_id=id; m_TileMuRcvEne=ene; m_TileMuRcvTime=time; } - void Set(int id, std::vector<float> &ene, std::vector<float> &time, std::vector<bool> &decision) + void Set(int id, const std::vector<float> &ene, const std::vector<float> &time, const std::vector<bool> &decision) { m_id=id; m_TileMuRcvEne=ene; m_TileMuRcvTime=time; m_TileMuRcvDecision=decision; } // access methods diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h b/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h index a8f6b90a13bd94104ed620d6a15e261465d6871a..27822a004a7866b37ad7ba8261ebcd57de54acb6 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //*************************************************************************** @@ -51,7 +51,10 @@ class TileRawChannel: public TileRawData { float ped = 0.0); TileRawChannel(const Identifier& id, float amplitude, float time, float quality, float ped = 0.0); + TileRawChannel (const TileRawChannel&) = default; TileRawChannel& operator=(const TileRawChannel&) = default; + TileRawChannel (TileRawChannel&&) = default; + TileRawChannel& operator= (TileRawChannel&&) = default; /* Destructor */ diff --git a/TileCalorimeter/TileEvent/src/TileMu.cxx b/TileCalorimeter/TileEvent/src/TileMu.cxx index 7231d55e3be55c337ead0d6693337fb4d0e45f7d..d2b599c414abf43fbf7bd9bdd8c68e89acc670c0 100755 --- a/TileCalorimeter/TileEvent/src/TileMu.cxx +++ b/TileCalorimeter/TileEvent/src/TileMu.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //======================================== @@ -13,7 +13,7 @@ #include <sstream> #include <iomanip> -TileMu::TileMu ( float eta, float phi, std::vector<float> & ener, float qual ) +TileMu::TileMu ( float eta, float phi, const std::vector<float> & ener, float qual ) : m_eta(eta) , m_phi(phi) , m_energy_deposited(ener) @@ -21,7 +21,7 @@ TileMu::TileMu ( float eta, float phi, std::vector<float> & ener, float qual ) { } -void TileMu::Set( float eta, float phi, std::vector<float> & ener, float qual ) +void TileMu::Set( float eta, float phi, const std::vector<float> & ener, float qual ) { m_eta = eta; m_phi = phi; diff --git a/TileCalorimeter/TileRecAlgs/src/TileRawChannelToTTL1.cxx b/TileCalorimeter/TileRecAlgs/src/TileRawChannelToTTL1.cxx index 582a98f9b3f592498f528fc076280a12ad226f8c..61d2d175dc5b0700cef2ffde7524e1a227d490ef 100644 --- a/TileCalorimeter/TileRecAlgs/src/TileRawChannelToTTL1.cxx +++ b/TileCalorimeter/TileRecAlgs/src/TileRawChannelToTTL1.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //***************************************************************************** @@ -30,9 +30,7 @@ // small hack to be able to modify original TileRawChannel #include "TileRawChannelToTTL1.h" -#define private public #include "TileEvent/TileRawChannel.h" -#undef private #include "TileIdentifier/TileHWID.h" #include "TileIdentifier/TileFragHash.h" @@ -242,27 +240,30 @@ StatusCode TileRawChannelToTTL1::execute() { //=== check if we have VeryLargeHfNoise, this indicates hot channel overflow if (status.contains(TileBchPrbs::VeryLargeHfNoise)) { hwid = m_tileHWID->adc_id(m_tileHWID->channel_id(hwid), adc); - pRch->m_adc_hwid = hwid; - pRch->m_amplitude[0] = m_tileToolEmscale->channelCalib(drawerIdx, + float amp = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, 1023., TileRawChannelUnit::ADCcounts, rChUnit); - pRch->m_time[0] = 0.0; - pRch->m_quality[0] = 15.; - pRch->m_pedestal = 0.0; + *pRch = TileRawChannel (hwid, + amp, + 0.0, // time + 15., // quality + 0.0); // pedestal } else { //=== dead channel, put zero energy - pRch->m_amplitude[0] = 0.0; - pRch->m_time[0] = 0.0; - pRch->m_quality[0] = 0.0; - pRch->m_pedestal = 0.0; + *pRch = TileRawChannel (pRch->adc_HWID(), + 0.0, // amplitude + 0.0, // time + 0.0, // quality + 0.0); // pedestal } } else if (status.isNoisy()) { // noisy channel ... //=== not bad, but noisy channel float noise = 0.0; // FIXME::add some noise - but don't know what to add - pRch->m_amplitude[0] += m_tileToolEmscale->channelCalib(drawerIdx, + float delamp = m_tileToolEmscale->channelCalib(drawerIdx, channel, adc, noise, TileRawChannelUnit::ADCcounts, rChUnit); + pRch->setAmplitude (delamp + pRch->amplitude()); } }