StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcAssociationMaker.h
1 
104 #ifndef STAR_StEEmcAssociationMaker_HH
105 #define STAR_StEEmcAssociationMaker_HH
106 
107 #define NDETECTORS 4
108 
109 #ifndef StMaker_H
110 #include "StMaker.h"
111 #include "StMcEvent/StMcCalorimeterHit.hh"
112 #include "TMatrix.h"
113 #endif
114 
115 #include <map>
116 #include <utility>
117 #if !defined(ST_NO_NAMESPACES)
118 using std::multimap;
119 using std::pair;
120 #endif
121 
122 class StEvent;
123 class StEmcRawHit;
124 class StEmcCluster;
125 class StEmcPoint;
126 class StMcTrack;
127 
129 {
130  private:
131  StMcTrack *mTrack;
132  public:
134  virtual ~StEEmcAssociation();
135  const StMcTrack* getTrack() const { return mTrack; }
136  ClassDef(StEEmcAssociation, 1)
137 };
138 
140 {
141  private:
142  StEmcCluster *mCluster;
143  float mFTrack;
144  float mFEmc;
145  public:
147  virtual ~StEEmcClusterAssociation();
148  const StEmcCluster* getCluster() const { return mCluster; }
149  float getFractionTrack() const { return mFTrack; }
150  float getFractionCluster() const { return mFEmc; }
151  ClassDef(StEEmcClusterAssociation, 1)
152 };
154 {
155  private:
156  StEmcPoint *mPoint;
157  int mAssocType;
158  public:
160  virtual ~StEEmcPointAssociation();
161  const StEmcPoint*getPoint() const { return mPoint; }
162  int getAssociation() const { return mAssocType; }
163  int getAssociation(int det) { return (det>0 && det<=NDETECTORS) ? ((mAssocType&(1<<(det-1)))!=0): 0; }
164  ClassDef(StEEmcPointAssociation, 1)
165 };
166 
167 // define basic multimap structures
168 
169 #ifndef __CINT__
170 struct compEEmcTrack { bool operator()(const StMcTrack* a, const StMcTrack* b) const {return a<b; } };
171 struct compEEmcHit { bool operator()(const StEmcRawHit* a, const StEmcRawHit* b) const {return a<b; }};
172 struct compEEmcCluster { bool operator()(const StEmcCluster* a, const StEmcCluster* b) const {return a<b; }};
173 struct compEEmcPoint { bool operator()(const StEmcPoint* a, const StEmcPoint* b) const {return a<b; }};
174 // define maps and iterators
175 typedef multimap<const StMcTrack*, const StEEmcClusterAssociation*, compEEmcTrack> multiEEmcTrackCluster;
176 typedef multimap<const StEmcCluster*, const StEEmcClusterAssociation*, compEEmcCluster> multiEEmcClusterTrack;
177 typedef multimap<const StMcTrack*, const StEEmcPointAssociation*, compEEmcTrack> multiEEmcTrackPoint;
178 typedef multimap<const StEmcPoint*, const StEEmcPointAssociation*, compEEmcPoint> multiEEmcPointTrack;
179 //defining iterators
180 typedef multiEEmcTrackCluster::iterator multiEEmcTrackClusterIter;
181 typedef multiEEmcClusterTrack::iterator multiEEmcClusterTrackIter;
182 typedef multiEEmcTrackPoint::iterator multiEEmcTrackPointIter;
183 typedef multiEEmcPointTrack::iterator multiEEmcPointTrackIter;
184 typedef multiEEmcTrackCluster::value_type multiEEmcTrackClusterValue;
185 typedef multiEEmcClusterTrack::value_type multiEEmcClusterTrackValue;
186 typedef multiEEmcTrackPoint::value_type multiEEmcTrackPointValue;
187 typedef multiEEmcPointTrack::value_type multiEEmcPointTrackValue;
188 #else
189 class multiEEmcTrackCluster;
190 class multiEEmcClusterTrack;
191 class multiEEmcTrackPoint;
192 class multiEEmcPointTrack;
193 class multiEEmcTrackClusterIter;
194 class multiEEmcClusterTrackIter;
195 class multiEEmcTrackPointIter;
196 class multiEEmcPointTrackIter;
197 class multiEEmcTrackClusterValue;
198 class multiEEmcClusterTrackValue;
199 class multiEEmcTrackPointValue;
200 class multiEEmcPointTrackValue;
201 #endif
202 
203 
205 {
206  public:
207  StEEmcAssociationMaker(const char* name="EEmcAssoc");
208  virtual ~StEEmcAssociationMaker();
209  Int_t Init();
210  Int_t Make();
211  Int_t Finish();
212  void Clear(const char*);
213 
214  void printMaps();
215 
216  multiEEmcTrackCluster* getTrackClusterMap(Int_t i) { if(i>0 && i<=NDETECTORS) return mTrackCluster[i-1]; else return NULL; }
217  multiEEmcTrackCluster* getTrackClusterMap(const char*);
218  multiEEmcClusterTrack* getClusterTrackMap(Int_t i) { if(i>0 && i<=NDETECTORS) return mClusterTrack[i-1]; else return NULL; }
219  multiEEmcClusterTrack* getClusterTrackMap(const char*);
220  multiEEmcTrackPoint* getTrackPointMap() { return mTrackPoint;}
221  multiEEmcPointTrack* getPointTrackMap() { return mPointTrack;}
222  Int_t getDetNum(const char*);
223 
224  void setPrint(Bool_t a) {mPrint = a;};
225  void printHits(StEvent*);
226 
227 
228 
229  protected:
230  Bool_t mPrint;
231 
232  multiEEmcTrackCluster* mTrackCluster[NDETECTORS];
233  multiEEmcClusterTrack* mClusterTrack[NDETECTORS];
234  multiEEmcTrackPoint* mTrackPoint;
235  multiEEmcPointTrack* mPointTrack;
236  ClassDef(StEEmcAssociationMaker, 1)
237 };
238 
239 #endif
240 
241 /*******************************************************************************/
243 //
244 // $Id: StEEmcAssociationMaker.h,v 1.1.1.1 2005/05/31 18:54:14 wzhang Exp $
245 // $Log: StEEmcAssociationMaker.h,v $
246 // Revision 1.1.1.1 2005/05/31 18:54:14 wzhang
247 // First version
248 //
249 //
float getFractionTrack() const
returns the fraction of the energy deposited by the track on the EMC that ended in the reconstructed ...
multiEEmcClusterTrack * getClusterTrackMap(Int_t i)
returns multimap for association betwwen clusters and MC tracks
multiEEmcTrackCluster * getTrackClusterMap(Int_t i)
returns multimap for association betwwen MC tracks and clusters
float getFractionCluster() const
returns the fraction of the energy of the cluster that was deposited by the MC track ...
int getAssociation(int det)
returns bit information (0,1) for each EMC subdetector
const StEmcCluster * getCluster() const
returns pointer to the EMC cluster
void printHits(StEvent *)
Set print log.
int getAssociation() const
returns Association information between MC track and EMC point
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
Int_t getDetNum(const char *)
returns detector number for each EMC sub detector
multiEEmcPointTrack * getPointTrackMap()
returns multimap for association betwwen points and MC tracks
multiEEmcTrackPoint * getTrackPointMap()
returns multimap for association betwwen MC tracks and points
const StMcTrack * getTrack() const
returns pointer to the MC track
const StEmcPoint * getPoint() const
returns pointer to the EMC point