StPicoBTOWHit.cxx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "StPicoBTOWHit.h"
  2. #include "StPicoConstants.h"
  3. #include "StPicoDstMaker.h"
  4. ClassImp(StPicoBTOWHit)
  5. //----------------------------------------------------------------------------------
  6. StPicoBTOWHit::StPicoBTOWHit()
  7. {
  8. Clear();
  9. }
  10. //----------------------------------------------------------------------------------
  11. StPicoBTOWHit::StPicoBTOWHit(int id, int adc, float e)
  12. {
  13. Clear();
  14. if(id <0) mId = 0;
  15. if(adc <0) mAdc = 0;
  16. mId = (id >Pico::USHORTMAX) ? Pico::USHORTMAX : (UShort_t)id;
  17. mAdc = (adc >Pico::USHORTMAX) ? Pico::USHORTMAX : (UShort_t)adc;
  18. mE = (e*1000. > Pico::SHORTMAX) ? Pico::SHORTMAX : (Short_t)(TMath::Nint(e*1000.));
  19. }
  20. //----------------------------------------------------------------------------------
  21. StPicoBTOWHit::~StPicoBTOWHit()
  22. { /* noop */ }
  23. //----------------------------------------------------------------------------------
  24. void StPicoBTOWHit::Clear(const Option_t* opt)
  25. {
  26. mId = 0;
  27. mAdc = 0;
  28. mE = 0;
  29. }
  30. //----------------------------------------------------------------------------------
  31. void StPicoBTOWHit::Print(const Char_t *option) const {
  32. LOG_INFO << " Id = " << id() << " Adc = " << adc() << " Energy = " << energy() << endm;
  33. }