StPicoMtdPidTraits.cxx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #include "StMuDSTMaker/COMMON/StMuMtdPidTraits.h"
  2. #include "StMuDSTMaker/COMMON/StMuMtdHit.h"
  3. #include "StarClassLibrary/PhysicalConstants.h"
  4. #include "StMessMgr.h"
  5. #include "StPicoConstants.h"
  6. #include "StPicoMtdPidTraits.h"
  7. ClassImp(StPicoMtdPidTraits)
  8. //----------------------------------------------------------------------------------
  9. StPicoMtdPidTraits::StPicoMtdPidTraits() :
  10. mMtdHitChan(-1), mTrackIndex(-1), mMatchFlag(-1),
  11. mDeltaY(-999.), mDeltaZ(-999.), mDeltaTimeOfFlight(-999.), mBeta(-999.)
  12. {
  13. // constructor
  14. }
  15. //----------------------------------------------------------------------------------
  16. StPicoMtdPidTraits::StPicoMtdPidTraits(const StMuMtdHit * hit,
  17. const StMuMtdPidTraits* trait,
  18. const Int_t index)
  19. {
  20. Int_t gchan = (hit->backleg()-1)*60 + (hit->module()-1)*12 + hit->cell();
  21. mMtdHitChan = (gchan > Pico::SHORTMAX) ? -1 : (Short_t) gchan;
  22. mTrackIndex = (Short_t)index;
  23. mMatchFlag = (Char_t) trait -> matchFlag();
  24. mDeltaY = trait -> deltaY();
  25. mDeltaZ = trait -> deltaZ();
  26. mDeltaTimeOfFlight = trait -> timeOfFlight() - trait -> expTimeOfFlight();
  27. mBeta = (trait->pathLength()/trait->expTimeOfFlight())*1e9/c_light;
  28. }
  29. //----------------------------------------------------------------------------------
  30. StPicoMtdPidTraits::~StPicoMtdPidTraits()
  31. {
  32. // dummy destructor
  33. }
  34. //----------------------------------------------------------------------------------
  35. void StPicoMtdPidTraits::Print(const Char_t *option) const
  36. {
  37. LOG_INFO << "Matched hit: backleg = " << backleg()
  38. << ", module = " << module()
  39. << ", cell = " << cell()
  40. <<endm;
  41. LOG_INFO << "Matched track index = " << mTrackIndex << endm;
  42. LOG_INFO << "(DeltaY, DeltaZ, DeltaTOF, beta) = ("
  43. << mDeltaY << ", "
  44. << mDeltaZ << ", "
  45. << mDeltaTimeOfFlight << ", "
  46. << mBeta << ")" << endm;
  47. }