/** \file \author Javier Gonzalez \version $Id: T3.h 14717 2009-09-17 20:24:36Z lukas $ \date 17 May 2007 */ #ifndef _sevt_T3_h_ #define _sevt_T3_h_ static const char CVSId_sevt_T3[] = "$Id: T3.h 14717 2009-09-17 20:24:36Z lukas $"; #include #include #include #include #include namespace sevt { /** \class T3 T3.h "sevt/T3.h" \ingroup sevt \brief This class contains the basic information to build a surface event. A T3 contains a list of T3Stations. The list of T3Stations include the stations that had a T2 in the cluster found by the central trigger. It also contains a list of stations to which data requests are to be sent. Each of these stations has an ID, an offset that should determine the time around which the time window is set and the window size. The usual case is that stations in the cluster have a zero-width window centered around the time of the T2 and the others have a window of plus/minus 30 microsecond around the T3 time stamp. This class is essentially the same as the \ref t3 class, but with names that make sense. It uses the T3Station structure which is based on \ref t3stat, but using the offline classes and unit conventions. */ class T3 { public: /** \class T3Station T3.h \brief Class to hold the trigger information for one station in a T3 (based on the \ref t3stat class). This is the information necessary to request data from a station. This includes the station ID, the offset (offset from the T3s time stamp) and window size. */ struct T3Station { int id; utl::TimeInterval offset; utl::TimeInterval window; }; private: typedef std::map InternalStationMap; typedef InternalStationMap::const_iterator ConstInternalStationIterator; struct InternalStationFunctor { const sevt::T3::T3Station& operator()(const InternalStationMap::value_type& pair) const { return pair.second; } }; public: /// Set the trigger time stamp void SetTime(const utl::TimeStamp& stamp) { fTime = stamp; } /// Get the trigger time stamp utl::TimeStamp GetTime() const { return fTime; } /// Set the trigger algorithm void SetAlgorithm(const std::string& algo) { fAlgorithm = algo; } /// Get the trigger algorithm std::string GetAlgorithm() const { return fAlgorithm; } /// Get number of T3 stations int GetNumberOfStations() const { return fParticipants.size(); } /// Add a station to request data, specifying offset and window size void AddStation(const int id, const utl::TimeInterval& offset, const utl::TimeInterval& window); bool HasStation(const int id) const { return fParticipants.find(id) != fParticipants.end(); } /// Get time offset for a specific station utl::TimeInterval GetOffset(const int id) const { return fParticipants.find(id)->second.offset; } /// Get time window for a specific station utl::TimeInterval GetWindow(const int id) const { return fParticipants.find(id)->second.window; } /// StationIterator returns a pointer to a T3Station typedef boost::transform_iterator StationIterator; /// Iterator over the list of T3Stations in T3. StationIterator StationsBegin() const { return StationIterator(fParticipants.begin()); } /// Iterator over the list of T3Stations in T3. StationIterator StationsEnd() const { return StationIterator(fParticipants.end()); } private: InternalStationMap fParticipants; utl::TimeStamp fTime; std::string fAlgorithm; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode:c++ // compile-command: "make -C .. -k" // End: