StPicoEmcTrigger.cxx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "StPicoEmcTrigger.h"
  2. #include "StPicoConstants.h"
  3. #include "StPicoDstMaker.h"
  4. ClassImp(StPicoEmcTrigger)
  5. //----------------------------------------------------------------------------------
  6. StPicoEmcTrigger::StPicoEmcTrigger()
  7. {
  8. Clear();
  9. }
  10. //----------------------------------------------------------------------------------
  11. StPicoEmcTrigger::StPicoEmcTrigger(int flag, int id, int adc)
  12. {
  13. Clear();
  14. if(flag<0) mFlag = 0;
  15. if(id <0) mId = 0;
  16. if(adc <0) mAdc = 0;
  17. mFlag = (flag>Pico::UCHARMAX) ? Pico::UCHARMAX : (UChar_t)flag;
  18. mId = (id >Pico::USHORTMAX) ? Pico::USHORTMAX : (UShort_t)id;
  19. mAdc = (adc >Pico::USHORTMAX) ? Pico::USHORTMAX : (UShort_t)adc;
  20. }
  21. //----------------------------------------------------------------------------------
  22. StPicoEmcTrigger::~StPicoEmcTrigger()
  23. { /* noop */ }
  24. //----------------------------------------------------------------------------------
  25. void StPicoEmcTrigger::Clear(const Option_t* opt)
  26. {
  27. mFlag = 0;
  28. mId = 0;
  29. mAdc = 0;
  30. }
  31. //----------------------------------------------------------------------------------
  32. void StPicoEmcTrigger::Print(const Char_t *option) const {
  33. LOG_INFO << " Flag = " << mFlag << " Id = " << mId << " Adc = " << mAdc << endm;
  34. }