StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBTofHit.cxx
1 /***************************************************************************
2  *
3  * $Id: StBTofHit.cxx,v 2.6 2012/10/23 20:16:32 fisyak Exp $
4  *
5  * Author: Xin Dong, Nov 2008
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StBTofHit.cxx,v $
13  * Revision 2.6 2012/10/23 20:16:32 fisyak
14  * Add print out
15  *
16  * Revision 2.5 2012/05/07 14:42:57 fisyak
17  * Add handilings for Track to Fast Detectors Matching
18  *
19  * Revision 2.4 2011/10/17 15:37:04 fisyak
20  * One line print out
21  *
22  * Revision 2.3 2009/03/04 04:36:58 ullrich
23  * Added missing check for valid pointer to operator<<
24  *
25  * Revision 2.2 2009/01/15 00:46:25 ullrich
26  * tray() now returns int.
27  *
28  * Revision 2.1 2008/12/22 20:30:57 ullrich
29  * Initial Revision.
30  *
31  *
32  **************************************************************************/
33 #include "StBTofHit.h"
34 #include "StTrack.h"
35 #include "TString.h"
36 const Float_t StBTofHit::mBTofPadWidth = 3.45;
37 ClassImp(StBTofHit);
38 //________________________________________________________________________________
39 StBTofHit::StBTofHit() {
40  mTray = 0;
41  mModule = 0;
42  mCell = 0;
43  mLeadingEdgeTime = 0.;
44  mTrailingEdgeTime = 0.;
45  mAssociatedTrack = 0;
46 }
47 //________________________________________________________________________________
48 const StTrack* StBTofHit::associatedTrack() const { return mAssociatedTrack; }
49  StTrack* StBTofHit::associatedTrack() { return mAssociatedTrack; }
50 //________________________________________________________________________________
51 void
52 StBTofHit::setAssociatedTrack(StTrack* val) { mAssociatedTrack = val; }
53 //________________________________________________________________________________
54 const StThreeVectorF& StBTofHit::position() const {
55  static StThreeVectorF pos;
56  pos.set(0.,mBTofPadWidth*(cell() - 3.5), 0.);
57  return *&pos;
58 }
59 //________________________________________________________________________________
60 ostream& operator<<(ostream &os, const StBTofHit& hit) {
61  os << Form("Tray:%3i",hit.tray())
62  << Form(" Module:%2i",hit.module())
63  << Form(" Cell:%2i",hit.cell())
64  << Form(" LeTime %7.2f",hit.leadingEdgeTime())
65  << Form(" TeTime %7.2f",hit.trailingEdgeTime())
66  << Form(" Track %5i",(hit.associatedTrack() ? hit.associatedTrack()->key() : 0))
67  << Form(" IdTruth %5i",hit.idTruth())
68  << Form(" Quality%3i",hit.qaTruth());
69  return os;
70 }
71 //________________________________________________________________________________