StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcRawMapMaker.h
1 /***************************************************************************
2  *
3  * $Id: StEEmcRawMapMaker.h,v 1.3 2012/05/09 21:11:58 sgliske Exp $
4  * Author: S. Gliske, April 2012
5  *
6  ***************************************************************************
7  *
8  * Description: Make a lookup table of ADC values and pedestals for
9  * the endcap preshowers, towers, and postshowers. Much of the input
10  * code is borrowed from StEEmcA2EMaker.
11  *
12  ***************************************************************************
13  *
14  * $Log: StEEmcRawMapMaker.h,v $
15  * Revision 1.3 2012/05/09 21:11:58 sgliske
16  * updates
17  *
18  * Revision 1.2 2012/04/13 15:08:43 sgliske
19  * updates
20  *
21  * Revision 1.1 2012/04/12 17:11:16 sgliske
22  * creation
23  *
24  *
25  **************************************************************************/
26 
27 #ifndef _StEEmcRawMapMaker_H_
28 #define _StEEmcRawMapMaker_H_
29 
30 #include "StMaker.h"
31 #include <map>
32 #include <string>
33 
34 class StEEmcDb;
35 
37  Int_t rawAdc, fail, stat;
38  Float_t ped, pedSigma, gain;
39 
40  StEEmcRawMapData() : rawAdc(-1), fail(1), stat(1), ped(-1), pedSigma(1000), gain(-1) { /* */ };
41 };
42 
43 typedef std::map< Int_t, StEEmcRawMapData > StEEmcRawMap;
44 
45 class StEEmcRawMapMaker : public StMaker {
46  public:
47  // constructors
48  StEEmcRawMapMaker( const Char_t* name = "EEmcRawMapMaker" );
49 
50  // deconstructor
51  virtual ~StEEmcRawMapMaker();
52 
53  // default equals operator and copy constructor OK
54  virtual Int_t Init();
55  virtual Int_t Make();
56  virtual void Clear( Option_t *opt = "");
57 
58  Int_t setInput( const Char_t *name, Int_t type ); // type = 0 is StEvent, type == 1 is MuDst
59 
60  const StEEmcRawMap& getMap( Int_t layer );
61 
62  protected:
63  enum layer_t { TOWER, PRE1, PRE2, POST, ESMD };
64 
65  Int_t mInputType;
66  std::string mInputName, mDbName;
67  const StEEmcDb *mEEmcDb;
68 
69  Int_t loadFromMuDst();
70  Int_t loadFromStEvent();
71  void addHitTower( Int_t sec, Int_t sub, Int_t eta, Int_t adc, Int_t layer );
72  void addHitStrip( Int_t sec, Bool_t layerIsV, Int_t strip, Int_t adc );
73 
74  StEEmcRawMap mMap[5]; // one for each layer+SMD
75 
76  private:
77  ClassDef(StEEmcRawMapMaker,1);
78 
79 };
80 
81 // inline
82 inline const StEEmcRawMap& StEEmcRawMapMaker::getMap( Int_t layer ){ return mMap[ (layer>0&&layer<5) ? layer : 0 ]; };
83 
84 
85 #endif
virtual void Clear(Option_t *opt="")
User defined functions.
virtual Int_t Make()