StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmcAssociationMaker.h
1 
105 #ifndef STAR_StEmcAssociationMaker_HH
106 #define STAR_StEmcAssociationMaker_HH
107 
108 #define NDETECTORS 4
109 
110 #ifndef StMaker_H
111 #include "StMaker.h"
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 StEmcRawHit;
123 class StEmcCluster;
124 class StEmcPoint;
125 class StMcTrack;
126 class StMcCalorimeterHit;
127 
129 {
130  private:
131  StMcTrack *mTrack;
132  public:
134  virtual ~StEmcAssociation();
135  const StMcTrack* getTrack() const { return mTrack; }
136  ClassDef(StEmcAssociation, 1)
137 };
138 
140 {
141  private:
142  StEmcCluster *mCluster;
143  float mFTrack;
144  float mFEmc;
145  public:
147  virtual ~StEmcClusterAssociation();
148  const StEmcCluster* getCluster() const { return mCluster; }
149  float getFractionTrack() const { return mFTrack; }
150  float getFractionCluster() const { return mFEmc; }
151  ClassDef(StEmcClusterAssociation, 1)
152 };
154 {
155  private:
156  StEmcPoint *mPoint;
157  int mAssocType;
158  public:
160  virtual ~StEmcPointAssociation();
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(StEmcPointAssociation, 1)
165 };
166 
167 // define basic multimap structures
168 
169 #ifndef __CINT__
170 struct compEmcTrack { bool operator()(const StMcTrack* a, const StMcTrack* b) const {return a<b; } };
171 struct compEmcHit { bool operator()(const StEmcRawHit* a, const StEmcRawHit* b) const {return a<b; }};
172 struct compEmcCluster { bool operator()(const StEmcCluster* a, const StEmcCluster* b) const {return a<b; }};
173 struct compEmcPoint { bool operator()(const StEmcPoint* a, const StEmcPoint* b) const {return a<b; }};
174 // define maps and iterators
175 typedef multimap<const StMcTrack*, const StEmcClusterAssociation*, compEmcTrack> multiEmcTrackCluster;
176 typedef multimap<const StEmcCluster*, const StEmcClusterAssociation*, compEmcCluster> multiEmcClusterTrack;
177 typedef multimap<const StMcTrack*, const StEmcPointAssociation*, compEmcTrack> multiEmcTrackPoint;
178 typedef multimap<const StEmcPoint*, const StEmcPointAssociation*, compEmcPoint> multiEmcPointTrack;
179 //defining iterators
180 typedef multiEmcTrackCluster::iterator multiEmcTrackClusterIter;
181 typedef multiEmcClusterTrack::iterator multiEmcClusterTrackIter;
182 typedef multiEmcTrackPoint::iterator multiEmcTrackPointIter;
183 typedef multiEmcPointTrack::iterator multiEmcPointTrackIter;
184 typedef multiEmcTrackCluster::value_type multiEmcTrackClusterValue;
185 typedef multiEmcClusterTrack::value_type multiEmcClusterTrackValue;
186 typedef multiEmcTrackPoint::value_type multiEmcTrackPointValue;
187 typedef multiEmcPointTrack::value_type multiEmcPointTrackValue;
188 #else
189 class multiEmcTrackCluster;
190 class multiEmcClusterTrack;
191 class multiEmcTrackPoint;
192 class multiEmcPointTrack;
193 class multiEmcTrackClusterIter;
194 class multiEmcClusterTrackIter;
195 class multiEmcTrackPointIter;
196 class multiEmcPointTrackIter;
197 class multiEmcTrackClusterValue;
198 class multiEmcClusterTrackValue;
199 class multiEmcTrackPointValue;
200 class multiEmcPointTrackValue;
201 #endif
202 
203 
205 {
206  public:
207  StEmcAssociationMaker(const char* name="EmcAssoc");
208  virtual ~StEmcAssociationMaker();
209  Int_t Init();
210  Int_t Make();
211  Int_t Finish();
212  void Clear(const char*);
213 
214  void printMaps();
215  void printTracks();
216 
217  multiEmcTrackCluster* getTrackClusterMap(Int_t i) { if(i>0 && i<=NDETECTORS) return mTrackCluster[i-1]; else return NULL; }
218  multiEmcTrackCluster* getTrackClusterMap(const char*);
219  multiEmcClusterTrack* getClusterTrackMap(Int_t i) { if(i>0 && i<=NDETECTORS) return mClusterTrack[i-1]; else return NULL; }
220  multiEmcClusterTrack* getClusterTrackMap(const char*);
221  multiEmcTrackPoint* getTrackPointMap() { return mTrackPoint;}
222  multiEmcPointTrack* getPointTrackMap() { return mPointTrack;}
223  Int_t getDetNum(const char*);
224 
225  void setPrint(Bool_t a) {mPrint = a;}
226 
227 
228  protected:
229  virtual Float_t dEToEnergy(StMcCalorimeterHit*,Int_t);
230  Bool_t mPrint;
231 
232  multiEmcTrackCluster* mTrackCluster[NDETECTORS];
233  multiEmcClusterTrack* mClusterTrack[NDETECTORS];
234  multiEmcTrackPoint* mTrackPoint;
235  multiEmcPointTrack* mPointTrack;
236  ClassDef(StEmcAssociationMaker, 1)
237 };
238 
239 #endif
240 
241 /*******************************************************************************/
multiEmcTrackCluster * getTrackClusterMap(Int_t i)
returns multimap for association betwwen MC tracks and clusters
const StEmcPoint * getPoint() const
returns pointer to the EMC point
int getAssociation(int det)
returns bit information (0,1) for each EMC subdetector
Int_t getDetNum(const char *)
returns detector number for each EMC sub detector
void setPrint(Bool_t a)
Set print log.
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
float getFractionCluster() const
returns the fraction of the energy of the cluster that was deposited by the MC track ...
int getAssociation() const
returns Association information between MC track and EMC point
multiEmcPointTrack * getPointTrackMap()
returns multimap for association betwwen points and MC tracks
const StEmcCluster * getCluster() const
returns pointer to the EMC cluster
const StMcTrack * getTrack() const
returns pointer to the MC track
multiEmcClusterTrack * getClusterTrackMap(Int_t i)
returns multimap for association betwwen clusters and MC tracks
float getFractionTrack() const
returns the fraction of the energy deposited by the track on the EMC that ended in the reconstructed ...
multiEmcTrackPoint * getTrackPointMap()
returns multimap for association betwwen MC tracks and points