StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtPoint.cxx
1 /***************************************************************************
2  *
3  * $Id: StFgtPoint.cxx,v 2.5 2017/11/20 20:01:49 smirnovd Exp $
4  * Author: S. Gliske, Oct 2011
5  *
6  ***************************************************************************
7  *
8  * Description: see header file.
9  *
10  ***************************************************************************
11  *
12  * $Log: StFgtPoint.cxx,v $
13  * Revision 2.5 2017/11/20 20:01:49 smirnovd
14  * Remove StRoot/ from included header prefix
15  *
16  * Revision 2.4 2013/02/19 21:55:57 ullrich
17  * Modified charge asymmetry calculation (Anselm).
18  *
19  * Revision 2.2 2013/01/08 19:53:15 ullrich
20  * Added comparison operators.
21  *
22  * Revision 1.4 2012/12/11 00:13:10 avossen
23  * update of StFgtPoint
24  *
25  * Revision 1.3 2012/03/06 22:28:01 sgliske
26  * asserts removed in StFgtPoint constructor.
27  * Now must check key after constructing
28  *
29  * Revision 1.2 2011/11/01 18:42:57 sgliske
30  * Added ::Clear(Option_t*) and few other missing things to FGT containers
31  *
32  * Revision 1.1 2011/10/31 21:51:30 sgliske
33  * creation: StEvent containers, take 2
34  *
35  *
36  **************************************************************************/
37 #include "StFgtHit.h"
38 #include "StFgtPoint.h"
39 #include "St_base/StMessMgr.h"
40 
41 // constructor
42 StFgtPoint::StFgtPoint( StFgtHit* hit1, StFgtHit* hit2, int key, int rank ) : StHit(), mKey( key ), mRank( rank ) {
43 
44  if( !hit1 || !hit2 ){
45  LOG_ERROR << "Passed null pointer into StFgtPoint::StFgtPoint( StFgtHit* hit1, StFgtHit* hit2, int key )" << endm;
46  mKey = -999;
47  return;
48  };
49 
50  mHitR = mHitPhi = 0;
51  if( hit1->getLayer() == 'R' && hit2->getLayer() == 'P' ){
52  mHitR = hit1;
53  mHitPhi = hit2;
54  } else if ( hit2->getLayer() == 'R' && hit1->getLayer() == 'P' ){
55  mHitR = hit2;
56  mHitPhi = hit1;
57  };
58 
59  if( !mHitR || !mHitPhi ){
60  LOG_ERROR << "Constructor not provided a r/phi pair." << endm;
61  mKey = -999;
62  return;
63  };
64 
65  if( mHitR->getDisc() != mHitPhi->getDisc() ){
66  LOG_ERROR << "Cluster pair are not on the same disc." << endm;
67  mKey = -999;
68  return;
69  };
70 
71  if( mHitR->getQuad() != mHitPhi->getQuad() ){
72  LOG_ERROR << "Cluster pair are not on the same quadrant." << endm;
73  mKey = -999;
74  return;
75  };
76 
77  mHardwarePosition = mHitR->hardwarePosition();
78  mCharge = hit1->charge() + hit2->charge();
79  mChargeAsymmetry=(mHitPhi->charge()-mHitR->charge())/mCharge;
80  mRank=1;
81 };
82 
83 // deconstructor
84 StFgtPoint::~StFgtPoint() {
85  // nothing to do
86 };
87 
88 ClassImp(StFgtPoint);
Definition: StHit.h:125
Represents a point in the FGT.
Definition: StFgtPoint.h:49