StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcA2EMaker.h
1 #ifndef __StEEmcA2EMaker_h__
2 #define __StEEmcA2EMaker_h__
3 
4 #include <StMaker.h>
5 #include <TString.h>
6 #include <vector>
7 
8 #include "StEEmcUtil/EEmcGeom/EEmcGeomDefs.h"
9 #include "StEEmcUtil/EEmcGeom/EEmcGeomSimple.h"
10 
11 #include "StEEmcTower.h"
12 #include "StEEmcStrip.h"
13 
14 class StEEmcDb;
15 
16 class StMuEmcCollection;
17 class StEmcCollection;
18 
19 class StEEmcA2EMaker : public StMaker {
20 public:
21  StEEmcA2EMaker( const Char_t *name="mEEanalysis" );
22  virtual ~StEEmcA2EMaker();
23 
25  virtual Int_t Init();
27  virtual Int_t Make();
29  virtual void Clear(Option_t *opts="");
30 
35  void threshold(Float_t cut, Int_t layer) { mSigmaPed[layer]=cut; }
36 
38  void database(const Char_t * /*dbname*/) { /*mDbName=dbname;*/ } /* obsolete */
39 
43  void source(const Char_t * /*name*/, Int_t /*type*/ = 0) { /*mInputName=name; mInputType=type;*/ } /* obsolete */
44 
49  StEEmcTowerVec_t &towers(Int_t layer=0){ return mHitTowers[layer]; }
50  const StEEmcTowerVec_t &towers(Int_t layer=0) const { return mHitTowers[layer]; }
51 
53  StEEmcStripVec_t &strips(Int_t sec, Int_t pln ){ return mHitStrips[sec][pln]; }
54  const StEEmcStripVec_t &strips(Int_t sec, Int_t pln ) const { return mHitStrips[sec][pln]; }
55 
58  Int_t numberOfHitTowers(Int_t layer) const { return (Int_t)mHitTowers[layer].size(); }
59 
63  StEEmcTower &hittower(Int_t hit, Int_t layer){ return mHitTowers[layer][hit]; }
64  const StEEmcTower &hittower(Int_t hit, Int_t layer) const { return mHitTowers[layer][hit]; }
65 
69  StEEmcTower &tower(Int_t index, Int_t layer=0) { return mTowers[index][layer]; }
70  const StEEmcTower &tower(Int_t index, Int_t layer=0) const { return mTowers[index][layer]; }
71 
77  StEEmcTower &tower(Int_t sector, Int_t subsector, Int_t etabin, Int_t layer=0 ){return tower(index(sector,subsector,etabin),layer);}
78  const StEEmcTower &tower(Int_t sector, Int_t subsector, Int_t etabin, Int_t layer=0) const {return tower(index(sector,subsector,etabin),layer);}
79 
83  StEEmcTower *tower(TVector3 &r, Int_t layer);
84  const StEEmcTower *tower(TVector3 &r, Int_t layer) const;
85 
87  Int_t phibin( Int_t sector, Int_t subsector) const { return sector * 5 + subsector; }
89  Int_t index( Int_t sector, Int_t subsector, Int_t etabin) const { return 12 * phibin(sector, subsector) + etabin; }
90 
91 
94  StEEmcTower &hightower(Int_t layer=0) { return *mHighTower[layer]; }
95  const StEEmcTower &hightower(Int_t layer=0) const { return *mHighTower[layer]; }
96 
100  Int_t numberOfHitStrips(Int_t sector, Int_t plane) const { return (Int_t)mHitStrips[sector][plane].size(); }
101 
106  StEEmcStrip &hitstrip(Int_t sec,Int_t pl, Int_t hit){ return mHitStrips[sec][pl][hit]; }
107  const StEEmcStrip &hitstrip(Int_t sec,Int_t pl, Int_t hit) const { return mHitStrips[sec][pl][hit]; }
108 
113  StEEmcStrip &strip(Int_t sector, Int_t plane, Int_t strip) { return mStrips[sector][plane][strip]; }
114  const StEEmcStrip &strip(Int_t sector, Int_t plane, Int_t strip) const { return mStrips[sector][plane][strip]; }
115 
120  Float_t energy(Int_t sector, Int_t layer) const { return mEnergy[sector][layer]; }
122  Float_t energy(Int_t layer) const;
123 
128  Int_t numberOfHits(Int_t sector, Int_t layer) const { return mHits[sector][layer]; }
129 
132  void scale(Float_t s){ mScale=s; }
133 
134  virtual const char* GetCVS() const
135  {static const char cvs[]="Tag $Name: $ $Id: StEEmcA2EMaker.h,v 1.8 2014/08/06 11:42:59 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs;}
136 
137 protected:
138 
139  Float_t mScale;
140  Float_t mSigmaPed[6];
146 
149  Bool_t readData();
151  Bool_t fillFromMuDst( const StMuEmcCollection *emc );
155  Bool_t fillFromSt( const StEmcCollection *emc );
156 
163  Float_t addTowerHit(Int_t sec, Int_t sub, Int_t eta, Float_t adc, Int_t layer);
169  Float_t addSmdHit(Int_t sec, Int_t plane, Int_t str, Float_t adc );
170 
172  StEEmcTower mTowers[kEEmcNumSectors*kEEmcNumSubSectors*kEEmcNumEtas][4];
174  StEEmcStrip mStrips[kEEmcNumSectors][kEEmcNumSmdUVs][kEEmcNumStrips];
175 
184  std::vector< StEEmcTowerVec_t > mHitTowers;
185 
188  std::vector< std::vector< StEEmcStripVec_t > > mHitStrips;
193 
194 
197  Float_t mEnergy[kEEmcNumSectors][6];
199  Int_t mHits[kEEmcNumSectors][6];
200 
203 
204 };
205 
206 #endif
StEEmcA2EMaker(const Char_t *name="mEEanalysis")
StEEmcTower & tower(Int_t sector, Int_t subsector, Int_t etabin, Int_t layer=0)
Float_t mEnergy[kEEmcNumSectors][6]
EEmc ADC –&gt; energy maker.
Bool_t fillFromMuDst(const StMuEmcCollection *emc)
StEEmcTower & hittower(Int_t hit, Int_t layer)
Float_t addTowerHit(Int_t sec, Int_t sub, Int_t eta, Float_t adc, Int_t layer)
void scale(Float_t s)
StEEmcTower * mHighTower[4]
std::vector< StEEmcTowerVec_t > mHitTowers
Float_t addSmdHit(Int_t sec, Int_t plane, Int_t str, Float_t adc)
Int_t mHits[kEEmcNumSectors][6]
Number of hits in layer.
void source(const Char_t *, Int_t=0)
StEEmcTowerVec_t & towers(Int_t layer=0)
StEEmcStrip mStrips[kEEmcNumSectors][kEEmcNumSmdUVs][kEEmcNumStrips]
Array of 12x2x288 smd strip objects.
StEEmcStrip & strip(Int_t sector, Int_t plane, Int_t strip)
const EEmcGeomSimple * mEEgeom
StEEmcStrip & hitstrip(Int_t sec, Int_t pl, Int_t hit)
Int_t numberOfHitStrips(Int_t sector, Int_t plane) const
Int_t index(Int_t sector, Int_t subsector, Int_t etabin) const
Given tower sector, subsector, etabin, translate into index.
Bool_t fillFromSt(const StEmcCollection *emc)
If StEvent is used, we will fill additional parts of StEEmcElement.
Int_t numberOfHitTowers(Int_t layer) const
Int_t phibin(Int_t sector, Int_t subsector) const
Given tower sector, subsector, translate to phibin.
void threshold(Float_t cut, Int_t layer)
const StEEmcDb * mDbMaker
std::vector< std::vector< StEEmcStripVec_t > > mHitStrips
Float_t energy(Int_t sector, Int_t layer) const
StEEmcStripVec_t & strips(Int_t sec, Int_t pln)
Returns a vector of hit strips, given the sector and plane.
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEEmcTower & hightower(Int_t layer=0)
virtual Int_t Init()
Initialize.
EEMC simple geometry.
ClassDef(StEEmcA2EMaker, 1)
Makes class available to root.
virtual void Clear(Option_t *opts="")
Clear the maker for next event.
StEEmcTower & tower(Int_t index, Int_t layer=0)
Float_t mSigmaPed[6]
StEEmcTower mTowers[kEEmcNumSectors *kEEmcNumSubSectors *kEEmcNumEtas][4]
Array of 720 x 4 tower objects.
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.
virtual Int_t Make()
Read and process one event.
Base class for describing an endcap SMD strip.
Definition: StEEmcStrip.h:8
Int_t numberOfHits(Int_t sector, Int_t layer) const