diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCalibEvent.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCalibEvent.h new file mode 100755 index 0000000000000000000000000000000000000000..ee2cd661c1ec2487ce2e0d65e84d3dc6355a6498 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCalibEvent.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZdcCalibEvent_H +#define ZdcCalibEvent_H + +// STL include +#include <vector> + +// Lang include +#include <inttypes.h> + +#include "DataModel/DataVector.h" + +#include "CLIDSvc/CLASS_DEF.h" + +#include "ZdcEvent/ZdcCell.h" + +class ZdcCalibEvent +{ + +public: + + ZdcCalibEvent (); + + virtual ~ZdcCalibEvent() { } + + /** + * Clear everything for next event + */ + //virtual void clear (); + + void print() const; + + private: + + std::vector<double> m_towerE_A; + std::vector<double> m_towerT_A; + std::vector<double> m_towerE_C; + std::vector<double> m_towerT_C; + + ZdcCellVec m_EMCellVec_A; + ZdcCellVec m_HADCellVec_A; + ZdcCellVec m_HADCellVec_C; + + public: + + double getTowerEnergy_A(int t) {return m_towerE_A[t];} + void setTowerEnergy_A(int t, double energy) {m_towerE_A[t] = energy;} + double getTowerEnergy_C(int t) {return m_towerE_C[t];} + void setTowerEnergy_C(int t,double energy) {m_towerE_C[t] = energy;} + + double getTowerTime_A(int t) {return m_towerT_A[t];} + void setTowerTime_A(int t, double energy) {m_towerT_A[t] = energy;} + double getTowerTime_C(int t) {return m_towerT_C[t];} + void setTowerTime_C(int t,double energy) {m_towerT_C[t] = energy;} + + double getTotalEnergy_A(); + double getTotalEnergy_C(); + + double getEMEnergy_A(); + double getHADEnergy_A(); + double getHADEnergy_C(); + + ZdcCellVec& getEMCell_A() {return m_EMCellVec_A;} + ZdcCellVec& getHADCell_A() {return m_HADCellVec_A;} + ZdcCellVec& getHADCell_C() {return m_HADCellVec_C;} + +}; + +CLASS_DEF(ZdcCalibEvent,9292611,0) + +#endif + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCell.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCell.h new file mode 100755 index 0000000000000000000000000000000000000000..f44e8caced8b491bb2ffa9b5a6a00f17d04f8477 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcCell.h @@ -0,0 +1,69 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//*************************************************************************** +// Filename : ZdcCell.h +// Author : Peter Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// A ZdcCell is the data class containing energy/position information for the "pixel" ZDC channels +// +// HISTORY: +// +// *************************************************************************** + +#ifndef ZDCEVENT_ZDCCell_H +#define ZDCEVENT_ZDCCell_H + +#include "ZdcEvent/ZdcRawData.h" + +class ZdcCell : public ZdcRawData +{ +public: + + /* Constructors */ + + ZdcCell() { } + + ZdcCell(const Identifier& id); + + /* Destructor */ + + virtual ~ZdcCell() { } + + /* Inline access methods */ + + + + std::string whoami (void) const { return "ZdcCell"; } + void print (void) const {}; + // Convertion operator to a std::string + // Can be used in a cast operation : (std::string) ZdcCell + operator std::string() const { return "ZdcCell::string()";}; + +private: + + double m_energy; + double m_time; + double m_x; + double m_y; + + public: + + void setEnergy(double e){m_energy = e;} + double getEnergy() {return m_energy;} + void setTime(double t){m_time = t;} + double getTime() {return m_time;} + void setX(double x){m_x = x;} + double getX() {return m_x;} + void setY(double y){m_x = y;} + double getY() {return m_y;} + +}; + +typedef std::vector<ZdcCell> ZdcCellVec; + +#endif //ZDCEVENT_ZDCDIGITS_H + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigits.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigits.h new file mode 100755 index 0000000000000000000000000000000000000000..8b85109075b13166a9e2fc196188bfb74b493b0e --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigits.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//*************************************************************************** +// Filename : ZdcDigits.h +// Author : Peter Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// A ZdcDigits is the data class corresponding to the amplitude information +// transmitted from the digitizers to the ROD's. It contains a hardware +// identifier (including pmt and adc info) and nsample amplitudes corresponding +// to the time slices read out. Optimal filtering must be applied to these +// amplitudes (including pedestal subtractioin) to produce a ZdcRawChannel. +// +// HISTORY: +// +// *************************************************************************** + +#ifndef ZDCEVENT_ZDCDIGITS_H +#define ZDCEVENT_ZDCDIGITS_H + +#include "ZdcEvent/ZdcRawData.h" + +class ZdcDigits : public ZdcRawData +{ +public: + + /* Constructors */ + + ZdcDigits() { + m_nSamples = 0; + } + + ZdcDigits(const Identifier& id); + + /* Destructor */ + + virtual ~ZdcDigits() { } + + /* Inline access methods */ + + inline int NtimeSamples(void) const { return m_digits_gain0_delay0.size(); } + + unsigned int m_nSamples; + + void set_digits_gain0_delay0(const std::vector<int>& v); + void set_digits_gain0_delay1(const std::vector<int>& v); + void set_digits_gain1_delay0(const std::vector<int>& v); + void set_digits_gain1_delay1(const std::vector<int>& v); + + inline const std::vector<int>& get_digits_gain0_delay0(void) const { return m_digits_gain0_delay0; } + inline const std::vector<int>& get_digits_gain0_delay1(void) const { return m_digits_gain0_delay1; } + inline const std::vector<int>& get_digits_gain1_delay0(void) const { return m_digits_gain1_delay0; } + inline const std::vector<int>& get_digits_gain1_delay1(void) const { return m_digits_gain1_delay1; } + + std::string whoami (void) const { return "ZdcDigits"; } + void print (void) const; + // Convertion operator to a std::string + // Can be used in a cast operation : (std::string) ZdcRawChannel + operator std::string() const; + +private: + + /* Member variables: */ + + std::vector<int> m_digits_gain0_delay0; + std::vector<int> m_digits_gain0_delay1; + std::vector<int> m_digits_gain1_delay0; + std::vector<int> m_digits_gain1_delay1; +}; + +#endif //ZDCEVENT_ZDCDIGITS_H + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigitsCollection.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigitsCollection.h new file mode 100755 index 0000000000000000000000000000000000000000..5bf19e9192fb78130de291e409af80829408d74e --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcDigitsCollection.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZdcDigitsCollection_H +#define ZdcDigitsCollection_H + +// STL include +#include <vector> + +// Lang include +#include <inttypes.h> + +#include "ZdcEvent/ZdcDigits.h" +#include "DataModel/DataVector.h" + +#include "CLIDSvc/CLASS_DEF.h" + +class ZdcDigitsCollection : public DataVector<ZdcDigits> +{ + + //friend class ZdcDigitsContainerCnv; +public: + + ZdcDigitsCollection ( SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) + : DataVector<ZdcDigits>(ownPolicy) {} + + virtual ~ZdcDigitsCollection() { } + + /** + * Clear everything for next event + */ + //virtual void clear (); + + void print(); + + private: + +}; + +SG_BASE(ZdcDigitsCollection, DataVector<ZdcDigits>); +CLASS_DEF(ZdcDigitsCollection,929261,0) + +#endif + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcEventDict.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcEventDict.h new file mode 100644 index 0000000000000000000000000000000000000000..83d739758a9bbd23c3b687306089a2c1fbf46a57 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcEventDict.h @@ -0,0 +1,36 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZDCEVENTDICT_H +#define ZDCEVENTDICT_H + +#include "ZdcEvent/ZdcRdo.h" +#include "ZdcEvent/ZdcRdoCollection.h" + +#include "ZdcEvent/ZdcDigits.h" +#include "ZdcEvent/ZdcDigitsCollection.h" +//#include "ZdcEvent/ZdcDigitsContainer.h" + +#include "ZdcEvent/ZdcCalibEvent.h" +#include "ZdcEvent/ZdcRawChannel.h" +#include "ZdcEvent/ZdcRawChannelCollection.h" + +#include "DataModel/DataVector.h" + +/* +void dummyZdcForTVCollTypedef(DataVector<ZdcRdo> a, + DataVector<ZdcRdoCollection> b) { + DataVector<ZdcRdo> aa = a; + DataVector<ZdcRdoCollection> bb = b; +} +*/ + +/* +void dummyZdcForTVCollTypedef(ZdcDigitsCollection a) +{ + ZdcDigitsCollection aa = a; +} +*/ + +#endif diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannel.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannel.h new file mode 100755 index 0000000000000000000000000000000000000000..4ec84ac647d0f2583f1da5f1e091855efaeb8271 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannel.h @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//*************************************************************************** +// Filename : ZdcRawChannel.h +// Author : Peter Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// A ZdcRawChannel is the data class containing energy/time information +// +// HISTORY: +// +// *************************************************************************** + +#ifndef ZDCEVENT_ZDCRAWCHANNEL_H +#define ZDCEVENT_ZDCRAWCHANNEL_H + +#include "ZdcEvent/ZdcRawData.h" +#include "CLIDSvc/CLASS_DEF.h" + +class ZdcRawChannel : public ZdcRawData +{ +public: + + /* Constructors */ + + ZdcRawChannel() { + m_size = 0; + } + + ZdcRawChannel(const Identifier& id): ZdcRawData(id) + //This will hold high/low gain combinations of up to 4 different methods + //of reconstruction + { + m_size = 8; + m_energy.resize(8,0.); + m_time.resize(8,0.); + m_chi.resize(8,0.); + } + + /* Destructor */ + + virtual ~ZdcRawChannel() { } + + /* Inline access methods */ + + + + std::string whoami (void) const { return "ZdcRawChannel"; } + void print (void) const{}; + // Convertion operator to a std::string + // Can be used in a cast operation : (std::string) ZdcRawChannel + operator std::string() const {return "ZdcRawChannel::string()";}; + +private: + + std::vector<float> m_energy; + std::vector<float> m_time; + std::vector<float> m_chi; + + unsigned int m_size; + + public: + + void setSize(unsigned int i) { + m_size = i; + m_energy.resize(i,0.); + m_time.resize(i,0.); + m_chi.resize(i,0.); + + } + + + void setEnergy(int i, float e) {m_energy[i] = e;} + void setTime (int i, float t) {m_time[i] = t;} + void setChi (int i, float c) {m_chi[i] = c;} + + unsigned int getSize () const {return m_energy.size();} + + float getEnergy(int i) const {return m_energy[i];} + float getTime(int i) const {return m_time[i];} + float getChi(int i) const {return m_chi[i];} + +}; + +CLASS_DEF(ZdcRawChannel,92926131,0) + + +#endif //ZDCEVENT_ZDCDIGITS_H diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannelCollection.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannelCollection.h new file mode 100755 index 0000000000000000000000000000000000000000..a158da00a97e83fc1bf16f0d07871f6da457e379 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawChannelCollection.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZdcRawChannelCollection_H +#define ZdcRawChannelCollection_H + +// STL include +#include <vector> + +// Lang include +#include <inttypes.h> + +#include "ZdcEvent/ZdcRawChannel.h" +#include "DataModel/DataVector.h" + +#include "CLIDSvc/CLASS_DEF.h" + +class ZdcRawChannelCollection : public DataVector<ZdcRawChannel> +{ + + //friend class ZdcDigitsContainerCnv; +public: + + ZdcRawChannelCollection ( SG::OwnershipPolicy ownPolicy=SG::OWN_ELEMENTS ) + : DataVector<ZdcRawChannel>(ownPolicy) {} + + virtual ~ZdcRawChannelCollection() { } + + /** + * Clear everything for next event + */ + //virtual void clear (); + + void print(){}; + + private: + +}; + +SG_BASE(ZdcRawChannelCollection, DataVector<ZdcRawChannel>); +CLASS_DEF(ZdcRawChannelCollection,92926111,0) + +#endif + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawData.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawData.h new file mode 100755 index 0000000000000000000000000000000000000000..c792ed535b8b3da362d95b28da87dfaabb70c19f --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRawData.h @@ -0,0 +1,74 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//*************************************************************************** +// Filename : ZdcRawData.h +// Author : Peter Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// A ZdcRawData is the base class for raw data classes, +// such as ZdcRdo +// It has only one member element - HWIdentifier +// +// HISTORY: +// 20 March 2009 +// +// BUGS: +// +// *************************************************************************** + +#ifndef ZDCEVENT_ZDCRAWDATA_H +#define ZDCEVENT_ZDCRAWDATA_H + +#include "Identifier/HWIdentifier.h" + +#include <string> +#include <vector> + +#include <inttypes.h> + +class ZdcRawData +{ +public: + + /* Constructor: */ + ZdcRawData(){} + ZdcRawData(const Identifier& id); + + /* Destructor */ + virtual ~ZdcRawData() {} + + /* Inline accessor methods: */ + inline Identifier identify(void) const { return m_id; } + + /* + Identifier side_ID (void) const; + Identifier module_ID (void) const; + Identifier type_ID (void) const; + Identifier channel_ID (void) const; + Identifier gain_ID (void) const; + Identifier delay_ID (void) const; + */ + + virtual std::string whoami (void) const { return "ZdcRawData"; } + virtual void print (void) const; + // Convertion operator to a std::string + // Can be used in a cast operation : (std::string) ZdcRawData + virtual operator std::string() const; + + static void print_to_stream ( const std::vector<double>& val, + const std::string & label, + std::ostringstream & text); + + static void print_to_stream ( const std::vector<int>& val, + const std::string & label, + std::ostringstream & text); +private: + + Identifier m_id; // Hardware (online) ID of the adc +}; + +#endif //ZDCEVENT_ZDCRAWDATA_H + diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdo.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdo.h new file mode 100644 index 0000000000000000000000000000000000000000..ea7c336f1f0f5beefd0762a762bbcdb1fae36797 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdo.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZDCRDO_H +#define ZDCRDO_H + +#include "CLIDSvc/CLASS_DEF.h" + +/** @class ZdcRdo + * @author W. H. Bell <W.Bell@cern.ch> + * + * A class to store the RAW readout decoded from bytestream or filled from + * monte carlo. + */ +class ZdcRdo { +public: + ZdcRdo(); + +}; + +// obtained using clid -m ZdcRdo +CLASS_DEF( ZdcRdo , 164548392 , 1 ) + +#endif diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdoCollection.h b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdoCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..fff1e61d01593c0954ebbba40632fe5d590cee8d --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/ZdcRdoCollection.h @@ -0,0 +1,23 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZDCRDOCOLLECTION_H +#define ZDCRDOCOLLECTION_H + +#include "CLIDSvc/CLASS_DEF.h" +#include "DataModel/DataVector.h" +#include "ZdcEvent/ZdcRdo.h" + +/** @class ZdcRdoCollection + * @author W. H. Bell <W.Bell@cern.ch> + * + * @brief A collection of ZdcRdo from the readout of all ZDC modules. + * + */ +class ZdcRdoCollection : public DataVector<ZdcRdo> { }; + +// obtained using clid -m ZdcRdoCollection +CLASS_DEF( ZdcRdoCollection , 1218480446 , 1 ) + +#endif diff --git a/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/selection.xml b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/selection.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2b266e8ba149e12f369f2a7848df3a41d783327 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/ZdcEvent/selection.xml @@ -0,0 +1,18 @@ +<lcgdict> + <class name="ZdcRdoCollection" id="EEE66016-58B9-46FD-9D1E-35B9D784CC48" /> + <class name="DataVector<ZdcRdo>" /> + <class name="std::vector<ZdcRdo*>" /> + <class name="ZdcRdo" /> + + <class name="ZdcDigitsCollection" id="B77B5F9A-1C29-4D74-A107-B3C71680C029" /> + <class name="std::vector<ZdcDigits*>" /> + <class name="DataVector<ZdcDigits>" /> + <class name="ZdcDigits" /> + + <class name="ZdcRawChannelCollection" id="A2BDA733-7A0A-459D-9237-33DFF3DC9982"/> + <class name="std::vector<ZdcRawChannel*>" /> + <class name="DataVector<ZdcRawChannel>" /> + <class name="ZdcRawChannel" /> + + +</lcgdict> diff --git a/ForwardDetectors/ZDC/ZdcEvent/cmt/requirements b/ForwardDetectors/ZDC/ZdcEvent/cmt/requirements new file mode 100644 index 0000000000000000000000000000000000000000..89880836a614064875f510380e1767ca12cf5ac7 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/cmt/requirements @@ -0,0 +1,27 @@ +package ZdcEvent + +author William H. Bell <W.Bell@cern.ch> + +use AtlasPolicy AtlasPolicy-* +use DataModel DataModel-* Control +use CLIDSvc CLIDSvc-* Control +use Identifier Identifier-* DetectorDescription +#use StoreGate StoreGate-* Control +#use EventContainers EventContainers-* Event +#use ZdcConditions ZdcConditions-* ForwardDetectors/ZDC +#use ZdcIdentifier ZdcIdentifier-* ForwardDetectors/ZDC + +library ZdcEvent *.cxx +apply_pattern installed_library + +private +use AtlasReflex AtlasReflex-* External -no_auto_imports +use ZdcConditions ZdcConditions-* ForwardDetectors/ZDC +use ZdcIdentifier ZdcIdentifier-* ForwardDetectors/ZDC + +apply_pattern lcgdict dict=ZdcEvent selectionfile=selection.xml \ + headerfiles="../ZdcEvent/ZdcEventDict.h" + +# dataLinks="ZdcRawData" + +end_private diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcCalibEvent.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcCalibEvent.cxx new file mode 100755 index 0000000000000000000000000000000000000000..e0beb88856effaed97be6b8c46801559952e4845 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcCalibEvent.cxx @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//***************************************************************************** +// Filename : ZdcCalibEvent.cxx +// Author : Steinberg +// Created : August 2009 +// +// DESCRIPTION: +// Implementation comments only. Class level comments go in .h file. +// +// HISTORY: +// +// BUGS: +// +// +// +//***************************************************************************** + +#include "ZdcEvent/ZdcCalibEvent.h" + +#include <iostream> +#include <sstream> +#include <iomanip> + +ZdcCalibEvent::ZdcCalibEvent() +{ + + m_towerE_A.clear(); + m_towerE_C.clear(); + m_towerT_A.clear(); + m_towerT_C.clear(); + + m_EMCellVec_A.clear(); + m_HADCellVec_A.clear(); + m_HADCellVec_C.clear(); + +} + +void ZdcCalibEvent::print() const +{ + + return; +} + +double ZdcCalibEvent::getTotalEnergy_A() +{ + double e = 0; + for (int i = 0;i<4;i++){e += m_towerE_A.at(i);} + return e; +} + +double ZdcCalibEvent::getTotalEnergy_C() +{ + double e = 0; + for (int i = 0;i<4;i++){e += m_towerE_C.at(i);} + return e; +} + +double ZdcCalibEvent::getEMEnergy_A() +{ + return 0; +} + +double ZdcCalibEvent::getHADEnergy_A() +{ + return 0; +} + +double ZdcCalibEvent::getHADEnergy_C() +{ + return 0; +} + diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx new file mode 100755 index 0000000000000000000000000000000000000000..d453d779ce06c6b18230dc2abc8f6430697e2226 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigits.cxx @@ -0,0 +1,143 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//***************************************************************************** +// Filename : ZdcDigit.cxx +// Author : Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// Implementation comments only. Class level comments go in .h file. +// +// HISTORY: +// +// BUGS: +// +// +// +//***************************************************************************** + +#include "ZdcEvent/ZdcDigits.h" + +#include <iostream> +#include <sstream> +#include <iomanip> + +ZdcDigits::ZdcDigits( const Identifier& id) + + : ZdcRawData( id ) +{ + m_nSamples = 0; +} + +/* +ZdcDigits::ZdcDigits( const HWIdentifier& HWid, + const std::vector<int>& digits ) + + : ZdcRawData( HWid ) + , m_digits ( digits ) +{ +} + +ZdcDigits::ZdcDigits( const HWIdentifier& HWid, + const std::vector<short>& digits ) + + : ZdcRawData( HWid ) +{ + m_digits.reserve(digits.size()); + + std::vector<short>::const_iterator it1=digits.begin(); + std::vector<short>::const_iterator it2=digits.end(); + + double dig; + for ( ; it1!=it2; ++it1) { + dig = (*it1); + m_digits.push_back(dig); + } +} +*/ + +void ZdcDigits::print() const +{ + + std::cout << "Trying to print ZdcDigits" << std::endl; + + //std::cout << (std::string) (*(ZdcRawData *)this); + //std::cout << std::setiosflags( std::ios::fixed ); + //std::cout << std::setiosflags( std::ios::showpoint ); + //std::cout << std::setprecision(2); + + std::vector<int>::const_iterator it; + std::vector<int>::const_iterator it_end; + + std::cout << "gain0/delay0 (" << m_digits_gain0_delay0.size() << " elements): "; + it = m_digits_gain0_delay0.begin(); + it_end = m_digits_gain0_delay0.end(); + while (it!=it_end) { std::cout << " " << (*it); it++;} + std::cout << std::endl; + + std::cout << "gain0/delay1 (" << m_digits_gain0_delay1.size() << " elements): "; + it = m_digits_gain0_delay1.begin(); + it_end = m_digits_gain0_delay1.end(); + while (it!=it_end) { std::cout << " " << (*it); it++;} + std::cout << std::endl; + + std::cout << "gain1/delay0 (" << m_digits_gain1_delay0.size() << " elements): "; + it = m_digits_gain1_delay0.begin(); + it_end = m_digits_gain1_delay0.end(); + while (it!=it_end) { std::cout << " " << (*it); it++;} + std::cout << std::endl; + + std::cout << "gain1/delay1 (" << m_digits_gain1_delay1.size() << " elements): "; + it = m_digits_gain1_delay1.begin(); + it_end = m_digits_gain1_delay1.end(); + while (it!=it_end) { std::cout << " " << (*it); it++;} + std::cout << std::endl; + + + return; +} + +ZdcDigits::operator std::string() const +{ + std::cout << "Trying to print ZdcDigits" << std::endl; + std::ostringstream text(std::ostringstream::out); + + text << (std::string) (*(ZdcRawData *)this); + text << std::setiosflags( std::ios::fixed ); + text << std::setiosflags( std::ios::showpoint ); + text << std::setprecision(2); + + ZdcRawData::print_to_stream(m_digits_gain0_delay0," Val:",text); + text << std::endl; + ZdcRawData::print_to_stream(m_digits_gain0_delay1," Val:",text); + text << std::endl; + ZdcRawData::print_to_stream(m_digits_gain1_delay0," Val:",text); + text << std::endl; + ZdcRawData::print_to_stream(m_digits_gain1_delay1," Val:",text); + text << std::endl; + + return text.str(); +} + +void ZdcDigits::set_digits_gain0_delay0(const std::vector<int>& v) +{ + m_digits_gain0_delay0 = std::vector<int>(v); // just copy it +} + +void ZdcDigits::set_digits_gain0_delay1(const std::vector<int>& v) +{ + m_digits_gain0_delay1 = std::vector<int>(v); // just copy it +} + +void ZdcDigits::set_digits_gain1_delay0(const std::vector<int>& v) +{ + m_digits_gain1_delay0 = std::vector<int>(v); // just copy it +} + +void ZdcDigits::set_digits_gain1_delay1(const std::vector<int>& v) +{ + m_digits_gain1_delay1 = std::vector<int>(v); // just copy it +} + diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c9dd897525313882fccbaa86fdfc9510ce03ebff --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcDigitsCollection.cxx @@ -0,0 +1,24 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#include "ZdcEvent/ZdcDigitsCollection.h" +#include <iostream> + +void ZdcDigitsCollection::print() +{ + iterator it = this->begin(); + iterator it_end = this->end(); + + std::cout << "Dumping ZdcDigitsCollection" << std::endl; + int i = 0; + while (it != it_end) + { + std::cout << "Printing Digit #" << i << std::endl; + (*it)->print(); + it++; + i++; + } + return; +} diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx new file mode 100755 index 0000000000000000000000000000000000000000..35de5bf85b6351c361b34dd21ae82ec9a16fcc25 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRawData.cxx @@ -0,0 +1,100 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//***************************************************************************** +// Filename : ZdcRawData.cxx +// Author : Peter Steinberg +// Created : March 2009 +// +// DESCRIPTION: +// +// +// HISTORY: +// 20 March 2009: Created +// +// BUGS: +// +// +// +//***************************************************************************** + +#include "ZdcEvent/ZdcRawData.h" +#include "ZdcConditions/ZdcCablingService.h" +#include "ZdcIdentifier/ZdcHardwareID.h" + +#include <iostream> +#include <sstream> +#include <iomanip> + +ZdcRawData::ZdcRawData( const Identifier& id ) +{ + m_id = id; +} + +void ZdcRawData::print() const +{ + std::cout << (std::string) (*this) << std::endl; +} + +ZdcRawData::operator std::string() const +{ + std::string result(whoami()); + //result += " Id = " + ZdcCablingService::getInstance()->getZdcID()->to_string(m_id); + return result; +} + + +/* +Identifier ZdcRawData::side_ID(void) const { + return ZdcCablingService::getInstance()->h2s_side_id(m_channel_hwid); +} + +Identifier ZdcRawData::module_ID(void) const { + return ZdcCablingService::getInstance()->h2s_module_id(m_channel_hwid); +} + +Identifier ZdcRawData::type_ID(void) const { + return ZdcCablingService::getInstance()->h2s_type_id(m_channel_hwid); +} + +Identifier ZdcRawData::channel_ID(void) const { + return ZdcCablingService::getInstance()->h2s_channel_id(m_channel_hwid); +} + +Identifier ZdcRawData::gain_ID(void) const { + return ZdcCablingService::getInstance()->h2s_gain_id(m_channel_hwid); +} + +Identifier ZdcRawData::delay_ID(void) const { + return ZdcCablingService::getInstance()->h2s_delay_id(m_channel_hwid); +} +*/ + + +void ZdcRawData::print_to_stream ( const std::vector<double>& val, + const std::string & label, + std::ostringstream & text) +{ + text << label; + + std::vector<double>::const_iterator it1=val.begin(); + std::vector<double>::const_iterator it2=val.end(); + + for ( ; it1!=it2; ++it1) text << " " << (*it1); + +} + +void ZdcRawData::print_to_stream ( const std::vector<int>& val, + const std::string & label, + std::ostringstream & text) +{ + text << label; + + std::vector<int>::const_iterator it1=val.begin(); + std::vector<int>::const_iterator it2=val.end(); + + for ( ; it1!=it2; ++it1) text << " " << (*it1); + +} + diff --git a/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRdo.cxx b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRdo.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6876136acc8d236f7b669e5470a3aa7e1d5572b9 --- /dev/null +++ b/ForwardDetectors/ZDC/ZdcEvent/src/ZdcRdo.cxx @@ -0,0 +1,12 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ZdcEvent/ZdcRdo.h" + +//--------------------------------------------------------------- + +ZdcRdo::ZdcRdo() { +} + +//---------------------------------------------------------------