Skip to content
Snippets Groups Projects
Commit ada5b392 authored by Roland Jansky's avatar Roland Jansky
Browse files

adding StripRawData to the EDM

parent d5a457e1
No related branches found
No related tags found
No related merge requests found
Showing
with 283 additions and 30 deletions
......@@ -36,3 +36,7 @@ atlas_add_dictionary( xAODTrackingDict
atlas_add_test( xAODTracking_StripCluster_test
SOURCES test/xAODTracking_StripCluster_test.cxx
LINK_LIBRARIES xAODTracking )
atlas_add_test( xAODTracking_StripRawData_test
SOURCES test/xAODTracking_StripRawData_test.cxx
LINK_LIBRARIES xAODTracking )
#include "xAODTracking/StripRawData.h"
// EDM include(s):
#include "xAODCore/AuxStoreAccessorMacros.h"
namespace xAOD {
StripRawData::StripRawData() { }
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(StripRawData, uint64_t, id, setId)
static const SG::AuxElement::Accessor<uint32_t> word_acc("dataword");
void StripRawData::setWord(uint32_t new_word) {
word_acc(*this) = new_word;
}
uint32_t StripRawData::getWord() const {
return word_acc(*this);
}
// decode size of group of strips information
int StripRawData::getGroupSize() const {
return getWord() & 0x7FF;
}
// decode strip information
int StripRawData::getStrip() const {
return (getWord() >> 11) & 0x7FF;
}
// decode time bin information
int StripRawData::getTimeBin() const {
return (getWord() >> 22) & 0x7;
}
// returns a word incoding the errors
int StripRawData::getErrors() const {
return (getWord() >> 25) & 0x7;
}
// returns true if the time bin corresponding to the present BC is on
bool StripRawData::OnTime() const {
return (getWord() >> 23) & 0x1;
}
// returns true if there is an error in the first hit's data
bool StripRawData::FirstHitError() const {
return (getWord() >> 29) & 0x1;
}
// returns true if there is an error in the second hit's data
bool StripRawData::SecondHitError() const {
return (getWord() >> 30) & 0x1;
}
} // namespace xAOD
\ No newline at end of file
#include "xAODTracking/StripRawDataAuxContainer.h"
namespace xAOD {
StripRawDataAuxContainer::StripRawDataAuxContainer()
: AuxContainerBase()
{
AUX_VARIABLE(id);
AUX_VARIABLE(dataword);
}
void StripRawDataAuxContainer::dump() const {
std::cout<<" Dumping StripRawDataAuxContainer"<<std::endl;
std::cout<<"id:";
std::copy(id.begin(), id.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<"dataword:";
std::copy(dataword.begin(), dataword.end(),
std::ostream_iterator<float>(std::cout, ", "));
std::cout<<std::endl;
}
}
\ No newline at end of file
......@@ -3,8 +3,8 @@
// Local include(s):
#include "xAODTracking/StripClusterContainer.h"
//#include "xAODTracking/versions/SCTRawHitValidationContainer_v1.h"
#include "xAODTracking/StripRawDataContainer.h"
// Set up the collection proxies:
ADD_NS_DV_PROXY( xAOD, StripClusterContainer );
//ADD_NS_DV_PROXY( xAOD, SCTRawHitValidationContainer_v1 );
\ No newline at end of file
ADD_NS_DV_PROXY( xAOD, StripRawDataContainer );
\ No newline at end of file
#include "xAODTracking/StripClusterContainer.h"
#include "xAODTracking/StripClusterAuxContainer.h"
#include "xAODTracking/StripRawDataContainer.h"
#include "xAODTracking/StripRawDataAuxContainer.h"
\ No newline at end of file
// System include(s):
#include <iostream>
// Local include(s):
#include "xAODTracking/StripRawDataContainer.h"
#include "xAODTracking/StripRawDataAuxContainer.h"
template< typename T >
std::ostream& operator<< ( std::ostream& out,
const std::vector< T >& vec ) {
out << "[";
for( size_t i = 0; i < vec.size(); ++i ) {
out << vec[ i ];
if( i < vec.size() - 1 ) {
out << ", ";
}
}
out << "]";
return out;
}
/// Function filling one Strip RDO with information
void fill( xAOD::StripRawData& sc ) {
sc.setWord( (uint32_t) 1010111);
sc.setId( (uint64_t) 1111111111111);
return;
}
/// Function printing the properties of a StripCluster
void print( const xAOD::StripRawData& sc ) {
std::cout << "id = " << sc.id() << std::endl;
std::cout << "word = " << sc.getWord() << std::endl;
return;
}
int main() {
// Create the main containers to test:
xAOD::StripRawDataAuxContainer aux;
xAOD::StripRawDataContainer tpc;
tpc.setStore( &aux );
// Add one strip cluster to the container:
xAOD::StripRawData* p = new xAOD::StripRawData();
tpc.push_back( p );
// Fill it with information:
fill( *p );
// Print the information:
print( *p );
// Print the contents of the auxiliary store:
aux.dump();
// Return gracefully:
return 0;
}
\ No newline at end of file
#ifndef XAODTRACKING_STRIPRAWDATA_H
#define XAODTRACKING_STRIPRAWDATA_H
// System include(s):
#include <vector>
// Core include(s):
#include "AthContainers/AuxElement.h"
namespace xAOD {
/** Class describing an Strip Raw Data Object (RDO).
*
* @author Roland Jansky <roland.jansky@cern.ch>
*/
class StripRawData : public SG::AuxElement {
public:
StripRawData();
/// set identifier of this RDO
void setId(uint64_t new_identifier);
/// return identifier of this RDO
uint64_t id() const;
/// set data word of this RDO
void setWord(uint32_t new_word);
/** access data word of this RDO and properties encoded therein
* @{
*/
/// return the data word
uint32_t getWord() const;
/// return number of strips in this RDO (typically just 1)
int getGroupSize() const;
/// return ID of (first) strip
int getStrip() const;
/** Decode time bin information for the 3 consecutive bunch crossings.
*
* This information is stored in 3 bits where the most significant bit
* corresponds to BC-1. So the 3 bit pattern is: (BC-1), BC, (BC+1).
*/
int getTimeBin() const;
/// return bitmask representing hit errors
int getErrors() const;
/// check if the time bin corresponding to the present BC is on
bool OnTime() const;
/// check if there is an error in the first hit's data
bool FirstHitError() const;
/// check if there is an error in the second hit's data
bool SecondHitError() const;
/// @}
}; // end of the StripRawData class definition
} // end of the xAOD namespace
#endif // XAODTRACKING_STRIPRAWDATA_H
\ No newline at end of file
#ifndef XAODTRACKING_STRIPRAWDATAAUXCONTAINER_H
#define XAODTRACKING_STRIPRAWDATAAUXCONTAINER_H
// System include(s):
#include <vector>
// Core include(s):
#include "xAODCore/AuxContainerBase.h"
#include "AthLinks/ElementLink.h"
namespace xAOD {
class StripRawDataAuxContainer : public AuxContainerBase {
public:
StripRawDataAuxContainer();
/// Dumps contents (for debugging)
void dump() const;
private:
std::vector<uint64_t> id;
std::vector<uint32_t> dataword;
};
}
// Set up a CLID for the container:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF( xAOD::StripRawDataAuxContainer , 1171743595 , 1 )
#endif // XAODTRACKING_STRIPRAWDATAAUXCONTAINER_H
\ No newline at end of file
#ifndef XAODTRACKING_STRIPRAWDATACONTAINER_H
#define XAODTRACKING_STRIPRAWDATACONTAINER_H
// Core include(s):
#include "AthContainers/DataVector.h"
// Local include(s):
#include "xAODTracking/StripRawData.h"
namespace xAOD {
/// The container is a simple typedef for now
typedef DataVector<xAOD::StripRawData> StripRawDataContainer;
}
// Set up a CLID for the container:
#include "xAODCore/CLASS_DEF.h"
CLASS_DEF(xAOD::StripRawDataContainer, 1314367244, 1)
#endif // XAODTRACKING_STRIPRAWDATACONTAINER_H
\ No newline at end of file
<lcgdict>
<!-- SCTRawHitValidation_v1 dictionaries: -->
<!-- <class name="xAOD::SCTRawHitValidationAuxContainer_v1" -->
<!-- id="788781DA-FE8A-414A-A72B-6E846094FCF8" /> -->
<!-- <class name="xAOD::SCTRawHitValidationContainer_v1" -->
<!-- id="4F8042A1-64B0-42AB-B0A4-C9716C15336A" /> -->
<!-- -->
<!-- <class name="DataLink<xAOD::SCTRawHitValidationContainer_v1>" /> -->
<!-- <class name="std::vector<DataLink<xAOD::SCTRawHitValidationContainer_v1> >" /> -->
<!-- -->
<!-- <class name="ElementLink<xAOD::SCTRawHitValidationContainer_v1>" /> -->
<!-- <class name="std::vector<ElementLink<xAOD::SCTRawHitValidationContainer_v1> >" /> -->
<!-- <class name="std::vector<std::vector<ElementLink<xAOD::SCTRawHitValidationContainer_v1> > >" /> -->
<!-- StripRawData dictionaries: -->
<class name="xAOD::StripRawDataAuxContainer"
id="788781DA-FE8A-414A-A72B-6E846094FCF8" />
<class name="xAOD::StripRawDataContainer"
id="4F8042A1-64B0-42AB-B0A4-C9716C15336A" />
<!-- Smart pointers to objects: -->
<class name="DataLink<xAOD::StripRawDataContainer>" />
<class name="std::vector<DataLink<xAOD::StripRawDataContainer> >" />
<class name="ElementLink<xAOD::StripRawDataContainer>" />
<class name="std::vector<ElementLink<xAOD::StripRawDataContainer> >" />
<class name="std::vector<std::vector<ElementLink<xAOD::StripRawDataContainer> > >" />
<!-- StripCluster dictionaries: -->
<class name="xAOD::StripCluster"/>
......@@ -19,7 +19,7 @@
<class name="xAOD::StripClusterContainer"
id="868F1FD8-AFE7-4B40-B12E-73716C37A6B0"/>
<!-- Smart pointers to objects: -->
<!-- Smart pointers to objects: -->
<class name="DataLink<xAOD::StripClusterContainer>" />
<class name="std::vector<DataLink<xAOD::StripClusterContainer> >" />
......
......@@ -23,12 +23,8 @@
#include "xAODTracking/StripClusterContainer.h"
#include "xAODTracking/StripClusterAuxContainer.h"
//#include "xAODTracking/SCTRawHitValidation.h"
//#include "xAODTracking/SCTRawHitValidationContainer.h"
//#include "xAODTracking/SCTRawHitValidationAuxContainer.h"
//#include "xAODTracking/versions/SCTRawHitValidation_v1.h"
//#include "xAODTracking/versions/SCTRawHitValidationContainer_v1.h"
//#include "xAODTracking/versions/SCTRawHitValidationAuxContainer_v1.h"
#include "xAODTracking/StripRawDataContainer.h"
#include "xAODTracking/StripRawDataAuxContainer.h"
namespace {
struct GCCXML_DUMMY_INSTANTIATION_XAODTRACKING {
......@@ -43,15 +39,15 @@ namespace {
std::vector< ElementLink< xAOD::StripClusterContainer > > pel2;
std::vector< std::vector< ElementLink< xAOD::StripClusterContainer > > > pel3;
// // Container(s):
// xAOD::SCTRawHitValidationContainer_v1 c6;
// // Data link(s):
// DataLink< xAOD::SCTRawHitValidationContainer_v1 > rdodl1;
// std::vector< DataLink< xAOD::SCTRawHitValidationContainer_v1 > > rdodl2;
// // Element link(s):
// ElementLink< xAOD::SCTRawHitValidationContainer > rdoel1;
// std::vector< ElementLink< xAOD::SCTRawHitValidationContainer_v1 > > rdoel2;
// std::vector< std::vector< ElementLink< xAOD::SCTRawHitValidationContainer_v1 > > > rdoel3;
// Container(s):
xAOD::StripRawDataContainer c6;
// Data link(s):
DataLink< xAOD::StripRawDataContainer > rdodl1;
std::vector< DataLink< xAOD::StripRawDataContainer > > rdodl2;
// Element link(s):
ElementLink< xAOD::StripRawDataContainer > rdoel1;
std::vector< ElementLink< xAOD::StripRawDataContainer > > rdoel2;
std::vector< std::vector< ElementLink< xAOD::StripRawDataContainer > > > rdoel3;
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment