| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

FecTraits.cc

Go to the documentation of this file.
00001 #include "FecReadoutFormat/FecTraits.h"
00002 #include "FecReadoutFormat/FecTraits_v1_3.h"
00003 
00004 #include <map>
00005 
00006 
00007 using DybDaq::FecTraits;
00008 using DybDaq::FecTraits_v1_3;
00009 
00010 // Components in this format
00011 const unsigned int FecTraits::kData = 0;
00012 
00013 const unsigned int FecTraits::kFecMarkerValue = 0x7e7e;
00014 
00015 const unsigned int FecTraits::kFecMarker = 0;
00016 const unsigned int FecTraits::kRpcCFId   = FecTraits::kFecMarker + 1;
00017 const unsigned int FecTraits::kRpcFecId  = FecTraits::kRpcCFId + 1;
00018 const unsigned int FecTraits::kTransErr1 = FecTraits::kRpcFecId + 1;
00019 const unsigned int FecTraits::kTransErr2 = FecTraits::kTransErr1 + 1;
00020 const unsigned int FecTraits::kTrigType  = FecTraits::kTransErr2 + 1;
00021 const unsigned int FecTraits::kFullFlag  = FecTraits::kTrigType + 1;
00022 const unsigned int FecTraits::kValidGPS  = FecTraits::kFullFlag + 1;
00023 const unsigned int FecTraits::kValidCLK  = FecTraits::kValidGPS + 1;
00024 const unsigned int FecTraits::kUsingUTC  = FecTraits::kValidCLK + 1;
00025 const unsigned int FecTraits::kSecond    = FecTraits::kUsingUTC + 1;
00026 const unsigned int FecTraits::kNanoSecond = FecTraits::kSecond + 1;
00027 const unsigned int FecTraits::kFecHitMap  = FecTraits::kNanoSecond + 1;
00028 
00029 static std::map<const char*, FecTraits*> m_allTraits;
00030 
00031 
00032 FecTraits::FecTraits() {
00033 }
00034 
00035 FecTraits::~FecTraits() {
00036 }
00037 
00038 const FecTraits& FecTraits::defaultTraits() {
00039    if ( m_allTraits.size() == 0 ) {
00040       m_allTraits.insert(std::pair<const char*, FecTraits*>(FecTraits_v1_3::key(), new FecTraits_v1_3()));
00041    }
00042    return *m_allTraits[ FecTraits_v1_3::key() ];
00043 }
00044 
00045 const FecTraits* FecTraits::readTraits(const char*& ) {
00046    defaultTraits();
00047    return m_allTraits[ FecTraits_v1_3::key() ];
00048 }
00049 
00050 const FecTraits* FecTraits::getTraits(const unsigned int version) {
00051    defaultTraits();
00052    if ( version == 0x13 ) {
00053       return m_allTraits[ FecTraits_v1_3::key() ];
00054    }
00055    return m_allTraits[ FecTraits_v1_3::key() ];
00056 }
00057 
00058 unsigned int FecTraits::illegalMarker() const {
00059    return 0xffffffffU;
00060 }
00061 
00062 unsigned int FecTraits::illegalField() const {
00063    return 0xffffffffU;
00064 }
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:07:52 2011 for FecReadoutFormat by doxygen 1.4.7