StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMCTruth.h
1 /***************************************************************************
2  *
3  * $Id: StMCTruth.h,v 1.3 2009/12/17 08:37:26 fisyak Exp $
4  *
5  * Author: Victor Perev, Jun 2005
6  ***************************************************************************
7  *
8  * Description:
9  *
10  ***************************************************************************
11  *
12  * $Log: StMCTruth.h,v $
13  * Revision 1.3 2009/12/17 08:37:26 fisyak
14  * account signature change snce root 5.24
15  *
16  * Revision 1.2 2005/09/09 21:42:03 perev
17  * Method Size() added
18  *
19  * Revision 1.1 2005/07/19 22:40:32 perev
20  * IdTruth classes
21  *
22  *
23  **************************************************************************/
24 #ifndef ST_MCTRUTH_H
25 #define ST_MCTRUTH_H
26 #include "Rtypes.h"
27 #if ROOT_VERSION_CODE <= 333312 /* ROOT_VERSION(5,22,0) */
28 typedef Long_t LongKey_t;
29 #else
30 typedef Long64_t LongKey_t;
31 #endif
32 struct StMCTruth {
33  StMCTruth(int id,int wt) {trackId=(short)id; trackWt=(short)wt;}
34  StMCTruth(int word=0) {*this=word;}
35 StMCTruth &operator=(int word);
36  operator int() const; //conversion to int
37 
38  short trackId; // Geant track id
39  short trackWt; // The contrubution or weight to signal (in promille)
40 
41 };
42 
43 
45 public:
46  StMCPivotTruth(int normInput=0);
47  void Reset() {fN=0;}
48  void Add(int trackId, double wt);
49  void Add(StMCTruth Id,double wt);
50  void Add(StMCTruth Id);
51  int Size() const {return fN;}
52  StMCTruth Get(int byCount=0) const;
53 private:
54  enum {HOWMANY=20};
55 int fN;
56 int fNorm;
57 int mTrackIds[HOWMANY];
58 float mTrackWts[HOWMANY];
59 float mTrackNum[HOWMANY];
60 int qwe;
61 };
62 
63 class TExMap;
64 class TExMapIter;
66 
67 public:
68  StMCPivotTruthMap(int normInput=0);
70 //void Reset();
71  void Add(LongKey_t token, int trackId, double wt);
72  void Add(LongKey_t token, StMCTruth truth);
73  StMCTruth Get(LongKey_t token,int byCount=0) const;
74  StMCTruth Iter(LongKey_t &token) const; //token=-1 to start iteration
75  //token=-1 at the end of iteration
76 private:
77 int fNorm;
78 TExMap *fMap;
79 mutable TExMapIter *fIter;
80 };
81 
82 
83 
84 
85 #endif