diff --git a/Event/xAOD/xAODForward/Root/AFPToFHitAuxContainer_v1.cxx b/Event/xAOD/xAODForward/Root/AFPToFHitAuxContainer_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..47612c177cab76adf13bff661c9fdcc5d5748459 --- /dev/null +++ b/Event/xAOD/xAODForward/Root/AFPToFHitAuxContainer_v1.cxx @@ -0,0 +1,22 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +// Local include(s): +#include "xAODForward/versions/AFPToFHitAuxContainer_v1.h" + +namespace xAOD { + + AFPToFHitAuxContainer_v1::AFPToFHitAuxContainer_v1() + : AuxContainerBase() { + AUX_VARIABLE( stationID ); + AUX_VARIABLE( time ); + AUX_VARIABLE( hptdcChannel ); + AUX_VARIABLE( barInTrainID ); + AUX_VARIABLE( trainID ); + AUX_VARIABLE( pulseLength ); + AUX_VARIABLE( hptdcID ); + } + +} // namespace xAOD diff --git a/Event/xAOD/xAODForward/Root/AFPToFHit_v1.cxx b/Event/xAOD/xAODForward/Root/AFPToFHit_v1.cxx new file mode 100644 index 0000000000000000000000000000000000000000..56f849b81ead1fc505747d30ecfd8daf6556a845 --- /dev/null +++ b/Event/xAOD/xAODForward/Root/AFPToFHit_v1.cxx @@ -0,0 +1,25 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// xAOD include(s): +#include "xAODCore/AuxStoreAccessorMacros.h" + +// Local include(s): +#include "xAODForward/versions/AFPToFHit_v1.h" +//#include "xAODForward/AFPTrackContainer.h" + + +namespace xAOD +{ + AFPToFHit_v1::AFPToFHit_v1() : SG::AuxElement() + { } + + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, int, stationID, setStationID) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, float, time, setTime) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, int, hptdcChannel, setHptdcChannel) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, int, barInTrainID, setBarInTrainID) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, int, trainID, setTrainID) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, float, pulseLength, setPulseLength) + AUXSTORE_PRIMITIVE_SETTER_AND_GETTER (AFPToFHit_v1, int, hptdcID, setHptdcID) +} diff --git a/Event/xAOD/xAODForward/Root/dict/ContainerProxies.cxx b/Event/xAOD/xAODForward/Root/dict/ContainerProxies.cxx index 4a64c456336ebaac1b8f8ed99bd060d668b5158d..b716133acc06decb760b85a606ef5e91bc10786d 100644 --- a/Event/xAOD/xAODForward/Root/dict/ContainerProxies.cxx +++ b/Event/xAOD/xAODForward/Root/dict/ContainerProxies.cxx @@ -9,6 +9,7 @@ #include "xAODForward/versions/ALFADataContainer_v1.h" #include "xAODForward/versions/AFPDataContainer_v1.h" #include "xAODForward/versions/AFPSiHitContainer_v1.h" +#include "xAODForward/versions/AFPToFHitContainer_v1.h" #include "xAODForward/versions/AFPSiHitsClusterContainer_v1.h" #include "xAODForward/versions/AFPTrackContainer_v1.h" #include "xAODForward/versions/ZdcModuleContainer_v1.h" @@ -19,6 +20,7 @@ ADD_NS_DV_PROXY( xAOD, ALFADataContainer_v1 ); ADD_NS_DV_PROXY( xAOD, AFPDataContainer_v1 ); ADD_NS_DV_PROXY( xAOD, AFPSiHitContainer_v1 ); +ADD_NS_DV_PROXY( xAOD, AFPToFHitContainer_v1 ); ADD_NS_DV_PROXY( xAOD, AFPSiHitsClusterContainer_v1 ); ADD_NS_DV_PROXY( xAOD, AFPTrackContainer_v1 ); ADD_NS_DV_PROXY( xAOD, ZdcModuleContainer_v1 ); diff --git a/Event/xAOD/xAODForward/Root/xAODForwardCLIDs.cxx b/Event/xAOD/xAODForward/Root/xAODForwardCLIDs.cxx index 990e36fb40e1d50354e095995a472825f7b0a1eb..02ba3a9286a684a53ee36d1f7249126c1d0deb86 100644 --- a/Event/xAOD/xAODForward/Root/xAODForwardCLIDs.cxx +++ b/Event/xAOD/xAODForward/Root/xAODForwardCLIDs.cxx @@ -15,6 +15,8 @@ #include "xAODForward/AFPSiHitContainer.h" #include "xAODForward/AFPSiHitAuxContainer.h" +#include "xAODForward/AFPToFHitContainer.h" +#include "xAODForward/AFPToFHitAuxContainer.h" #include "xAODForward/AFPSiHitsClusterContainer.h" #include "xAODForward/AFPSiHitsClusterAuxContainer.h" #include "xAODForward/AFPTrackContainer.h" diff --git a/Event/xAOD/xAODForward/xAODForward/AFPToFHit.h b/Event/xAOD/xAODForward/xAODForward/AFPToFHit.h new file mode 100644 index 0000000000000000000000000000000000000000..2db64cce214f6e71075194f11b5d58ba3f2f2750 --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/AFPToFHit.h @@ -0,0 +1,15 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODFORWARD_AFPToFHIT_H +#define XAODFORWARD_AFPToFHIT_H + +#include"xAODForward/versions/AFPToFHit_v1.h" + +namespace xAOD +{ + typedef AFPToFHit_v1 AFPToFHit; +} + +#endif diff --git a/Event/xAOD/xAODForward/xAODForward/AFPToFHitAuxContainer.h b/Event/xAOD/xAODForward/xAODForward/AFPToFHitAuxContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..58166612adebbaaa0c3cb48741c681e648052867 --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/AFPToFHitAuxContainer.h @@ -0,0 +1,18 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODFORWARD_AFPToFHITAUXCONTAINER_H +#define XAODFORWARD_AFPToFHITAUXCONTAINER_H + +#include"xAODForward/versions/AFPToFHitAuxContainer_v1.h" + +namespace xAOD +{ + typedef AFPToFHitAuxContainer_v1 AFPToFHitAuxContainer; +} + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAOD::AFPToFHitAuxContainer, 1192598913, 1 ) + +#endif diff --git a/Event/xAOD/xAODForward/xAODForward/AFPToFHitContainer.h b/Event/xAOD/xAODForward/xAODForward/AFPToFHitContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..8c5fc9aabedc35fa3548c0b78ccc9ae8af95cfae --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/AFPToFHitContainer.h @@ -0,0 +1,18 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODFORWARD_AFPToFHITCONTAINER_H +#define XAODFORWARD_AFPToFHITCONTAINER_H + +#include"xAODForward/versions/AFPToFHitContainer_v1.h" + +namespace xAOD +{ + typedef AFPToFHitContainer_v1 AFPToFHitContainer; +} + +#include "xAODCore/CLASS_DEF.h" +CLASS_DEF( xAOD::AFPToFHitContainer, 1307016706, 1 ) + +#endif // XAODFORWARD_AFPToFHITCONTAINER_H diff --git a/Event/xAOD/xAODForward/xAODForward/selection.xml b/Event/xAOD/xAODForward/xAODForward/selection.xml index 186791b4b2d17ac0c9084750d6e42251cc6f028c..2bc4595884cf8fbe476a09687127e63776ce748f 100644 --- a/Event/xAOD/xAODForward/xAODForward/selection.xml +++ b/Event/xAOD/xAODForward/xAODForward/selection.xml @@ -19,6 +19,10 @@ <class name="xAOD::AFPSiHitContainer_v1" id="6BE5A00E-A13D-4904-9358-CB28D4C57879" /> <class name="xAOD::AFPSiHitAuxContainer_v1" id="B7C50786-FA4B-4D48-86C3-180EF5E6DE43" /> + <class name="xAOD::AFPToFHit_v1" /> + <class name="xAOD::AFPToFHitContainer_v1" id="AF3603F3-CDC9-4597-B111-155D9BC2E8D1" /> + <class name="xAOD::AFPToFHitAuxContainer_v1" id="65012075-753E-4F3E-8A37-5BBB66C523D6" /> + <class name="xAOD::AFPSiHitsCluster_v1" /> <class name="xAOD::AFPSiHitsClusterContainer_v1" id="CCBFAFB3-9A9E-486B-AD37-43C0FFB68998" /> <class name="xAOD::AFPSiHitsClusterAuxContainer_v1" id="1B4F1207-38F5-42ED-BC5B-F9125F845C3F" /> @@ -58,7 +62,8 @@ <class name="std::vector<ElementLink<xAOD::ALFADataContainer_v1> >" /> <class name="std::vector<std::vector<ElementLink<xAOD::ALFADataContainer_v1> > >" /> - <!-- AFP --> + <!-- *** AFP *** --> + <!-- AFPDataContainer --> <class name="DataLink<xAOD::AFPDataContainer_v1>" /> <class name="std::vector<DataLink<xAOD::AFPDataContainer_v1> >" /> @@ -66,6 +71,7 @@ <class name="std::vector<ElementLink<xAOD::AFPDataContainer_v1> >" /> <class name="std::vector<std::vector<ElementLink<xAOD::AFPDataContainer_v1> > >" /> + <!-- AFPSiHitContainer --> <class name="DataLink<xAOD::AFPSiHitContainer_v1>" /> <class name="std::vector<DataLink<xAOD::AFPSiHitContainer_v1> >" /> @@ -73,6 +79,15 @@ <class name="std::vector<ElementLink<xAOD::AFPSiHitContainer_v1> >" /> <class name="std::vector<std::vector<ElementLink<xAOD::AFPSiHitContainer_v1> > >" /> + <!-- AFPToFHitContainer --> + <class name="DataLink<xAOD::AFPToFHitContainer_v1>" /> + <class name="std::vector<DataLink<xAOD::AFPToFHitContainer_v1> >" /> + + <class name="ElementLink<xAOD::AFPToFHitContainer_v1>" /> + <class name="std::vector<ElementLink<xAOD::AFPToFHitContainer_v1> >" /> + <class name="std::vector<std::vector<ElementLink<xAOD::AFPToFHitContainer_v1> > >" /> + + <!-- AFPSiHitsClusterContainer --> <class name="DataLink<xAOD::AFPSiHitsClusterContainer_v1>" /> <class name="std::vector<DataLink<xAOD::AFPSiHitsClusterContainer_v1> >" /> @@ -80,6 +95,7 @@ <class name="std::vector<ElementLink<xAOD::AFPSiHitsClusterContainer_v1> >" /> <class name="std::vector<std::vector<ElementLink<xAOD::AFPSiHitsClusterContainer_v1> > >" /> + <!-- AFPTrackContainer --> <class name="DataLink<xAOD::AFPTrackContainer_v1>" /> <class name="std::vector<DataLink<xAOD::AFPTrackContainer_v1> >" /> diff --git a/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitAuxContainer_v1.h b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitAuxContainer_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..7e2275846a3d60b864d240cc3a3588f3883466e2 --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitAuxContainer_v1.h @@ -0,0 +1,47 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODFORWARD_VERSIONS_AFPToFHITAUXCONTAINER_V1_H +#define XAODFORWARD_VERSIONS_AFPToFHITAUXCONTAINER_V1_H + +#include<vector> + +// EDM include(s): +#include "xAODCore/AuxContainerBase.h" + +// local includes +#include "xAODForward/AFPToFHit.h" + + +namespace xAOD { + + /// @brief Class storing information of xAOD::AFPToFHit_v1 objects. + /// + /// This class actually stores information that is accessed by the xAOD::AFPToFHit_v1. + class AFPToFHitAuxContainer_v1 : public AuxContainerBase { + + public: + AFPToFHitAuxContainer_v1(); + + private: + std::vector< int > stationID; + std::vector< float > time; + std::vector< int > hptdcChannel; + std::vector< int > barInTrainID; + std::vector< int > trainID; + std::vector< float > pulseLength; + std::vector< int > hptdcID; + + }; // class AFPToFHitAuxContainer_v1 + + +} // end xAOD namespace + +// StoreGate registration +#include "xAODCore/BaseInfo.h" +SG_BASE( xAOD::AFPToFHitAuxContainer_v1, xAOD::AuxContainerBase ); + + +#endif // XAODFORWARD_VERSIONS_AFPToFHITAUXCONTAINER_V1_H + diff --git a/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitContainer_v1.h b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitContainer_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..63e5c954cc21f2b54a2c30a1815305b9e4e6e61a --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHitContainer_v1.h @@ -0,0 +1,20 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#ifndef XAODFORWARD_VERSIONS_AFPToFHITCONTAINER_V1_H +#define XAODFORWARD_VERSIONS_AFPToFHITCONTAINER_V1_H + +// EDM include(s): +#include "AthContainers/DataVector.h" + +// Local include(s): +#include "xAODForward/versions/AFPToFHit_v1.h" + +namespace xAOD { + typedef DataVector< AFPToFHit_v1 > AFPToFHitContainer_v1; +} + + +#endif // XAODFORWARD_VERSIONS_AFPToFHITCONTAINER_V1_H diff --git a/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHit_v1.h b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHit_v1.h new file mode 100644 index 0000000000000000000000000000000000000000..ba6dd59fca7729c91533c862a6e61fab37edbc1d --- /dev/null +++ b/Event/xAOD/xAODForward/xAODForward/versions/AFPToFHit_v1.h @@ -0,0 +1,109 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef XAODFORWARD_VERSIONS_AFPToFHIT_V1_H +#define XAODFORWARD_VERSIONS_AFPToFHIT_V1_H + +// EDM include(s): +#include "AthContainers/AuxElement.h" +#include "AthLinks/ElementLink.h" +#include "xAODForward/AFPStationID.h" + +// needed for forward declaration +#include "AthContainers/DataVector.h" + + +namespace xAOD { + + /// @brief Class representing a hit in ToF detector. + /// + /// This class provides information about a single hit in AFP ToF + /// detector. + class AFPToFHit_v1 : public SG::AuxElement + { + public: + // needed by athenaRoot + AFPToFHit_v1(); + + /// @brief Time of AFP ToF detector hit relative to the reference clock + /// + /// Time between the signal in AFP ToF detector and reference + /// clock tick. The reference clock runs with the 40 MHz rate + /// which corresponds to LHC bunch spacing so there should be a + /// clock tick that zeros the time measurement for every bunch + /// crossing. Time is expressed in nanoseconds. + float time() const; + + void setTime(float time); + + /// @brief HPTDC channel number + /// + /// Information about mapping and more details about High + /// Performance/Precision Time to Digital Converter (HPTDC) are + /// available at + /// https://twiki.cern.ch/twiki/bin/view/Atlas/AFPHPTDC + int hptdcChannel() const; + + void setHptdcChannel(int hptdcChannel); + + /// @brief ID number of the LQBar in a train where hit was detected + /// + /// The value should be between 0 and 3 + int barInTrainID() const; + + void setBarInTrainID(const int barInTrainID); + + /// @brief ID number of the train of LQBars (set of 4 bars), where hit was detected + /// + /// The value should be between 0 and 3 + int trainID() const; + + void setTrainID(const int barInTrainID); + + /// @brief Lenght of the signal pulse which is proportional to the signal + /// amplitude + /// + /// The returned value is roughly lenght of the signal above + /// threshold expressed in nanoseconds. + float pulseLength() const; + + void setPulseLength(float pulseLength); + + /// Identification number of the HPTDC module. + /// + /// Detailed documentation of High Performance/Precision Time to + /// Digital Converter (HPTDC) is available in + /// https://twiki.cern.ch/twiki/bin/view/Atlas/AFPHPTDC + int hptdcID() const; + + void setHptdcID(int hptdcID); + + /// @brief Index of the station with time-of-flight hit + /// + /// The numbering scheme is the same as in xAOD::AFPStationID. It + /// is recommended to use this class instead of bare numbers. + int stationID() const; + + void setStationID(int side); + + /// Returns true if ToF hit is in far station on A side + bool isSideA() const + { return stationID() == xAOD::AFPStationID::farA;} + + /// Returns true if ToF hit is in far station on A side + bool isSideC() const + { return stationID() == xAOD::AFPStationID::farC;} + + /// Function making sure that the object is ready for persistification i.e. saving - does nothing + void toPersistent() {} + }; + + +} // namespace xAOD + +// Declare the inheritance of the type to StoreGate: +#include "xAODCore/BaseInfo.h" +SG_BASE( xAOD::AFPToFHit_v1, SG::AuxElement ); + +#endif // XAODFORWARD_VERSIONS_AFPToFHIT_V1_H diff --git a/Event/xAOD/xAODForward/xAODForward/xAODForwardDict.h b/Event/xAOD/xAODForward/xAODForward/xAODForwardDict.h index fb7e04b4f4c028331e827ed4670e8c4cac150361..f1dc070d3d115d49c676c4ac1d7db8443220cc5c 100644 --- a/Event/xAOD/xAODForward/xAODForward/xAODForwardDict.h +++ b/Event/xAOD/xAODForward/xAODForward/xAODForwardDict.h @@ -34,6 +34,12 @@ #include "xAODForward/versions/AFPSiHitAuxContainer_v1.h" #include "xAODForward/versions/AFPSiHit_v1.h" +#include "xAODForward/AFPToFHitContainer.h" +#include "xAODForward/AFPToFHitAuxContainer.h" +#include "xAODForward/versions/AFPToFHitContainer_v1.h" +#include "xAODForward/versions/AFPToFHitAuxContainer_v1.h" +#include "xAODForward/versions/AFPToFHit_v1.h" + #include "xAODForward/AFPSiHitsClusterContainer.h" #include "xAODForward/AFPSiHitsClusterAuxContainer.h" #include "xAODForward/versions/AFPSiHitsClusterContainer_v1.h" @@ -82,6 +88,13 @@ namespace xAOD std::vector<ElementLink<xAOD::AFPSiHitContainer_v1> > afpSiHit_l4; std::vector<std::vector<ElementLink<xAOD::AFPSiHitContainer_v1> > > afpSiHit_l5; + xAOD::AFPToFHitContainer_v1 afpToFHit_c1; + DataLink<xAOD::AFPToFHitContainer_v1> afpToFHit_l1; + std::vector<DataLink<xAOD::AFPToFHitContainer_v1> > afpToFHit_l2; + ElementLink<xAOD::AFPToFHitContainer_v1> afpToFHit_l3; + std::vector<ElementLink<xAOD::AFPToFHitContainer_v1> > afpToFHit_l4; + std::vector<std::vector<ElementLink<xAOD::AFPToFHitContainer_v1> > > afpToFHit_l5; + xAOD::AFPSiHitsClusterContainer_v1 afpSiHitsContainer_c1; DataLink<xAOD::AFPSiHitsClusterContainer_v1> afpSiHitsContainer_l1; std::vector<DataLink<xAOD::AFPSiHitsClusterContainer_v1> > afpSiHitsContainer_l2; diff --git a/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt b/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt index c9601da9270b261daabf6a193335ab4b5c0df75e..770dc0e135748ca46c7c04bb620f045f62cacfbe 100644 --- a/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODForwardAthenaPool/CMakeLists.txt @@ -22,7 +22,9 @@ atlas_add_poolcnv_library( xAODForwardAthenaPoolPoolCnv xAODForward/AFPDataAuxContainer.h xAODForward/AFPSiHitContainer.h xAODForward/AFPSiHitAuxContainer.h - xAODForward/AFPSiHitsClusterContainer.h + xAODForward/AFPToFHitContainer.h + xAODForward/AFPToFHitAuxContainer.h + xAODForward/AFPSiHitsClusterContainer.h xAODForward/AFPSiHitsClusterAuxContainer.h xAODForward/AFPTrackContainer.h xAODForward/AFPTrackAuxContainer.h @@ -32,7 +34,7 @@ atlas_add_poolcnv_library( xAODForwardAthenaPoolPoolCnv xAODForward/MBTSModuleAuxContainer.h xAODForward/ForwardEventInfoContainer.h xAODForward/ForwardEventInfoAuxContainer.h - TYPES_WITH_NAMESPACE xAOD::ALFADataContainer xAOD::ALFADataAuxContainer xAOD::AFPDataContainer xAOD::AFPDataAuxContainer xAOD::AFPSiHitContainer xAOD::AFPSiHitAuxContainer xAOD::AFPSiHitsClusterContainer xAOD::AFPSiHitsClusterAuxContainer xAOD::AFPTrackContainer xAOD::AFPTrackAuxContainer xAOD::ZdcModuleContainer xAOD::ZdcModuleAuxContainer xAOD::MBTSModuleContainer xAOD::MBTSModuleAuxContainer xAOD::ForwardEventInfoContainer xAOD::ForwardEventInfoAuxContainer + TYPES_WITH_NAMESPACE xAOD::ALFADataContainer xAOD::ALFADataAuxContainer xAOD::AFPDataContainer xAOD::AFPDataAuxContainer xAOD::AFPSiHitContainer xAOD::AFPSiHitAuxContainer xAOD::AFPToFHitContainer xAOD::AFPToFHitAuxContainer xAOD::AFPSiHitsClusterContainer xAOD::AFPSiHitsClusterAuxContainer xAOD::AFPTrackContainer xAOD::AFPTrackAuxContainer xAOD::ZdcModuleContainer xAOD::ZdcModuleAuxContainer xAOD::MBTSModuleContainer xAOD::MBTSModuleAuxContainer xAOD::ForwardEventInfoContainer xAOD::ForwardEventInfoAuxContainer CNV_PFX xAOD LINK_LIBRARIES AthContainers AthenaKernel AthenaPoolCnvSvcLib AthenaPoolUtilities xAODForward ) diff --git a/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.cxx b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..281f987f6a34fd9b4a44f87234a5d279a47cc021 --- /dev/null +++ b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.cxx @@ -0,0 +1,46 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// System include(s): +#include <exception> + +// Athena/Gaudi include(s): +#include "AthenaKernel/IThinningSvc.h" +#include "AthContainers/tools/copyThinned.h" + +// Local include(s): +#include "xAODAFPToFHitAuxContainerCnv.h" + +xAODAFPToFHitAuxContainerCnv::xAODAFPToFHitAuxContainerCnv( ISvcLocator* svcLoc ) + : xAODAFPToFHitAuxContainerCnvBase( svcLoc ) { + +} + +xAOD::AFPToFHitAuxContainer* xAODAFPToFHitAuxContainerCnv::createPersistent( xAOD::AFPToFHitAuxContainer* trans ) { + + // Access the thinning svc, if thinning is defined for this object: + IThinningSvc* thinSvc = IThinningSvc::instance(); + + // Create the persistent object using the helper function from AthContainers: + return SG::copyThinned( *trans, thinSvc ); +} + +xAOD::AFPToFHitAuxContainer* xAODAFPToFHitAuxContainerCnv::createTransient() { + + // The known ID(s) for this container: + static const pool::Guid v1_guid( "65012075-753E-4F3E-8A37-5BBB66C523D6" ); + + // Check which version of the container we're reading: + if( compareClassGuid( v1_guid ) ) { + // It's the latest version, read it directly: + return poolReadObject< xAOD::AFPToFHitAuxContainer >(); + } + + // If we didn't recognise the ID: + throw std::runtime_error( "Unsupported version of " + "xAOD::AFPToFHitAuxContainer found" ); + return 0; +} + + diff --git a/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.h b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..ecb0bfe49c6a7870c92f0d29631990de15de300e --- /dev/null +++ b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitAuxContainerCnv.h @@ -0,0 +1,35 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFPToFHITAUXCONTAINERCNV_H +#define AFPToFHITAUXCONTAINERCNV_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "xAODForward/AFPToFHitAuxContainer.h" + +typedef T_AthenaPoolCustomCnv<xAOD::AFPToFHitAuxContainer, xAOD::AFPToFHitAuxContainer> xAODAFPToFHitAuxContainerCnvBase; + + +class xAODAFPToFHitAuxContainerCnv : + public xAODAFPToFHitAuxContainerCnvBase { + + // Declare the factory as our friend: + friend class CnvFactory< xAODAFPToFHitAuxContainerCnv >; + +protected: + /// Converter constructor + xAODAFPToFHitAuxContainerCnv( ISvcLocator* svcLoc ); + + /// Function preparing the container to be written out + virtual xAOD::AFPToFHitAuxContainer* + createPersistent( xAOD::AFPToFHitAuxContainer* trans ); + + /// Function reading in the object from the input file + virtual xAOD::AFPToFHitAuxContainer* createTransient(); + +}; + + +#endif + diff --git a/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.cxx b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.cxx new file mode 100644 index 0000000000000000000000000000000000000000..45e5202464a8be719166ead9e0491724fb33d73d --- /dev/null +++ b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.cxx @@ -0,0 +1,99 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// System include(s): +#include <exception> +#include <iostream> + +// Gaudi/Athena include(s): +#include "GaudiKernel/IOpaqueAddress.h" + +// Local include(s): +#include "xAODAFPToFHitContainerCnv.h" + + +namespace { + + /// Helper function setting up the container's link to its auxiliary store + void setStoreLink( SG::AuxVectorBase* cont, const std::string& key ) { + + // The link to set up: + DataLink< SG::IConstAuxStore > link( key + "Aux." ); + + // Give it to the container: + cont->setStore( link ); + + return; + } + +} // private namespace + + +xAODAFPToFHitContainerCnv::xAODAFPToFHitContainerCnv( ISvcLocator* svcLoc ) + : xAODAFPToFHitContainerCnvBase( svcLoc ) { + +} + +/** + * * This function needs to be re-implemented in order to figure out the StoreGate + * * key of the container that's being created. After that's done, it lets the + * * base class do its normal task. + * */ +StatusCode xAODAFPToFHitContainerCnv::createObj( IOpaqueAddress* pAddr, + DataObject*& pObj ) { + + // Get the key of the container that we'll be creating: + m_key = *( pAddr->par() + 1 ); + ATH_MSG_VERBOSE( "Key of xAOD::AFPToFHitContainer: " << m_key ); + + // Let the base class do its thing now: + return AthenaPoolConverter::createObj( pAddr, pObj ); +} + +xAOD::AFPToFHitContainer* xAODAFPToFHitContainerCnv::createPersistent( xAOD::AFPToFHitContainer* trans ) +{ + + // Create a view copy of the container: + xAOD::AFPToFHitContainer* result = + new xAOD::AFPToFHitContainer( trans->begin(), trans->end(), + SG::VIEW_ELEMENTS ); + + // Prepare the objects to be written out: +// xAOD::AFPToFHitContainer::iterator itr = result->begin(); +// xAOD::AFPToFHitContainer::iterator end = result->end(); +// for( ; itr != end; ++itr ) { +// toPersistent( *itr ); +// } + + // Return the new container: + return result; +} + +xAOD::AFPToFHitContainer* xAODAFPToFHitContainerCnv::createTransient() +{ + // The known ID(s) for this container: + static pool::Guid v1_guid( "AF3603F3-CDC9-4597-B111-155D9BC2E8D1" ); + + // Check if we're reading the most up to date type: + if( compareClassGuid( v1_guid ) ) { + xAOD::AFPToFHitContainer* c = + poolReadObject< xAOD::AFPToFHitContainer >(); + setStoreLink( c, m_key ); + return c; + } + + // If we didn't recognise the ID, let's complain: + throw std::runtime_error( "Unsupported version of " + "xAOD::AFPToFHitContainer found" ); + return 0; +} + +void xAODAFPToFHitContainerCnv::toPersistent( xAOD::AFPToFHit* hit ) const { + + // Tell the object to prepare all its smart pointers for persistification: + hit->toPersistent(); + + return; +} + diff --git a/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.h b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.h new file mode 100644 index 0000000000000000000000000000000000000000..ea2b295bbfe0d437fdf39c1c0a52f93d1737b7a9 --- /dev/null +++ b/Event/xAOD/xAODForwardAthenaPool/src/xAODAFPToFHitContainerCnv.h @@ -0,0 +1,45 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFPToFHITCONTAINERCNV_H +#define AFPToFHITCONTAINERCNV_H + +#include "AthenaPoolCnvSvc/T_AthenaPoolCustomCnv.h" +#include "xAODForward/AFPTrackContainer.h" +#include "xAODForward/AFPToFHitContainer.h" +#include "xAODForward/AFPToFHit.h" + + +typedef T_AthenaPoolCustomCnv<xAOD::AFPToFHitContainer, xAOD::AFPToFHitContainer> xAODAFPToFHitContainerCnvBase; + +class xAODAFPToFHitContainerCnv : public xAODAFPToFHitContainerCnvBase { + + // Declare the factory as our friend: + friend class CnvFactory< xAODAFPToFHitContainerCnv >; + +public: + /// Converter constructor + xAODAFPToFHitContainerCnv( ISvcLocator* svcLoc ); + + /// Re-implemented function in order to get access to the SG key + virtual StatusCode createObj( IOpaqueAddress* pAddr, DataObject*& pObj ); + + /// Function preparing the container to be written out + virtual xAOD::AFPToFHitContainer* createPersistent( xAOD::AFPToFHitContainer* trans ); + + /// Function reading in the persistent object + virtual xAOD::AFPToFHitContainer* createTransient(); + +private: + /// Function preparing a vertex object for persistence + void toPersistent( xAOD::AFPToFHit* hit ) const; + + /// StoreGate key of the container just being created + std::string m_key; + +}; + + +#endif + diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h index 325b346789ea0996ebfa0d9bc0186dc9e3f3dfa8..349e8572bb955eb58ea5f0f4c280316e86a3476e 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h @@ -2,94 +2,78 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef DECODER_AFP_DECODER_H -#define DECODER_AFP_DECODER_H +#ifndef AFP_BYTESTREAM2RAWCNV_H +#define AFP_BYTESTREAM2RAWCNV_H -#include <map> #include <stdint.h> + #include <string> +#include <set> #include "AthenaBaseComps/AthAlgTool.h" -#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! - #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/IToolSvc.h" #include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/ToolFactory.h" -#include "StoreGate/StoreGateSvc.h" #include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "ByteStreamData/RawEvent.h" -#include "eformat/FullEventFragment.h" -#include "eformat/ROBFragment.h" - -#include "AFP_RawDataCollectionReadOut.h" -#include "AFP_RawDataContainerReadOut.h" -#include "AFP_RawDataReadOut.h" -#include "AFP_RawEv/AFP_RawData.h" -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" +#include "AFP_RawEv/AFP_RawContainer.h" +#include "AFP_RawEv/AFP_RawDataCommonHead.h" -using eformat::helper::SourceIdentifier; - -using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; -using OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment; -class ISvcLocator; -class StatusCode; +#include "AFP_WordReadOut.h" class AFP_ByteStream2RawCnv : public ::AthAlgTool { public: - typedef AFP_RawData m_AFP_RawData; - typedef AFP_RawDataCollection m_AFP_RawDataCollection; - AFP_ByteStream2RawCnv(const std::string &type, const std::string &name, const IInterface *parent); static const InterfaceID &interfaceID(); + /// Does nothing virtual ~AFP_ByteStream2RawCnv(); virtual StatusCode initialize(); - // virtual StatusCode execute(); virtual StatusCode finalize(); - // StatusCode getEvent(); - StatusCode fillCollection(const ROBFragment *robFrag, - AFP_RawDataContainer *rdoCont, - std::vector<unsigned int> *vecHash = NULL); - - AFP_RawDataCollection* getCollection(const unsigned int columnNum, - const unsigned int robID, - AFP_RawDataContainer *cont); - - - AFP_RawData *getRawData(unsigned int Link, AFP_RawDataCollection *coll); - - // const eformat::FullEventFragment<const uint32_t*> getEvent(); - - inline const eformat::FullEventFragment<const uint32_t *> * - eventFragment() const { - return m_event; - } - inline const eformat::ROBFragment<const uint32_t *> *robFragment() const { - return m_robFrag; - } - + /// Fills rawContainer with collections from ROBFragment + StatusCode fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, AFP_RawContainer *rawContainer); + + /// returns true if provided link corresponds to time-of-flight information + bool isLinkToF (const unsigned int link) const {return s_linksToF.find(link) != s_linksToF.end();} + + /// returns true if provided link corresponds to silicon detector information + bool isLinkSi (const unsigned int link) const {return s_linksSi.find(link) != s_linksSi.end();} + + /// @brief Adds new silicon collection to AFP_RawContainer + /// + /// It is checked if a silicon collection with given link and robId + /// is already in the container. If it is a warning message is + /// issued and nullptr is returned. If it is not, then it is created + /// and pointer to the new collection is returned. + AFP_SiRawCollection* getCollectionSi(const unsigned int link, const unsigned int robId, AFP_RawContainer *container); + + /// @brief Adds new time-of-flight collection to AFP_RawContainer + /// + /// It is checked if a time-of-flight collection with given link and + /// robId is already in the container. If it is a warning message is + /// issued and nullptr is returned. If it is not, then it is created + /// and pointer to the new collection is returned. + AFP_ToFRawCollection* getCollectionToF(const unsigned int link, const unsigned int robId, AFP_RawContainer *container); + + /// Sets data header information for given argument based on #m_wordReadout + void setDataHeader (AFP_RawDataCommonHead* dataHead) const; + private: - const eformat::FullEventFragment<const uint32_t *> *m_event; - const eformat::ROBFragment<const uint32_t *> *m_robFrag; - StoreGateSvc *m_EvtStore; - unsigned int m_fragment_number; - unsigned int m_count_hits; - ServiceHandle<IROBDataProviderSvc> m_robDataProvider; - AFP_RawDataReadOut *m_AFP_RawDataReadOut; - AFP_RawDataCollectionReadOut *m_AFP_RawDataCollectionReadOut; - AFP_RawDataContainerReadOut *m_AFP_RawDataContainerReadOut; + AFP_WordReadOut m_wordReadout; + + static const uint32_t s_siNoHitMarker = 15; + static const std::set<unsigned int> s_linksToF; + static const std::set<unsigned int> s_linksSi; }; #endif //> !DECODER_AFP_DECODER_H diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataCollectionReadOut.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataCollectionReadOut.h deleted file mode 100644 index 69d8dce32b22b98b7dbb15d072c61ab12222d1d5..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataCollectionReadOut.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACOLLECTIONREADOUT_H -#define AFP_RAWDATACOLLECTIONREADOUT_H - -#include "AFP_ReadOut.h" - -#include <stdint.h> - -using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; - -class AFP_RawDataCollectionReadOut : public AFP_ReadOut { -private: - uint32_t m_dataWord; - uint16_t m_wordHeader; - uint16_t m_wordHeader2; - uint32_t m_lvl1Id; - uint32_t m_link; - uint16_t m_flag; - // uint16_t m_ecnt_LWC; - uint16_t m_ToT2; - // uint16_t m_ecnt_EOB; - uint16_t m_bcid; - uint16_t m_DiscConf; - uint16_t m_row; - uint16_t m_column; - uint32_t m_ToT1; - static const uint16_t headerPos = 24; - static const uint16_t headerBits = 0xff; - static const uint16_t headerPos2 = 20; - static const uint16_t headerBits2 = 0xfff; - static const uint16_t BOBvalue = - 0x3; // Header identifier, getBits(31,28) == 0011 (I think) - static const uint16_t LWCvalue = - 0x3; // Have no idea what this is, let it be Data record id, - // getBits(31,30) == 11. Could in princpile use BOBvalue, but need a - // different boolean anyway, so for consistency define this again.; - static const uint16_t BOLvalue = 0x18; - static const uint16_t TLPvalue = 0x890; - static const uint16_t TWCvalue = 0x8a; - static const uint16_t EOBvalue = 0xf0; - -public: - AFP_RawDataCollectionReadOut(); - ~AFP_RawDataCollectionReadOut(); - - void decodeWord(uint32_t dataWord); - - bool is_BOB() { - return m_wordHeader == BOBvalue; - }; // This is going to be is_Header - bool is_LWC() { return m_wordHeader2 == LWCvalue; }; - // bool is_BOL() {return m_wordHeader == BOLvalue;}; - // bool is_TLP() {return m_wordHeader2 == TLPvalue;}; - // bool is_TWC() {return m_wordHeader == TWCvalue;}; - // bool is_EOB() {return m_wordHeader == EOBvalue;}; - - uint32_t lvl1Id() { return m_lvl1Id; } - uint32_t link() { return m_link; } - uint16_t DiscConf() { return m_DiscConf; } - uint16_t flag() { return m_flag; } - - // uint16_t ecnt_LWC() {return m_ecnt_LWC;} - uint16_t ToT2() { return m_ToT2; } - // uint16_t ecnt_EOB() {return m_ecnt_EOB;} - uint16_t bcid() { return m_bcid; } - uint16_t row() { return m_row; } - uint16_t column() { return m_column; } - uint16_t ToT1() { return m_ToT1; } - -private: - void setZero(); -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataContainerReadOut.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataContainerReadOut.h deleted file mode 100644 index 9e3a50e86e00f118423dd755aab75881deb10783..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataContainerReadOut.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACONTAINERREADOUT_H -#define AFP_RAWDATACONTAINERREADOUT_H - - -#include "AFP_ReadOut.h" - - -class AFP_RawDataContainerReadOut : public AFP_ReadOut { - -private: - uint32_t m_wordMarker; - uint32_t m_dataWord; - uint16_t m_subdetId; - uint16_t m_mrodId; - uint32_t m_lvl1Id; - uint16_t m_ecrId; - uint16_t m_bcId; - uint32_t m_runNum; - uint16_t m_runType; - uint16_t m_triggerTypeId; - uint32_t m_DetEventType; - uint32_t m_timestamp; - uint32_t m_BCId; - static const uint32_t FullEVmarker = 0xaa1234aa; - static const uint32_t ROBmarker = 0xdd1234dd; - static const uint32_t RODmarker = 0xee1234ee; - static const uint32_t RODheadersize = 0x00000009; - static const uint32_t RODversion = 0x03010000; - -public: - AFP_RawDataContainerReadOut(); - ~AFP_RawDataContainerReadOut(); - bool is_FullEVmarker() { return m_wordMarker == FullEVmarker; }; - bool is_ROBmarker() { return m_wordMarker == ROBmarker; }; - bool is_RODmarker() { return m_wordMarker == RODmarker; }; - - - - - uint16_t subdetId() { return m_subdetId; } - uint16_t mrodId() { return m_mrodId; } - uint32_t runNum() { return m_runNum; } - uint16_t runType() { return m_runType; } - uint32_t lvl1Id() { return m_lvl1Id; } - uint16_t ecrId() { return m_ecrId; } - uint16_t bcId() { return m_bcId; } - uint16_t trigtypeId() { return m_triggerTypeId; } - uint32_t DetEventType() { return m_DetEventType; } - uint32_t TimeStamp() { return m_timestamp; } - uint32_t BCId() { return m_BCId; } - -private: - void setZero(); - void setZeroFull(); -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProvider.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProvider.h index c9fa4d18c7e716c53695cb3026718fafbafbadbb..6fac1940e4d99fcfe1c492b262f9c7779025cf6a 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProvider.h +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProvider.h @@ -6,42 +6,49 @@ #define DECODER_AFP_RAWDATAPROVIDER_H 1 #include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ClassID.h" -#include "GaudiKernel/Converter.h" -#include "GaudiKernel/MsgStream.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" -#include "AFP_RawEv/AFP_RawEvDict.h" -#include "ByteStreamCnvSvcBase/IByteStreamEventAccess.h" #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" - #include "AFP_RawDataProviderTool.h" -#include <string> -class AFP_RawDataProviderTool; -class ISvcLocator; -class StatusCode; +#include "AFP_RawEv/AFP_ROBID.h" + +#include "eformat/ROBFragment.h" + +#include <string> +#include <vector> class AFP_RawDataProvider : public ::AthAlgorithm { public: AFP_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator); + + /// Does nothing virtual ~AFP_RawDataProvider(); + /// Initialise tool and service virtual StatusCode initialize(); - virtual StatusCode execute(); + + /// Does nothing virtual StatusCode finalize() { return StatusCode::SUCCESS; } + /// @brief Creates raw objects from bytestream + /// + /// Creates a new AFP_RawDataContainer saves it to StoreGate and + /// fills with collections based on information from robIDs + /// specified in #s_robIDs + virtual StatusCode execute(); + private: - int m_nRawDataCollection; - int m_nRawData; - ServiceHandle<IROBDataProviderSvc> m_robDataProvider; ToolHandle<AFP_RawDataProviderTool> m_rawDataTool; - std::string m_AFP_RawDataCollectionKey; - std::string m_collection; + /// name used to store AFP_RawContainer in StoreGate + std::string m_AFP_RawContainerKey; + + /// vector of robIDs from which data should be processed + static const std::vector<unsigned int> s_robIDs; }; #endif //> !DECODER_AFP_RAWDATAPROVIDER_H diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h index 4c465d6537a07cd3ff4f2ed53f409496dec23e6a..70d294b70672ca73874a9e18fd7666b5c935eeb0 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h @@ -6,41 +6,35 @@ #define DECODER_AFP_RAWDATAPROVIDERTOOL_H #include "AFP_ByteStream2RawCnv.h" -#include "AFP_RawEv/AFP_RawData.h" -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" +#include "AFP_RawEv/AFP_RawContainer.h" + #include "AthenaBaseComps/AthAlgTool.h" -#include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" -#include "ByteStreamData/RawEvent.h" -#include "DataModel/DataVector.h" #include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolFactory.h" #include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! + +#include "eformat/ROBFragment.h" + #include <set> #include <stdint.h> #include <string> #include <vector> -using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; -class AFP_RawData; -class AFP_RawDataCollection; -class AFP_RawDataContainer; - class AFP_RawDataProviderTool : public ::AthAlgTool { public: static const InterfaceID &interfaceID(); AFP_RawDataProviderTool(const std::string &type, const std::string &name, const IInterface *parent); + /// Does nothing virtual ~AFP_RawDataProviderTool(); virtual StatusCode initialize(); - // virtual StatusCode execute(); virtual StatusCode finalize(); - StatusCode convert(std::vector<const ROBFragment *> &vecRobs, - AFP_RawDataContainer *rdoCont); + /// Fill rawContainer with collections created from provided vecRobs + StatusCode convert(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> &vecRobs, + AFP_RawContainer *rawContainer); private: ToolHandle<AFP_ByteStream2RawCnv> m_decoder; diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataReadOut.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataReadOut.h deleted file mode 100644 index 7b5def761c74ccb6f0c331a3e90c7b3f4d97ec34..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_RawDataReadOut.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFPRAWDATAREADOUT_H -#define AFPRAWDATAREADOUT_H - -#include "AFP_ReadOut.h" - -using OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment; - -class AFP_RawDataReadOut : public AFP_ReadOut { - -private: - uint32_t m_dataWord; - uint16_t m_wordHeader; - uint16_t m_SlotId; - uint16_t m_LsbTdcId; - uint16_t m_ecnt_BOT; - uint16_t m_ecnt_EOT; - uint16_t m_bcId; - uint16_t m_wcnt; - uint16_t m_Column; - uint16_t m_bit26_27; - uint16_t m_bit24_27; - - uint16_t m_HitDiscConfig; - uint16_t m_Link; - uint16_t m_fiber; - uint16_t m_ADC; - std::vector<bool> m_pattern; - uint16_t m_BCId; - bool m_bit16; - bool m_error_bit17; - bool m_bit18; - std::vector<uint32_t> ToT; - - static const uint16_t headerPos = 28; - static const uint16_t headerBits = 0xf; - static const uint16_t BOTvalue = 0xa; - static const uint16_t EOTvalue = 0xc; - static const uint16_t TSMvalue = 0x3; - -public: - AFP_RawDataReadOut(); - ~AFP_RawDataReadOut(); - - void decodeWord(uint32_t dataWord); - - bool is_BOT() { return (m_wordHeader == BOTvalue); }; - - bool is_EOT() { return (m_wordHeader == EOTvalue); }; - - bool is_TDCt() { return (m_wordHeader == TSMvalue); }; - - uint16_t Column() { return m_Column; } - uint16_t SlotId() { return m_SlotId; } - uint16_t LsbTdcId() { return m_LsbTdcId; } - uint16_t ecnt_BOT() { return m_ecnt_BOT; } - uint16_t ecnt_EOT() { return m_ecnt_EOT; } - uint16_t bcId() { return m_bcId; } - uint16_t HitDiscConfig() { return m_HitDiscConfig; } - uint16_t Link() { return m_Link; } - uint16_t fiber() { return m_fiber; } - uint16_t ADC() { return m_ADC; } - std::vector<bool> pattern() { return m_pattern; } - uint16_t BCId() { return m_BCId; } - bool bit16() { return m_bit16; } - bool error_bit17() { return m_error_bit17; } - bool bit18() { return m_bit18; } - bool isError() { return m_error_bit17; } - uint16_t bit26_27() { return m_bit26_27; } - uint16_t bit24_27() { return m_bit24_27; } - - std::vector<uint32_t> HitChan() const { return ToT; } - -private: - void setZero(); -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ReadOut.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ReadOut.h deleted file mode 100644 index f0155aafe5a5ed73d29f51f67b9841617768651f..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_ReadOut.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef DECODER_AFPREADOUT_H -#define DECODER_AFPREADOUT_H - - -#include <stdint.h> -#include <vector> - - -#include "StoreGate/StoreGateSvc.h" -#include "AthenaBaseComps/AthAlgTool.h" - -#include "eformat/SourceIdentifier.h" -#include "eformat/Version.h" -#include "ByteStreamData/RawEvent.h" - -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/Bootstrap.h" - -#include "AFP_RawEv/AFP_RawDataContainer.h" -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "AFP_RawEv/AFP_RawData.h" - - - - - - -class AFP_ReadOut { - -public: - AFP_ReadOut(); - ~AFP_ReadOut(); - -protected: - uint32_t getBits(const uint16_t bstart, const uint16_t bstop); - - uint32_t setBits(uint16_t nData, uint16_t *inputData, uint16_t *inputPos); - - uint32_t setBits(uint16_t nData, uint32_t *inputData, uint16_t *inputPos); - - uint32_t m_word; -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_WordReadOut.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_WordReadOut.h new file mode 100644 index 0000000000000000000000000000000000000000..652cd35a096e7afa4b4399f478a5074d4f08cff1 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/AFP_WordReadOut.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_RECORDREADOUT_H +#define AFP_RECORDREADOUT_H + +#include <stdint.h> + +/// Class capable spliting word into parts, used to fill raw containers. +class AFP_WordReadOut { +public: + /// Sets word which is to be processed + void setWord (const uint32_t dataWord) {m_word = dataWord;} + + /// @brief Returns true if the word is marked as header word + /// + /// The word is marked as header if four most significant bits are + /// equal #s_wordHeader. + bool isHeader () const {return s_wordHeader == getBits(31, 28);} + + /// @brief Returns true if the word is marked as data word + /// + /// The word is marked as data word if two most significant bits are + /// equal #s_wordData. + bool isData() const {return s_wordData == getBits(31, 30);} + + /// @brief Returns true if the word is marked as service word + /// + /// The word is marked as service word if four most significant bits are + /// equal #s_wordService. + bool isService() const {return s_wordService == getBits(31, 28);} + + /// @brief Value of 5-8 most significant bits + /// + /// In the following word: `xxxx LLLL xxxx xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `L`. + uint32_t link() const {return getBits (27, 24);} + + /// @brief Returns integer value of the selcted bits + /// + /// Bits are numbered starting from 0 for the least significant bit + /// and raising as bits significance rises. + /// + /// @param start the most significant bit from which decoding should + /// begin (the start bit will be included) + /// + /// @param stop the least significant bit where decoding should end + /// (the stop bit will be included) + /// + /// For example for word `0011 1010` the function will give following results: + /// - `getBits (7, 4) = 3` + /// - `getBits (3, 0) = 10` + /// - `getBits (4, 4) = 1` + /// - `getBits (2, 2) = 0` + /// - `getBits (5, 3) = 7` + uint32_t getBits(const uint16_t start, const uint16_t stop) const; + + /// Header word is marked with four most significant bits set to 0011 + static constexpr uint16_t s_wordHeader = 3; + + /// Data word is marked with two most significant bits set to 11 + static constexpr uint16_t s_wordData = 3; + + /// Service word is marked with four most significant bits set to 0000 + static constexpr uint16_t s_wordService = 0; + +private: + uint32_t m_word; +}; + +#endif diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/RawDataProvider.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/RawDataProvider.h deleted file mode 100644 index 1510172774d6cfd912e10e02b83d06ae520aa317..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/RawDataProvider.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef DECODER_RAWDATAPROVIDER_H -#define DECODER_RAWDATAPROVIDER_H 1 - -#include "AthenaBaseComps/AthAlgorithm.h" -//#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! -#include "AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h" - - -class RawDataProvider: public ::AthAlgorithm { - public: - RawDataProvider( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~RawDataProvider(); - - virtual StatusCode initialize(); - virtual StatusCode execute(); - virtual StatusCode finalize(); - - private: - -}; - -#endif //> !DECODER_RAWDATAPROVIDER_H diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/runit.h b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/runit.h deleted file mode 100644 index ac6dfd27d74dfd737f19c2fbea08ce83dc4608cc..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv/runit.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef DECODER_RUNIT_H -#define DECODER_RUNIT_H 1 -#include "AFP_ByteStream2RawCnv.h" -#include "AthenaBaseComps/AthAlgorithm.h" -//#include "GaudiKernel/ToolHandle.h" //included under assumption you'll want to use some tools! Remove if you don't! - - - -class runit: public ::AthAlgorithm { - public: - runit( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~runit(); - - virtual StatusCode initialize(); - virtual StatusCode execute(); - virtual StatusCode finalize(); - - private: - -ToolHandle<AFP_ByteStream2RawCnv> m_decoder; - -}; - -#endif //> !DECODER_RUNIT_H diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/cmt/requirements b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/cmt/requirements deleted file mode 100644 index ff7085d8d47df8c33b652af3d9ad5794c49458af..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/cmt/requirements +++ /dev/null @@ -1,46 +0,0 @@ -## automatically generated CMT requirements file -package AFP_ByteStream2RawCnv -author nifomin - -public -## for athena policies: this has to be the first use statement -use AtlasPolicy AtlasPolicy-* - -## for gaudi tools, services and objects -use GaudiInterface GaudiInterface-* External - -use AthenaBaseComps AthenaBaseComps-* Control -use ByteStreamCnvSvcBase ByteStreamCnvSvcBase-* Event -use ByteStreamData ByteStreamData-* Event -use DataCollection DataCollection-* External -use GaudiInterface GaudiInterface-* External -use StoreGate StoreGate-* Control -use AFP_RawEv AFP_RawEv-* ForwardDetectors/AFP - -##use AFP_RawEv AFP_RawEv-* -use AthenaBaseComps AthenaBaseComps-* Control -use DataModel DataModel-* Control -private -use AthenaBaseComps AthenaBaseComps-* Control -end_private - - - - - - -## put here your package dependencies... - -## - -branches src src/components run - -## default is to make component library. See: https://twiki.cern.ch/twiki/bin/view/Main/LearningAthena#Libraries_in_CMT for alternatives -#library AFP_ByteStream2RawCnv *.cxx -s=components *.cxx -#apply_pattern component_library -apply_pattern dual_use_library files="*.cxx" -##apply_pattern declare_joboptions files="*.py" -##apply_pattern declare_python_modules files="*.py" - - - diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ByteStream2RawCnv.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ByteStream2RawCnv.cxx index c782121f2732770f597a266f92783926a5487509..d81d0c39a00b8f5b9e72c5252658595fc704f9ff 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ByteStream2RawCnv.cxx +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ByteStream2RawCnv.cxx @@ -4,40 +4,37 @@ // AFP_ByteStream2RawCnv includes #include "AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h" -//#include "AFP_ByteStream2RawCnv/ReadOut.h" + +#include "AFP_RawEv/AFP_RawDataCommonHead.h" + +#include "AFP_RawEv/AFP_SiRawData.h" +#include "AFP_RawEv/AFP_SiRawCollection.h" + +#include "AFP_RawEv/AFP_ToFRawData.h" +#include "AFP_RawEv/AFP_ToFRawCollection.h" + #include <algorithm> -static const InterfaceID IID_IAFP_ByteStream2RawCnv("AFP_ByteStream2RawCnv", 1, - 0); +const std::set<unsigned int> AFP_ByteStream2RawCnv::s_linksToF = {12, 13}; +const std::set<unsigned int> AFP_ByteStream2RawCnv::s_linksSi = {0, 1, 2, 3, 8, 9, 10, 11}; + + const InterfaceID &AFP_ByteStream2RawCnv::interfaceID() { + static const InterfaceID IID_IAFP_ByteStream2RawCnv("AFP_ByteStream2RawCnv", 1, 0); return IID_IAFP_ByteStream2RawCnv; } -////////////////////////// -// constructor -////////////////////////// - AFP_ByteStream2RawCnv::AFP_ByteStream2RawCnv(const std::string &type, const std::string &name, const IInterface *parent) - : AthAlgTool(type, name, parent), - m_robDataProvider("ROBDataProviderSvc", name), m_AFP_RawDataReadOut(0), - m_AFP_RawDataCollectionReadOut(0), m_AFP_RawDataContainerReadOut(0) - + : AthAlgTool(type, name, parent), + m_robDataProvider("ROBDataProviderSvc", name) { declareInterface<AFP_ByteStream2RawCnv>(this); } -////////////////////////// -//// destructor -////////////////////////// - AFP_ByteStream2RawCnv::~AFP_ByteStream2RawCnv() {} -////////////////////////// -//// initialize() -////////////////////////// - StatusCode AFP_ByteStream2RawCnv::initialize() { ATH_MSG_INFO("Initializing " << name() << "..."); @@ -50,56 +47,22 @@ StatusCode AFP_ByteStream2RawCnv::initialize() { if (m_robDataProvider.retrieve().isFailure()) { ATH_MSG_WARNING("Failed to retrieve service " << m_robDataProvider - << "..."); + << "..."); return StatusCode::SUCCESS; } else { ATH_MSG_DEBUG("Retrieved service " << m_robDataProvider << "..."); } - if (StatusCode::SUCCESS != - serviceLocator()->service("StoreGateSvc", m_EvtStore)) { - ATH_MSG_WARNING("Can't get StoreGateSvc"); - return StatusCode::SUCCESS; - } - - m_fragment_number = 0; - - m_AFP_RawDataReadOut = new AFP_RawDataReadOut(); - m_AFP_RawDataCollectionReadOut = new AFP_RawDataCollectionReadOut(); - m_AFP_RawDataContainerReadOut = new AFP_RawDataContainerReadOut(); - - m_count_hits = 0; return StatusCode::SUCCESS; } -////////////////////////// -////// finalize() -////////////////////////// - StatusCode AFP_ByteStream2RawCnv::finalize() { ATH_MSG_DEBUG("AFP_ByteStream2RawCnv: finalizing "); - ATH_MSG_DEBUG(" Bytestream summary:" << m_fragment_number - << " fragments found"); - if (m_AFP_RawDataReadOut) { - delete m_AFP_RawDataReadOut; - } - if (m_AFP_RawDataCollectionReadOut) { - delete m_AFP_RawDataCollectionReadOut; - } - if (m_AFP_RawDataContainerReadOut) { - delete m_AFP_RawDataContainerReadOut; - } return StatusCode::SUCCESS; } -////////////////////////// -////// fillCollection() -////////////////////////// - -StatusCode AFP_ByteStream2RawCnv::fillCollection(const ROBFragment *robFrag, - AFP_RawDataContainer *rdoCont, - std::vector<unsigned int> *) { +StatusCode AFP_ByteStream2RawCnv::fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, AFP_RawContainer *rawContainer) { ATH_MSG_DEBUG("AFP_ByteStream2RawCnv::fillColelction rob_source_id: in decimal="<<std::dec<<robFrag->rob_source_id()<<", in hex=0x"<<std::hex<<robFrag->rob_source_id()<<std::dec); try { @@ -109,8 +72,8 @@ StatusCode AFP_ByteStream2RawCnv::fillCollection(const ROBFragment *robFrag, return StatusCode::SUCCESS; } - uint32_t nstat = robFrag->nstatus(); - if (nstat) { + const uint32_t nStat = robFrag->nstatus(); + if (nStat) { const uint32_t *it; robFrag->status(it); if (*it) { @@ -119,8 +82,8 @@ StatusCode AFP_ByteStream2RawCnv::fillCollection(const ROBFragment *robFrag, } } - if (!rdoCont) { - ATH_MSG_WARNING("NULL pointer passed in rdoCont argument."); + if (!rawContainer) { + ATH_MSG_WARNING("NULL pointer passed in rawContainer argument."); return StatusCode::SUCCESS; } @@ -129,147 +92,163 @@ StatusCode AFP_ByteStream2RawCnv::fillCollection(const ROBFragment *robFrag, OFFLINE_FRAGMENTS_NAMESPACE::PointerType vint; robFrag->rod_data(vint); - uint32_t size = robFrag->rod_ndata(); - - OFFLINE_FRAGMENTS_NAMESPACE::PointerType vint_status; - robFrag->rod_status(vint_status); - uint32_t size_status = robFrag->rod_nstatus(); - - if (size_status <= 0) { + if (robFrag->rod_nstatus() <= 0) { ATH_MSG_WARNING("Buffer size <= 0!"); return StatusCode::SUCCESS; } - const uint32_t wordPos = 0; - m_AFP_RawDataCollectionReadOut->decodeWord(vint[wordPos]); - m_AFP_RawDataReadOut->decodeWord(vint[wordPos]); - - const eformat::FullEventFragment<const uint32_t *> *event = - m_robDataProvider->getEvent(); + const eformat::FullEventFragment<const uint32_t*> *event = m_robDataProvider->getEvent(); if (!event) { ATH_MSG_WARNING("NULL event retrived from m_robDataProvider"); return StatusCode::SUCCESS; } - const uint32_t Time_StampID = event->bc_time_seconds(); - const uint32_t Time_StampnsID = event->bc_time_nanoseconds(); - const uint32_t BC_ID = event->bc_id(); - const uint32_t LumiBlock_ID = event->lumi_block(); - const uint32_t Lvl1_ID = event->lvl1_id(); - - rdoCont->SetTimeStamp(Time_StampID); - rdoCont->SetTimeStampns(Time_StampnsID); - rdoCont->SetBCId(BC_ID); - rdoCont->SetLumiBlock(LumiBlock_ID); - rdoCont->SetLvl1Id(Lvl1_ID); - AFP_RawDataCollection *collection = nullptr; - unsigned int collection_number = 0; - const uint32_t noHitMarker = 15; - + // set information about event in the RawContainer + rawContainer->setTimeStamp(event->bc_time_seconds()); + rawContainer->setTimeStampNS(event->bc_time_nanoseconds()); + rawContainer->setBCId(event->bc_id()); + rawContainer->setLumiBlock(event->lumi_block()); + rawContainer->setLvl1Id(event->lvl1_id()); -int first_BCID = 0; -int current_BCID = 0; -int hitLvl1 = 0; + // fill container with collections + AFP_SiRawCollection *collectionSi = nullptr; + AFP_ToFRawCollection *collectionToF = nullptr; - + const uint32_t size = robFrag->rod_ndata(); for (unsigned i = 0; i < size; i++) { - - m_AFP_RawDataCollectionReadOut->decodeWord(vint[i]); - if (m_AFP_RawDataCollectionReadOut->is_BOB()) { - collection = getCollection(collection_number, robFrag->rob_source_id(), rdoCont); - - if (!collection) { - ATH_MSG_WARNING( - "NULL pointer returned by getCollection(collection_number = " - << collection_number << ", rdoCont)"); - + m_wordReadout.setWord(vint[i]); + + if (m_wordReadout.isHeader()) { + AFP_RawCollectionHead* collectionHead = nullptr; + if ( isLinkToF (m_wordReadout.link()) ) { + // prepare collection for time-of-flight + collectionToF = getCollectionToF(m_wordReadout.link(), robFrag->rob_source_id(), rawContainer); + collectionHead = collectionToF; + } + else if ( isLinkSi (m_wordReadout.link()) ) { + // prepare collection for silicon detector + collectionSi = getCollectionSi(m_wordReadout.link(), robFrag->rob_source_id(), rawContainer); + collectionHead = collectionSi; + } + else { + ATH_MSG_WARNING("Unidentified value of link="<<m_wordReadout.link()<<" for header record."); return StatusCode::SUCCESS; } - collection->Set_lvl1Id(m_AFP_RawDataCollectionReadOut->lvl1Id()); - collection->Set_link_header(m_AFP_RawDataCollectionReadOut->link()); - collection->Set_flag(m_AFP_RawDataCollectionReadOut->flag()); - collection->Set_bcid(m_AFP_RawDataCollectionReadOut->bcid()); - collection->Set_header(collection_number); - collection->Set_robID(robFrag->rob_source_id()); - collection_number++; - if(collection_number == 1) {first_BCID = m_AFP_RawDataCollectionReadOut->bcid();} - current_BCID = m_AFP_RawDataCollectionReadOut->bcid(); - hitLvl1 = 0; - - if(current_BCID >= first_BCID) - {hitLvl1 = (current_BCID-first_BCID);} - else if (first_BCID > current_BCID) - {hitLvl1 = 1024 + (current_BCID - first_BCID);} + if (!collectionHead) { + ATH_MSG_WARNING("nullptr returned by getCollection(link = " + << m_wordReadout.link() << ", robID = " << robFrag->rob_source_id() <<")"); + return StatusCode::SUCCESS; + } + // set head collection informaiton + collectionHead->setLvl1Id(m_wordReadout.getBits(14, 10)); + collectionHead->setLink(m_wordReadout.link()); + collectionHead->setFrontendFlag(m_wordReadout.getBits(15, 15)); + collectionHead->setBcId(m_wordReadout.getBits(9, 0)); + collectionHead->setRobId(robFrag->rob_source_id()); } - - else if (m_AFP_RawDataCollectionReadOut->is_LWC() && collection) { - if (m_AFP_RawDataCollectionReadOut->ToT1() != noHitMarker) { - AFP_RawData *rawData = new AFP_RawData(i); - - rawData->addData(vint[i]); - rawData->Set_DiscConf(m_AFP_RawDataCollectionReadOut->DiscConf()); - rawData->Set_link(m_AFP_RawDataCollectionReadOut->link()); - rawData->Set_column(m_AFP_RawDataCollectionReadOut->row()); - rawData->Set_row(m_AFP_RawDataCollectionReadOut->column()); - rawData->Set_lvl1(hitLvl1); - - if (m_AFP_RawDataCollectionReadOut->ToT1() <= 13) { - rawData->Set_ToT(m_AFP_RawDataCollectionReadOut->ToT1() + m_AFP_RawDataCollectionReadOut->DiscConf() + 1); + else if (m_wordReadout.isData()) { + // fill time-of-flight collection + if ( isLinkToF (m_wordReadout.link()) ) { + + // check if collection is available + if ( !collectionToF ) { + ATH_MSG_WARNING("No ToF collection available to fill data."); + return StatusCode::SUCCESS; + } + + AFP_ToFRawData& ToFData = collectionToF->newDataRecord(); + ToFData.setHeader( m_wordReadout.getBits (23, 21) ); + ToFData.setEdge( m_wordReadout.getBits (20, 20) ); + ToFData.setChannel( m_wordReadout.getBits (19, 16) ); + ToFData.setTime( m_wordReadout.getBits (9, 0) ); + + setDataHeader (&ToFData); } - else if (m_AFP_RawDataCollectionReadOut->ToT1() == 14) { - rawData->Set_ToT(m_AFP_RawDataCollectionReadOut->DiscConf()); + else if ( isLinkSi (m_wordReadout.link()) ) { + // fill silicon detector collection + + // check if collection is available + if ( !collectionSi ) { + ATH_MSG_WARNING("No silicon detector collection available to fill data."); + return StatusCode::SUCCESS; + } + + // check first silicon hit information + if (m_wordReadout.getBits(7, 4) != s_siNoHitMarker) { + AFP_SiRawData& siData = collectionSi->newDataRecord(); + siData.setColumn (m_wordReadout.getBits(23, 17)); + siData.setRow (m_wordReadout.getBits(16, 8)); + siData.setTimeOverThreshold (m_wordReadout.getBits(7, 4)); + + setDataHeader (&siData); + } + + // check second silicon hit information + if (m_wordReadout.getBits(3, 0) != s_siNoHitMarker) { + AFP_SiRawData& siData = collectionSi->newDataRecord(); + siData.setColumn (m_wordReadout.getBits(23, 17)); + siData.setRow (m_wordReadout.getBits(16, 8) + 1); + siData.setTimeOverThreshold (m_wordReadout.getBits(3, 0)); + + setDataHeader (&siData); + } } - collection->push_back(rawData); + else { + ATH_MSG_WARNING("Not recognised value of link="<<m_wordReadout.link()<<" for data record."); + return StatusCode::SUCCESS; } - if (m_AFP_RawDataCollectionReadOut->ToT2() != noHitMarker) { - AFP_RawData *rawData = new AFP_RawData(i); - rawData->addData(vint[i]); - rawData->Set_DiscConf(m_AFP_RawDataCollectionReadOut->DiscConf()); - rawData->Set_link(m_AFP_RawDataCollectionReadOut->link()); - rawData->Set_column(m_AFP_RawDataCollectionReadOut->row()); - rawData->Set_row(m_AFP_RawDataCollectionReadOut->column() + 1); - rawData->Set_lvl1(hitLvl1); + } // end is data - if (m_AFP_RawDataCollectionReadOut->ToT2() <= 13) { - rawData->Set_ToT(m_AFP_RawDataCollectionReadOut->ToT2() + m_AFP_RawDataCollectionReadOut->DiscConf() + 1); - } - else if (m_AFP_RawDataCollectionReadOut->ToT2() == 14) { - rawData->Set_ToT(m_AFP_RawDataCollectionReadOut->DiscConf()); - } - - collection->push_back(rawData); - } - } } // end of loop return StatusCode::SUCCESS; } -////////////////////////// -///////// getCollection() -////////////////////////// +AFP_SiRawCollection * +AFP_ByteStream2RawCnv::getCollectionSi(const unsigned int link, const unsigned int robId, + AFP_RawContainer *container) { -AFP_RawDataCollection * -AFP_ByteStream2RawCnv::getCollection(const unsigned int columnNum, const unsigned int robID, - AFP_RawDataContainer *cont) { + if (!container) { + ATH_MSG_WARNING("NULL pointer passed in argument: container. NULL pointer returned."); + return nullptr; + } + + for (const AFP_SiRawCollection& collection : container->collectionsSi()) { + if (collection.link() == link && collection.robId() == robId) { + ATH_MSG_WARNING("Silicon collection link="<<link<<" robId="<<robId<<" already in container, although it should not be there."); + return nullptr; + } + } - if (!cont) { - ATH_MSG_WARNING( - "NULL pointer passed in argument: cont. NULL pointer returned"); + AFP_SiRawCollection& newCollection = container->newCollectionSi(); + return &newCollection; +} + +AFP_ToFRawCollection * +AFP_ByteStream2RawCnv::getCollectionToF(const unsigned int link, const unsigned int robId, + AFP_RawContainer *container) { + + if (!container) { + ATH_MSG_WARNING("NULL pointer passed in argument: container. NULL pointer returned."); return nullptr; } - for (const AFP_RawDataCollection* collection : *cont) { - if (collection->Get_header_number_POT() == columnNum && collection->Get_robID() == robID) { - ATH_MSG_WARNING("Collection already in container, although it should not be there."); + for (const AFP_ToFRawCollection& collection : container->collectionsToF()) { + if (collection.link() == link && collection.robId() == robId) { + ATH_MSG_WARNING("Silicon collection link="<<link<<" robId="<<robId<<" already in container, although it should not be there."); return nullptr; } } - AFP_RawDataCollection *coll = new AFP_RawDataCollection(columnNum); - cont->push_back(coll); - return coll; + AFP_ToFRawCollection& newCollection = container->newCollectionToF(); + return &newCollection; +} + +void AFP_ByteStream2RawCnv::setDataHeader (AFP_RawDataCommonHead* dataHead) const +{ + dataHead->setLink (m_wordReadout.link()); + dataHead->setHitDiscConfig (m_wordReadout.getBits(29, 28)); } diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataCollectionReadOut.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataCollectionReadOut.cxx deleted file mode 100644 index 71b710207d480a4e0ea5366c720ef69b22fbd501..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataCollectionReadOut.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_ByteStream2RawCnv/AFP_RawDataCollectionReadOut.h" - -AFP_RawDataCollectionReadOut::AFP_RawDataCollectionReadOut() - : - - m_dataWord(0), - m_wordHeader(0), m_wordHeader2(0), m_lvl1Id(0), m_link(0), m_flag(0), - m_ToT2(0), m_bcid(0), m_DiscConf(0), m_row(0), m_column(0), m_ToT1(0) {} - -AFP_RawDataCollectionReadOut::~AFP_RawDataCollectionReadOut() {} - -void AFP_RawDataCollectionReadOut::decodeWord(uint32_t dataWord) - -{ - setZero(); - - m_dataWord = dataWord; - m_word = dataWord; - m_wordHeader = getBits(31, 28); - m_wordHeader2 = getBits(31, 30); - - if (is_BOB()) { - - // https://indico.cern.ch/event/493415/contributions/1172054/attachments/1222236/1787442/bytestream.pdf - // using the data format defined in the slides: - - m_lvl1Id = getBits(14, 10); // L1id - m_link = getBits(27, 24); // link number - m_flag = getBits(15, 15); // frontend flag, no idea what this is - m_bcid = getBits(9, 0); // BCID - } - - else if (is_LWC()) { - m_DiscConf = getBits(29, 28); // HitDiscConfig - m_link = getBits(27, 24); // link number - m_row = getBits(23, 17); // row - m_column = getBits(16, 8); // column - m_ToT1 = getBits(7, 4); // ToT1 - m_ToT2 = getBits(3, 0); // ToT2 - } -} - -void AFP_RawDataCollectionReadOut::setZero() { - m_lvl1Id = 0; - m_link = 0; - m_flag = 0; - m_ToT1 = 0; - m_DiscConf = 0; - m_ToT2 = 0; - m_bcid = 0; - m_row = 0; - m_column = 0; -} diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataContainerReadOut.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataContainerReadOut.cxx deleted file mode 100644 index cb58c181acbe88f85cf72d8628ce62ae087ccde1..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataContainerReadOut.cxx +++ /dev/null @@ -1,32 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_ByteStream2RawCnv/AFP_RawDataContainerReadOut.h" - -AFP_RawDataContainerReadOut::AFP_RawDataContainerReadOut() - : - - m_wordMarker(0), - m_dataWord(0), m_subdetId(0), m_mrodId(0), m_lvl1Id(0), m_ecrId(0), - m_bcId(0), m_runNum(0), m_runType(0), m_triggerTypeId(0), - m_DetEventType(0), m_timestamp(0), m_BCId(0) {} - -AFP_RawDataContainerReadOut::~AFP_RawDataContainerReadOut() {} - -void AFP_RawDataContainerReadOut::setZero() { - m_subdetId = 0; - m_mrodId = 0; - m_runNum = 0; - m_runType = 0; - m_lvl1Id = 0; - m_ecrId = 0; - m_bcId = 0; - m_triggerTypeId = 0; - m_DetEventType = 0; -} - -void AFP_RawDataContainerReadOut::setZeroFull() { - m_timestamp = 0; - m_BCId = 0; -} diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProvider.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProvider.cxx index dc8dd5f5e544e0b050f6de824bd312323e5e3e22..1766769eb87cbf8f2eec46f6846b94ef04d3dce6 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProvider.cxx +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProvider.cxx @@ -3,22 +3,25 @@ */ // AFP includes -#include "AFP_RawEv/AFP_ROBID.h" // AFP_ByteStream2RawCnv includes #include "AFP_ByteStream2RawCnv/AFP_RawDataProvider.h" +#include "AFP_RawEv/AFP_RawContainer.h" + +const std::vector<unsigned int> AFP_RawDataProvider::s_robIDs = {AFP_ROBID::sideA, AFP_ROBID::sideC}; + AFP_RawDataProvider::AFP_RawDataProvider(const std::string &name, ISvcLocator *pSvcLocator) - : AthAlgorithm(name, pSvcLocator), m_nRawDataCollection(0), m_nRawData(0), + : AthAlgorithm(name, pSvcLocator), m_robDataProvider("ROBDataProviderSvc", name), - m_rawDataTool("AFP_RawDataProviderTool"), m_AFP_RawDataCollectionKey(), - m_collection() - + m_rawDataTool("AFP_RawDataProviderTool") { - declareProperty("AFP_RawDataCollectionKey", - m_AFP_RawDataCollectionKey = "AFP_RawData"); + declareProperty("AFP_RawContainerKey", + m_AFP_RawContainerKey = "AFP_RawData", + "Name under which AFP_RawContainer object will be saved in StoreGate"); + declareProperty("ProviderTool", m_rawDataTool); } @@ -45,10 +48,11 @@ StatusCode AFP_RawDataProvider::initialize() { StatusCode AFP_RawDataProvider::execute() { ATH_MSG_DEBUG("AFP_RawDataProvider::EXECUTE"); - AFP_RawDataContainer *container = new AFP_RawDataContainer(); + AFP_RawContainer *container = new AFP_RawContainer; ATH_MSG_DEBUG("Created AFP RDO Container"); + StatusCode recordSC = - evtStore()->record(container, m_AFP_RawDataCollectionKey); + evtStore()->record(container, m_AFP_RawContainerKey); if (recordSC.isFailure()) { ATH_MSG_WARNING("Unable to record AFP RDO Container"); return StatusCode::SUCCESS; @@ -56,26 +60,20 @@ StatusCode AFP_RawDataProvider::execute() { ATH_MSG_DEBUG("AFP RDO Container recorded"); } - std::vector<const ROBFragment *> listOfRobf; - std::vector<unsigned int> ROBIDs; - ROBIDs.push_back(AFP_ROBID::sideA); - ROBIDs.push_back(AFP_ROBID::sideC); + std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> listOfRobf; - m_robDataProvider->getROBData(ROBIDs, listOfRobf); - ATH_MSG_DEBUG(" ROB ID " << std::hex << ROBIDs<<std::dec); + m_robDataProvider->getROBData(s_robIDs, listOfRobf); + ATH_MSG_DEBUG(" ROB ID " << std::hex << s_robIDs<<std::dec); ATH_MSG_DEBUG(" Number of ROB fragments is " << listOfRobf.size()); if (m_rawDataTool->convert(listOfRobf, container).isFailure()) { - ATH_MSG_WARNING("BS conversion into RDOs failed"); + ATH_MSG_WARNING("Bytestream conversion into raw failed"); return StatusCode::SUCCESS; } else { - ATH_MSG_DEBUG(" Number of collections in container is " - << container->size()); - } - - StatusCode sc = evtStore()->retrieve(container, m_AFP_RawDataCollectionKey); - if (sc.isSuccess()) { - ATH_MSG_DEBUG("AFP RDO Container retrieved"); + ATH_MSG_DEBUG(" Number of time-of-flight collections in container is " + << container->collectionsToF().size()); + ATH_MSG_DEBUG(" Number of silicon collections in container is " + << container->collectionsSi().size()); } return StatusCode::SUCCESS; diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProviderTool.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProviderTool.cxx index 4f76dd0a31d2cbc67182c364ef1b41467c8e4fed..2aa90beacda3c3387cb67e31b6171d4d38c88e1d 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProviderTool.cxx +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataProviderTool.cxx @@ -14,8 +14,10 @@ const InterfaceID &AFP_RawDataProviderTool::interfaceID() { AFP_RawDataProviderTool::AFP_RawDataProviderTool(const std::string &type, const std::string &name, const IInterface *parent) - : AthAlgTool(type, name, parent), m_decoder("AFP_ByteStream2RawCnv"), - m_robIdSet() { + : AthAlgTool(type, name, parent), + m_decoder("AFP_ByteStream2RawCnv"), + m_robIdSet() +{ declareProperty("AFP_ByteStream2RawCnv", m_decoder); declareInterface<AFP_RawDataProviderTool>(this); } @@ -26,7 +28,7 @@ StatusCode AFP_RawDataProviderTool::initialize() { ATH_MSG_INFO("Initializing " << name() << "..."); StatusCode sc = AthAlgTool::initialize(); - ATH_MSG_DEBUG("INITIALIZE AFP+RawDataProviderTool"); + ATH_MSG_DEBUG("INITIALIZE AFP_RawDataProviderTool"); if (sc.isFailure()) { ATH_MSG_WARNING(" Failed to init baseclass"); return StatusCode::SUCCESS; @@ -42,15 +44,13 @@ StatusCode AFP_RawDataProviderTool::initialize() { } StatusCode -AFP_RawDataProviderTool::convert(std::vector<const ROBFragment *> &vecRobs, - AFP_RawDataContainer *rdoCont) - +AFP_RawDataProviderTool::convert(std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *> &vecRobs, + AFP_RawContainer *rawContainer) { - static uint32_t LastLvl1ID = 0xffffffff; - if (!rdoCont) { - ATH_MSG_WARNING("NULL pointer passed in rdoCont."); + if (!rawContainer) { + ATH_MSG_WARNING("NULL pointer passed in rawContainer."); return StatusCode::SUCCESS; } @@ -59,20 +59,20 @@ AFP_RawDataProviderTool::convert(std::vector<const ROBFragment *> &vecRobs, return StatusCode::SUCCESS; } - std::vector<const ROBFragment *>::const_iterator rob_it = vecRobs.begin(); - - if (((*rob_it)->rod_lvl1_id()) != LastLvl1ID) { - LastLvl1ID = ((*rob_it)->rod_lvl1_id()); + // clear containers + const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* firstROB = vecRobs.front(); + if (firstROB->rod_lvl1_id() != LastLvl1ID) { + LastLvl1ID = firstROB->rod_lvl1_id(); m_robIdSet.clear(); - rdoCont->clear(); + rawContainer->clear(); } - const std::vector<const ROBFragment *>::const_iterator robEnd = vecRobs.end(); - for (; rob_it != robEnd; ++rob_it) { - uint32_t robid = (*rob_it)->rod_source_id(); + // Loop over robs and fill rawContainer + for (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment* rob : vecRobs) { + const uint32_t robId = rob->rod_source_id(); - if (m_robIdSet.insert(robid).second) { - StatusCode sc = m_decoder->fillCollection(&**rob_it, rdoCont); + if (m_robIdSet.insert(robId).second) { + StatusCode sc = m_decoder->fillCollection(rob, rawContainer); if (sc.isFailure()) { ATH_MSG_WARNING("Failed filling collection"); return StatusCode::SUCCESS; diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataReadOut.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataReadOut.cxx deleted file mode 100644 index c0a85be8b31901334932c56864e44a1a89219906..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_RawDataReadOut.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_ByteStream2RawCnv/AFP_RawDataReadOut.h" - -AFP_RawDataReadOut::AFP_RawDataReadOut() - : m_dataWord(0), m_wordHeader(0), m_SlotId(0), m_LsbTdcId(0), m_ecnt_BOT(0), - m_ecnt_EOT(0), m_bcId(0), m_wcnt(0), m_Column(0), m_bit26_27(0), - m_bit24_27(0), m_HitDiscConfig(0), m_Link(0), m_fiber(0), m_ADC(0), - m_pattern(), m_BCId(0), m_bit16(0), m_error_bit17(0), m_bit18(0), ToT() {} - -AFP_RawDataReadOut::~AFP_RawDataReadOut() {} - -void AFP_RawDataReadOut::decodeWord(uint32_t dataWord) { - - setZero(); - m_dataWord = dataWord; - m_wordHeader = (dataWord >> headerPos) & headerBits; - - if (is_TDCt()) { - m_bit18 = (bool)getBits(18, 18); - m_error_bit17 = (bool)getBits(17, 17); - m_HitDiscConfig = getBits(25, 24); - m_Link = getBits(23, 19); - m_bit16 = (bool)getBits(16, 16); - m_bit26_27 = getBits(27, 26); - m_fiber = getBits(15, 0); - m_ADC = getBits(11, 0); - - for (int i = 15; i > -1; i--) - - { - if (getBits(i, i)) - m_pattern.push_back(true); - else - m_pattern.push_back(false); - } - m_BCId = getBits(15, 0); - m_Column = getBits(7, 0); - } else if (is_BOT()) { - - m_SlotId = getBits(28, 24); - m_ecnt_BOT = getBits(23, 12); - m_bcId = getBits(11, 0); - } - - else if (is_EOT()) { - m_LsbTdcId = getBits(25, 24); - m_ecnt_EOT = getBits(23, 12); - m_wcnt = getBits(11, 0); - m_bit24_27 = getBits(27, 24); - } -} - -void AFP_RawDataReadOut::setZero() { - m_SlotId = 0; - m_LsbTdcId = 0; - m_ecnt_BOT = 0; - m_ecnt_EOT = 0; - m_bcId = 0; - m_wcnt = 0; - m_HitDiscConfig = 0; - m_Link = 0; - m_fiber = 0; - m_ADC = 0; - m_pattern.clear(); - m_BCId = 0; - m_bit16 = false; - m_error_bit17 = false; - m_bit18 = false; - m_Column = 0; - m_bit26_27 = 0; - m_bit24_27 = 0; -} diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ReadOut.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ReadOut.cxx deleted file mode 100644 index cdbe36feaadf5ab758832d3c48757b14f6025ce5..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_ReadOut.cxx +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_ByteStream2RawCnv/AFP_ReadOut.h" - -#include <string> - -AFP_ReadOut::AFP_ReadOut() : m_word(0) {} - -AFP_ReadOut::~AFP_ReadOut() {} - -uint32_t AFP_ReadOut::getBits(const uint16_t bstart, const uint16_t bstop) { - uint32_t word = 0; - for (uint16_t i = bstop; i < bstart; i++) { - word = ((word | 1) << 1); - } - uint32_t result = (m_word >> bstop) & (word | 1); - return result; -} diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_WordReadOut.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_WordReadOut.cxx new file mode 100644 index 0000000000000000000000000000000000000000..db90178a5098529a9caac5b65e9e42c3edcabbe4 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/AFP_WordReadOut.cxx @@ -0,0 +1,15 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "AFP_ByteStream2RawCnv/AFP_WordReadOut.h" + +uint32_t AFP_WordReadOut::getBits(const uint16_t start, const uint16_t stop) const +{ + uint32_t word = 0; + for (uint16_t i = stop; i < start; i++) { + word = ((word | 1) << 1); + } + uint32_t result = (m_word >> stop) & (word | 1); + return result; +} diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/RawDataProvider.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/RawDataProvider.cxx deleted file mode 100644 index c944150258b0a2f034d3ae6891e85ca6ff8b5f83..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/RawDataProvider.cxx +++ /dev/null @@ -1,38 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// AFP_ByteStream2RawCnv includes -#include "AFP_ByteStream2RawCnv/RawDataProvider.h" - - - -RawDataProvider::RawDataProvider( const std::string& name, ISvcLocator* pSvcLocator ) : AthAlgorithm( name, pSvcLocator ){ - - //declareProperty( "Property", m_nProperty ); //example property declaration - -} - - -RawDataProvider::~RawDataProvider() {} - - -StatusCode RawDataProvider::initialize() { - ATH_MSG_INFO ("Initializing " << name() << "..."); - - return StatusCode::SUCCESS; -} - -StatusCode RawDataProvider::finalize() { - ATH_MSG_INFO ("Finalizing " << name() << "..."); - - return StatusCode::SUCCESS; -} - -StatusCode RawDataProvider::execute() { - ATH_MSG_DEBUG ("Executing " << name() << "..."); - - return StatusCode::SUCCESS; -} - - diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_entries.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_entries.cxx index a8b45aea656c5809a5ddeecca48441fda9f33dd0..06b0e04da8af7c1e3204f9e4ae585119dcfd478c 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_entries.cxx +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_entries.cxx @@ -1,19 +1,15 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ #include "GaudiKernel/DeclareFactoryEntries.h" -#include "AFP_ByteStream2RawCnv/RawDataProvider.h" - -DECLARE_ALGORITHM_FACTORY( RawDataProvider ) - - #include "AFP_ByteStream2RawCnv/AFP_ByteStream2RawCnv.h" DECLARE_TOOL_FACTORY( AFP_ByteStream2RawCnv ) - #include "AFP_ByteStream2RawCnv/AFP_RawDataProviderTool.h" DECLARE_TOOL_FACTORY( AFP_RawDataProviderTool ) - #include "AFP_ByteStream2RawCnv/AFP_RawDataProvider.h" DECLARE_ALGORITHM_FACTORY( AFP_RawDataProvider ) @@ -22,5 +18,4 @@ DECLARE_FACTORY_ENTRIES( AFP_ByteStream2RawCnv ) DECLARE_ALGORITHM( AFP_RawDataProvider ); DECLARE_TOOL( AFP_RawDataProviderTool ); DECLARE_TOOL( AFP_ByteStream2RawCnv ); - DECLARE_ALGORITHM( RawDataProvider ); } diff --git a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_load.cxx b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_load.cxx index 125337d5cc6353bae852f7e61dd24a4cba36dddf..09fbc6224bdfc476341a166bfc991bb33bedc817 100644 --- a/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_load.cxx +++ b/ForwardDetectors/AFP/AFP_ByteStream2RawCnv/src/components/Decoder_load.cxx @@ -1,3 +1,6 @@ - +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + #include "GaudiKernel/LoadFactoryEntries.h" LOAD_FACTORY_ENTRIES(AFP_ByteStream2RawCnv) diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDLocRecoEvCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDLocRecoEvCollectionCnv.cxx index 2d0b6e5134927397121b75d27f69587650242eef..30e848bd9a82f87523b2c0d3bf4f0f5219af665a 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDLocRecoEvCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDLocRecoEvCollectionCnv.cxx @@ -8,17 +8,17 @@ AFP_SIDLocRecoEvCollection_PERS* AFP_SIDLocRecoEvCollectionCnv::createPersistent(AFP_SIDLocRecoEvCollection* transCont) { - MsgStream mlog(messageService(), "AFP_SIDLocRecoEvCollectionConverter" ); - AFP_SIDLocRecoEvCollectionCnv_p1 m_TPConverter; - AFP_SIDLocRecoEvCollection_PERS *persObj = m_TPConverter.createPersistent( transCont, mlog ); + MsgStream mlog(msgSvc(), "AFP_SIDLocRecoEvCollectionConverter" ); + AFP_SIDLocRecoEvCollectionCnv_p1 TPConverter; + AFP_SIDLocRecoEvCollection_PERS *persObj = TPConverter.createPersistent( transCont, mlog ); return persObj; } AFP_SIDLocRecoEvCollection* AFP_SIDLocRecoEvCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_SIDLocRecoEvCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_SIDLocRecoEvCollectionConverter" ); - AFP_SIDLocRecoEvCollectionCnv_p1 m_TPConverter_p1; + AFP_SIDLocRecoEvCollectionCnv_p1 TPConverter_p1; AFP_SIDLocRecoEvCollection *trans_cont(0); // probably inicialization @@ -27,7 +27,7 @@ AFP_SIDLocRecoEvCollection* AFP_SIDLocRecoEvCollectionCnv::createTransient() { if( this->compareClassGuid(p1_guid)) { std::auto_ptr< AFP_SIDLocRecoEvCollection_p1 > col_vect( this->poolReadObject< AFP_SIDLocRecoEvCollection_p1 >() ); - trans_cont = m_TPConverter_p1.createTransient( col_vect.get(), mlog ); + trans_cont = TPConverter_p1.createTransient( col_vect.get(), mlog ); } else { diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDSimHitCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDSimHitCollectionCnv.cxx index 575b3a0ad54071919eafdec264e86a5e6002867e..76d379bd04b66173720f389d329d2d25351aaae0 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDSimHitCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SIDSimHitCollectionCnv.cxx @@ -8,7 +8,7 @@ AFP_SIDSimHitCollection_PERS* AFP_SIDSimHitCollectionCnv::createPersistent(AFP_SIDSimHitCollection* transCont) { - MsgStream mlog(messageService(), "AFP_SIDSimHitCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_SIDSimHitCollectionConverter" ); AFP_SIDSimHitCollectionCnv_p1 TPConverter; AFP_SIDSimHitCollection_PERS *pPersColl = TPConverter.createPersistent( transCont, mlog ); @@ -18,7 +18,7 @@ AFP_SIDSimHitCollection_PERS* AFP_SIDSimHitCollectionCnv::createPersistent(AFP_S AFP_SIDSimHitCollection* AFP_SIDSimHitCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_SIDSimHitCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_SIDSimHitCollectionConverter" ); //GUID of persistence collection class (see selection.xml in AFP_EventTPCnv, class item AFP_SIDSimHitCollection_p1 static const pool::Guid p1_guid("AAA03560-D4CC-40C3-80D6-165448375201"); diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SiDigiCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SiDigiCollectionCnv.cxx index bc6323f7798eeef98c025726baf3f90348716d15..325e58f8ee219ce3b7f6efe7faf2251bfb2e00ea 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SiDigiCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_SiDigiCollectionCnv.cxx @@ -8,7 +8,7 @@ AFP_SiDigiCollection_PERS* AFP_SiDigiCollectionCnv::createPersistent(AFP_SiDigiCollection* transCont) { - MsgStream mlog(messageService(), "AFP_SiDigiCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_SiDigiCollectionConverter" ); AFP_SiDigiCollectionCnv_p1 TPConverter; AFP_SiDigiCollection_PERS *pPersColl = TPConverter.createPersistent( transCont, mlog ); @@ -18,7 +18,7 @@ AFP_SiDigiCollection_PERS* AFP_SiDigiCollectionCnv::createPersistent(AFP_SiDigiC AFP_SiDigiCollection* AFP_SiDigiCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_SiDigiCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_SiDigiCollectionConverter" ); //GUID of persistence collection class (see selection.xml in AFP_EventTPCnv, class item AFP_SiDigiCollection_p1 static const pool::Guid p1_guid("513B266D-BD55-4603-A064-8E6F24042707"); diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDDigiCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDDigiCollectionCnv.cxx index 98b63bf2f05c66452bdc7e55e09fe5f6985f8895..03b7cebc0744d57af52d483acf23a5c6ddfa7a4e 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDDigiCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDDigiCollectionCnv.cxx @@ -8,7 +8,7 @@ AFP_TDDigiCollection_PERS* AFP_TDDigiCollectionCnv::createPersistent(AFP_TDDigiCollection* transCont) { - MsgStream mlog(messageService(), "AFP_TDDigiCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_TDDigiCollectionConverter" ); AFP_TDDigiCollectionCnv_p1 TPConverter; AFP_TDDigiCollection_PERS *pPersColl = TPConverter.createPersistent( transCont, mlog ); @@ -18,7 +18,7 @@ AFP_TDDigiCollection_PERS* AFP_TDDigiCollectionCnv::createPersistent(AFP_TDDigiC AFP_TDDigiCollection* AFP_TDDigiCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_TDDigiCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_TDDigiCollectionConverter" ); //GUID of persistence collection class (see selection.xml in AFP_EventTPCnv, class item AFP_TDDigiCollection_p1 static const pool::Guid p1_guid("352BE1B9-96FA-46BB-B1AE-51DDF56380EB"); diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDLocRecoEvCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDLocRecoEvCollectionCnv.cxx index 299ed9a9bd64496283a76f07a5318cea38967e97..4091cfb3c5300b41dcea8c9ecb40a2bbdd09fcf0 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDLocRecoEvCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDLocRecoEvCollectionCnv.cxx @@ -8,17 +8,17 @@ AFP_TDLocRecoEvCollection_PERS* AFP_TDLocRecoEvCollectionCnv::createPersistent(AFP_TDLocRecoEvCollection* transCont) { - MsgStream mlog(messageService(), "AFP_TDLocRecoEvCollectionConverter" ); - AFP_TDLocRecoEvCollectionCnv_p1 m_TPConverter; - AFP_TDLocRecoEvCollection_PERS *persObj = m_TPConverter.createPersistent( transCont, mlog ); + MsgStream mlog(msgSvc(), "AFP_TDLocRecoEvCollectionConverter" ); + AFP_TDLocRecoEvCollectionCnv_p1 TPConverter; + AFP_TDLocRecoEvCollection_PERS *persObj = TPConverter.createPersistent( transCont, mlog ); return persObj; } AFP_TDLocRecoEvCollection* AFP_TDLocRecoEvCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_TDLocRecoEvCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_TDLocRecoEvCollectionConverter" ); - AFP_TDLocRecoEvCollectionCnv_p1 m_TPConverter_p1; + AFP_TDLocRecoEvCollectionCnv_p1 TPConverter_p1; AFP_TDLocRecoEvCollection *trans_cont(0); // probably inicialization @@ -27,7 +27,7 @@ AFP_TDLocRecoEvCollection* AFP_TDLocRecoEvCollectionCnv::createTransient() { if( this->compareClassGuid(p1_guid)) { std::auto_ptr< AFP_TDLocRecoEvCollection_p1 > col_vect( this->poolReadObject< AFP_TDLocRecoEvCollection_p1 >() ); - trans_cont = m_TPConverter_p1.createTransient( col_vect.get(), mlog ); + trans_cont = TPConverter_p1.createTransient( col_vect.get(), mlog ); } else { diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDSimHitCollectionCnv.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDSimHitCollectionCnv.cxx index acb116ee242c1d0e2699b8cf3d0ba9e6280a87d1..3f29d2029cc4882e2a96e8bcd089170f238b2169 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDSimHitCollectionCnv.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventAthenaPool/src/AFP_TDSimHitCollectionCnv.cxx @@ -8,7 +8,7 @@ AFP_TDSimHitCollection_PERS* AFP_TDSimHitCollectionCnv::createPersistent(AFP_TDSimHitCollection* transCont) { - MsgStream mlog(messageService(), "AFP_TDSimHitCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_TDSimHitCollectionConverter" ); AFP_TDSimHitCollectionCnv_p1 TPConverter; AFP_TDSimHitCollection_PERS *pPersColl = TPConverter.createPersistent( transCont, mlog ); @@ -18,7 +18,7 @@ AFP_TDSimHitCollection_PERS* AFP_TDSimHitCollectionCnv::createPersistent(AFP_TDS AFP_TDSimHitCollection* AFP_TDSimHitCollectionCnv::createTransient() { - MsgStream mlog(messageService(), "AFP_TDSimHitCollectionConverter" ); + MsgStream mlog(msgSvc(), "AFP_TDSimHitCollectionConverter" ); //GUID of persistence collection class (see selection.xml in AFP_EventTPCnv, class item AFP_TDSimHitCollection_p1 static const pool::Guid p1_guid("F38ED236-94F3-483B-A015-C95EA7B194AE"); diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_EventTPCnvDict.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_EventTPCnvDict.h index dd1e7568f6bdfa3dc22032ac978d8aa0de947b2d..47182bd2b0e4e4897d6323693c198b764222a98a 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_EventTPCnvDict.h +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_EventTPCnvDict.h @@ -11,10 +11,6 @@ #include "AFP_EventTPCnv/AFP_TDDigiCollection_p1.h" #include "AFP_EventTPCnv/AFP_TDDigi_p1.h" -#include "AFP_EventTPCnv/AFP_RawData_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataCollection_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataContainer_p1.h" - #include "AFP_EventTPCnv/AFP_SIDSimHitCollection_p1.h" #include "AFP_EventTPCnv/AFP_SIDSimHit_p1.h" diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCnv_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCnv_p1.h deleted file mode 100644 index aa50efa071ae72309e5fbae9cfc742f49b3165eb..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCnv_p1.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACNV_P1_H -#define AFP_RAWDATACNV_P1_H - -#include "AFP_RawData_p1.h" -#include "AFP_RawEv/AFP_RawData.h" -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -class MsgStream; -class AFP_RawDataCnv_p1: public T_AthenaPoolTPCnvBase<AFP_RawData, AFP_RawData_p1> { - - public: - - AFP_RawDataCnv_p1() {} - - virtual void persToTrans(const AFP_RawData_p1* persObj, AFP_RawData* transObj, MsgStream &log); - virtual void transToPers(const AFP_RawData* transObj, AFP_RawData_p1* persObj , MsgStream &log); -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollectionCnv_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollectionCnv_p1.h deleted file mode 100644 index e370d7ea9687bfd1c4178299f01eda63df349238..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollectionCnv_p1.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACOLLECTIONCNV_P1_H -#define AFP_RAWDATACOLLECTIONCNV_P1_H - -#include "AFP_RawDataCollection_p1.h" -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "AFP_EventTPCnv/AFP_RawDataCnv_p1.h" -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" - -class MsgStream; - -typedef T_AthenaPoolTPCnvVector< AFP_RawDataCollection, AFP_RawDataCollection_p1, AFP_RawDataCnv_p1> AFP_RawDataCollection_Cnvp1_base_t; - -class AFP_RawDataCollectionCnv_p1: public AFP_RawDataCollection_Cnvp1_base_t{ - -//public T_AthenaPoolTPCnvBase<AFP_RawDataCollection, AFP_RawDataCollection_p1> { - - public: - - AFP_RawDataCollectionCnv_p1() {} - - virtual void persToTrans(const AFP_RawDataCollection_p1* persColl, AFP_RawDataCollection* transColl, MsgStream& log); - virtual void transToPers(const AFP_RawDataCollection* transColl, AFP_RawDataCollection_p1* persColl, MsgStream& log); -}; -#endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollection_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollection_p1.h deleted file mode 100644 index ddc4aa8bf1ba78f7cf2aa844d9460e166f4380c4..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataCollection_p1.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACOLLECTION_P1_H -#define AFP_RAWDATACOLLECTION_P1_H - -#include "AthenaPoolUtilities/TPObjRef.h" -#include "AFP_RawData_p1.h" -#include <vector> -#include <string> -#include <inttypes.h> - -class AFP_RawDataCollection_p1: public std::vector<AFP_RawData_p1> { - - public: - friend class AFP_RawDataCollectionCnv_p1; - AFP_RawDataCollection_p1(): - L1Id(0), - frontend_flag(0), - patternId(0), - BCIdId(0), - header_numberId(0), - ADC2Id(0), - TrigSyncErrId(0) - {} - //Motherboard id - uint16_t L1Id; - //Event counter - uint32_t frontend_flag; - //pattern id - std::vector<bool> patternId; - //BCId id - uint16_t BCIdId; - //header_number id Chan0 - uint16_t header_numberId; - //header_number id Chan1 - uint16_t ADC2Id; - //Time Stamp - //syncronization error of PMF 24 (trigger info) - bool TrigSyncErrId; - -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainerCnv_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainerCnv_p1.h deleted file mode 100644 index 4feaff95148a1ff07486afd9841232bbd2d428d4..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainerCnv_p1.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFPEVENTATHENAPOOL_AFPCONTAINERCNV_P1_H -#define AFPEVENTATHENAPOOL_AFPCONTAINERCNV_P1_H - -#include "AthenaPoolCnvSvc/T_AthenaPoolTPConverter.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" -#include "AFP_RawDataCollectionCnv_p1.h" -#include "AFP_RawDataContainer_p1.h" - - -class MsgStream; - -typedef T_AthenaPoolTPCnvVector< AFP_RawDataContainer, AFP_RawDataContainer_p1, AFP_RawDataCollectionCnv_p1 > AFP_RawDataContainer_Cnvp1_base_t; - - -class AFP_RawDataContainerCnv_p1 - : public AFP_RawDataContainer_Cnvp1_base_t - { - public: - AFP_RawDataContainerCnv_p1() {} - - virtual void persToTrans(const AFP_RawDataContainer_p1* persCont, AFP_RawDataContainer* transCont, MsgStream& log); - virtual void transToPers(const AFP_RawDataContainer* transCont, AFP_RawDataContainer_p1* persCont, MsgStream& log); -}; -#endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainer_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainer_p1.h deleted file mode 100644 index bf72fb6a35d2885eeff5ba653825621418227181..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawDataContainer_p1.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFPATHENAPOOL_AFPCONTAINER_P1_H -#define AFPATHENAPOOL_AFPCONTAINER_P1_H -#include <vector> -#include "AFP_RawDataCollection_p1.h" - -class AFP_RawDataContainer_p1: public std::vector<AFP_RawDataCollection_p1> -{ - - uint32_t TimeStamp; - //Time Stamp ns - uint32_t TimeStampns; - //Lumi Block ID - uint32_t LumiBlock; -//Bunch Crossing ID - uint32_t bcId; -// Lvl1 ID - uint32_t lvl1Id; - //Lvl1 trigger pattern (fired items in lvl1 trigger) - std::vector<bool> lvl1Pattern; - //Lvl2 trigger pattern (fired items in lvl2 trigger) - std::vector<bool> lvl2Pattern; - //EF trigger pattern (fired items in EF) - std::vector<bool> efPattern; - - public: - - AFP_RawDataContainer_p1() - { - TimeStamp=0; - TimeStampns=0; - LumiBlock=0; - bcId=0; - }; - - friend class AFP_RawDataContainerCnv_p1; - - }; - - #endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawData_p1.h b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawData_p1.h deleted file mode 100644 index 9be7759aec386e58048c78ae320ca4f2673bfcb6..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/AFP_RawData_p1.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATA_P1_H -#define AFP_RAWDATA_P1_H - -#include <inttypes.h> - -#include<stdint.h> -#include<vector> -#include <iostream> -class AFP_RawData_p1 { - - private: - - // Data info TSM: - uint16_t HitDiscConfig; - uint16_t Link; - uint16_t Column; - uint32_t Row; - uint16_t ToT; // sostituisce il p_hit di prima - uint16_t lvl1; - bool m_error_bit17; - - // All the datawords (no headers and footers) coming from this channel - // to be decoded on demand using AFP_ReadOut methods - std::vector<uint32_t> m_dataWords; - - - public: - - friend class AFP_RawDataCnv_p1; - - - AFP_RawData_p1(): - - HitDiscConfig(0), - Link(0), - Column(0), - Row(0), - ToT(0), - m_error_bit17(0), - lvl1(0) - {} - - -}; - -#endif diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/selection.xml b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/selection.xml index abcdc2d90beea9069b6ded70d863b8d30e1ba57a..35c02091250e8a41003c82095309ac96bad8e306 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/selection.xml +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/AFP_EventTPCnv/selection.xml @@ -23,10 +23,4 @@ <class name="std::vector<AFP_SIDLocRecoEvent_p1>" /> <class name="AFP_SIDLocRecoEvCollection_p1" id="D0C144F2-E82E-44B3-84BC-22C7D10F262E" /> - <class name="AFP_RawDataContainer_p1" id = "229CCDDE-6686-49A2-BC5D-431FEA055EC8"/> - <class name="std::vector<AFP_RawDataCollection_p1>" /> - <class name="AFP_RawDataCollection_p1" /> - <class name="std::vector<AFP_RawData_p1>" /> - <class name="AFP_RawData_p1" /> - </lcgdict> diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/CMakeLists.txt b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/CMakeLists.txt index 0fbfae841f3bf2b607c02df9f7ca682c8a3987d5..69c5164d8ea530e06d48c4d77a16c8cb9b777917 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/CMakeLists.txt +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/CMakeLists.txt @@ -12,7 +12,7 @@ atlas_depends_on_subdirs( PUBLIC ForwardDetectors/AFP/AFP_DigiEv ForwardDetectors/AFP/AFP_RecoEv/AFP_LocRecoEv ForwardDetectors/AFP/AFP_SimEv - ForwardDetectors/AFP_AFP_RawEv + ForwardDetectors/AFP/AFP_RawEv PRIVATE DetectorDescription/Identifier GaudiKernel ) diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCnv_p1.cxx deleted file mode 100644 index 6895c0b7d998da5615034baf09e48f35bcfca907..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCnv_p1.cxx +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_RawEv/AFP_RawData.h" -#include "GaudiKernel/MsgStream.h" -#include "AFP_EventTPCnv/AFP_RawDataCnv_p1.h" - -void AFP_RawDataCnv_p1::persToTrans(const AFP_RawData_p1* persObj, -AFP_RawData* transObj, MsgStream &log) { - - - log << MSG::DEBUG << "In AFP_RawDataCnv_p1:persToTrans called" << endreq; - - transObj->SetZero_PMF(); - transObj->Set_DiscConf (persObj->HitDiscConfig); - transObj->Set_link (persObj->Link); - transObj->Set_column (persObj->Column); - transObj->Set_row (persObj->Row); - transObj->Set_ToT (persObj->ToT); - transObj->Set_lvl1 (persObj->lvl1); - for (uint32_t w : persObj->m_dataWords) - transObj->addData (w); - transObj->Set_error_bit17 (persObj->m_error_bit17); - - - } - -void AFP_RawDataCnv_p1::transToPers(const AFP_RawData* transObj, AFP_RawData_p1* persObj, MsgStream &log) { - - - log << MSG::DEBUG << "In AFP_RawDataCnv_p1:transToPers called" << endreq; - - persObj->HitDiscConfig = transObj->Get_DiscConf(); - persObj->Link = transObj->Get_link(); - persObj->Column = transObj->Get_column(); - persObj->Row = transObj->Get_row(); - persObj->m_error_bit17 = transObj->Get_error_bit17(); - persObj->ToT = transObj->Get_ToT(); - persObj->lvl1 = transObj->Get_lvl1(); -// const std::vector<uint16_t>& v = transObj->HitChan(); - // for ( int i = 0; i < 16; i++ ){ -// persObj->m_ToT[i] = v[i]; -// } - - - if (transObj->dataWords()!=0) - persObj->m_dataWords = *transObj->dataWords(); -} diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCollectionCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCollectionCnv_p1.cxx deleted file mode 100644 index a1b482ae9840a27ba5ce43bae727c8421563c955..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataCollectionCnv_p1.cxx +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "GaudiKernel/MsgStream.h" -#include "AFP_EventTPCnv/AFP_RawDataCollectionCnv_p1.h" - -#include <sstream> - - -void AFP_RawDataCollectionCnv_p1::transToPers(const AFP_RawDataCollection* transColl, AFP_RawDataCollection_p1* persColl, MsgStream& log) { - - if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "In AFP_RawDataCollectionCnv_p1::transToPers" << endreq; - - // Invoke vector converter from the base template - AFP_RawDataCollection_Cnvp1_base_t::transToPers( transColl, persColl, log ); - - - persColl->L1Id = transColl->Get_lvl1Id(); - persColl->frontend_flag = transColl->Get_flag(); - persColl->patternId = transColl->Get_pattern_POT(); - persColl->BCIdId = transColl->Get_bcid(); - persColl->header_numberId = transColl->Get_header_number_POT(); - persColl->ADC2Id = transColl->Get_ADC2_POT(); - persColl->TrigSyncErrId = transColl->GetTrigSyncErr(); - -} - -void AFP_RawDataCollectionCnv_p1::persToTrans(const AFP_RawDataCollection_p1* persColl, AFP_RawDataCollection* transColl, MsgStream& log) { - - if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "In AFP_RawDataCollectionCnv_p1::persToTrans" << endreq; - - - // Invoke vector converter from the base template - AFP_RawDataCollection_Cnvp1_base_t::persToTrans( persColl, transColl, log ); - - transColl->Set_lvl1Id (persColl->L1Id); - transColl->Set_flag (persColl->frontend_flag); - transColl->Set_pattern_POT (persColl->patternId); - transColl->Set_bcid (persColl->BCIdId); - transColl->Set_header (persColl->header_numberId); - transColl->Set_ADC2_POT (persColl->ADC2Id); - transColl->SetTrigSyncErr (persColl->TrigSyncErrId); -} diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataContainerCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataContainerCnv_p1.cxx deleted file mode 100644 index 4511f2aca2cd39a8c4c9773414b9af9aff53676a..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_RawDataContainerCnv_p1.cxx +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "GaudiKernel/MsgStream.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" -#include "AFP_EventTPCnv/AFP_RawDataContainerCnv_p1.h" - -void AFP_RawDataContainerCnv_p1::transToPers(const AFP_RawDataContainer* transCont, AFP_RawDataContainer_p1* persCont, MsgStream& log) { - - if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "In AFP_RawDataContainerCnv_p1::transToPers" << endreq; - - // Invoke vector converter from the base template - AFP_RawDataContainer_Cnvp1_base_t::transToPers( transCont, persCont, log ); - - persCont->TimeStamp = transCont->GetTimeStamp(); - persCont->TimeStampns = transCont->GetTimeStampns(); - persCont->LumiBlock = transCont->GetLumiBlock(); - persCont->bcId = transCont->GetBCId(); - persCont->lvl1Id = transCont->lvl1Id(); - persCont->lvl1Pattern = transCont->GetLvl1Pattern_POT(); - persCont->lvl2Pattern = transCont->GetLvl2Pattern_POT(); - persCont->efPattern = transCont->GetEFPattern_POT(); - - } -void AFP_RawDataContainerCnv_p1::persToTrans(const AFP_RawDataContainer_p1* persCont, AFP_RawDataContainer* transCont, MsgStream& log) { - - -if (log.level()<=MSG::DEBUG) log << MSG::DEBUG << "In AFP_RawDataContainerCnv_p1::persToTrans" << endreq; - - -// Invoke vector converter from the base template - AFP_RawDataContainer_Cnvp1_base_t::persToTrans( persCont, transCont, log ); - - transCont->SetTimeStamp (persCont->TimeStamp); - transCont->SetTimeStampns (persCont->TimeStampns); - transCont->SetLumiBlock (persCont->LumiBlock); - transCont->SetBCId (persCont->bcId); - transCont->SetLvl1Id(persCont->lvl1Id); - transCont->SetLvl1Pattern (persCont->lvl1Pattern); - transCont->SetLvl2Pattern (persCont->lvl2Pattern); - transCont->SetEFPattern (persCont->efPattern); -} diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDLocRecoEventCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDLocRecoEventCnv_p1.cxx index 8b95aac6ee10f5ff2ba08f8ee194d104f366504c..500174f9ea2436fed26ddd148865296df791f0a5 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDLocRecoEventCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDLocRecoEventCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_SIDLocRecoEventCnv_p1::persToTrans(const AFP_SIDLocRecoEvent_p1* persObj, AFP_SIDLocRecoEvent* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SIDLocRecoEventCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_SIDLocRecoEventCnv_p1::persToTrans called " << endmsg; transObj->m_iAlgoNum = persObj->m_iAlgoNum; transObj->m_nStationID = persObj->m_nStationID; @@ -34,7 +34,7 @@ void AFP_SIDLocRecoEventCnv_p1::persToTrans(const AFP_SIDLocRecoEvent_p1* persOb void AFP_SIDLocRecoEventCnv_p1::transToPers(const AFP_SIDLocRecoEvent* transObj, AFP_SIDLocRecoEvent_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SIDLocRecoEventCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_SIDLocRecoEventCnv_p1::transToPers called " << endmsg; persObj->m_iAlgoNum = transObj->m_iAlgoNum; persObj->m_nStationID = transObj->m_nStationID; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDSimHitCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDSimHitCnv_p1.cxx index 54b544318eb7f666a4eca4010cc0a7ad6211c076..ec09498969a48f8e09d29df476d9472108edbc85 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDSimHitCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SIDSimHitCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_SIDSimHitCnv_p1::persToTrans(const AFP_SIDSimHit_p1* persObj, AFP_SIDSimHit* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SIDSimHitCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_SIDSimHitCnv_p1::persToTrans called " << endmsg; transObj->m_nHitID=persObj->m_nHitID; transObj->m_nTrackID=persObj->m_nTrackID; @@ -39,7 +39,7 @@ void AFP_SIDSimHitCnv_p1::persToTrans(const AFP_SIDSimHit_p1* persObj, AFP_SIDSi void AFP_SIDSimHitCnv_p1::transToPers(const AFP_SIDSimHit* transObj, AFP_SIDSimHit_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SIDSimHitCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_SIDSimHitCnv_p1::transToPers called " << endmsg; persObj->m_nHitID=transObj->m_nHitID; persObj->m_nTrackID=transObj->m_nTrackID; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SiDigiCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SiDigiCnv_p1.cxx index 3d89c1823e533a2d1b6a5e7651e66b1b5f9240c0..0971ed2334117409abb87df7616ab215b47ce8fb 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SiDigiCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_SiDigiCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_SiDigiCnv_p1::persToTrans(const AFP_SiDigi_p1* persObj, AFP_SiDigi* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SiDigiCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_SiDigiCnv_p1::persToTrans called " << endmsg; transObj->m_fADC=persObj->m_fADC; @@ -27,7 +27,7 @@ void AFP_SiDigiCnv_p1::persToTrans(const AFP_SiDigi_p1* persObj, AFP_SiDigi* tra void AFP_SiDigiCnv_p1::transToPers(const AFP_SiDigi* transObj, AFP_SiDigi_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_SiDigiCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_SiDigiCnv_p1::transToPers called " << endmsg; persObj->m_fADC=transObj->m_fADC; persObj->m_fTDC=transObj->m_fTDC; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDDigiCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDDigiCnv_p1.cxx index 5e0e08805f14353a64d78000264f001b93f9c486..9e3c9561b1036d101817719026ba7bce0afa75a2 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDDigiCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDDigiCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_TDDigiCnv_p1::persToTrans(const AFP_TDDigi_p1* persObj, AFP_TDDigi* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDDigiCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_TDDigiCnv_p1::persToTrans called " << endmsg; transObj->m_fADC=persObj->m_fADC; @@ -26,7 +26,7 @@ void AFP_TDDigiCnv_p1::persToTrans(const AFP_TDDigi_p1* persObj, AFP_TDDigi* tra void AFP_TDDigiCnv_p1::transToPers(const AFP_TDDigi* transObj, AFP_TDDigi_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDDigiCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_TDDigiCnv_p1::transToPers called " << endmsg; persObj->m_fADC=transObj->m_fADC; persObj->m_fTDC=transObj->m_fTDC; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDLocRecoEventCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDLocRecoEventCnv_p1.cxx index 4361caee8ff7e10e1768d31c45d58fd6b42976dd..f28817cec83b2abcbebcbcf75f59bfea000fcc8b 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDLocRecoEventCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDLocRecoEventCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_TDLocRecoEventCnv_p1::persToTrans(const AFP_TDLocRecoEvent_p1* persObj, AFP_TDLocRecoEvent* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDLocRecoEventCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_TDLocRecoEventCnv_p1::persToTrans called " << endmsg; transObj->m_iAlgoNum = persObj->m_iAlgoNum; transObj->m_nStationID = persObj->m_nStationID; @@ -28,7 +28,7 @@ void AFP_TDLocRecoEventCnv_p1::persToTrans(const AFP_TDLocRecoEvent_p1* persObj, void AFP_TDLocRecoEventCnv_p1::transToPers(const AFP_TDLocRecoEvent* transObj, AFP_TDLocRecoEvent_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDLocRecoEventCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_TDLocRecoEventCnv_p1::transToPers called " << endmsg; persObj->m_iAlgoNum = transObj->m_iAlgoNum; persObj->m_nStationID = transObj->m_nStationID; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDSimHitCnv_p1.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDSimHitCnv_p1.cxx index 39873036668f84a229381a9be78539d5fa82086a..a4d269cf205c777186e9ae75266284485bb4a96d 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDSimHitCnv_p1.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/AFP_TDSimHitCnv_p1.cxx @@ -13,7 +13,7 @@ void AFP_TDSimHitCnv_p1::persToTrans(const AFP_TDSimHit_p1* persObj, AFP_TDSimHit* transObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDSimHitCnv_p1::persToTrans called " << endreq; + log << MSG::DEBUG << "AFP_TDSimHitCnv_p1::persToTrans called " << endmsg; transObj->m_nHitID=persObj->m_nHitID; transObj->m_nTrackID=persObj->m_nTrackID; @@ -36,7 +36,7 @@ void AFP_TDSimHitCnv_p1::persToTrans(const AFP_TDSimHit_p1* persObj, AFP_TDSimHi void AFP_TDSimHitCnv_p1::transToPers(const AFP_TDSimHit* transObj, AFP_TDSimHit_p1* persObj, MsgStream &log) { - log << MSG::DEBUG << "AFP_TDSimHitCnv_p1::transToPers called " << endreq; + log << MSG::DEBUG << "AFP_TDSimHitCnv_p1::transToPers called " << endmsg; persObj->m_nHitID=transObj->m_nHitID; persObj->m_nTrackID=transObj->m_nTrackID; diff --git a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/components/AFP_SimEvTPCnv_entries.cxx b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/components/AFP_SimEvTPCnv_entries.cxx index 293b9ae6a71a394bfe4e041eece7e26b76f57e5c..bd8f821398b75f316c8f94f33984f95de89ad0e0 100644 --- a/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/components/AFP_SimEvTPCnv_entries.cxx +++ b/ForwardDetectors/AFP/AFP_EventCnv/AFP_EventTPCnv/src/components/AFP_SimEvTPCnv_entries.cxx @@ -8,14 +8,6 @@ #include "AFP_EventTPCnv/AFP_TDDigiCollection_p1.h" #include "AFP_EventTPCnv/AFP_TDDigiCollectionCnv_p1.h" -#include "AFP_EventTPCnv/AFP_RawData_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataCnv_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataCollection_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataCollectionCnv_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataContainer_p1.h" -#include "AFP_EventTPCnv/AFP_RawDataContainerCnv_p1.h" - - #include "AFP_EventTPCnv/AFP_SIDSimHit_p1.h" #include "AFP_EventTPCnv/AFP_SIDSimHitCnv_p1.h" #include "AFP_EventTPCnv/AFP_SIDSimHitCollection_p1.h" @@ -50,13 +42,6 @@ DECLARE_ALGORITHM_FACTORY( AFP_TDDigiCnv_p1 ) DECLARE_ALGORITHM_FACTORY( AFP_TDDigiCollection_p1 ) DECLARE_ALGORITHM_FACTORY( AFP_TDDigiCollectionCnv_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawData_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawDataCnv_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawDataCollection_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawDataCollectionCnv_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawDataContainer_p1 ) -DECLARE_ALGORITHM_FACTORY( AFP_RawDataContainerCnv_p1 ) - DECLARE_ALGORITHM_FACTORY( AFP_SIDSimHit_p1 ) DECLARE_ALGORITHM_FACTORY( AFP_SIDSimHitCnv_p1 ) DECLARE_ALGORITHM_FACTORY( AFP_SIDSimHitCollection_p1 ) @@ -90,13 +75,6 @@ DECLARE_FACTORY_ENTRIES(AFP_EventTPCnv) { DECLARE_ALGORITHM( AFP_TDDigiCollection_p1 ) DECLARE_ALGORITHM( AFP_TDDigiCollectionCnv_p1 ) - DECLARE_ALGORITHM( AFP_RawData_p1 ) - DECLARE_ALGORITHM( AFP_RawDataCnv_p1 ) - DECLARE_ALGORITHM( AFP_RawDataCollection_p1 ) - DECLARE_ALGORITHM( AFP_RawDataCollectionCnv_p1 ) - DECLARE_ALGORITHM( AFP_RawDataContainer_p1 ) - DECLARE_ALGORITHM( AFP_RawDataContainerCnv_p1 ) - DECLARE_ALGORITHM( AFP_SIDSimHit_p1 ) DECLARE_ALGORITHM( AFP_SIDSimHitCnv_p1 ) DECLARE_ALGORITHM( AFP_SIDSimHitCollection_p1 ) diff --git a/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalLayerMonitor.h b/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalLayerMonitor.h index 33df3a6623df8ab3e3d94fa03687fa7a8df46211..62b5b65b5b93e35bd829135d3db9b939913cb9b6 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalLayerMonitor.h +++ b/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalLayerMonitor.h @@ -7,7 +7,7 @@ #include <list> -#include <AFP_RawEv/AFP_RawData.h> +#include <AFP_RawEv/AFP_SiRawData.h> // forward declarations for lightweight histograms class LWHist1D; @@ -23,7 +23,7 @@ public: // void bookHistogramsRecurrent(ManagedMonitorToolBase* toolToStoreHistograms); void bookHistograms(ManagedMonitorToolBase* toolToStoreHistograms, std::string histsDirName = ""); - void fillHistograms(const AFP_RawData& hit); + void fillHistograms(const AFP_SiRawData& hit); void eventEnd(); ///< method that should be called when event processing is finished void endOfLumiBlock(ManagedMonitorToolBase* toolToStoreHistograms); ///< Process histograms at the end of lumiblock @@ -36,11 +36,7 @@ protected: const int m_pixelLayerID; const int m_stationID; - AFP_RawData m_seed; ///< hit with largest time over threshold - // histograms - LWHist1D* m_lvl1; - LWHist1D* m_lvl1Seed; ///< lvl1 distribution for hit with largest time over threshold }; #endif diff --git a/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalStationMonitor.h b/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalStationMonitor.h index ad02e0401e8c3e671ac8b771f843d5bcf1f5b1ca..b3a47e4db7769b71ed28d092626430b9b0a5da44 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalStationMonitor.h +++ b/ForwardDetectors/AFP/AFP_Monitoring/AFP_Monitoring/AFPTechnicalStationMonitor.h @@ -15,7 +15,7 @@ class LWHist2D; class AFPTechnicalMonitorTool; class AFPTechnicalLayerMonitor; -class AFP_RawData; +class AFP_SiRawData; class AFPTechnicalStationMonitor { @@ -26,7 +26,7 @@ public: // void bookHistogramsRecurrent(ManagedMonitorToolBase* toolToStoreHistograms); void bookHistograms(AFPTechnicalMonitorTool* toolToStoreHistograms); - void fillHistograms(const AFP_RawData& hit); + void fillHistograms(const AFP_SiRawData& hit); void eventEnd(); ///< method to call eventEnd in layers void endOfLumiBlock(AFPTechnicalMonitorTool* toolToStoreHistograms); ///< process histograms at the end of lumi block diff --git a/ForwardDetectors/AFP/AFP_Monitoring/cmt/requirements b/ForwardDetectors/AFP/AFP_Monitoring/cmt/requirements deleted file mode 100644 index 370ecadb8d9a20ef267c904c68fe09b5bb5bbdb5..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_Monitoring/cmt/requirements +++ /dev/null @@ -1,38 +0,0 @@ -## automatically generated CMT requirements file -package AFP_Monitoring -author ggach - -## for athena policies: this has to be the first use statement -use AtlasPolicy AtlasPolicy-* - -## for gaudi tools, services and objects -use GaudiInterface GaudiInterface-* External -use AthenaMonitoring AthenaMonitoring-* Control -use AFP_RawEv AFP_RawEv-* ForwardDetectors/AFP -use xAODForward xAODForward-* Event/xAOD -private -use AtlasROOT AtlasROOT-* External -use GaudiInterface GaudiInterface-* External -use LWHists LWHists-* Tools -# use AsgTools AsgTools-* Control/AthToolSupport -use xAODEventInfo xAODEventInfo-* Event/xAOD -end_private - - -## put here your package dependencies... - -## - -branches src src/components doc python share - -private -## default is to make component library -library AFP_Monitoring *.cxx components/*.cxx - -apply_pattern component_library -apply_pattern declare_joboptions files="*.py" -apply_pattern declare_python_modules files="*.py" - -end_private - - diff --git a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx index ea2ab7500db9b66469bc1ef3af835244e38710c2..b6ca52cbfb6bb132ec94e966bba94625a5984848 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx +++ b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPSiLayerMonitor.cxx @@ -103,7 +103,7 @@ void AFPSiLayerMonitor::eventEnd() m_colIDs.clear(); } -void AFPSiLayerMonitor::endOfLumiBlock(ManagedMonitorToolBase* toolToStoreHistograms) +void AFPSiLayerMonitor::endOfLumiBlock(ManagedMonitorToolBase* /* toolToStoreHistograms */) { } diff --git a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalLayerMonitor.cxx b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalLayerMonitor.cxx index 790bb0ef6e3655f8f5d4424ef1abcd5e321099be..0ac0d748f531a61a48f6d214ef8e88845eff2c9e 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalLayerMonitor.cxx +++ b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalLayerMonitor.cxx @@ -13,11 +13,8 @@ AFPTechnicalLayerMonitor::AFPTechnicalLayerMonitor(const int pixelLayerID, const int stationID) : m_pixelLayerID (pixelLayerID) ,m_stationID (stationID) - ,m_lvl1(nullptr) - ,m_lvl1Seed(nullptr) { // make sure that in first event time-over threshold can be overwriten - m_seed.Set_ToT(0); } @@ -32,46 +29,21 @@ void AFPTechnicalLayerMonitor::bookHistograms(ManagedMonitorToolBase* toolToStor // ********** Per lumi block ********** ManagedMonitorToolBase::MonGroup managed_booking_lumiBlock( toolToStoreHistograms, histsDirName.data(), toolToStoreHistograms->lumiBlock); // to re-booked every luminosity block - // ----- hit map ----- - // create histogram name and title - std::string lvl1Name = makeHistName("h_lvl1"); - std::string lvl1Title = makeHistName("lvl1"); - - // create and register histogram - m_lvl1 = TH1F_LW::create(lvl1Name.data(), - lvl1Title.data(), - 16, -0.5, 15.5); - - toolToStoreHistograms->regHist(m_lvl1, managed_booking_lumiBlock ).ignore(); - - - std::string lvl1SeedName = makeHistName("h_lvl1Seed"); - std::string lvl1SeedTitle = makeHistName("lvl1 for hit with largest time over threshold"); - m_lvl1Seed = TH1F_LW::create(lvl1SeedName.data(), - lvl1SeedTitle.data(), - 16, -0.5, 15.5); - - toolToStoreHistograms->regHist(m_lvl1Seed, managed_booking_lumiBlock ).ignore(); - } -void AFPTechnicalLayerMonitor::fillHistograms(const AFP_RawData& hit) +void AFPTechnicalLayerMonitor::fillHistograms(const AFP_SiRawData& /*hit*/) { // fill histograms - m_lvl1->Fill(hit.Get_lvl1()); - // look for hit with largest time over threshold - if (hit.Get_ToT() >= m_seed.Get_ToT()) - m_seed = hit; } void AFPTechnicalLayerMonitor::eventEnd() { - m_lvl1Seed->Fill(m_seed.Get_lvl1()); + } -void AFPTechnicalLayerMonitor::endOfLumiBlock(ManagedMonitorToolBase* toolToStoreHistograms) +void AFPTechnicalLayerMonitor::endOfLumiBlock(ManagedMonitorToolBase* /* toolToStoreHistograms */) { } diff --git a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalMonitorTool.cxx b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalMonitorTool.cxx index 021997d5d6ab411bdcbd6240ea21aac2fe5d6df9..e7d249d6f96b147df79f415eea67cfa76d24242b 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalMonitorTool.cxx +++ b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalMonitorTool.cxx @@ -9,8 +9,8 @@ #include <LWHists/TH1F_LW.h> #include <xAODEventInfo/EventInfo.h> -#include <AFP_RawEv/AFP_RawData.h> -#include <AFP_RawEv/AFP_RawDataContainer.h> +#include <AFP_RawEv/AFP_SiRawData.h> +#include <AFP_RawEv/AFP_RawContainer.h> #include <AFP_Monitoring/AFPTechnicalMonitorTool.h> @@ -85,7 +85,6 @@ StatusCode AFPTechnicalMonitorTool::bookHistograms( ) StatusCode AFPTechnicalMonitorTool::fillHistograms() { - // read information const xAOD::EventInfo* eventInfo = 0; CHECK( evtStore()->retrieve( eventInfo) ); @@ -94,19 +93,19 @@ StatusCode AFPTechnicalMonitorTool::fillHistograms() if(m_environment == AthenaMonManager::online || m_environment == AthenaMonManager::tier0Raw) { // read information - const AFP_RawDataContainer* afpContainer = 0; + const AFP_RawContainer* afpContainer = 0; CHECK(evtStore()->retrieve(afpContainer)); - for (AFP_RawDataCollection* hitCollection : *afpContainer) { - for (AFP_RawData* hit : *hitCollection) { - if (hit->Get_link() >= 0 && hit->Get_link() <= 3) { - m_cNearStation.fillHistograms(*hit); + for (const AFP_SiRawCollection& hitCollection : afpContainer->collectionsSi()) { + for (const AFP_SiRawData& hit : hitCollection.dataRecords()) { + if (hit.link() <= 3) { // hit.link() is unsigned, so always greater than 0 + m_cNearStation.fillHistograms(hit); } - else if (hit->Get_link() >= 8 && hit->Get_link() <= 11) { - m_cFarStation.fillHistograms(*hit); + else if (hit.link() >= 8 && hit.link() <= 11) { + m_cFarStation.fillHistograms(hit); } else - ATH_MSG_WARNING("Unrecognised station index: "<<hit->Get_link()); + ATH_MSG_WARNING("Unrecognised station index: "<<hit.link()); } } diff --git a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalStationMonitor.cxx b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalStationMonitor.cxx index ef29000514e17cceb767b64c45a288107e83eb16..cd30728f7dca92bbf9ec64b6577df85866179ab6 100644 --- a/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalStationMonitor.cxx +++ b/ForwardDetectors/AFP/AFP_Monitoring/src/AFPTechnicalStationMonitor.cxx @@ -11,6 +11,8 @@ #include "../AFP_Monitoring/AFPTechnicalLayerMonitor.h" #include "../AFP_Monitoring/AFPTechnicalStationMonitor.h" +#include "AFP_RawEv/AFP_SiRawData.h" + const int AFPTechnicalStationMonitor::s_firstLayerIndex = 0; const int AFPTechnicalStationMonitor::s_secondLayerIndex = 1; @@ -47,9 +49,9 @@ void AFPTechnicalStationMonitor::bookHistograms(AFPTechnicalMonitorTool* toolToS } -void AFPTechnicalStationMonitor::fillHistograms(const AFP_RawData& hit) +void AFPTechnicalStationMonitor::fillHistograms(const AFP_SiRawData& hit) { - switch (hit.Get_link()%4) { + switch (hit.link()%4) { case s_firstLayerIndex: m_firstLayer->fillHistograms(hit); break; diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/AFP_Raw2Digi.h b/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/AFP_Raw2Digi.h index 5d6e3385f9297f0add5bdadc18bdc13755a9dab8..7f899c946d3083e66018d8f293f423343cac1263 100644 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/AFP_Raw2Digi.h +++ b/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/AFP_Raw2Digi.h @@ -19,9 +19,13 @@ class AFP_Raw2Digi : public ::AthAlgorithm { public: AFP_Raw2Digi(const std::string &name, ISvcLocator *pSvcLocator); + + /// Does nothing virtual ~AFP_Raw2Digi(); virtual StatusCode initialize(); + + /// Executes commands in #m_digitool virtual StatusCode execute(); virtual StatusCode finalize(); diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/IAFP_Raw2DigiTool.h b/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/IAFP_Raw2DigiTool.h index 257b2f913e8b4467e7545ad597136b808383d99a..56382a9112cba82a46b0280113400638960f87b8 100644 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/IAFP_Raw2DigiTool.h +++ b/ForwardDetectors/AFP/AFP_Raw2Digi/AFP_Raw2Digi/IAFP_Raw2DigiTool.h @@ -37,6 +37,16 @@ public: /// hits in form of xAOD::AFPSiHitContainer. It should read input raw data from StoreGate and save output also to StoreGate. virtual StatusCode recoSiHits() = 0; + /// @brief Translates RawData to xAOD::AFPToFHit and saves it to StoreGate + /// + /// This is the method that should be called in order to obtain AFP + /// hits in form of xAOD::AFPToFHitContainer. It should read input + /// raw data from StoreGate and save output also to StoreGate. + virtual StatusCode recoToFHits() = 0; + + /// Call all reconstruction steps + virtual StatusCode recoAll() = 0; + virtual StatusCode finalize() = 0; }; diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/cmt/requirements b/ForwardDetectors/AFP/AFP_Raw2Digi/cmt/requirements deleted file mode 100644 index a1d1f908db1704cc368194bd83d5e71f7da1aa68..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/cmt/requirements +++ /dev/null @@ -1,36 +0,0 @@ -## automatically generated CMT requirements file -package AFP_Raw2Digi -author nifomin - -## for athena policies: this has to be the first use statement -use AtlasPolicy AtlasPolicy-* - -## for gaudi tools, services and objects - -## put here your package dependencies... - -public -use AtlasPolicy AtlasPolicy-* -use AFP_DigiEv AFP_DigiEv-* ForwardDetectors/AFP -use AFP_RawEv AFP_RawEv-* ForwardDetectors/AFP -use AthenaBaseComps AthenaBaseComps-* Control -use GaudiInterface GaudiInterface-* External -use xAODForward xAODForward-* Event/xAOD -private -use AthenaKernel AthenaKernel-* Control -use AtlasROOT AtlasROOT-* External -end_private -## - -branches src src/components doc - -## default is to make component library. See: https://twiki.cern.ch/twiki/bin/view/Main/LearningAthena#Libraries_in_CMT for alternatives -# library AFP_Raw2Digi *.cxx components/*.cxx - -apply_pattern dual_use_library files="*.cxx" - -##apply_pattern declare_joboptions files="*.py" -##apply_pattern declare_python_modules files="*.py" - - - diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2Digi.cxx b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2Digi.cxx index 208be5740374d6ed2fd0b0a5313b2733c1fc3b57..bd082fae9e36789e29d3ecf410de2ad03a83bac6 100644 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2Digi.cxx +++ b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2Digi.cxx @@ -10,12 +10,6 @@ #include "xAODForward/AFPSiHitContainer.h" #include "xAODForward/AFPSiHitAuxContainer.h" -#include "TBranch.h" - -////////////////////////// -//// constructor -////////////////////////// - AFP_Raw2Digi::AFP_Raw2Digi(const std::string &name, ISvcLocator *pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_DigiTool( "AFP_Raw2DigiTool") @@ -23,16 +17,8 @@ AFP_Raw2Digi::AFP_Raw2Digi(const std::string &name, ISvcLocator *pSvcLocator) declareProperty("DigiTool", m_DigiTool , "Tool to translate RawData to xAOD"); } -////////////////////////// -//// destructor -////////////////////////// - AFP_Raw2Digi::~AFP_Raw2Digi() {} -////////////////////////// -//// initialize -////////////////////////// - StatusCode AFP_Raw2Digi::initialize() { ATH_MSG_INFO("Initializing " << name() << "..."); @@ -41,25 +27,17 @@ StatusCode AFP_Raw2Digi::initialize() { return StatusCode::SUCCESS; } -////////////////////////// -//// finalize -////////////////////////// - StatusCode AFP_Raw2Digi::finalize() { ATH_MSG_INFO("Finalizing " << name() << "..."); return StatusCode::SUCCESS; } -////////////////////////// -//// execute -////////////////////////// - StatusCode AFP_Raw2Digi::execute() { ATH_MSG_DEBUG("Executing " << name() << "..."); - CHECK (m_DigiTool->recoSiHits() ); + CHECK (m_DigiTool->recoAll() ); return StatusCode::SUCCESS; } diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.cxx b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.cxx index 5e2e496d872eda2e13303300ca0a07b9c553a078..165cfde9bc5845a5e82498de730023aef44e59c1 100644 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.cxx +++ b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.cxx @@ -3,31 +3,52 @@ */ #include "AFP_Raw2DigiTool.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" +#include "AFP_RawEv/AFP_RawContainer.h" #include "AFP_RawEv/AFP_ROBID.h" #include "xAODForward/AFPStationID.h" + #include "xAODForward/AFPSiHit.h" #include "xAODForward/AFPSiHitContainer.h" #include "xAODForward/AFPSiHitAuxContainer.h" +#include "xAODForward/AFPToFHit.h" +#include "xAODForward/AFPToFHitContainer.h" +#include "xAODForward/AFPToFHitAuxContainer.h" + +#include <vector> + AFP_Raw2DigiTool::AFP_Raw2DigiTool(const std::string &type, const std::string &name, const IInterface *parent) - : AthAlgTool(type, name, parent){ + : AthAlgTool(type, name, parent), + m_totToChargeTransformation ("totToChargeTransformation", "1909 + x*363 + x*x*141") +{ declareInterface<IAFP_Raw2DigiTool>(this); declareProperty( "rawDataContainerName", m_rawDataContainerName = "AFP_RawData"); declareProperty( "AFPSiHitsContainerName", m_AFPSiHitsContainerName = "AFPSiHitContainer" ); + declareProperty( "AFPHitsContainerNameToF", m_AFPHitsContainerNameToF = "AFPToFHitContainer" ); } AFP_Raw2DigiTool::~AFP_Raw2DigiTool() {} -StatusCode AFP_Raw2DigiTool::initialize(){ +StatusCode AFP_Raw2DigiTool::initialize() +{ ATH_MSG_INFO("Initializing " << name() << "..."); + + return StatusCode::SUCCESS; +} + +StatusCode AFP_Raw2DigiTool::recoAll() +{ + CHECK( recoSiHits() ); + CHECK( recoToFHits() ); + return StatusCode::SUCCESS; } -StatusCode AFP_Raw2DigiTool::recoSiHits(){ +StatusCode AFP_Raw2DigiTool::recoSiHits() +{ ATH_MSG_DEBUG("AFP_Raw2DigiTool recoSiHits "); // create output containers @@ -38,83 +59,222 @@ StatusCode AFP_Raw2DigiTool::recoSiHits(){ siHitContainer->setStore(siHitAuxContainer); // retrieve raw data - const AFP_RawDataContainer *container = 0; - StatusCode sc_read = evtStore()->retrieve(container, m_rawDataContainerName); - if (sc_read.isFailure()) { + const AFP_RawContainer *container = nullptr; + if (evtStore()->retrieve(container, m_rawDataContainerName).isFailure()) { + ATH_MSG_WARNING("AFP_Raw2DigiTool: Could not find raw data container"); + return StatusCode::SUCCESS; + } + else + ATH_MSG_DEBUG("AFP_Raw2DigiTool: Raw data container retrieved"); + + for (const AFP_SiRawCollection& collection: container->collectionsSi()) + for (const AFP_SiRawData& data : collection.dataRecords()) + newXAODHitSi (siHitContainer, collection, data); + + return StatusCode::SUCCESS; +} + +StatusCode AFP_Raw2DigiTool::recoToFHits() +{ + ATH_MSG_DEBUG("AFP_Raw2DigiTool recoToFHits "); + + // create output containers + xAOD::AFPToFHitContainer* tofHitContainer = new xAOD::AFPToFHitContainer(); + CHECK( evtStore()->record(tofHitContainer, m_AFPHitsContainerNameToF) ); + xAOD::AFPToFHitAuxContainer* tofHitAuxContainer = new xAOD::AFPToFHitAuxContainer(); + CHECK( evtStore()->record(tofHitAuxContainer, m_AFPHitsContainerNameToF + "Aux.") ); + tofHitContainer->setStore(tofHitAuxContainer); + + // retrieve raw data + const AFP_RawContainer *container = nullptr; + if (evtStore()->retrieve(container, m_rawDataContainerName).isFailure()) { ATH_MSG_WARNING("AFP_Raw2DigiTool: Could not find raw data container"); return StatusCode::SUCCESS; } else ATH_MSG_DEBUG("AFP_Raw2DigiTool: Raw data container retrieved"); - - for (const AFP_RawDataCollection* const collection: *container) { - - for (const AFP_RawData* const data : *collection) { - const uint32_t hitLink = data->Get_link(); - - if (hitLink == 12 || hitLink == 13) { - // fill time-of-flight information - } - else { - // fill tracking information - xAOD::AFPSiHit* xAODSiHit = new xAOD::AFPSiHit(); - siHitContainer->push_back(xAODSiHit); - - // decoding according to Outlink numbers in: https://twiki.cern.ch/twiki/bin/view/Atlas/AFPRunning#Tracker - if (hitLink <=3) { // not checking if larger or equal 0, because this is uint, which is always positive - // set near station ID selecting side based on ROB - if (collection->Get_robID() == AFP_ROBID::sideA) - xAODSiHit->setStationID(xAOD::AFPStationID::nearA); - else if (collection->Get_robID() == AFP_ROBID::sideC) - xAODSiHit->setStationID(xAOD::AFPStationID::nearC); - else { - ATH_MSG_WARNING("Unrecognised robID: in dec="<<std::dec<<collection->Get_robID()<<", in hex=0x"<<std::hex<<collection->Get_robID()<<std::dec); - xAODSiHit->setStationID(-1); - } - - // set pixel layer ID - xAODSiHit->setPixelLayerID(hitLink%4); - - } else if (hitLink >= 8 && hitLink <= 11) { - // set far station ID selecting side based on ROB - if (collection->Get_robID() == AFP_ROBID::sideA) - xAODSiHit->setStationID(xAOD::AFPStationID::farA); - else if (collection->Get_robID() == AFP_ROBID::sideC) - xAODSiHit->setStationID(xAOD::AFPStationID::farC); - else { - ATH_MSG_WARNING("Unrecognised robID: in dec="<<std::dec<<collection->Get_robID()<<", in hex=0x"<<std::hex<<collection->Get_robID()<<std::dec); - xAODSiHit->setStationID(-1); - } - - // set pixel layer ID - xAODSiHit->setPixelLayerID(hitLink%4); - - } else { - ATH_MSG_WARNING("Unrecognised value in hitLink = " << hitLink); - xAODSiHit->setStationID(-1); - xAODSiHit->setPixelLayerID(-1); - } // end of switch - - ATH_MSG_DEBUG("Filled information about station and detector in xAODSiHit object"); - - xAODSiHit->setPixelColIDChip( data->Get_column() ); - xAODSiHit->setPixelRowIDChip( data->Get_row() ); - - const unsigned int ToT_value = data->Get_ToT(); - xAODSiHit->setTimeOverThreshold(ToT_value); - xAODSiHit->setDepositedCharge(1909 + ToT_value * 363 + ToT_value * ToT_value * 141); - - ATH_MSG_DEBUG("Filled xAOD::AFPSiHit"); - } // end of if else (hitLink == 12 || hitLink == 13) - - } // end of for over RawData_Collection_Beg using p_RawData_Beg - - } // end of for over container using RawData_Collection_Beg + + for (const AFP_ToFRawCollection& collection: container->collectionsToF()) + for (const AFP_ToFRawData& data : collection.dataRecords()) + if (data.hitDiscConfig() == 3 && data.header() == 2) + newXAODHitToF (tofHitContainer, collection, data); return StatusCode::SUCCESS; } + StatusCode AFP_Raw2DigiTool::finalize(){ ATH_MSG_INFO("Finalizing " << name() << "..."); + + return StatusCode::SUCCESS; } + + +void AFP_Raw2DigiTool::newXAODHitToF (xAOD::AFPToFHitContainer* tofHitContainer, const AFP_ToFRawCollection& collection, const AFP_ToFRawData& data) const +{ + xAOD::AFPToFHit* xAODToFHit = new xAOD::AFPToFHit(); + tofHitContainer->push_back(xAODToFHit); + + const uint32_t hitLink = data.link(); + const unsigned int robID = collection.robId(); + xAODToFHit->setTime(data.time()*s_timeConversionFactor); + xAODToFHit->setPulseLength(0); // currently there is no information in raw data about pulse length + xAODToFHit->setHptdcChannel(data.channel()); + + // set station ID + if (robID == AFP_ROBID::sideC) + xAODToFHit->setStationID(xAOD::AFPStationID::farC); + else if (robID == AFP_ROBID::sideA) + xAODToFHit->setStationID(xAOD::AFPStationID::farA); + else + xAODToFHit->setStationID(-1); + + // set hptdcID + if (hitLink == 12) + xAODToFHit->setHptdcID(2); + else if (hitLink == 13) + xAODToFHit->setHptdcID(1); + else + xAODToFHit->setHptdcID(-1); + + // set barID + setBarAndTrainID(xAODToFHit); +} + +void AFP_Raw2DigiTool::newXAODHitSi (xAOD::AFPSiHitContainer* siHitContainer, const AFP_SiRawCollection& collection, const AFP_SiRawData& data) const +{ + xAOD::AFPSiHit* xAODSiHit = new xAOD::AFPSiHit(); + siHitContainer->push_back(xAODSiHit); + + const unsigned int hitLink = data.link(); + const unsigned int robID = collection.robId(); + // decoding according to Outlink numbers in: https://twiki.cern.ch/twiki/bin/view/Atlas/AFPRunning#Tracker + if (hitLink <=3 ) { // not checking if larger or equal 0, because this is uint, which is always positive + // set near station ID selecting side based on ROB + if (robID == AFP_ROBID::sideA) + xAODSiHit->setStationID(xAOD::AFPStationID::nearA); + else if (robID == AFP_ROBID::sideC) + xAODSiHit->setStationID(xAOD::AFPStationID::nearC); + else { + ATH_MSG_WARNING("Unrecognised robID: in dec="<<std::dec<<robID<<", in hex=0x"<<std::hex<<robID<<std::dec); + xAODSiHit->setStationID(-1); + } + } else if (hitLink >= 8 && hitLink <= 11) { + // set far station ID selecting side based on ROB + if (robID == AFP_ROBID::sideA) + xAODSiHit->setStationID(xAOD::AFPStationID::farA); + else if (robID == AFP_ROBID::sideC) + xAODSiHit->setStationID(xAOD::AFPStationID::farC); + else { + ATH_MSG_WARNING("Unrecognised robID: in dec="<<std::dec<<robID<<", in hex=0x"<<std::hex<<robID<<std::dec); + xAODSiHit->setStationID(-1); + } + } else { + ATH_MSG_WARNING("Unrecognised value in hitLink = " << hitLink); + xAODSiHit->setStationID(-1); + } // end of switch + + ATH_MSG_DEBUG("Filled information about station and detector in xAODSiHit object"); + + xAODSiHit->setPixelLayerID( hitLink%4 ); + xAODSiHit->setPixelColIDChip( data.column() ); + xAODSiHit->setPixelRowIDChip( data.row() ); + + const unsigned int ToT_value = decodeTimeOverThresholdSi( data.timeOverThreshold(), data.hitDiscConfig() ); + xAODSiHit->setTimeOverThreshold(ToT_value); + xAODSiHit->setDepositedCharge( m_totToChargeTransformation(ToT_value) ); + + ATH_MSG_DEBUG("Filled xAOD::AFPSiHit"); +} + +void AFP_Raw2DigiTool::setBarAndTrainID(xAOD::AFPToFHit* tofHit) const +{ + // mapping is implemented according to https://twiki.cern.ch/twiki/bin/view/Atlas/AFPHPTDC#Channel_Mapping + + const int hptdcChannel = tofHit->hptdcChannel(); + const int hptdcID = tofHit->hptdcID(); + + if (hptdcID == 1) { + switch (hptdcChannel) { + case 0: + tofHit->setTrainID(0); + tofHit->setBarInTrainID(0); + break; + case 2: + tofHit->setTrainID(1); + tofHit->setBarInTrainID(2); + break; + case 3: + tofHit->setTrainID(0); + tofHit->setBarInTrainID(3); + break; + case 5: + tofHit->setTrainID(1); + tofHit->setBarInTrainID(1); + break; + case 6: + tofHit->setTrainID(0); + tofHit->setBarInTrainID(2); + break; + case 8: + tofHit->setTrainID(1); + tofHit->setBarInTrainID(0); + break; + case 9: + tofHit->setTrainID(0); + tofHit->setBarInTrainID(1); + break; + case 11: + tofHit->setTrainID(1); + tofHit->setBarInTrainID(3); + break; + } + } + else if (hptdcID == 2) { + switch (hptdcChannel) { + case 0: + tofHit->setTrainID(2); + tofHit->setBarInTrainID(0); + break; + case 2: + tofHit->setTrainID(3); + tofHit->setBarInTrainID(2); + break; + case 3: + tofHit->setTrainID(2); + tofHit->setBarInTrainID(3); + break; + case 5: + tofHit->setTrainID(3); + tofHit->setBarInTrainID(1); + break; + case 6: + tofHit->setTrainID(2); + tofHit->setBarInTrainID(2); + break; + case 8: + tofHit->setTrainID(3); + tofHit->setBarInTrainID(0); + break; + case 9: + tofHit->setTrainID(2); + tofHit->setBarInTrainID(1); + break; + case 11: + tofHit->setTrainID(3); + tofHit->setBarInTrainID(3); + break; + } + } +} + +unsigned int AFP_Raw2DigiTool::decodeTimeOverThresholdSi (const unsigned int input, const unsigned int discConfig) const +{ + if (input <= 13) + return input + discConfig + 1; + else if (input == 14) + return discConfig; + else + return 0; +} diff --git a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.h b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.h index 2e0489833ceaa9fa86393cb2e2973fbcc44028c3..5ed5aa478e5f3355a6ec553a07652f3e469ecf1f 100644 --- a/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.h +++ b/ForwardDetectors/AFP/AFP_Raw2Digi/src/AFP_Raw2DigiTool.h @@ -7,20 +7,67 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "AFP_Raw2Digi/IAFP_Raw2DigiTool.h" +#include "AFP_RawEv/AFP_RawContainer.h" +#include "xAODForward/AFPToFHit.h" +#include "xAODForward/AFPToFHitContainer.h" +#include "xAODForward/AFPSiHitContainer.h" #include <string> +#include "TF1.h" class AFP_Raw2DigiTool : virtual public ::IAFP_Raw2DigiTool, public ::AthAlgTool { public: - AFP_Raw2DigiTool(const std::string &type, const std::string &name, const IInterface *parent); - virtual ~AFP_Raw2DigiTool(); - virtual StatusCode initialize(); - StatusCode recoSiHits(); - virtual StatusCode finalize(); + AFP_Raw2DigiTool(const std::string &type, const std::string &name, const IInterface *parent); + /// Does nothing + virtual ~AFP_Raw2DigiTool() override; + + /// Does nothing + virtual StatusCode initialize() override; + + /// Creates xAOD for silicon detector + StatusCode recoSiHits() override; + + /// Creates xAOD for time-of-flight detector + StatusCode recoToFHits() override; + + StatusCode recoAll() override; + + + /// Does nothing + virtual StatusCode finalize() override; + + /// Method that decodes raw information about time-over-threshold to + /// number of clock ticks + unsigned int decodeTimeOverThresholdSi (const unsigned int input, const unsigned int discConfig) const; + protected: std::string m_rawDataContainerName; std::string m_AFPSiHitsContainerName; + std::string m_AFPHitsContainerNameToF; + + /// @brief Factor converting signal to time + /// + /// The value of the factor is 25/1024 nanoseconds + static constexpr double s_timeConversionFactor = 25./1024.; + + /// @brief Function that transforms time-over-threshold to charge + /// + /// Transformation function can be set in steering cards + TF1 m_totToChargeTransformation; + + /// Method that creates a new AFPToFHit and sets it valus according to #data + void newXAODHitToF (xAOD::AFPToFHitContainer* tofHitContainer, const AFP_ToFRawCollection& collection, const AFP_ToFRawData& data) const; + + /// Method that creates a new AFPSiHit and sets it valus according to #data + void newXAODHitSi (xAOD::AFPSiHitContainer* xAODSiHit, const AFP_SiRawCollection& collection, const AFP_SiRawData& data) const; + + /// @brief Method mapping hptdcID and hptdcChannel to train ID and bar in train ID + /// + /// The method requires that hptdcID and hptdcChannel are set in the + /// tofHit passed as argument. Mapping is implemented according to + /// https://twiki.cern.ch/twiki/bin/view/Atlas/AFPHPTDC#Channel_Mapping + void setBarAndTrainID(xAOD::AFPToFHit* tofHit) const; }; #endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ROBID.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ROBID.h index 68e98cb227a313be5dc4866a04b75f52e5857779..b80ddb4865ff459d2215d3a343852d5a2b84b4af 100644 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ROBID.h +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ROBID.h @@ -12,8 +12,8 @@ class AFP_ROBID { public: - static const uint32_t sideA; ///< ROB ID of stations on A side - static const uint32_t sideC; ///< ROB ID of stations on C side + static constexpr unsigned int sideA = 0x00850001; ///< ROB ID of stations on A side + static constexpr unsigned int sideC = 0x00850002; ///< ROB ID of stations on C side }; #endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollection.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..eba404c6cd7841d7a82cd6e25d129c9c6a115525 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollection.h @@ -0,0 +1,27 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_RAWCOLLECTION_H +#define AFP_RAWCOLLECTION_H + +#include "AFP_RawEv/AFP_RawCollectionHead.h" +#include <list> + +/// Class representing collection of silicon detector data +template <typename RAWDATA_T> +class AFP_RawCollection : public AFP_RawCollectionHead +{ +public: + /// @copydoc AFP_RawCollection::m_dataRecords; + const std::list<RAWDATA_T>& dataRecords() const {return m_dataRecords;} + + /// Creates a new empty data record in the collection and returns reference to it. + RAWDATA_T& newDataRecord () {m_dataRecords.emplace_back(); return m_dataRecords.back();} + +private: + /// List of silicon detector data records + std::list<RAWDATA_T> m_dataRecords; +}; + +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollectionHead.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollectionHead.h new file mode 100644 index 0000000000000000000000000000000000000000..fbd7a77841c4a8eee9b237a7cc0bb21a75ac390c --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawCollectionHead.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_RAWCOLLECTIONHEAD_H +#define AFP_RAWCOLLECTIONHEAD_H + +#include <stdint.h> + +/// @brief Class represnting header record in bytestream +/// +/// Header record in bytestream starts a new collection that is why this +/// class is meant to be base for the data collections. +class AFP_RawCollectionHead +{ +public: + /// @copydoc AFP_RawCollectionHead::m_lvl1Id + uint16_t lvl1Id () const {return m_lvl1Id;} + void setLvl1Id (const uint16_t lvl1Id) {m_lvl1Id = lvl1Id;} + + /// @copydoc AFP_RawCollectionHead::m_link + uint16_t link () const {return m_link;} + void setLink (const uint16_t link) {m_link = link;} + + /// @copydoc AFP_RawCollectionHead::m_frontendFlag + uint32_t frontendFlag () const {return m_frontendFlag;}; + void setFrontendFlag (const uint32_t flag) {m_frontendFlag = flag;} + + /// @copydoc AFP_RawCollectionHead::m_bcId + uint16_t bcId () const {return m_bcId;}; + void setBcId (const uint16_t bcId) {m_bcId = bcId;} + + /// @copydoc AFP_RawCollectionHead::m_robId + uint32_t robId () const {return m_robId;} + void setRobId (const uint32_t robId) {m_robId = robId;} + +private: + /// @brief Value of 11-15 least significant bits + /// + /// In the following record: `xxxx xxxx xxxx xxxx xLLL LLxx xxxx xxxx` + /// it means bits marked with `L`. + uint16_t m_lvl1Id; + + /// @brief Value of 5-8 most significant bits + /// + /// In the following record: `xxxx LLLL xxxx xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `L`. Contains information about outlink. + uint16_t m_link; + + /// @brief Value of the 16 least significant bit + /// + /// In the following record: `xxxx xxxx xxxx xxxx Fxxx xxxx xxxx xxxx` + /// it means bits marked with `F`. + uint32_t m_frontendFlag; + + /// @brief Value of 10 least significant bits + /// + /// In the following record: `xxxx xxxx xxxx xxxx xxxx xxBB BBBB BBBB` + /// it means bits marked with `B`. Contains information about bunch crossing ID. + uint16_t m_bcId; + + /// ROB in from which the collection was read + uint32_t m_robId; +}; + +#endif + diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawContainer.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawContainer.h new file mode 100644 index 0000000000000000000000000000000000000000..d7e3d7e8efe646f41f48151a22b23470f5f14d49 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawContainer.h @@ -0,0 +1,55 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_RAWCONTAINER_H +#define AFP_RAWCONTAINER_H + +#include "AFP_RawEv/AFP_SiRawCollection.h" +#include "AFP_RawEv/AFP_ToFRawCollection.h" +#include "SGTools/CLASS_DEF.h" +#include "CLIDSvc/CLASS_DEF.h" + +class AFP_RawContainer +{ +public: + uint32_t timeStamp () const {return m_timeStamp;} + void setTimeStamp (const uint32_t timeStamp) {m_timeStamp = timeStamp;} + + uint16_t bcId () const {return m_bcId;} + void setBCId (const uint32_t bcId) {m_bcId = bcId;} + + uint32_t timeStampNS () const {return m_timeStampNS;} + void setTimeStampNS (const uint32_t timeStampNS) { m_timeStampNS = timeStampNS;} + + uint32_t lumiBlock () const {return m_lumiBlock;} + void setLumiBlock (const uint32_t lumiBlock) {m_lumiBlock = lumiBlock;} + + uint32_t lvl1Id () const {return m_lvl1Id;} + void setLvl1Id (const uint32_t lvl1ID) {m_lvl1Id = lvl1ID;} + + const std::list<AFP_SiRawCollection>& collectionsSi () const {return m_collectionSi;} + AFP_SiRawCollection& newCollectionSi () {m_collectionSi.emplace_back(); return m_collectionSi.back();} + + const std::list<AFP_ToFRawCollection>& collectionsToF () const {return m_collectionToF;} + AFP_ToFRawCollection& newCollectionToF () {m_collectionToF.emplace_back(); return m_collectionToF.back();} + + void clear (); + +private: + uint32_t m_lvl1Id; + uint16_t m_bcId; + uint32_t m_timeStamp; + uint32_t m_timeStampNS; + uint32_t m_lumiBlock; + + std::list<AFP_SiRawCollection> m_collectionSi; + std::list<AFP_ToFRawCollection> m_collectionToF; +}; + + +CLASS_DEF(AFP_RawContainer, 1212355773, 1) + + + +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawData.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawData.h deleted file mode 100644 index 1a12de2ea84ca174ba5880a559df1dbf951475f9..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawData.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATA_H -#define AFP_RAWDATA_H - -#include <stdint.h> -#include<vector> -#include <iostream> - -class MsgStream; - -class AFP_RawData -{ - -public: - - AFP_RawData(); - - AFP_RawData(uint16_t PMF_number); - ~AFP_RawData(); - - void Set_DiscConf(uint16_t Word_number); - void Set_link(uint16_t PMF_number); - void Set_column(uint16_t MB_number); - void Set_row(uint32_t Event_number); - void Set_ToT(uint16_t ToT); - void PushBack_PMF(uint16_t fiber_hit); - void Set_error_bit17(bool bit); - void Set_lvl1(uint16_t tmplvl1); - void SetZero_PMF(); - void addData(uint32_t dataWord); - - - - uint16_t Get_DiscConf() const {return m_HitDiscConfig;}; - uint16_t Get_link() const {return m_Link;}; - uint16_t Get_column() const {return m_Column;}; - uint32_t Get_row() const {return m_Row;}; - uint16_t Get_ToT() const {return m_ToT;}; -// uint32_t Get_Chan(uint16_t Numchan) const {return 0;}; - uint32_t GetSize() const {return 0;}; - uint16_t Get_bit26_27() const {return m_bit26_27;}; - uint16_t Get_bit24_27() const {return m_bit24_27;}; - uint16_t Get_lvl1() const {return m_lvl1;}; - bool Get_bit16() const {return m_bit16;}; - bool Get_bit18() const {return m_bit18;}; - bool Get_error_bit17() const {return m_error_bit17;}; - - - - const std::vector<uint32_t>* dataWords() const {return &m_dataWords;} - - -private: - - uint16_t m_HitDiscConfig; - uint16_t m_Link; - uint16_t m_Column; - uint32_t m_Row; - uint16_t m_ToT; - bool m_bit16; - bool m_bit18; - bool m_error_bit17; - uint16_t m_bit26_27; - uint16_t m_bit24_27; - uint16_t m_lvl1; - -std::vector<uint32_t> m_dataWords; -}; -#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCollection.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCollection.h deleted file mode 100644 index 966dfcc4efa0fa202567a2f2fa973be70987038b..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCollection.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACOLLECTION_H -#define AFP_RAWDATACOLLECTION_H - -#include "DataModel/DataVector.h" -#include "SGTools/CLASS_DEF.h" -#include "CLIDSvc/CLASS_DEF.h" -#include "AFP_RawEv/AFP_RawData.h" - -#include <stdint.h> - -//apparently changing strings with sed doesn't count as a change for svn. - -class AFP_RawDataCollection : public DataVector <AFP_RawData> - -{ - private: - - uint16_t m_L1Id; - uint16_t m_link_number_POT; - uint32_t m_frontend_flag; - std::vector<AFP_RawData> m_POT_DATA; - - std::vector<bool> m_patternId; - uint16_t m_BCIdId; - uint16_t m_header_numberId; - uint16_t m_ADC2Id; - bool m_TrigSyncErrId; - uint32_t m_robID; ///< ID of ROB from which data come from. Destinguish A and C side - - public: - -typedef AFP_RawData DIGIT; - -AFP_RawDataCollection(); -AFP_RawDataCollection(uint16_t MB_number); -AFP_RawDataCollection(uint16_t Mrod_number, uint16_t MB_number); -virtual ~AFP_RawDataCollection() { }; - -void Set_lvl1Id(uint16_t MB_number); - void Set_link_header(uint16_t Mrod_number); - void Set_flag(uint32_t Event_number); - void PushBack_POT(const AFP_RawData& PMF_HIT); - - void Set_pattern_POT(const std::vector<bool>& pattern_number); - void Set_bcid(uint16_t BCId_number); - void Set_header(uint16_t header_number_number); - void Set_ADC2_POT(uint16_t ADC2_number); - void SetTrigSyncErr(bool bit); - void Set_robID(const uint32_t robID) {m_robID = robID;} - - void SetZero_POT(); - - -uint16_t Get_lvl1Id() const {return m_L1Id;}; - uint16_t Get_link_header() const {return m_link_number_POT;}; - uint32_t Get_flag() const {return m_frontend_flag;}; - const std::vector<bool>& Get_pattern_POT() const {return m_patternId;}; - uint16_t Get_bcid() const {return m_BCIdId;}; - uint16_t Get_header_number_POT() const {return m_header_numberId;}; - uint16_t Get_ADC2_POT() const {return m_ADC2Id;}; - bool GetTrigSyncErr() const {return m_TrigSyncErrId;}; - uint32_t Get_robID() const {return m_robID;} - - const std::vector<AFP_RawData>& Get_POT_DATA() const {return m_POT_DATA;}; - AFP_RawData Get_POT_PMF_DATA(uint32_t Numpmf) const {return m_POT_DATA[Numpmf];}; - -}; - -CLASS_DEF( AFP_RawDataCollection , 1078031561 , 1 ) - -#endif - diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCommonHead.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCommonHead.h new file mode 100644 index 0000000000000000000000000000000000000000..c8f44c0a81ee250791c4e530f9e667d9dc5342d4 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataCommonHead.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_RAWDATACOMMONHEAD_H +#define AFP_RAWDATACOMMONHEAD_H + +#include <stdint.h> + +/// @brief Base class representing first 8 bits in a record in bytestream +/// +/// The class is meant to be used as a base for classes representing +/// records in AFP bytestream. The format of the bytestream is +/// documented in presentation: +/// https://indico.cern.ch/login/?next=%2Fevent%2F493415%2Fcontributions%2F1172054%2Fattachments%2F1222236%2F1787442%2Fbytestream.pdf +class AFP_RawDataCommonHead +{ +public: + /// @copydoc AFP_RawDataCommonHead::m_hitDiscConfig + uint16_t hitDiscConfig() const {return m_hitDiscConfig;}; + void setHitDiscConfig(const uint16_t hitDiscConfig) {m_hitDiscConfig = hitDiscConfig;} + + uint16_t link() const {return m_link;}; + void setLink(const uint16_t outlink) {m_link = outlink;} + +private: + /// @brief Value of third and forth most significant bits + /// + /// In the following record: `xxdd xxxx xxxx xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `d`. + /// - values 0-2 are used by silicon detectors + /// - value 3 represent time-of-flight detector + uint16_t m_hitDiscConfig; + + /// @brief Values of the 5-8 most significant bits + /// + /// In the following record: `xxxx LLLL xxxx xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `L`. + uint16_t m_link; +}; +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataContainer.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataContainer.h deleted file mode 100644 index f281ce0230d2b3237c2d45f0ae6391b134c7d146..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawDataContainer.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef AFP_RAWDATACONTAINER_H -#define AFP_RAWDATACONTAINER_H - -#include <vector> -#include <string> -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "SGTools/CLASS_DEF.h" -#include "CLIDSvc/CLASS_DEF.h" -#include "DataModel/DataVector.h" - -//svn hook - -class AFP_RawDataContainer : public DataVector <AFP_RawDataCollection> -{ - -private: - -uint32_t m_wordMarker; - uint16_t m_subdetId; -uint16_t m_mrodId; - uint32_t m_lvl1Id; - uint16_t m_ecrId; - uint16_t m_bcId; - uint32_t m_runNum; - uint16_t m_runType; - uint16_t m_triggerTypeId; -uint32_t m_DetEventType; - - static const uint32_t s_FullEVmarker = 0xaa1234aa; - static const uint32_t s_ROBmarker = 0xdd1234dd; - static const uint32_t s_RODmarker = 0xee1234ee; - static const uint32_t s_RODheadersize = 0x00000009; - static const uint32_t s_RODversion = 0x03010000; - -uint32_t m_TimeStamp; -uint32_t m_TimeStampns; - -uint32_t m_LumiBlock; -std::vector<bool> m_lvl1Pattern; -std::vector<bool> m_lvl2Pattern; -std::vector<bool> m_efPattern; - - public: - -AFP_RawDataContainer(); -~AFP_RawDataContainer(); -typedef AFP_RawDataCollection::size_type size_type; - -size_type digit_size() const; - -bool is_FullEVmarker() const {return m_wordMarker == s_FullEVmarker;}; - bool is_ROBmarker() const {return m_wordMarker == s_ROBmarker;}; - bool is_RODmarker() const {return m_wordMarker == s_RODmarker;}; - - - uint16_t subdetId() const {return m_subdetId;} - uint16_t mrodId() const {return m_mrodId;} - uint32_t runNum() const {return m_runNum;} - uint16_t runType() const {return m_runType;} - uint32_t lvl1Id() const {return m_lvl1Id;} - uint16_t ecrId() const {return m_ecrId;} - uint16_t bcId() const {return m_bcId;} - uint16_t trigtypeId() const {return m_triggerTypeId;} - uint32_t DetEventType() const {return m_DetEventType;} - - void SetLvl1Pattern(const std::vector<bool>& tmplvl1_pattern); - void SetLvl2Pattern(const std::vector<bool>& tmplvl2_pattern); - void SetEFPattern(const std::vector<bool>& tmpef_pattern); - void SetTimeStamp(uint32_t tmpTimeStamp); - void SetTimeStampns(uint32_t tmpTimeStampns); - void SetLumiBlock(uint32_t tmpLumiBlock); - void SetBCId(uint32_t tmpBCId); - void SetLvl1Id(uint32_t tmpLvl1ID); - - const std::vector<bool>& GetLvl1Pattern_POT() const {return m_lvl1Pattern;}; - const std::vector<bool>& GetLvl2Pattern_POT() const {return m_lvl2Pattern;}; - const std::vector<bool>& GetEFPattern_POT() const {return m_efPattern;}; - uint32_t GetTimeStamp() const {return m_TimeStamp;}; - uint32_t GetTimeStampns() const {return m_TimeStampns;}; - uint32_t GetLumiBlock() const {return m_LumiBlock;}; - uint32_t GetBCId() const {return m_bcId;}; - - -private: - -void setZero(); - -}; - - -CLASS_DEF( AFP_RawDataContainer , 1237702017 , 1 ) - - - -#endif - - diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawEvDict.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawEvDict.h index 675871a07f50bf47cf8ec85ad6e322a8f6931590..6eb84e4b413b907e83b688a1c0f99e03e77e2a58 100644 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawEvDict.h +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_RawEvDict.h @@ -2,14 +2,27 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef AFP_RawEvDict_h -#define AFP_RawEvDict_h +#ifndef AFP_RAWEVDICT_H +#define AFP_RAWEVDICT_H -//#include "AFP_RawEv/AFP_DigitCollection.h" -//#include "AFP_RawEv/AFP_ODDigitCollection.h" +#include "AFP_RawEv/AFP_SiRawData.h" +#include "AFP_RawEv/AFP_SiRawCollection.h" -#include "AFP_RawEv/AFP_RawDataCollection.h" -#include "AFP_RawEv/AFP_RawDataContainer.h" +#include "AFP_RawEv/AFP_ToFRawData.h" +#include "AFP_RawEv/AFP_ToFRawCollection.h" + +#include "AFP_RawEv/AFP_RawContainer.h" + +namespace AFP_RawEvDict +{ + AFP_SiRawData siRawData; + AFP_SiRawCollection siRawCollection; + + AFP_ToFRawData ToFRawData; + AFP_ToFRawCollection ToFRawCollection; + + AFP_RawContainer RawContainer; +} #endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawCollection.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..86cce820f05652eba2587da3d04420163a212938 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawCollection.h @@ -0,0 +1,18 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_SIRAWCOLLECTION_H +#define AFP_SIRAWCOLLECTION_H + +#include "AFP_RawEv/AFP_SiRawData.h" +#include "AFP_RawEv/AFP_RawCollection.h" + +#include "CLIDSvc/CLASS_DEF.h" + +/// Class representing collection of silicon detector data +typedef AFP_RawCollection<AFP_SiRawData> AFP_SiRawCollection; + +CLASS_DEF( AFP_SiRawCollection, 1319088211, 1 ) + +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawData.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawData.h new file mode 100644 index 0000000000000000000000000000000000000000..7ff2f043576e5b6c60f1a8d124c5af4b29ab62cb --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_SiRawData.h @@ -0,0 +1,53 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_SIRAWDATA_H +#define AFP_SIRAWDATA_H + +#include "AFP_RawDataCommonHead.h" + +#include <stdint.h> + +/// @brief Class representing data record for silicon detectors. +/// +/// Documentation of the format is in presentation: +/// https://indico.cern.ch/login/?next=%2Fevent%2F493415%2Fcontributions%2F1172054%2Fattachments%2F1222236%2F1787442%2Fbytestream.pdf +class AFP_SiRawData : public AFP_RawDataCommonHead +{ +public: + /// @copydoc AFP_SiRawData::m_column + uint16_t column() const {return m_column;} + void setColumn (const uint16_t column) {m_column = column;} + + /// @copydoc AFP_SiRawData::m_row + uint32_t row() const {return m_row;} + void setRow (const uint32_t row) {m_row = row;} + + /// @copydoc AFP_SiRawData::m_timeOverThreshold + uint16_t timeOverThreshold() const {return m_timeOverThreshold;} + void setTimeOverThreshold (const uint16_t timeOverThreshold) {m_timeOverThreshold = timeOverThreshold;} + +private: + /// @brief Value of 9-15 most significant bits + /// + /// In the following record: `xxxx xxxx CCCC CCCx xxxx xxxx xxxx xxxx` + /// it means bits marked with `C`. Contains column number of the fired + /// pixel. + uint16_t m_column; + + /// @brief Value of 16-24 most significant bits + /// + /// In the following record: `xxxx xxxx xxxx xxxR RRRR RRRR xxxx xxxx` + /// it means bits marked with `R`. Contains row number of the fired + /// pixel. + uint32_t m_row; + + /// @brief Value of eight least significant bits + /// + /// In the following record: `xxxx xxxx xxxx xxxx xxxx xxxx TTTT TTTT` + /// it means bits marked with `T`. Contains information about signal + /// time over threshold. + uint16_t m_timeOverThreshold; +}; +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawCollection.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawCollection.h new file mode 100644 index 0000000000000000000000000000000000000000..b1f9ac3ee7cb474cb79fe0b6ed4051839dffd436 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawCollection.h @@ -0,0 +1,18 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_TOFRAWCOLLECTION_H +#define AFP_TOFRAWCOLLECTION_H + +#include "AFP_RawEv/AFP_ToFRawData.h" +#include "AFP_RawEv/AFP_RawCollection.h" + +#include "CLIDSvc/CLASS_DEF.h" + +/// Class representing collection of silicon detector data +typedef AFP_RawCollection<AFP_ToFRawData> AFP_ToFRawCollection; + +CLASS_DEF(AFP_ToFRawCollection, 1242654793, 1 ) + +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawData.h b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawData.h new file mode 100644 index 0000000000000000000000000000000000000000..043a403740f78aed1f30fb5108896a755303467f --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/AFP_ToFRawData.h @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_TOFRAWDATA_H +#define AFP_TOFRAWDATA_H + +#include "AFP_RawDataCommonHead.h" + +#include <stdint.h> + +/// @brief Class representing data record for time-of-flight detectors. +/// +/// Documentation of the format is available in the twiki page: +/// https://twiki.cern.ch/twiki/bin/view/Atlas/AFPHPTDC#Data_Encoding +class AFP_ToFRawData : public AFP_RawDataCommonHead +{ +public: + /// @copydoc AFP_ToFRawData::m_header + uint16_t header() const {return m_header;} + void setHeader(const uint16_t header) {m_header = header;} + + /// @copydoc AFP_ToFRawData::m_edge + uint16_t edge() const {return m_edge;} + void setEdge(const uint16_t edge) {m_edge = edge;} + + /// @copydoc AFP_ToFRawData::m_channel + uint16_t channel() const {return m_channel;} + void setChannel(const uint16_t channel) {m_channel = channel;} + + /// @copydoc AFP_ToFRawData::m_time + uint32_t time() const {return m_time;} + void setTime(const uint32_t time) {m_time = time;} + +private: + /// @brief Value of 9-11 most significant bits + /// + /// In the following record: `xxxx xxxx hhhx xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `h`. Contains information about time-of-flight data type or error: + /// - value 0 means TDC header + /// - value 2 means hit measurement + /// - value 3 is per event error + uint16_t m_header; + + /// @brief Value of 12 most significant bit + /// + /// In the following record: `xxxx xxxx xxxE xxxx xxxx xxxx xxxx xxxx` + /// it means bits marked with `E`. Contains information about signal + /// beginning or end. + uint16_t m_edge; + + /// @brief Value of 13-17 most significant bits + /// + /// In the following record: `xxxx xxxx xxxx CCCC xxxx xxxx xxxx xxxx` + /// it means bits marked with `C`. Contains information about + /// channel in HPTDC of the time measurement. + uint16_t m_channel; + + /// @brief Value of 10 least significant bits + /// + /// In the following record: `xxxx xxxx xxxx xxxx xxxx xxtt tttt tttt` + /// it means bits marked with `t`. Contains information about time. + uint32_t m_time; +}; +#endif diff --git a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/selection.xml b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/selection.xml index b2ca2fcf1ba7e881c399effcfeeec9c6ef0217a6..833410e738c9c33d8bde0b295626baeec28dcdcb 100644 --- a/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/selection.xml +++ b/ForwardDetectors/AFP/AFP_RawEv/AFP_RawEv/selection.xml @@ -1,23 +1,14 @@ - <lcgdict> - - - - - - - - - - - <class name="AFP_RawDataContainer" id = "229CCDDE-6686-49A2-BC5D-431FEA055EC8"/> - <class name="std::vector<AFP_RawDataCollection*>" /> - <class name="DataVector<AFP_RawDataCollection>" /> - - <class name="AFP_RawDataCollection" /> - <class name="std::vector<AFP_RawData*>" /> - <class name="DataVector<AFP_RawData>" /> - - <class name="AFP_RawData" /> + <class name="AFP_RawContainer" id = "9942A27B-F44A-4313-8723-4F817A350F7D"/> + + <class name="AFP_SiRawCollection" /> + <class name="std::list<AFP_SiRawCollection*>" /> + <class name="std::list<AFP_SiRawData>" /> + <class name="AFP_SiRawData" /> + + <class name="AFP_ToFRawCollection" /> + <class name="std::list<AFP_ToFRawCollection*>" /> + <class name="std::list<AFP_ToFRawData>" /> + <class name="AFP_ToFRawData" /> </lcgdict> diff --git a/ForwardDetectors/AFP/AFP_RawEv/cmt/requirements b/ForwardDetectors/AFP/AFP_RawEv/cmt/requirements deleted file mode 100644 index 3979c94ea17b820b30e5cdf561fbf3451162dc63..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/cmt/requirements +++ /dev/null @@ -1,40 +0,0 @@ -## automatically generated CMT requirements file -package AFP_RawEv -author nifomin - -## for athena policies: this has to be the first use statement -use AtlasPolicy AtlasPolicy-* - -## put here your package dependencies... - -use CLIDSvc CLIDSvc-* Control -use DataModel DataModel-* Control -use HitManagement HitManagement-* Simulation -use SGTools SGTools-* Control -use AtlasReflex AtlasReflex-* External -no_auto_imports - - - -## - -##branches src src/components doc python share - -## default is to make component library. See: https://twiki.cern.ch/twiki/bin/view/Main/LearningAthena#Libraries_in_CMT for alternatives -library AFP_RawEv ../src/*.cxx -apply_pattern installed_library - -apply_pattern lcgdict dict=AFP_RawEv selectionfile=selection.xml headerfiles="../AFP_RawEv/AFP_RawEvDict.h" - -##apply_pattern declare_joboptions files="*.py" -##apply_pattern declare_python_modules files="*.py" - -private - -use GaudiInterface GaudiInterface-* External -use EventContainers EventContainers-* Event -use StoreGate StoreGate-* Control - -end_private - - - diff --git a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_ROBID.cxx b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_ROBID.cxx deleted file mode 100644 index d13658c953483177a3b240b3f995b904b1a6eb78..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_ROBID.cxx +++ /dev/null @@ -1,8 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include"AFP_RawEv/AFP_ROBID.h" - -const uint32_t AFP_ROBID::sideA = 0x00850001; -const uint32_t AFP_ROBID::sideC = 0x00850002; diff --git a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawContainer.cxx b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawContainer.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b471f0177f41737482c8b7313bb31aeea7c848f2 --- /dev/null +++ b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawContainer.cxx @@ -0,0 +1,13 @@ +#include "AFP_RawEv/AFP_RawContainer.h" + +void AFP_RawContainer::clear () +{ + m_lvl1Id = 0; + m_bcId = 0; + m_timeStamp = 0; + m_timeStampNS = 0; + m_lumiBlock = 0; + + m_collectionSi.clear(); + m_collectionToF.clear(); +} diff --git a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawData.cxx b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawData.cxx deleted file mode 100644 index d13b7c8c6235c09ecd50900db92a51936c7e560f..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawData.cxx +++ /dev/null @@ -1,118 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_RawEv/AFP_RawData.h" -#include "GaudiKernel/MsgStream.h" - -//svn is acting up weirdly, comment to make it pick this up again - -AFP_RawData::AFP_RawData(): - - m_HitDiscConfig(0), - m_Link(0), - m_Column(0), - m_Row(0), - m_ToT(0), - m_bit16(0), - m_bit18(0), - m_error_bit17(0), - m_bit26_27(0), - m_bit24_27(0), - m_lvl1(0) -{} - -AFP_RawData::AFP_RawData(uint16_t Link): - m_HitDiscConfig(0), - m_Link(Link), - m_Column(0), - m_Row(0), - m_ToT(0), - m_bit16(0), - m_bit18(0), - m_error_bit17(0), - m_bit26_27(0), - m_bit24_27(0), - m_lvl1(0) -{} - - -AFP_RawData::~AFP_RawData() -{} - - - - -void AFP_RawData::Set_DiscConf(uint16_t Word_number) -{ -m_HitDiscConfig = Word_number; -} - -void AFP_RawData::Set_link(uint16_t PMF_number) -{ -m_Link = PMF_number; -} - -void AFP_RawData::Set_column(uint16_t MB_number) -{ -m_Column = MB_number; -} - -void AFP_RawData::Set_row(uint32_t Event_number) -{ -m_Row = Event_number; -} - -void AFP_RawData::Set_ToT(uint16_t HitChan) -{ - m_ToT=HitChan; -} - -void AFP_RawData::PushBack_PMF(uint16_t fiber_hit){ - m_ToT=fiber_hit; -} - -void AFP_RawData::addData(uint32_t dataWord) -{ - m_dataWords.push_back(dataWord); -} - -void AFP_RawData::Set_error_bit17(bool bit) -{ - m_error_bit17=bit; -} - -void AFP_RawData::Set_lvl1(uint16_t tmplvl1) -{ - m_lvl1=tmplvl1; -} - -void AFP_RawData::SetZero_PMF() - -{ - m_HitDiscConfig=0; - m_Link=0; - m_Column=0; - m_Row=0; - m_bit26_27=0; - m_bit24_27=0; - m_bit16=false; - m_bit18=false; - m_error_bit17=false; - m_ToT = 0; - m_lvl1 = 0; - m_dataWords.clear(); -} - - - - - - - - - - - - - diff --git a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataCollection.cxx b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataCollection.cxx deleted file mode 100644 index 0c082788c5339e7b2aa093b060c917d93eae74bc..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataCollection.cxx +++ /dev/null @@ -1,126 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "AFP_RawEv/AFP_RawDataCollection.h" - -AFP_RawDataCollection::AFP_RawDataCollection(): -DataVector<AFP_RawData>(), - m_L1Id(0), - m_link_number_POT(0), - m_frontend_flag(0), - m_POT_DATA(), - m_patternId(), - m_BCIdId(0), - m_header_numberId(0), - m_ADC2Id(0), - m_TrigSyncErrId(0), - m_robID(0) -{ } - - - - -AFP_RawDataCollection::AFP_RawDataCollection(uint16_t MB_number) : - DataVector<AFP_RawData>(), - m_L1Id(MB_number), - m_link_number_POT(0), - m_frontend_flag(0), - m_POT_DATA(), - m_patternId(), - m_BCIdId(0), - m_header_numberId(0), - m_ADC2Id(0), - m_TrigSyncErrId(0), - m_robID(0) -{ } - - -AFP_RawDataCollection::AFP_RawDataCollection( uint16_t Mrod_number, uint16_t MB_number) : - DataVector<AFP_RawData>(), - m_L1Id(MB_number), - m_link_number_POT(Mrod_number), - m_frontend_flag(0), - m_POT_DATA(), - m_patternId(), - m_BCIdId(0), - m_header_numberId(0), - m_ADC2Id(0), - m_TrigSyncErrId(0), - m_robID(0) -{ } - - - -void AFP_RawDataCollection::Set_lvl1Id(uint16_t MB_number) -{ - m_L1Id=MB_number; -} - - -void AFP_RawDataCollection::Set_link_header(uint16_t Mrod_number) -{ - m_link_number_POT=Mrod_number; -} - - -void AFP_RawDataCollection::Set_flag(uint32_t Event_number) -{ - m_frontend_flag=Event_number; -} - -void AFP_RawDataCollection::Set_pattern_POT(const std::vector<bool>& pattern_number) -{ - m_patternId=pattern_number; -} - -void AFP_RawDataCollection::Set_bcid(uint16_t BCId_number) -{ - m_BCIdId=BCId_number; -} - -void AFP_RawDataCollection::Set_header(uint16_t header_number_number) -{ - m_header_numberId=header_number_number; -} - -void AFP_RawDataCollection::Set_ADC2_POT(uint16_t ADC2_number) -{ - m_ADC2Id=ADC2_number; -} - -void AFP_RawDataCollection::SetTrigSyncErr(bool bit) -{ - m_TrigSyncErrId=bit; -} - -void AFP_RawDataCollection::PushBack_POT(const AFP_RawData& PMF_HIT) -{ - m_POT_DATA.push_back(PMF_HIT); -} - -void AFP_RawDataCollection::SetZero_POT() -{ - - m_L1Id = 0; // MB number - - m_link_number_POT = 0; // Mrodnumber - - m_frontend_flag=0; - - m_patternId.clear(); - m_BCIdId=0; - m_header_numberId=0; - m_ADC2Id=0; - m_TrigSyncErrId=false; - - m_POT_DATA.clear(); -} - - - - - - - - diff --git a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataContainer.cxx b/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataContainer.cxx deleted file mode 100644 index 4c44b65fd2a3718e5011f1fd824c51ac7be3f746..0000000000000000000000000000000000000000 --- a/ForwardDetectors/AFP/AFP_RawEv/src/AFP_RawDataContainer.cxx +++ /dev/null @@ -1,119 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "GaudiKernel/Bootstrap.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/IMessageSvc.h" -#include "StoreGate/StoreGateSvc.h" - -#include "AFP_RawEv/AFP_RawDataContainer.h" -#include "EventContainers/SelectAllObject.h" -#include <map> -#include <cassert> -#include <iostream> - -using std::ostream; -using std::endl; - -//svn, fix - -AFP_RawDataContainer::AFP_RawDataContainer(): - - DataVector<AFP_RawDataCollection>(), - m_wordMarker(0), - m_subdetId(0), - m_mrodId(0), - m_lvl1Id(0), - m_ecrId(0), - m_bcId(0), - m_runNum(0), - m_runType(0), - m_triggerTypeId(0), - m_DetEventType(0), - m_TimeStamp(0), - m_TimeStampns(0), - m_LumiBlock(0), - m_lvl1Pattern() -{ -} - - -AFP_RawDataContainer::~AFP_RawDataContainer() -{} - - AFP_RawDataContainer::size_type AFP_RawDataContainer::digit_size() const { - AFP_RawDataContainer::size_type count = 0; - AFP_RawDataContainer::const_iterator it = begin(); - AFP_RawDataContainer::const_iterator iend = end(); - - for (; it != iend; ++it ) { - count += (*it)->size(); - } - return count; -} - - -void AFP_RawDataContainer::SetTimeStamp(uint32_t tmpTimeStamp) -{ - m_TimeStamp=tmpTimeStamp; -} - -void AFP_RawDataContainer::SetTimeStampns(uint32_t tmpTimeStampns) -{ - m_TimeStampns=tmpTimeStampns; -} - -void AFP_RawDataContainer::SetLumiBlock(uint32_t tmpLumiBlock) -{ - m_LumiBlock=tmpLumiBlock; -} - -void AFP_RawDataContainer::SetBCId(uint32_t tmpBCId) -{ - m_bcId=tmpBCId; -} - -void AFP_RawDataContainer::SetLvl1Pattern(const std::vector<bool>& tmplvl1_pattern) -{ - m_lvl1Pattern = tmplvl1_pattern; -} -void AFP_RawDataContainer::SetLvl2Pattern(const std::vector<bool>& tmplvl2_pattern) -{ - m_lvl2Pattern = tmplvl2_pattern; -} - -void AFP_RawDataContainer::SetEFPattern(const std::vector<bool>& tmpef_pattern) -{ - m_efPattern = tmpef_pattern; -} - -void AFP_RawDataContainer::SetLvl1Id(uint32_t tmpLvl1ID) -{ - m_lvl1Id = tmpLvl1ID; -} - - - - -void AFP_RawDataContainer::setZero() -{ - m_subdetId = 0; - m_mrodId = 0; - m_runNum = 0; - m_runType = 0; - m_lvl1Id = 0; - m_ecrId = 0; - m_bcId = 0; - m_triggerTypeId = 0; - m_DetEventType = 0; - - m_TimeStamp=0; - m_TimeStampns=0; - m_LumiBlock=0; - - m_lvl1Pattern.clear(); - m_lvl2Pattern.clear(); - m_efPattern.clear(); - -} diff --git a/ForwardDetectors/ForwardRec/share/AFP_Rec_OutputItemList_jobOptions.py b/ForwardDetectors/ForwardRec/share/AFP_Rec_OutputItemList_jobOptions.py index 92ac1743a788659d1cdedde462ca402e7d2dd95f..d85af8fa6c9be2d4eccc768049d5fb9594f76174 100644 --- a/ForwardDetectors/ForwardRec/share/AFP_Rec_OutputItemList_jobOptions.py +++ b/ForwardDetectors/ForwardRec/share/AFP_Rec_OutputItemList_jobOptions.py @@ -11,3 +11,5 @@ AFP_ItemList.append("xAOD::AFPSiHitContainer#AFPSiHitContainer") AFP_ItemList.append("xAOD::AFPSiHitAuxContainer#AFPSiHitContainerAux.") AFP_ItemList.append("xAOD::AFPTrackContainer#AFPTrackContainer") AFP_ItemList.append("xAOD::AFPTrackAuxContainer#AFPTrackContainerAux.") +AFP_ItemList.append("xAOD::AFPToFHitContainer#AFPToFHitContainer") +AFP_ItemList.append("xAOD::AFPToFHitAuxContainer#AFPToFHitContainerAux.") diff --git a/Trigger/TrigAlgorithms/TrigAFPReco/CMakeLists.txt b/Trigger/TrigAlgorithms/TrigAFPReco/CMakeLists.txt index 68ea37c19c70574e98a96873e6a50714302a7af3..b42aabadebbe32a69fe1295db6162a4e845c9f48 100644 --- a/Trigger/TrigAlgorithms/TrigAFPReco/CMakeLists.txt +++ b/Trigger/TrigAlgorithms/TrigAFPReco/CMakeLists.txt @@ -15,6 +15,7 @@ atlas_depends_on_subdirs( PUBLIC Control/AthContainers ForwardDetectors/AFP/AFP_ByteStream2RawCnv ForwardDetectors/AFP/AFP_DigiEv + ForwardDetectors/AFP/AFP_RawEv ForwardDetectors/AFP/AFP_Raw2Digi ForwardDetectors/AFP/AFP_Reconstruction/AFP_LocRecoInterfaces Event/EventInfo @@ -33,8 +34,8 @@ find_package( ROOT COMPONENTS pthread Core Tree Hist HepMC CLHEP) atlas_add_component( TrigAFPReco src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps AthContainers xAODForward AFP_ByteStream2RawCnvLib GaudiKernel TrigParticle TrigInterfaces) + INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} AFP_RawEv + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} AthenaBaseComps AFP_RawEv AthContainers xAODForward AFP_ByteStream2RawCnvLib GaudiKernel TrigParticle TrigInterfaces) # Install files from the package: atlas_install_headers( TrigAFPReco ) diff --git a/Trigger/TrigAlgorithms/TrigAFPReco/TrigAFPReco/Trig_AFPSiTrkReco.h b/Trigger/TrigAlgorithms/TrigAFPReco/TrigAFPReco/Trig_AFPSiTrkReco.h index 577cccd90be07da593312a1f5f6bdf2ac898f7fc..c162b6f4e098e4d203fbe0cf7bc69308a9dcfde8 100644 --- a/Trigger/TrigAlgorithms/TrigAFPReco/TrigAFPReco/Trig_AFPSiTrkReco.h +++ b/Trigger/TrigAlgorithms/TrigAFPReco/TrigAFPReco/Trig_AFPSiTrkReco.h @@ -66,6 +66,8 @@ private: std::string m_siHitContainerName; /// Name of the AFP tracks container that will be stored in storegate to be used by the hypothesis algorithm. Default: "AFPTrackContainer" std::string m_trackContainerName; + + static const std::vector<unsigned int> s_robIDs; }; #endif diff --git a/Trigger/TrigAlgorithms/TrigAFPReco/src/Trig_AFPSiTrkReco.cxx b/Trigger/TrigAlgorithms/TrigAFPReco/src/Trig_AFPSiTrkReco.cxx index c7395b105d88c5c0f46929471da9f4f3758622e8..d56e39507083a52a5ff684cbf5ec5a2dd8acf8ab 100644 --- a/Trigger/TrigAlgorithms/TrigAFPReco/src/Trig_AFPSiTrkReco.cxx +++ b/Trigger/TrigAlgorithms/TrigAFPReco/src/Trig_AFPSiTrkReco.cxx @@ -3,16 +3,21 @@ */ #include "TrigAFPReco/Trig_AFPSiTrkReco.h" +#include "AFP_RawEv/AFP_RawContainer.h" +#include "AFP_RawEv/AFP_ROBID.h" #include "xAODForward/AFPTrackContainer.h" #include "xAODForward/AFPSiHitContainer.h" +const std::vector<unsigned int> Trig_AFPSiTrkReco::s_robIDs = {AFP_ROBID::sideA, AFP_ROBID::sideC}; + Trig_AFPSiTrkReco::Trig_AFPSiTrkReco(const std::string& name, ISvcLocator* pSvcLocator) : HLT::FexAlgo(name, pSvcLocator), - m_robDataProvider("ROBDataProviderSvc", name), - m_rawDataTool("AFP_RawDataProviderTool"), - m_digiTool("AFP_Raw2DigiTool"), - m_trackRecoTool("AFP_SIDLocRecoTool") { + m_robDataProvider("ROBDataProviderSvc", name), + m_rawDataTool("AFP_RawDataProviderTool"), + m_digiTool("AFP_Raw2DigiTool"), + m_trackRecoTool("AFP_SIDLocRecoTool") +{ declareProperty("AFP_RawDataCollectionKey", m_rawDataCollectionKey = "AFP_RawData", "Name of the raw data container"); declareProperty("AFP_SiHitContainerName", m_siHitContainerName = "AFPSiHitContainer", "Name of the storegate container with Silicon pixel hits"); declareProperty("AFP_TrackContainerName", m_trackContainerName = "AFPTrackContainer", "Name of the AFP tracks container to be called in the hypothesis algorithm with the same name"); @@ -63,7 +68,7 @@ HLT::ErrorCode Trig_AFPSiTrkReco::hltExecute(const HLT::TriggerElement* /*inputT //Reconstructing Si hits in case it is not already in evtStore, in which case there would be a conflict if (!evtStore()->contains<xAOD::AFPSiHitContainer>(m_siHitContainerName)) { //Recording raw data container to be used by m_rawDataTool - AFP_RawDataContainer* container = new AFP_RawDataContainer(); + AFP_RawContainer* container = new AFP_RawContainer(); ATH_MSG_DEBUG("Created AFP RDO Container"); StatusCode recordSC = evtStore()->record(container, m_rawDataCollectionKey); @@ -74,15 +79,11 @@ HLT::ErrorCode Trig_AFPSiTrkReco::hltExecute(const HLT::TriggerElement* /*inputT ATH_MSG_DEBUG("AFP RDO Container recorded"); } - std::vector<const ROBFragment*> listOfRobf; - std::vector<unsigned int> ROBIDs; - //Adding ROB numbers with AFP information - ROBIDs.push_back(0x00850001); - ROBIDs.push_back(0x00850002); + std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> listOfRobf; - //Retrieving ROB data - m_robDataProvider->getROBData(ROBIDs, listOfRobf); - ATH_MSG_DEBUG(" ROB ID " << std::hex << ROBIDs << std::dec); + //Retrieving ROB data + m_robDataProvider->getROBData(s_robIDs, listOfRobf); + ATH_MSG_DEBUG(" ROB ID " << std::hex << s_robIDs << std::dec); ATH_MSG_DEBUG(" Number of ROB fragments is " << listOfRobf.size()); //Reconstructing Raw Data from ROBs @@ -90,8 +91,10 @@ HLT::ErrorCode Trig_AFPSiTrkReco::hltExecute(const HLT::TriggerElement* /*inputT ATH_MSG_WARNING("BS conversion into RDOs failed"); return HLT::ERROR; } else { - ATH_MSG_DEBUG(" Number of collections in container is " - << container->size()); + ATH_MSG_DEBUG(" Number of time-of-flight collections in container is " + << container->collectionsToF().size()); + ATH_MSG_DEBUG(" Number of silicon collections in container is " + << container->collectionsSi().size()); } // Reconstructing Si Hits from raw data