StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcGenericPointMaker.cxx
1 #include "StEEmcGenericPointMaker.h"
2 
3 #include "TH1F.h"
4 #include "TH2F.h"
5 
7 
8 // ----------------------------------------------------------------------------
9 StEEmcGenericPointMaker::StEEmcGenericPointMaker( const Char_t *name, const StEEmcA2EMaker *a2e, const StEEmcGenericClusterMaker *cl )
10  : StMaker(name)
11 {
12 
13  mEEanalysis=a2e;
14  mEEclusters=cl;
15 
16  mEEtow=new EEmcGeomSimple();
17  mEEsmd=EEmcSmdGeom::instance();
18  mEEmap=EEmcSmdMap::instance();
19 
20  mKey=0;
21 
22 }
23 
24 //----------------------------------------------------------------------------
25 Int_t StEEmcGenericPointMaker::Init()
26 {
27 
28  // hNumberOfPoints=new TH1F("hNumberOfPoints","N points",20,0.,20.);
29  // hEnergyOfPoints=new TH1F("hEnergyOfPoints","Energy spectrum of points",50,0.,25.);
30  // hDistributionOfPoints=new TH2F("hDistributionOfPoints",225,-225,225,225,-225,225);
31  return StMaker::Init();
32 }
33 
34 // ----------------------------------------------------------------------------
36 {
37 
38  return StMaker::Make();
39 }
40 
41 // ----------------------------------------------------------------------------
42 void StEEmcGenericPointMaker::Clear(Option_t *opts)
43 {
45  mKey=0;
46  mPoints.clear();
47  mSmdPoints.clear();
48  mTowerPoints.clear();
49  mPoint2cluster.clear();
50  mCluster2points.clear();
51 }
52 
53 // ----------------------------------------------------------------------------
54 void StEEmcGenericPointMaker::addPoint( const StEEmcPoint &point )
55 {
56  StEEmcPoint p = point;
57  p.key(nextPointId());
58  mPoints.push_back(p);
59 
60 
61  StEEmcClusterVec_t myclusters = p.clusters(0);
62  StEEmcCluster mycluster = myclusters[0];
63  // printf("gen pointmaker adding key=%i E=%5.3f\n",mycluster.key(),mycluster.energy());
64 
65  mPoint2cluster[ p.key() ] = mycluster;
66 
67 
68 
69  // get key to the tower cluster associated with this point
70  Int_t key=mycluster.key();
71  // if it's the first time this key is referenced, add a point vector to the map
72  StEEmcPointVec_t mypoints;
73  if ( !mCluster2points.count(key) ) mCluster2points[ key ] = mypoints;
74  // add this point to the list of points associated with this cluster
75  mCluster2points[ key ].push_back(p);
76 
77 }
78 
79 void StEEmcGenericPointMaker::addSmdPoint( const StEEmcPoint &point )
80 {
81  StEEmcPoint p = point;
82  p.key(nextPointId());
83  mSmdPoints.push_back(p);
84 
85 
86  /**** do not count smd points in maps
87 
88  StEEmcClusterVec_t myclusters = p.clusters(0);
89  StEEmcCluster mycluster = myclusters[0];
90  // printf("gen pointmaker addingsmd key=%i E=%5.3f\n",mycluster.key(),mycluster.energy());
91 
92  mPoint2cluster[ p.key() ] = mycluster;
93 
94  // get key to the tower cluster associated with this point
95  Int_t key=p.clusters(0)[0].key();
96  // if it's the first time this key is referenced, add a point vector to the map
97  StEEmcPointVec_t mypoints;
98  if ( !mCluster2points.count(key) ) mCluster2points[ key ] = mypoints;
99  // add this point to the list of points associated with this cluster
100  mCluster2points[ key ].push_back(p);
101 
102  ****/
103 
104 }
105 
106 void StEEmcGenericPointMaker::addTowerPoint( const StEEmcPoint &point )
107 {
108  StEEmcPoint p = point;
109  p.key(nextPointId());
110  mTowerPoints.push_back(p);
111  mPoint2cluster[ p.key() ] = p.clusters(0)[0];
112 
113  /**** do not count tower points in maps
114 
115  // get key to the tower cluster associated with this point
116  Int_t key=p.clusters(0)[0].key();
117  // if it's the first time this key is referenced, add a point vector to the map
118  StEEmcPointVec_t mypoints;
119  if ( !mCluster2points.count(key) ) mCluster2points[ key ] = mypoints;
120  // add this point to the list of points associated with this cluster
121  mCluster2points[ key ].push_back(p);
122 
123  ****/
124 
125 }
126 
127 // ----------------------------------------------------------------------------
128 StEEmcPointVec_t StEEmcGenericPointMaker::buildPoints( const StEEmcClusterVec_t &tower, const StEEmcSmdClusterVec_t &smdu, const StEEmcSmdClusterVec_t &smdv )
129 {
130  StEEmcPointVec_t points;
131  return points;
132 }
133 
134 // ----------------------------------------------------------------------------
135 StEEmcPointVec_t StEEmcGenericPointMaker::buildSmdPoints( Int_t sector, const StEEmcSmdClusterVec_t &u, const StEEmcSmdClusterVec_t &v)
136 {
137  StEEmcPointVec_t points;
138  return points;
139 }
140 
141 // ----------------------------------------------------------------------------
142 StEEmcPointVec_t StEEmcGenericPointMaker::buildTowerPoints(Int_t sector, const StEEmcClusterVec_t &c )
143 {
144  StEEmcPointVec_t points;
145  return points;
146 }
147 
148 // ----------------------------------------------------------------------------
149 void StEEmcGenericPointMaker::fillStEvent()
150 {
151 
152 }
EEmc ADC –> energy maker.
Base class for representing EEMC points.
Definition: StEEmcPoint.h:24
StEEmcPointVec_t buildSmdPoints(Int_t sector, const StEEmcSmdClusterVec_t &u, const StEEmcSmdClusterVec_t &v)
StEEmcGenericClusterMaker * mEEclusters
StEEmcA2EMaker * mEEanalysis
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StMaker.cxx:634
StEEmcPointVec_t buildPoints(const StEEmcClusterVec_t &towerClusters, const StEEmcSmdClusterVec_t &u, const StEEmcSmdClusterVec_t &v)
StEEmcPointVec_t buildTowerPoints(Int_t sector, const StEEmcClusterVec_t &c)
virtual Int_t Make()
Definition: StMaker.cxx:898
EEMC simple geometry.
virtual void Clear(Option_t *opts="")
User defined functions.
StEEmcPointVec_t & points()
Return vector of EEmc points.
A base class for describing clusters of EEMC towers.
Definition: StEEmcCluster.h:50
StEEmcPoint & point(Int_t ipoint)
StEEmcClusterVec_t & clusters(Int_t layer)
Returns tower clusters for the specified layer 0=T, 1=P, 2=Q, 3=R, 4+=crash.
Definition: StEEmcPoint.h:53