StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsCollection.h
1 /***************************************************************************
2  *
3  * $Id: StFmsCollection.h,v 2.9 2019/06/25 15:56:33 ullrich Exp $
4  *
5  * Author: Jingguo Ma, Dec 2009
6  ***************************************************************************
7  *
8  * Description:
9  * Collection of all hits (towers), clusters and points (photons) in the FMS.
10  * This collection owns all these objects, and is itself owned by StEvent.
11  * It is therefore vital to *not* delete any of the objects stored in this
12  * container yourself - the collection will handle freeing memory.
13  * Similarly, any object added to the collection via an add() method must be
14  * allocated with new, and not be owned anywhere else.
15  *
16  ***************************************************************************
17  *
18  * $Log: StFmsCollection.h,v $
19  * Revision 2.9 2019/06/25 15:56:33 ullrich
20  * FMS shower shape scaling in StFmsCollection (Akio)
21  *
22  * Revision 2.8 2015/11/05 19:00:39 ullrich
23  * Added 4 new inline functions.
24  *
25  * Revision 2.7 2015/10/21 14:53:59 ullrich
26  * Added new member and methods.
27  *
28  * Revision 2.6 2015/09/14 16:59:53 ullrich
29  * Added StFmsPointPair collection.
30  *
31  * Revision 2.5 2015/09/01 21:01:47 ullrich
32  * Minor changes to format of print statments and \nchange to naming of data member.
33  *
34  * Revision 2.4 2015/09/01 18:29:01 ullrich
35  * Changes due to adding StFpsSlat and interconnection between slats and points.
36  *
37  * Revision 2.3 2015/08/26 16:51:59 ullrich
38  * Added print out fct and operator.
39  *
40  * Revision 2.2 2015/02/14 18:57:25 ullrich
41  * Big upgrade after adding StFmPoint and StFmsCluster.
42  *
43  * Revision 2.1 2010/01/08 22:42:31 ullrich
44  * Initial Revision.
45  *
46  **************************************************************************/
47 #ifndef StFmsCollection_hh
48 #define StFmsCollection_hh
49 
50 #include "Stiostream.h"
51 #include "StObject.h"
52 #include "StContainers.h"
53 
54 class StFmsHit;
55 class StFmsCluster;
56 class StFmsPoint;
57 class StFmsPointPair;
58 class StFpsSlat;
59 
60 class StFmsCollection : public StObject {
61 public:
63  ~StFmsCollection();
64 
65  void addHit(StFmsHit*); // Add a hit to the collection
66  void addCluster(StFmsCluster*); // Add a cluster to the collection
67  void addPoint(StFmsPoint*); // Add a point to the collection
68 
69  unsigned int numberOfHits() const; // Return the number of hits in the collection
70  unsigned int numberOfClusters() const; // Return the number of clusters in the collection
71  unsigned int numberOfPoints() const; // Return the number of points in the collection
72 
73  StSPtrVecFmsHit& hits(); // Return the hit list
74  const StSPtrVecFmsHit& hits() const;
75 
76  StSPtrVecFmsCluster& clusters(); // Return the cluster list
77  const StSPtrVecFmsCluster& clusters() const;
78 
79  StSPtrVecFmsPoint& points(); // Return the point list
80  const StSPtrVecFmsPoint& points() const;
81 
82  int fmsReconstructionFlag() const;
83  int isMergeSmallToLarge() const;
84  int isGlobalRefit() const;
85  int isTry1PhotonFit() const;
86  int isNewClusterCategorization() const;
87  int isScaleShowerShape() const;
88  float scaleShowerShapeLarge() const;
89  float scaleShowerShapeSmall() const;
90  void setFmsReconstructionFlag(int v);
91  void setMergeSmallToLarge(int v);
92  void setGlobalRefit(int v);
93  void setTry1PhotonFit(int v);
94  void setNewClusterCategorization(int v);
95  void setScaleShowerShape(int v);
96  void setScaleShowerShape(float l, float s);
97 
98  void fillFpsSlat(); //update FPS slat info based on FMS hits
99  void fillFpsAssociation(); //update FPS-FMS association info based on FMS points
100  StSPtrVecFpsSlat& fpsSlats(); //Return the fps slats array
101  StFpsSlat* fps(int slatid); //return FPS slat for a given slatid
102 
103  void fillFmsPointPair();
104  unsigned int numberOfPointPairs();
105  vector<StFmsPointPair*>& pointPairs();
106  vector<StFmsPointPair*>& pointPairsEnergySorted();
107  vector<StFmsPointPair*>& pointPairsETSorted();
108  vector<StFmsPointPair*>& pointPairsPi0MassSorted();
109 
110  void sortPointsByEnergy();
111  void sortPointsByET();
112 
113  void print(int option=1);
114 
115 private:
116  StSPtrVecFmsHit mHits; // Owns all FMS hits
117  StSPtrVecFmsCluster mClusters; // Owns all FMS clusters
118  StSPtrVecFmsPoint mPoints; // Owns all FMS points (photons)
119  StSPtrVecFpsSlat mFpsSlats;
120 
121  vector<StFmsPointPair*> mPointPairs;
122  vector<StFmsPointPair*> mPointPairsEnergySorted;
123  vector<StFmsPointPair*> mPointPairsETSorted;
124  vector<StFmsPointPair*> mPointPairsPi0MassSorted;
125 
126  Int_t mFmsReconstructionFlag; // LSB=(0=small/large separately, 1=merge small cell to large)
127  // 2nd LSB=(0=No global refit, 1=performe global refit)
128  // 3rd LSB=(0=No 1photon fit retry, 1=performe 1 photon fit if 2 photon fit is bad)
129  Float_t mScaleShowerShapeLarge=1.0;
130  Float_t mScaleShowerShapeSmall=1.0;
131 
132 
133  bool mFpsSlatFilled;
134  bool mFpsAssociationFilled;
135  bool mFmsPointPairFilled;
136 
137  ClassDef(StFmsCollection, 4)
138 };
139 
140 inline int StFmsCollection::fmsReconstructionFlag() const {return mFmsReconstructionFlag;}
141 inline int StFmsCollection::isMergeSmallToLarge() const {return (mFmsReconstructionFlag & 0x1);}
142 inline int StFmsCollection::isGlobalRefit() const {return ((mFmsReconstructionFlag & 0x2)>>1);}
143 inline int StFmsCollection::isTry1PhotonFit() const {return ((mFmsReconstructionFlag & 0x4)>>2);}
144 inline int StFmsCollection::isNewClusterCategorization() const {return ((mFmsReconstructionFlag & 0x8)>>3);}
145 inline int StFmsCollection::isScaleShowerShape() const {return ((mFmsReconstructionFlag & 0x10)>>4);}
146 inline float StFmsCollection::scaleShowerShapeLarge() const {return mScaleShowerShapeLarge;}
147 inline float StFmsCollection::scaleShowerShapeSmall() const {return mScaleShowerShapeSmall;}
148 inline void StFmsCollection::setFmsReconstructionFlag(int v) {mFmsReconstructionFlag=v;}
149 inline void StFmsCollection::setMergeSmallToLarge(int v) {mFmsReconstructionFlag=(mFmsReconstructionFlag & 0xfffffe) | (v & 0x1); }
150 inline void StFmsCollection::setGlobalRefit(int v) {mFmsReconstructionFlag=(mFmsReconstructionFlag & 0xfffffd) | (v & 0x1)<<1;}
151 inline void StFmsCollection::setTry1PhotonFit(int v) {mFmsReconstructionFlag=(mFmsReconstructionFlag & 0xfffffb) | (v & 0x1)<<2;}
152 inline void StFmsCollection::setNewClusterCategorization(int v) {mFmsReconstructionFlag=(mFmsReconstructionFlag & 0xfffff7) | (v & 0x1)<<3;}
153 inline void StFmsCollection::setScaleShowerShape(int v) {mFmsReconstructionFlag=(mFmsReconstructionFlag & 0xffffef) | (v & 0x1)<<4;}
154 inline void StFmsCollection::setScaleShowerShape(float l, float s) {mScaleShowerShapeLarge=l; mScaleShowerShapeSmall=s;};
155 #endif