StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFpsSlat.cxx
1 /***************************************************************************
2  *
3  * $Id: StFpsSlat.cxx,v 2.1 2015/09/01 18:26:45 ullrich Exp $
4  *
5  * Author: Akio Ogawa, Sep 2015
6  ***************************************************************************
7  *
8  * Description: StFpsSlat is data for individual slat
9  *
10  ***************************************************************************
11  *
12  * $Log: StFpsSlat.cxx,v $
13  * Revision 2.1 2015/09/01 18:26:45 ullrich
14  * Initial Revision.
15  *
16  **************************************************************************/
17 #include "StFpsSlat.h"
18 #include "StFmsPoint.h"
19 
20 ClassImp(StFpsSlat)
21 
22 StFpsSlat::StFpsSlat() : mSlatId(-1), mMip(0.0)
23 {
24  memset(mNPoint, 0, sizeof(mNPoint));
25 }
26 
27 StFpsSlat::StFpsSlat(int slatid, float mip) : mSlatId(slatid), mMip(mip)
28 {
29  memset(mNPoint,0,sizeof(mNPoint));
30 }
31 
32 StFpsSlat::~StFpsSlat() {/* no op */}
33 
34 StPtrVecFmsPoint& StFpsSlat::point(int type) {
35  switch(type) {
36  case 0:
37  return mPoint1;
38  case 1:
39  return mPoint2;
40  case 2:
41  return mPoint3;
42  case 3:
43  return mPoint4;
44  default:
45  return mPoint1;
46  }
47 }
48 
49 const StPtrVecFmsPoint& StFpsSlat::point(int type) const {
50  switch(type) {
51  case 0:
52  return mPoint1;
53  case 1:
54  return mPoint2;
55  case 2:
56  return mPoint3;
57  case 3:
58  return mPoint4;
59  default:
60  return mPoint1;
61  }
62 }
63 
64 void StFpsSlat::addPoint(StFmsPoint* point, Int_t type){
65  switch(type){
66  case 0:
67  mPoint1.push_back(point); break;
68  case 1:
69  mPoint2.push_back(point); break;
70  case 2:
71  mPoint3.push_back(point); break;
72  case 3:
73  mPoint4.push_back(point); break;
74  default:
75  return;
76  }
77  mNPoint[type]++;
78  mNPoint[kFpsNCandidate]++;
79 }
80 
81 void StFpsSlat::print(int option) const {
82  if(option==0 && mNPoint[0]==0 && mNPoint[1]==0) return;
83  if(option==1 && mMip<0.5 && mNPoint[0]==0 && mNPoint[1]==0) return;
84  int slat=mSlatId%21+1;
85  int layer=(mSlatId/21)%3+1;
86  int quad=(mSlatId/21/3)+1;
87  cout << Form("StFpsSlat Id=%3d Q%1dL%1dS%02d Mip=%6.2f Npoint=%2d/%2d/%2d/%2d=%2d ",
88  mSlatId,quad,layer,slat,mMip,mNPoint[0],mNPoint[1],mNPoint[2],mNPoint[3],mNPoint[4]);
89  if(mNPoint[0]>0) {
90  cout << "1st=";
91  for(unsigned int i=0; i<mNPoint[0]; i++){ cout << Form("%d(%4.1f) ",mPoint1[i]->id(),mPoint1[i]->fpsDistance(layer,0));}
92  }
93  if(mNPoint[1]>0){
94  cout << "2nd=";
95  for(unsigned int i=0; i<mNPoint[1]; i++){ cout << Form("%d(%4.1f) ",mPoint2[i]->id(),mPoint2[i]->fpsDistance(layer,1));}
96  }
97  if(mNPoint[2]>0){
98  cout << "3rd=";
99  for(unsigned int i=0; i<mNPoint[2]; i++){ cout << Form("%d(%4.1f) ",mPoint3[i]->id(),mPoint3[i]->fpsDistance(layer,2));}
100  }
101  if(mNPoint[3]>0){
102  cout << "4th=";
103  for(unsigned int i=0; i<mNPoint[3]; i++){ cout << Form("%d(%4.1f) ",mPoint4[i]->id(),mPoint4[i]->fpsDistance(layer,3));}
104  }
105  cout << endl;
106 }
StPtrVecFmsPoint mPoint4
3rd closest points
Definition: StFpsSlat.h:54
StPtrVecFmsPoint mPoint1
0 for closest, 1/2/3 for 2nd/3rd/4th closest, 5 for either
Definition: StFpsSlat.h:51
StPtrVecFmsPoint mPoint3
2nd closest points
Definition: StFpsSlat.h:53
StPtrVecFmsPoint mPoint2
closest points
Definition: StFpsSlat.h:52