/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

LtbTraits.h
Go to the documentation of this file.
00001 #ifndef LTBREADOUTFORMAT_LTBTRAITS_H
00002 #define LTBREADOUTFORMAT_LTBTRAITS_H
00003 
00004 /*
00005  *  LtbTraits.h
00006  *  LtbReadoutFormat
00007  *
00008  *  Created by Simon Patton on 7/21/10.
00009  *  Copyright 2010 DayaBay Collaboration. All rights reserved.
00010  *
00011  */
00012 #include <vector>
00013 #include <ctime>
00014 
00015 #include "DaqReadoutFormat/DaqTraits.h"
00016 
00017 namespace DybDaq {
00018     class LtbTime;
00019 }
00020 
00021 namespace DybDaq {
00022 
00023 class LtbTraits : public DaqTraits {
00024 
00025 public:
00026 
00027     typedef std::vector<const char*> TriggerLines;
00028 
00029     typedef LtbTime LtbDateTime;
00030 
00034     static const unsigned int kHead;
00035     
00039     static const unsigned int kFrameFront;
00040     
00044     static const unsigned int kTime;
00045     
00049     static const unsigned int kFrameBack;
00050     
00054     static const unsigned int kFoot;
00055     
00059     static const unsigned int kUnixTime;
00060 
00064     static const unsigned int kGpsTime;
00065     
00066     // Fields
00067 
00071     static const unsigned int kRawTriggerTotal;
00072 
00076     static const unsigned int kRawTriggersSaved;
00077 
00081     static const unsigned int kLtbStatus;
00082 
00086     static const unsigned int kLocalTriggerNumber;
00087 
00091     static const unsigned int kFrameNumber;
00092 
00096     static const unsigned int kReadoutType;
00097 
00101     static const unsigned int kTriggerMask;
00102 
00106     static const unsigned int kYear;
00107 
00111     static const unsigned int kMonth;
00112 
00116     static const unsigned int kDay;
00117 
00121     static const unsigned int kHour;
00122 
00126     static const unsigned int kMinutes;
00127 
00131     static const unsigned int kSeconds;
00132 
00136     static const unsigned int kTicks;
00137 
00141     static const unsigned int kHitSum;
00142 
00146     static const unsigned int kTotalEsum;
00147 
00151     static const unsigned int kHighEsum;
00152 
00156     static const unsigned int kLowEsum;
00157 
00161     static const unsigned int kEnergySum;
00162 
00166     static const unsigned int kCrossTriggerSource;
00167 
00171     static const unsigned int kFootDataLength;
00172 
00176     static const unsigned int kClockError;
00177 
00181     static const unsigned int kVersion;
00182 
00186     static const unsigned int kAccumulationStatus;
00187 
00191     static const unsigned int kValidGps;
00192 
00196     static const unsigned int kUsingUtc;
00197 
00198     /* Added v4.1 */
00202     static const unsigned int kValidClockSystem;
00203 
00207     static const unsigned int kHighNanoseconds;
00208 
00212     static const unsigned int kLowNanoseconds;
00213 
00217     static const unsigned int kHighUnixTime;
00218 
00222     static const unsigned int kLowUnixTime;
00223 
00227     static const unsigned int kHighAccumulation;
00228 
00232     static const unsigned int kLowAccumulation;
00233 
00237     static const unsigned int kFeeBufferFull;
00238 
00242     static const unsigned int kLtbBufferFull;
00243 
00247     static const unsigned int kBlockedTriggerCount;
00248 
00249     /* Added v4.6 */
00253     static const unsigned int kHighCrossTrigger;
00254 
00258     static const unsigned int kLowCrossTrigger;
00259 
00260     // Known trigger lines
00261 
00265     static const unsigned int kManualTrigger;
00266 
00270     static const unsigned int kCrossTrigger;
00271 
00275     static const unsigned int kPeriodicTrigger;
00276 
00280     static const unsigned int kPedestalTrigger;
00281 
00285     static const unsigned int kCalibTrigger;
00286 
00290     static const unsigned int kRandomTrigger;
00291 
00295     static const unsigned int kMultiplicityTrigger;
00296 
00300     static const unsigned int kEsumAdcTrg;
00301 
00305     static const unsigned int kHighEsumCompTrg;
00306 
00310     static const unsigned int kLowEsumCompTrg;
00311 
00315     static const unsigned int kAllEsumCompTrg;
00316 
00320     static const unsigned int kNHitLowTrigger;
00321 
00325     static const unsigned int kNHitHighTrigger;
00326 
00330     static const LtbTraits& defaultTraits();
00331 
00335     static const LtbTraits* readTraits(const char*& buffer);
00336 
00340     virtual ~LtbTraits();
00341 
00345     virtual unsigned int illegalMarker() const;
00346 
00350     virtual unsigned int illegalField() const;
00351 
00355     const std::string dateTimeAsString(const LtbDateTime& time) const;
00356 
00360     const LtbDateTime* makeDateTime(const time_t& time) const;
00361 
00365     virtual const TriggerLines* triggerLines(const unsigned int mask) const;
00366 
00370     virtual const char* triggerLineAsString(unsigned int line) const;
00371 
00375     virtual unsigned int triggerLineBit(const unsigned int line) const;
00376 
00380     virtual unsigned int headSize() const = 0;
00381 
00385     virtual unsigned int frameSize() const = 0;
00386 
00390     virtual unsigned int timeSize() const = 0;
00391 
00395     virtual unsigned int footSize() const = 0;
00396 
00400     virtual void initializeHead(char* buffer) const = 0;
00401 
00405     virtual void initializeFrame(char* buffer) const = 0;
00406 
00410     virtual void initializeTime(char* buffer) const = 0;
00411 
00415     virtual void initializeFoot(char* buffer) const = 0;
00416 
00420     virtual unsigned int timeOffset() const = 0;
00421 
00422 protected:
00423 
00427     LtbTraits();
00428 
00432     virtual unsigned int triggerLineEnd() const = 0;
00433 
00437     virtual const char** triggerLineStrings() const = 0;
00438 
00442     virtual const unsigned int* triggerLineBits() const = 0;
00443 
00444 private:
00445 
00449     LtbTraits(LtbTraits& rhs);
00450 
00454     LtbTraits& operator=(LtbTraits& rhs);
00455 };
00456 
00457 }
00458 
00459 #endif // LTBREADOUTFORMAT_LTBTRAITS_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:53:06 for LtbReadoutFormat by doxygen 1.7.4