StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMiniMcMaker.h
Go to the documentation of this file.
1 
187 #ifndef StMiniMcMaker_H
188 #define StMiniMcMaker_H
189 
190 #include "StMaker.h"
191 
192 #include <vector>
193 #include <utility>
194 #include <algorithm>
195 #include <map>
196 
197 #include "TString.h"
198 
199 #include "StAssociationMaker/StAssociationMaker.h"
200 #include "StAssociationMaker/StTrackPairInfo.hh"
201 
205 
206 class TFile;
207 class TTree;
208 class StEvent;
209 class StMcEvent;
210 class StMcTrack;
211 class StTrack;
212 class StPrimaryTrack;
213 class StIOInterFace;
214 #include "StThreeVectorF.hh"
217 class StTpcHit;
218 class StDedxPidTraits;
219 class StEmcRawHit;
220 class StEmcPoint;
221 
222 // typdef's
223 #ifndef __CINT__
224 
225 typedef map<UInt_t,Int_t> RCFOUNDMAP;
226 typedef map<long,Int_t> MCFOUNDMAP;
227 typedef map<Long_t,const StMcTrack*> MCMAP;
228 typedef vector<StTrackPairInfo*> PAIRVEC;
229 typedef pair<const StTpcHit*,const StTpcHit*> PAIRHIT;
230 inline bool pairCmp(StTrackPairInfo* p1, StTrackPairInfo* p2){
231  return p1->commonTpcHits() < p2->commonTpcHits();
232 }
233 inline bool sortCmp(StTrackPairInfo* p1, StTrackPairInfo* p2){
234  return p1->commonTpcHits() > p2->commonTpcHits();
235 }
236 
237 #endif
238 //bool hitCmp(StTpcHit* p1, StTpcHit* p2);
239 
240 
241 // check StMiniMcEvent for the track categories...
242 
243 //____________________________________________
244 
245 class StMiniMcMaker : public StMaker{
246  public:
247  StMiniMcMaker(const Char_t* name="StMiniMcMaker",
248  const Char_t* title="event/StMiniMcMaker");
249  virtual ~StMiniMcMaker();
250 
251  void Clear(Option_t *option="");
252  Int_t Init();
253  Int_t InitRun(int runnumber);
254  Int_t Make();
255  Int_t Finish();
256  virtual const char *GetCVS() const
257  {static const char cvs[]="Tag $Name: $ $Id: StMiniMcMaker.h,v 1.20 2014/08/06 11:43:27 jeromel Exp $ built " __DATE__ " " __TIME__ ; return cvs;}
258 
259  //---- SETS -------
260 
261  void setGhost(Bool_t doit=kTRUE) { mGhost = doit; }
262  void setOutDir(const char* dir= "./") { mOutDir = dir; }
263  void setPtCut(Float_t minPt=0, Float_t maxPt=9999)
264  { mMinPt=minPt; mMaxPt=maxPt; }
265  void setFileName(const TString& val) { mInFileName = val; }
266  void setFilePrefix(const TString& val) { mInFilePrefix = val; }
267 
268  private:
269  //static const Float_t mSharedHitsCut = .5;
270 
271  // methods
272 
273  Bool_t initAssociation(); // sets all the assoc maps
274  Bool_t initVertex(); // finds the primary vertex if it exists
275  Bool_t acceptRaw(const StMcTrack*);
276  Bool_t accept(const StMcTrack*);
277  Bool_t accept(const StTrack*);
278  Bool_t acceptGood20(const StTrack*);
279  Bool_t acceptGood20(const StMcTrack*);
280  Bool_t acceptCentrality(const StTrack*);
281  Bool_t acceptUncorrected(const StTrack*);
282  Bool_t acceptGlobals(const StTrack* track);
283  Bool_t acceptFTPC(const StTrack*);
284  Bool_t ok(const StTrack*);
285  Bool_t isSameSign(const StTrack*,const StMcTrack*);
286  Bool_t acceptPt(const StTrack*);
287  Bool_t acceptPt(const StMcTrack*);
288  Bool_t acceptDebug(const StMcTrack*);
289 
290  StTrackPairInfo* findBestMatchedGlobal(const StMcTrack*);
291  PAIRVEC findMatchedRc(const StMcTrack*);
292  PAIRHIT findFirstLastHit(const StTrack*);
293  PAIRHIT findFirstLastFitHit(const StTrack*);
294 
295  Float_t computeXY(const StThreeVectorF*, const StTrack*);
296  StDedxPidTraits* findDedxPidTraits(const StTrack*);
297  //pair<Float_t,Float_t> computeProj(const StThreeVectorF*,const StTrack*);
298  Float_t computeZDca(const StThreeVectorF*,const StTrack*);
299 
300  const StPrimaryTrack* isPrimaryTrack(const StTrack*);
301  Bool_t isPrimaryTrack(const StMcTrack*);
302  Int_t openFile();
303  Int_t closeFile();
304  void trackLoop();
305  void trackLoopIdT();
306  void buildEmcIndexArray();
307  void fillEventInfo(Int_t nGoodTrack, Int_t nRcGlobal, Int_t nRcGoodGlobal20,
308  //Int_t nAcceptedRaw,
309  Int_t nMcGlobal, Int_t nMcGoodGlobal20,
310  Int_t nMcNch, Int_t nMcHminus,
311  Int_t nMcFtpcENch, Int_t nMcFtpcWNch,
312  Int_t nFtpcEUncorrected, Int_t nFtpcWUncorrected,
313  Int_t nUncorrectedGlobals);
314  void fillTrackPairInfo(StMiniMcPair*,
315  const StMcTrack*,
316  const StTrack* prTrack,
317  const StTrack* glTrack,
318  Int_t commonHits, Int_t nAssMc,
319  Int_t nAssGl, Int_t nAssPr,
320  Bool_t isBestContam=kFALSE);
321 
322  void fillRcTrackInfo(StTinyRcTrack*,
323  const StTrack* prTrack,
324  const StTrack* glTrack,
325  Int_t nAssMc);
326 
327  void fillMcTrackInfo(StTinyMcTrack*,
328  const StMcTrack*,
329  Int_t nAssGl, Int_t nAssPr);
330 
331  void checkMerged(const StMcTrack* merged, Int_t mergedCommonHits,
332  const StTrack* prTrack);
333  void checkSplit (const StMcTrack*,const StTrack*,Int_t);
334  void checkContam(const StMcTrack*,const StGlobalTrack*,Int_t);
335 
336  size_t getIndex(size_t mult);
337 
338  void AppendMCDaughterTrack();
339  static void dominatTkInfo(const StTrack* recTrack,int &dominatrackKey ,int& dominatrackHits,float& avgQuality);
340  // members
341  StMiniMcEvent* mMiniMcEvent;
342  StIOInterFace* mIOMaker;
343  TTree* mMiniMcTree;
344  TFile* mMiniMcDST;
345  TString mInFileName;
346  TString mInFilePrefix;
347  TString mOutFileName;
348  TString mOutDir;
349  TString mParameterFileName;
350 
351  StEvent* mRcEvent;
352  StMcEvent* mMcEvent;
353  rcTpcHitMapType* mRcHitMap;
354  rcTrackMapType* mRcTrackMap;
355  mcTrackMapType* mMcTrackMap;
356  const StThreeVectorF* mRcVertexPos;
357  const StThreeVectorF* mMcVertexPos;
358  StTpcDedxPidAlgorithm* mTpcDedxAlgo;
359  StuProbabilityPidAlgorithm* mPidAlgo;
360  vector<StEmcRawHit*> mEmcIndex;
361  Bool_t mGhost;
362 
363  Float_t mMinPt;
364  Float_t mMaxPt;
365 
366  Int_t mNSplit;
367  Int_t mNRc;
368  Int_t mNGhost;
369  Int_t mNContam;
370  Int_t mNMatched;
371  Int_t mNMatGlob;
372  int mMainVtx;
373  ClassDef(StMiniMcMaker,0)
374 };
375 
376 
377 
378 
379 #endif
380 //
381 // $Log $
382 //
Monte Carlo Track class All information on a simulated track is stored in this class: kinematics...
Definition: StMcTrack.hh:144
Top level class for the MiniMcTree, containing event-wise information and the McTrack, and all TrackPair collections.
for simplicity, this contains both the rc and mc track information.
Definition of Pair for Contamination tracks (secondary tracks, weak decay tracks) ...
Event data structure to hold all information from a Monte Carlo simulation. This class is the interfa...
Definition: StMcEvent.hh:169
void Clear(Option_t *option="")
User defined functions.