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 class StMuDstMaker;
16 class StEventMaker;
17 
18 class StMuEmcCollection;
19 class StEmcCollection;
20 
21 class StEEmcA2EMaker : public StMaker {
22 
23  public:
24 
25  StEEmcA2EMaker( const Char_t *name="mEEanalysis" );
26  ~StEEmcA2EMaker(){ /* nada */ };
27 
28  Int_t Init();
29  Int_t Make();
30  void Clear(Option_t *opts="");
31 
35  void threshold( Float_t cut, Int_t layer );
36 
38  void database( const Char_t *dbname );
39 
45  void source( const Char_t *name, Int_t type=0 );
46 
51  StEEmcTowerVec_t towers(Int_t layer=0){ return mHitTowers[layer]; }
52 
54  StEEmcStripVec_t strips(Int_t sec, Int_t pln ){ return mHitStrips[sec][pln]; }
55 
58  Int_t numberOfHitTowers(Int_t layer) { return (Int_t)mHitTowers[layer].size(); }
59 
63  StEEmcTower hittower( Int_t hit, Int_t layer ){ return mHitTowers[layer][hit]; }
64 
68  StEEmcTower tower(Int_t index, Int_t layer=0) { return mTowers[index][layer]; }
69 
75  StEEmcTower tower(Int_t sector, Int_t subsector, Int_t etabin, Int_t layer=0){return tower(index(sector,subsector,etabin),layer);}
76 
80  StEEmcTower *tower( TVector3 &r, Int_t layer );
81 
83  Int_t phibin( Int_t sector, Int_t subsector ) { return sector * 5 + subsector; }
85  Int_t index( Int_t sector, Int_t subsector, Int_t etabin ) { return 12 * phibin(sector, subsector) + etabin; }
86 
87 
90  StEEmcTower hightower(Int_t layer=0);
91 
95  Int_t numberOfHitStrips(Int_t sector, Int_t plane ) { return (Int_t)mHitStrips[sector][plane].size(); }
96 
97  StEEmcStrip hitstrip(Int_t sec,Int_t pl, Int_t hit){ return (mHitStrips[sec][pl])[hit]; }
98 
103  StEEmcStrip strip(Int_t sector, Int_t plane, Int_t strip) { return mStrips[sector][plane][strip]; }
104 
109  Float_t energy(Int_t sec, Int_t layer) { return mEnergy[sec][layer]; }
111  Float_t energy(Int_t layer);
112 
117  Int_t numberOfHits(Int_t sec, Int_t layer){ return mHits[sec][layer]; }
118 
121  void scale(Float_t s){ mScale=s; }
122 
123  private:
124  protected:
125 
126  Float_t mScale;
127  Float_t mSigmaPed[6]; // cut nsigma > ped for [0-5]=[TPQRUV]
128  TString mDbName;
129  TString mInputName;
130  Int_t mInputType;
131 
133  StMuDstMaker *mMuDstMaker;
134  StEventMaker *mEventMaker;
135 
137 
140  Bool_t readData();
141  Bool_t readMuDst(); // 0
142  Bool_t readStEvent(); // 1 (not implemented)
143  Bool_t readEzt(); // 2 (not implemented)
144 
147  Bool_t fillFromMuDst( StMuEmcCollection *emc );
149  Bool_t fillFromSt( StEmcCollection *emc );
150 
151 
152 
153  void addTowerHit(Int_t sec, Int_t sub, Int_t eta, Float_t adc, Int_t layer);
154  void addSmdHit(Int_t sec, Int_t plane, Int_t str, Float_t adc );
155 
157  StEEmcTower mTowers[kEEmcNumSectors*kEEmcNumSubSectors*kEEmcNumEtas][4];
158  StEEmcStrip mStrips[kEEmcNumSectors][kEEmcNumSmdUVs][kEEmcNumStrips];
159 
168  std::vector< StEEmcTowerVec_t > mHitTowers;
169 
171 
176  std::vector< std::vector< StEEmcStripVec_t > > mHitStrips;
177 
178 
181  Float_t mEnergy[kEEmcNumSectors][6];
182  Int_t mHits[kEEmcNumSectors][6];
183 
185 
186 };
187 
188 inline void StEEmcA2EMaker::threshold(Float_t c, Int_t l){ mSigmaPed[l]=c; }
189 inline void StEEmcA2EMaker::database(const Char_t *name){ mDbName=name; }
190 inline void StEEmcA2EMaker::source(const Char_t *name, Int_t type){ mInputName=name; mInputType=type; }
191 
192 inline StEEmcTower StEEmcA2EMaker::hightower(Int_t layer){ return *mHighTower[layer]; }
193 
194 
195 #endif
Float_t energy(Int_t sec, Int_t layer)
StEEmcA2EMaker(const Char_t *name="mEEanalysis")
Float_t mEnergy[kEEmcNumSectors][6]
EEmc ADC –&gt; energy maker.
Bool_t fillFromMuDst(const StMuEmcCollection *emc)
StEEmcStripVec_t strips(Int_t sec, Int_t pln)
Returns a vector of hit strips, given the sector and plane.
Int_t phibin(Int_t sector, Int_t subsector)
Given tower sector, subsector, translate to phibin.
Float_t addTowerHit(Int_t sec, Int_t sub, Int_t eta, Float_t adc, Int_t layer)
void scale(Float_t s)
StEEmcStrip strip(Int_t sector, Int_t plane, Int_t strip)
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)
StEEmcStrip mStrips[kEEmcNumSectors][kEEmcNumSmdUVs][kEEmcNumStrips]
Array of 12x2x288 smd strip objects.
StEEmcTowerVec_t towers(Int_t layer=0)
StEEmcStrip & strip(Int_t sector, Int_t plane, Int_t strip)
StEEmcTower hittower(Int_t hit, Int_t layer)
const EEmcGeomSimple * mEEgeom
StEEmcStrip & hitstrip(Int_t sec, Int_t pl, Int_t hit)
Int_t numberOfHitStrips(Int_t sector, Int_t plane)
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 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
Int_t index(Int_t sector, Int_t subsector, Int_t etabin)
Given tower sector, subsector, etabin, translate into index.
Base class for representing tower, preshower and postshower elements.
Definition: StEEmcTower.h:11
StEEmcTower & hightower(Int_t layer=0)
StEEmcTower tower(Int_t sector, Int_t subsector, Int_t etabin, 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.
Int_t numberOfHitTowers(Int_t layer)
void database(const Char_t *)
Set the name of the EEMC database, init obtains pointer.
StEEmcTower tower(Int_t index, Int_t layer=0)
virtual Int_t Make()
Read and process one event.
Int_t numberOfHits(Int_t sec, Int_t layer)
Base class for describing an endcap SMD strip.
Definition: StEEmcStrip.h:8