StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcHitCollection.h
1 // $Id: StEmcHitCollection.h,v 1.10 2007/04/28 17:56:04 perev Exp $
2 // $Log: StEmcHitCollection.h,v $
3 // Revision 1.10 2007/04/28 17:56:04 perev
4 // Redundant StChain.h removed
5 //
6 // Revision 1.9 2003/01/23 03:50:04 jeromel
7 // Include changed
8 //
9 // Revision 1.8 2001/04/23 21:58:09 pavlinov
10 // Change StEmcGeom.h to StEmcUtil/StEmcGeom.h
11 //
12 // Revision 1.7 1999/09/24 01:23:38 fisyak
13 // Reduced Include Path
14 //
15 // Revision 1.6 1999/09/17 21:28:40 fisyak
16 // remove St_db_Maker.h
17 //
18 // Revision 1.5 1999/09/08 00:25:32 fisyak
19 // Add tables/ for table includes
20 //
21 // Revision 1.4 1999/07/16 18:04:08 pavlinov
22 // Little correction for StEclMake
23 //
24 // Revision 1.3 1999/07/02 03:01:56 pavlinov
25 // Little corrections for Linux
26 //
27 // Revision 1.2 1999/07/01 16:17:57 pavlinov
28 // class StEmcGeom was created and maker was remade for new maker scheme
29 //
30 // Revision 1.1 1999/02/12 19:15:39 akio
31 // *** empty log message ***
32 //
33 // Revision 1.1 1998/12/15 22:39:55 akio
34 // Add emc_hit object and adc_to_energy in here.
35 //
36 #ifndef STAR_StEmcHitCollection
37 #define STAR_StEmcHitCollection
38 #include "St_DataSet.h"
39 #include "St_DataSetIter.h"
40 #include "St_Table.h"
41 #include "St_TableSorter.h"
42 #include "StMaker.h"
43 #include "StEmcUtil/geometry/StEmcGeom.h"
44 #include "TArrayS.h"
45 #include "TArrayF.h"
46 #include "TArrayI.h"
47 #include "tables/St_emc_hits_Table.h"
48 #include "tables/St_emc_pedestal_Table.h"
49 #include "tables/St_emc_adcslope_Table.h"
50 #include "tables/St_emc_calib_header_Table.h"
51 //
52 //#include <vector>
53 //#include "StEmcHit.hh"
54 //#include "StEmcTowerHitCollection.hh"
56 // //
57 // StEmcHitCollection class for <FONT COLOR="RED">EMc Calibrated Hit</FONT> //
58 // //
60 class StEmcHitCollection : public St_DataSet , public StEmcGeom {
61 private:
62 
63  St_DataSet *mEmcCalib;
64 
65  Int_t mNHit;
66  TArrayS mId; // Id and Energy are the
67  TArrayF mEnergy; // hits collection !!!!
68 
69  Float_t mEnergySum;
70  Float_t mEtSum;
71 
72  // Service information
73  Int_t mModule; // Number of modules with information
74  TArrayS mNumsModule; // Numbers of modules
75  TArrayS mIndexFirstLast; // First and last index of hits for modules
76 
77  Int_t ADCtoEnergy(St_emc_hits*); // Get ADC from emc_hits and fill energy
78 protected:
79 public:
80  StEmcHitCollection(); // For comfort
81  StEmcHitCollection(const Char_t* );
82  virtual ~StEmcHitCollection();
83 
84  Int_t NHit() const;
85  Float_t EnergySum() const;
86  Float_t EtSum() const;
87  Float_t HitEnergy(Int_t );
88  Int_t HitId(Int_t );
89  TArrayF* Energy();
90  TArrayS* Id();
91 
92  Int_t Module();
93  TArrayS* NumsModule();
94  TArrayS* IndexFirstLast();
95 
96  void setEmcCalib(St_DataSet *var);
97  St_emc_hits *copyToTable(const Char_t*); // Create emc_hit table and copy hits; ??
98  void printHits(Int_t n=10, Int_t start=0); // *MENU*
99  void printHitsAll(); // *MENU*
100  void Browse(TBrowser *b); // browser
101  //virtual Long_t HasData() const {return 1;} // Non zero means it has data;
102  //virtual Bool_t IsFolder() {return kFALSE;} // KTRUE means it is directory;
103  void printNameTable();
104 
105  Int_t fill(St_emc_hits*); // Fill energy from ADC table
106  ClassDef(StEmcHitCollection,1) // Standard Root macro;
107 };
108 
109  inline void StEmcHitCollection::setEmcCalib(St_DataSet *var) {mEmcCalib = var;}
110 
111  inline Int_t StEmcHitCollection::NHit() const {return mNHit;}
112  inline Float_t StEmcHitCollection::EnergySum() const {return mEnergySum;}
113  inline Float_t StEmcHitCollection::EtSum() const {return mEtSum;}
114 
115  inline Float_t StEmcHitCollection::HitEnergy(Int_t i) {return mEnergy[i];}
116  inline Int_t StEmcHitCollection::HitId(Int_t i) { return mId[i];}
117  inline TArrayF* StEmcHitCollection::Energy() {return &mEnergy;}
118  inline TArrayS* StEmcHitCollection::Id() {return &mId;}
119 
120  inline Int_t StEmcHitCollection::Module() {return mModule;}
121  inline TArrayS* StEmcHitCollection::NumsModule() {return &mNumsModule;}
122  inline TArrayS* StEmcHitCollection::IndexFirstLast() {return &mIndexFirstLast;}
123 #endif
void Browse(TBrowser *b)
Browse this dataset (called by TBrowser).