diff --git a/TileCalorimeter/TileEvent/CMakeLists.txt b/TileCalorimeter/TileEvent/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..f48215d5afccfa8ea712b6b0071208ec29bd0ecf --- /dev/null +++ b/TileCalorimeter/TileEvent/CMakeLists.txt @@ -0,0 +1,41 @@ +################################################################################ +# Package: TileEvent +################################################################################ + +# Declare the package name: +atlas_subdir( TileEvent ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + Calorimeter/CaloEvent + Control/CLIDSvc + Control/DataModel + Control/StoreGate + DetectorDescription/Identifier + Event/EventContainers + GaudiKernel + TileCalorimeter/TileConditions + TileCalorimeter/TileIdentifier + TileCalorimeter/TileSimEvent + PRIVATE + Calorimeter/CaloDetDescr + Calorimeter/CaloIdentifier + Control/SGTools ) + +# External dependencies: +find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) + +# Component(s) in the package: +atlas_add_library( TileEvent + src/Tile*.cxx + PUBLIC_HEADERS TileEvent + PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES CaloEvent DataModel Identifier GaudiKernel TileIdentifier TileSimEvent StoreGateLib SGtests TileConditionsLib CaloDetDescrLib + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} CaloIdentifier SGTools ) + +atlas_add_dictionary( TileEventDict + TileEvent/TileEventDict.h + TileEvent/selection.xml + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} CaloEvent DataModel StoreGateLib SGtests Identifier GaudiKernel TileConditionsLib TileIdentifier TileSimEvent CaloDetDescrLib CaloIdentifier SGTools TileEvent ) + diff --git a/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h b/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h index cb13aed8c2ea1c7f6d6bd167d1afcfd9427ee6ad..49342f1ea3664d4e64f5d9888f20961d73f359db 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileBeamElem.h @@ -34,6 +34,7 @@ public: TileBeamElem(const Identifier& id, const std::vector<uint32_t>& digits ); TileBeamElem(const HWIdentifier& HWid, const std::vector<uint32_t>& digits ); + TileBeamElem(const HWIdentifier& HWid, std::vector<uint32_t>&& digits ); TileBeamElem(const HWIdentifier& HWid, uint32_t digit ); @@ -45,7 +46,7 @@ public: inline int size(void) const { return m_digits.size(); } - inline std::vector<uint32_t> get_digits(void) const { return m_digits; } + inline const std::vector<uint32_t>& get_digits(void) const { return m_digits; } std::string whoami (void) const { return "TileBeamElem"; } void print (void) const; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileCosmicMuon.h b/TileCalorimeter/TileEvent/TileEvent/TileCosmicMuon.h index c9ab775e9590bbe90cf3c0093647239702fc3bc7..643055183489a5d3ffecd6b6ff072f67dac68f26 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileCosmicMuon.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileCosmicMuon.h @@ -56,15 +56,44 @@ class TileCosmicMuon inline void SetDirectionTheta(double theta) {m_directionTheta = theta;} inline void SetFitQuality(double quality) {m_fitQuality = quality;} inline void SetFitNCells(int ncells) {m_fitNCells = ncells;} - inline void SetPathTop(std::vector<double> path) {m_pathTop = path;} - inline void SetPathBottom(std::vector<double> path) {m_pathBottom = path;} - inline void SetEnergyTop(std::vector<double> energy) {m_energyTop = energy;} - inline void SetEnergyBottom(std::vector<double> energy) {m_energyBottom = energy;} - inline void SetTrackCellHash(std::vector<IdentifierHash> cells) {m_trackCellHash = cells;} - inline void SetSegmentPath(std::vector<double> path) {m_segmentPath = path;} - inline void SetSegmentPartition(std::vector<int> partition) {m_segmentPartition = partition;} - inline void SetSegmentModule(std::vector<int> module) {m_segmentModule = module;} - inline void SetSegmentSampling(std::vector<int> sampling) {m_segmentSampling = sampling;} + + inline void SetPathTop(const std::vector<double>& path) + {m_pathTop = path;} + inline void SetPathBottom(const std::vector<double>& path) + {m_pathBottom = path;} + inline void SetEnergyTop(const std::vector<double>& energy) + {m_energyTop = energy;} + inline void SetEnergyBottom(const std::vector<double>& energy) + {m_energyBottom = energy;} + inline void SetTrackCellHash(const std::vector<IdentifierHash>& cells) + {m_trackCellHash = cells;} + inline void SetSegmentPath(const std::vector<double>& path) + {m_segmentPath = path;} + inline void SetSegmentPartition(const std::vector<int>& partition) + {m_segmentPartition = partition;} + inline void SetSegmentModule(const std::vector<int>& module) + {m_segmentModule = module;} + inline void SetSegmentSampling(const std::vector<int>& sampling) + {m_segmentSampling = sampling;} + + inline void SetPathTop(std::vector<double>&& path) + {m_pathTop = std::move(path);} + inline void SetPathBottom(std::vector<double>&& path) + {m_pathBottom = std::move(path);} + inline void SetEnergyTop(std::vector<double>&& energy) + {m_energyTop = std::move(energy);} + inline void SetEnergyBottom(std::vector<double>&& energy) + {m_energyBottom = std::move(energy);} + inline void SetTrackCellHash(std::vector<IdentifierHash>&& cells) + {m_trackCellHash = std::move(cells);} + inline void SetSegmentPath(std::vector<double>&& path) + {m_segmentPath = std::move(path);} + inline void SetSegmentPartition(std::vector<int>&& partition) + {m_segmentPartition = std::move(partition);} + inline void SetSegmentModule(std::vector<int>&& module) + {m_segmentModule = std::move(module);} + inline void SetSegmentSampling(std::vector<int>&& sampling) + {m_segmentSampling = std::move(sampling);} /** Getters. See class members description. */ diff --git a/TileCalorimeter/TileEvent/TileEvent/TileDigits.h b/TileCalorimeter/TileEvent/TileEvent/TileDigits.h index fbf98847caf2d74c52d898648004b2d62b61027e..880daa36a599ba50403605c6f46eddc902cd256b 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileDigits.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileDigits.h @@ -44,6 +44,8 @@ public: TileDigits(const HWIdentifier& HWid, const std::vector<float>& digits ); + TileDigits(const HWIdentifier& HWid, std::vector<float>&& digits ); + /** @return number of samples */ int nsamples() const { return m_digits.size(); } diff --git a/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h b/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h index 3b1083971317d041cc015317516f2fd98c67f325..81ce5b02b95d4676c1d72128f9b3d6e179e8a060 100644 --- a/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileLasCalib.h @@ -18,9 +18,7 @@ class TileLasCalib { public: TileLasCalib() - : HG(1) - , LG(0) - , m_mean_LG(-99.) + : m_mean_LG(-99.) , m_sigma_LG(-99.) , m_mean_HG(-99.) , m_sigma_HG(-99.) @@ -98,14 +96,14 @@ class TileLasCalib { bool isSet(int gain) const{ if(gain == LG) return m_isSet_LG; if(gain == HG) return m_isSet_HG; - if(gain != LG && gain != HG) return false; + //if(gain != LG && gain != HG) return false; return false; } // isSet private: - int HG; - int LG; + static const int HG = 1; + static const int LG = 0; double m_mean_LG; double m_sigma_LG; double m_mean_HG; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h b/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h index 39197fe5f543785b6e1d67212e09238edd1515cb..3ed83b5d0a40a0d17c7a0a05322751bc41858332 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawChannel.h @@ -43,12 +43,47 @@ class TileRawChannel: public TileRawData { TileRawChannel(const Identifier& id, float amplitude, float time, float quality, float ped = 0.0); TileRawChannel(const HWIdentifier& HWid, float amplitude, float time, float quality, float ped = 0.0); + TileRawChannel(const HWIdentifier& HWid, + std::vector<float>&& amplitude, + std::vector<float>&& time, + std::vector<float>&& quality, + float ped = 0.0); /* Destructor */ ~TileRawChannel() { } + void assign (const HWIdentifier& id, + float amplitude, + float time, + float quality, + float ped = 0.0) + { + TileRawData::operator= (TileRawData (id)); + m_amplitude.resize(1); + m_amplitude[0] = amplitude; + m_time.resize(1); + m_time[0] = time; + m_quality.resize(1); + m_quality[0] = quality; + m_pedestal = ped; + } + + template <class IteratorA, class IteratorT, class IteratorQ> + void assign (const HWIdentifier& id, + IteratorA amplitude_beg, IteratorA amplitude_end, + IteratorT time_beg, IteratorT time_end, + IteratorQ qual_beg, IteratorQ qual_end, + float ped = 0.0) + { + TileRawData::operator= (TileRawData (id)); + m_amplitude.assign (amplitude_beg, amplitude_end); + m_time.assign (time_beg, time_end); + m_quality.assign (qual_beg, qual_end); + m_pedestal = ped; + } + int add(float amplitude, float time, float quality); void setPedestal(float ped) { m_pedestal = ped; } void scaleAmplitude(float scale); @@ -58,13 +93,15 @@ class TileRawChannel: public TileRawData { /* Inline access methods */ inline float amplitude(int ind = 0) const { return m_amplitude[ind]; } + inline void setAmplitude (float a, int ind=0) { m_amplitude[ind] = a; } inline float time(int ind = 0) const { return m_time[ind]; } inline float uncorrTime() const { return m_time[m_time.size() - 1]; } inline float quality(int ind = 0) const { return m_quality[ind]; } inline float pedestal(void) const { return m_pedestal; } - inline int size(void) const { return m_amplitude.size(); } - inline int sizeTime(void) const { return m_time.size(); } + inline int size() const { return m_amplitude.size(); } + inline int sizeTime() const { return m_time.size(); } + inline int sizeQuality() const { return m_quality.size(); } std::string whoami(void) const { return "TileRawChannel"; } void print(void) const; diff --git a/TileCalorimeter/TileEvent/TileEvent/TileRawData.h b/TileCalorimeter/TileEvent/TileEvent/TileRawData.h index c60a5e7e40b8b38fc0c4f22c3ce9a20fbfacd12d..ab0f905065d56a0875f8926bb43e7238ad460dae 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileRawData.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileRawData.h @@ -37,7 +37,10 @@ public: /* Constructor: */ TileRawData(){} TileRawData(const Identifier& id); - TileRawData(const HWIdentifier& HWid); + TileRawData(const HWIdentifier& HWid) + : m_adc_hwid (HWid) + { + } /* Destructor */ virtual ~TileRawData() {} diff --git a/TileCalorimeter/TileEvent/TileEvent/TileTTL1.h b/TileCalorimeter/TileEvent/TileEvent/TileTTL1.h index c4ecba75c6967b8735a0e6e248ab18f43eb6dc4f..3ff6d177864e7babf133ee83fedd52910c950305 100755 --- a/TileCalorimeter/TileEvent/TileEvent/TileTTL1.h +++ b/TileCalorimeter/TileEvent/TileEvent/TileTTL1.h @@ -35,6 +35,8 @@ public: TileTTL1(const Identifier& id, const std::vector<float>& digits ); + TileTTL1(const Identifier& id, std::vector<float>&& digits ); + ~TileTTL1() {} /* Access methods */ diff --git a/TileCalorimeter/TileEvent/src/TileBeamElem.cxx b/TileCalorimeter/TileEvent/src/TileBeamElem.cxx index 386ba631ca7ceb06dae83d080feecc94f4ed31a4..65ecb3ec57bd4f6921ccc558823715e50b9deac0 100755 --- a/TileCalorimeter/TileEvent/src/TileBeamElem.cxx +++ b/TileCalorimeter/TileEvent/src/TileBeamElem.cxx @@ -41,6 +41,14 @@ TileBeamElem::TileBeamElem( const HWIdentifier& HWid, { } +TileBeamElem::TileBeamElem( const HWIdentifier& HWid, + std::vector<uint32_t>&& digits ) + + : TileRawData( HWid ) + , m_digits ( std::move(digits) ) +{ +} + TileBeamElem::TileBeamElem( const HWIdentifier& HWid, uint32_t digit ) diff --git a/TileCalorimeter/TileEvent/src/TileDigits.cxx b/TileCalorimeter/TileEvent/src/TileDigits.cxx index d1a0095707deb8e82c9d2eaca31121636f817837..28bbef43db3ec7479fb7a57f648c32270ca3c7d7 100755 --- a/TileCalorimeter/TileEvent/src/TileDigits.cxx +++ b/TileCalorimeter/TileEvent/src/TileDigits.cxx @@ -97,6 +97,15 @@ TileDigits::TileDigits( const HWIdentifier& HWid, } +TileDigits::TileDigits( const HWIdentifier& HWid, + std::vector<float>&& digits ) + + : TileRawData( HWid ) + , m_digits ( std::move(digits) ) +{ +} + + void TileDigits::print() const { std::cout << (std::string) (*this) << std::endl; diff --git a/TileCalorimeter/TileEvent/src/TileRawChannel.cxx b/TileCalorimeter/TileEvent/src/TileRawChannel.cxx index 526e1ee0503614091dda1ceadb87bff471f93841..c677c8e0c39439ccd20503ed2ac249e4d23922d7 100755 --- a/TileCalorimeter/TileEvent/src/TileRawChannel.cxx +++ b/TileCalorimeter/TileEvent/src/TileRawChannel.cxx @@ -46,6 +46,19 @@ TileRawChannel::TileRawChannel( const HWIdentifier& HWid, { } +TileRawChannel::TileRawChannel(const HWIdentifier& HWid, + std::vector<float>&& amplitude, + std::vector<float>&& time, + std::vector<float>&& quality, + float ped /*= 0.0*/) + : TileRawData( HWid ), + m_amplitude (std::move(amplitude)), + m_time (std::move(time)), + m_quality (std::move(quality)), + m_pedestal (ped) +{ +} + int TileRawChannel::add(float amplitude, float time, float quality) { m_amplitude.push_back(amplitude); m_time.push_back(time); diff --git a/TileCalorimeter/TileEvent/src/TileRawData.cxx b/TileCalorimeter/TileEvent/src/TileRawData.cxx index c3449096245cc191e1c70086fd2decbb2f486d5c..1a529ae8f8c5501efe97f573eab23fffcf9ce387 100755 --- a/TileCalorimeter/TileEvent/src/TileRawData.cxx +++ b/TileCalorimeter/TileEvent/src/TileRawData.cxx @@ -31,10 +31,6 @@ // get cabling TileCablingService * s_cabling = TileCablingService::getInstance(); -TileRawData::TileRawData( const HWIdentifier& hwid ) : m_adc_hwid( hwid ) -{ -} - TileRawData::TileRawData( const Identifier& id ) { m_adc_hwid = s_cabling->s2h_adc_id(id); diff --git a/TileCalorimeter/TileEvent/src/TileTTL1.cxx b/TileCalorimeter/TileEvent/src/TileTTL1.cxx index f32b61d84df166f7f84425d753550d233df3fff0..330074c6eda2ee235d95e205fb3bdcdf8c90ecea 100755 --- a/TileCalorimeter/TileEvent/src/TileTTL1.cxx +++ b/TileCalorimeter/TileEvent/src/TileTTL1.cxx @@ -36,6 +36,13 @@ TileTTL1::TileTTL1( const Identifier& id, { } +TileTTL1::TileTTL1( const Identifier& id, + std::vector<float>&& digits ) : + m_ID (id), + m_TTL1digits (std::move(digits)) + { } + + TileTTL1::TileTTL1( const Identifier& id, const std::vector<double>& digits ) : m_ID (id)