StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructCentrality.h
1 /**********************************************************************
2  *
3  * $Id: StEStructCentrality.h,v 1.8 2010/03/02 21:47:18 prindle Exp $
4  *
5  * Author: Jeff Porter
6  *
7  **********************************************************************
8  *
9  * Description: allows run-time definition of event class centrality
10  * this used to be persistent with dst...
11  *
12  ***********************************************************************/
13 #ifndef __STESTRUCTCENTRALITY_H
14 #define __STESTRUCTCENTRALITY_H
15 
16 #include "TROOT.h"
17 
18 enum StEStructCentType { ESNTracks=0, ESGenImpact }; // may be others from generators...
19 
21 
22  double mValue;
23  double *mcentralities;
24  int mnumCentralities;
25  double *mpts, *mptcents;
26  int mnumpts, mnumptcents;
27  int warningCount;
28 
29  StEStructCentType mCentType;
30 
31  static StEStructCentrality* mInstance;
32  StEStructCentrality(): mcentralities(0), mnumCentralities(0), mpts(0), mptcents(0),mnumpts(0), mnumptcents(0), warningCount(0), mCentType(ESNTracks) {};
33 
34  public:
35 
36  static StEStructCentrality* Instance();
37 
38  virtual ~StEStructCentrality();
39 
40  double minCentrality(int id);
41  double maxCentrality(int id);
42 
43  int centrality( double impact );
44  double GetCentValue();
45  int ptIndex(const double pt);
46  int ptCentrality(const double cent);
47 
48  void setCentralities( const double* centralities, const int num );
49  void setPtLimit( const int index, double pt );
50  int numCentralities();
51  double centralityLimit( const int index );
52 
53  void setPts( const double* ptRange, const int numPt,
54  const double* centRange, const int numPtCent );
55  int numPts();
56  int numPtCentralities();
57  double ptLimit( const int ptIndex );
58  double ptCentralityLimit( const int ptCent );
59 
60  void setCentTypeNTracks();
61  void setCentTypeImpact();
62 
63  void Print();
64 
65  StEStructCentType getCentType();
66 
67  ClassDef(StEStructCentrality,1)
68 };
69 
70 
71 
72 inline double StEStructCentrality::GetCentValue() {
73  return mValue;
74 }
75 
76 inline double StEStructCentrality::minCentrality(int id){
77  if(mcentralities && id>=0 && id<mnumCentralities ) return mcentralities[id];
78  return -1;
79 }
80 
81 inline double StEStructCentrality::maxCentrality(int id){
82  if(mcentralities && id>=0 && id<(mnumCentralities-1) ) return mcentralities[id+1]-1;
83  return -1;
84 }
85 
86 
87 inline void StEStructCentrality::setCentTypeNTracks() { mCentType=ESNTracks ;};
88 inline void StEStructCentrality::setCentTypeImpact() { mCentType=ESGenImpact;};
89 inline StEStructCentType StEStructCentrality::getCentType(){ return mCentType;};
90 
91 #endif
92 
93 /***********************************************************************
94  *
95  * $Log: StEStructCentrality.h,v $
96  * Revision 1.8 2010/03/02 21:47:18 prindle
97  * Support to retrieve track radius when it crosses endplate
98  * Add way to retrieve centrality
99  *
100  * Revision 1.7 2007/01/26 17:19:50 msd
101  * Added Print function.
102  *
103  * Revision 1.6 2006/04/04 22:12:29 porter
104  * Set up StEtructCentrality for use in event cut selection - includes impact para for generators
105  *
106  * Revision 1.5 2004/09/24 01:46:45 prindle
107  * Added call for setPtLimit. I use this in fluctuations which prevented
108  * a fresh CVS checkout from compiling
109  *
110  * Revision 1.4 2004/06/25 03:13:41 porter
111  * updated centrality methods and put a test in StEStructEvent.cxx
112  *
113  * Revision 1.3 2004/06/09 22:39:09 prindle
114  * Expanded centrality class.
115  * Call to set centrality from event reader.
116  *
117  *
118  * CVS :nded ----------------------------------------------------------------------
119  *
120  * Revision 1.2 2004/02/27 02:28:03 prindle
121  *
122  * Small modification to StEStructCentrality in EventMaker branch.
123  * Many modifications to Fluctuations branch, although that branch is not
124  * stable yet.
125  *
126  * Revision 1.1 2003/10/15 18:20:51 porter
127  * initial check in of Estruct Analysis maker codes.
128  *
129  *
130  *********************************************************************/
131 
132