00001
00002 #ifndef CHANNEL_HIT_HH
00003 #define CHANNEL_HIT_HH
00004
00005
00006
00007
00008
00009
00010
00011 #include "Channel.hh"
00012 #include "mTypes.h"
00013
00014 #include <string>
00015 #include <vector>
00016
00017
00018
00019
00020 class ChannelHit {
00021
00022 public:
00023 ChannelHit(const Channel &);
00024 ChannelHit(const Channel &, const i16 value);
00025 virtual ~ChannelHit() ;
00026
00027 inline i16 getValue(void) const { return value; }
00028 inline bool setValue(i16 aValue) { value = aValue; return true; }
00029 inline const Channel& getChannel(void) const { return channel; }
00030 inline const ULong64_t getTimestamp(void) const { return(timestamp); };
00031 inline const UInt_t getBcId_Abs(void) const { return(bcId_Abs); };
00032 inline const UInt_t getBcId_Dif(void) const { return(bcId_Dif); };
00033 inline const UInt_t getBcId_Hit(void) const { return(bcId_Hit); };
00034 inline void setHardrocTime(const ULong64_t ts, const UInt_t aBcId_Abs, const UInt_t aBcId_Dif, const UInt_t aBcId_Hit)
00035 { timestamp = ts, bcId_Abs = aBcId_Abs, bcId_Dif = aBcId_Dif, bcId_Hit = aBcId_Hit; };
00036
00037
00038 public:
00039 static void sortByValue(std::vector <ChannelHit *>&, bool ascending);
00040 void print(void) const;
00041
00042
00043 private:
00044 i16 value;
00045 const Channel &channel;
00046
00047 ULong64_t timestamp;
00048 UInt_t bcId_Abs;
00049 UInt_t bcId_Dif;
00050 UInt_t bcId_Hit;
00051 };
00052
00053
00054
00055 struct Descending
00056 {
00057 bool operator() (const ChannelHit * lhs, const ChannelHit * rhs) const
00058 {
00059 return lhs->getValue() > rhs->getValue();
00060 }
00061 };
00062
00063 struct Ascending
00064 {
00065 bool operator() (const ChannelHit * lhs, const ChannelHit * rhs) const
00066 {
00067 return lhs->getValue() < rhs->getValue();
00068 }
00069 };
00070
00071 #endif // CHANNEL_HIT_HH