Go to the documentation of this file.00001
00002
00003 #include "TSTSEvent.h"
00004 #include "TGo4Version.h"
00005 #if __GO4BUILDVERSION__ > 40502
00006 #include "go4iostream.h"
00007 #else
00008 #include "Riostream.h"
00009 #endif
00010
00011 TSTSEvent::TSTSEvent(const char* name, Short_t id) :
00012 TGo4EventElement(name,name,id)
00013 {
00014 cout << "**** TSTSEvent: Create instance " << name <<" with composite id "<<id << endl;
00015 }
00016
00017 TSTSEvent::TSTSEvent() :
00018 TGo4EventElement()
00019 {
00020 }
00021
00022
00023
00024 TSTSEvent::~TSTSEvent()
00025 {
00026 }
00027
00028
00029
00030 void TSTSEvent::AddPoint( UInt_t plane, TSpacepoint const & point )
00031 {
00032 if( plane >= fPoints.size() ) {
00033 fPoints.resize( plane + 1 );
00034 }
00035 fPoints.at( plane ).push_back( point );
00036 }
00037
00038
00039 void TSTSEvent::AddDigi( UInt_t station, UInt_t side, TSTSDigi const & digi )
00040 {
00041 if( station >= fDigis.size() ) {
00042 fDigis.resize( station + 1 );
00043 for( UInt_t iStation = 0; iStation < fDigis.size(); iStation++ ) {
00044 fDigis.at( iStation ).resize( TSTSTopology::kNSides );
00045 }
00046 }
00047
00048 fDigis.at( station ).at(side).push_back( digi );
00049 }
00050
00051
00052
00053 void TSTSEvent::AddCluster( UInt_t station, UInt_t side, TSTSCluster const & clust )
00054 {
00055 if( station >= fClusters.size() ) {
00056 fClusters.resize( station + 1 );
00057 for( UInt_t iStation = 0; iStation < fClusters.size(); iStation++ ) {
00058 fClusters.at( iStation ).resize( TSTSTopology::kNSides );
00059 }
00060 }
00061 fClusters.at( station ).at(side).push_back( clust );
00062 }
00063
00064
00065
00066 void TSTSEvent::Clear(Option_t *t)
00067 {
00068
00069 fHits.clear();
00070 for( UInt_t iStation = 0; iStation < fPoints.size(); iStation++ ) {
00071 fPoints.at( iStation ).clear();
00072 }
00073
00074 for( UInt_t iStation = 0; iStation < fPoints.size(); iStation++ ) {
00075 for( UInt_t iSide = 0; iSide < TSTSTopology::kNSides; iSide++ ) {
00076 fDigis.at( iStation ).at( iSide ).clear();
00077 fClusters.at( iStation).at( iSide ).clear();
00078 }
00079 }
00080 }
00081