StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEmbeddingQAUtilities.cxx
1 /****************************************************************************************************
2  * $Id: StEmbeddingQAUtilities.cxx,v 1.18 2019/07/10 05:46:43 zhux Exp $
3  * $Log: StEmbeddingQAUtilities.cxx,v $
4  * Revision 1.18 2019/07/10 05:46:43 zhux
5  * added option for btof pid for primary real tracks
6  *
7  * Revision 1.17 2012/06/11 14:35:55 fisyak
8  * std namespace
9  *
10  * Revision 1.16 2012/03/05 10:32:43 cpowell
11  * Functions added to cut on refMult
12  *
13  * Revision 1.15 2011/08/25 17:37:26 cpowell
14  * Remove use of function getGeantId(const UInt_t geantid)
15  *
16  * Revision 1.14 2011/08/05 00:26:50 cpowell
17  * Fix by Xianglei related to the update in StMiniMcMaker for calculating dcaGl of StTinyRcTrack
18  *
19  * Revision 1.13 2011/04/26 20:27:22 hmasui
20  * Add isGamma function
21  *
22  * Revision 1.12 2011/04/05 23:12:36 hmasui
23  * Added getGeantId() function
24  *
25  * Revision 1.11 2011/04/01 05:02:50 hmasui
26  * Implement track selections (moved from StEmbeddingQATrack)
27  *
28  * Revision 1.10 2011/02/11 23:20:56 hmasui
29  * Bug fix for e+ and e-
30  *
31  * Revision 1.9 2010/08/13 21:54:51 hmasui
32  * Separate charge for pi/K/p
33  *
34  * Revision 1.8 2010/07/12 21:27:32 hmasui
35  * Added StParticleTable & StParticleDefinition utilities
36  *
37  * Revision 1.7 2010/06/10 14:50:28 hmasui
38  * Use TString::KIgnoreCase
39  *
40  * Revision 1.6 2010/02/16 02:10:46 hmasui
41  * Add TStyle date attributes
42  *
43  * Revision 1.5 2009/12/22 21:37:54 hmasui
44  * Add comments for functions and members
45  *
46  ****************************************************************************************************/
47 
48 #include <assert.h>
49 
50 #include "TError.h"
51 #include "TH1.h"
52 #include "TStyle.h"
53 
54 #include "StEmbeddingQAUtilities.h"
55 #include "StMessMgr.h"
56 #include "StParticleDefinition.hh"
57 #include "StParticleTable.hh"
58 using namespace std;
59  StEmbeddingQAUtilities* StEmbeddingQAUtilities::mInstance = 0 ;
60 
61 //____________________________________________________________________________________________________
62 StEmbeddingQAUtilities::StEmbeddingQAUtilities()
63 {
65 
75  //
76  mCategory[0] = MC ; mCategoryName[0] = "MC"; mCategoryTitle[0] = "MC tracks";
77  mCategory[1] = MATCHED ; mCategoryName[1] = "MATCHED"; mCategoryTitle[1] = "Matched pairs" ;
78  mCategory[2] = GHOST ; mCategoryName[2] = "GHOST"; mCategoryTitle[2] = "Ghost pairs" ;
79  mCategory[3] = CONTAM ; mCategoryName[3] = "CONTAM"; mCategoryTitle[3] = "Contaminated pairs" ;
80  mCategory[4] = MATGLOB ; mCategoryName[4] = "MATGLOB"; mCategoryTitle[4] = "Matched global pairs" ;
81  mCategoryName[5] = "PRIMARY"; mCategoryTitle[5] = "Primary tracks (real)";
82  mCategoryName[6] = "GLOBAL"; mCategoryTitle[6] = "Global tracks (real)";
83 
84  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[0], 0) );
85  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[1], 1) );
86  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[2], 2) );
87  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[3], 3) );
88  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[4], 4) );
89  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[5], 5) );
90  mCategoryId.insert( pair<const TString, const UInt_t>(mCategoryName[6], 6) );
91 
92  // Default cut
93  mPtMinCut = 0.1 ;
94  mPtMaxCut = 10.0 ;
95  mEtaCut = 1.5 ;
96  mNHitCut = 10 ;
97  mNHitToNPossCut = 0.51 ;
98  mDcaCut = 3.0 ;
99  mNSigmaCut = 2.0 ;
100  mBTofPid = kFALSE ;
101  mRapidityCut = 10.0 ;
102  mZVertexCut = 30.0 ;
103  mRefMultMinCut = 0 ;
104  mRefMultMaxCut = 1000 ;
105  mTriggerIdCut.clear() ;
106 }
107 
108 //____________________________________________________________________________________________________
110 {
112 }
113 
114 //____________________________________________________________________________________________________
116 {
118 
120  if ( !mInstance ) mInstance = new StEmbeddingQAUtilities();
121 
123  return mInstance ;
124 }
125 
126 
127 //__________________________________________________________________________________________
128 Category StEmbeddingQAUtilities::getCategory(const UInt_t id) const
129 {
131  if ( id >= StEmbeddingQAConst::mNEmbedding ){
132  Error("StEmbeddingQAUtilities::getCategory", "Unknown category id, id=%3d. Return MC", id);
133  return mCategory[0] ;
134  }
135 
136  return mCategory[id] ;
137 }
138 
139 //__________________________________________________________________________________________
140 TString StEmbeddingQAUtilities::getCategoryName(const UInt_t id) const
141 {
143  if( id >= StEmbeddingQAConst::mNCategory ){
144  Error("StEmbeddingQAUtilities::getCategoryName", "Unknown category id, id=%3d. Return MC name", id);
145  return mCategoryName[0];
146  }
147 
148  return mCategoryName[id] ;
149 }
150 
151 //__________________________________________________________________________________________
152 TString StEmbeddingQAUtilities::getCategoryTitle(const UInt_t id) const
153 {
155  if( id >= StEmbeddingQAConst::mNCategory ){
156  Error("StEmbeddingQAUtilities::getCategoryTitle", "Unknown category id, id=%3d. Return MC title", id);
157  return mCategoryTitle[0] ;
158  }
159 
160  return mCategoryTitle[id] ;
161 }
162 
163 //__________________________________________________________________________________________
164 Int_t StEmbeddingQAUtilities::getCategoryId(const TString name) const
165 {
167 
168  map<const TString, const UInt_t>::const_iterator iter = mCategoryId.find(name);
169 
170  if( iter != mCategoryId.end() ) return iter->second ;
171  else{
172  Error("StEmbeddingQAUtilities::getCategoryId", "Unknown category name, name=%s. Return MC id", name.Data());
173  return 0; // return MC track
174  }
175 }
176 
177 //____________________________________________________________________________________________________
178 Bool_t StEmbeddingQAUtilities::CompareString(const TString s0, const TString s1, const Bool_t isExact) const
179 {
183 
184  return (isExact) ? s0.CompareTo(s1)==0 : s0.CompareTo(s1, TString::kIgnoreCase)==0 ;
185 }
186 
187 //____________________________________________________________________________________________________
188 Bool_t StEmbeddingQAUtilities::isMc(const TString name) const
189 {
191 
192  return CompareString(name, mCategoryName[0]);
193 }
194 
195 //____________________________________________________________________________________________________
196 Bool_t StEmbeddingQAUtilities::isMatched(const TString name) const
197 {
199 
200  return CompareString(name, mCategoryName[1]);
201 }
202 
203 //____________________________________________________________________________________________________
204 Bool_t StEmbeddingQAUtilities::isGhost(const TString name) const
205 {
207 
208  return CompareString(name, mCategoryName[2]);
209 }
210 
211 //____________________________________________________________________________________________________
212 Bool_t StEmbeddingQAUtilities::isContaminated(const TString name) const
213 {
215 
216  return CompareString(name, mCategoryName[3]);
217 }
218 
219 //____________________________________________________________________________________________________
220 Bool_t StEmbeddingQAUtilities::isMatchedGlobal(const TString name) const
221 {
223 
224  return CompareString(name, mCategoryName[4]);
225 }
226 
227 //____________________________________________________________________________________________________
228 Bool_t StEmbeddingQAUtilities::isPrimary(const TString name) const
229 {
231 
232  return CompareString(name, mCategoryName[5]) ;
233 }
234 
235 //____________________________________________________________________________________________________
236 Bool_t StEmbeddingQAUtilities::isGlobal(const TString name) const
237 {
239 
240  return CompareString(name, mCategoryName[6]) ;
241 }
242 
243 //____________________________________________________________________________________________________
244 Bool_t StEmbeddingQAUtilities::isEmbedding(const TString name) const
245 {
248 
249  return isMatched(name) || isGhost(name) || isContaminated(name) || isMatchedGlobal(name) ;
250 }
251 
252 //____________________________________________________________________________________________________
253 Bool_t StEmbeddingQAUtilities::isReal(const TString name) const
254 {
257 
258  return isPrimary(name) || isGlobal(name) ;
259 }
260 
261 //____________________________________________________________________________________________________
262 Bool_t StEmbeddingQAUtilities::isPositron(const Int_t geantid) const { return geantid==2 ; }
263 
264 //____________________________________________________________________________________________________
265 Bool_t StEmbeddingQAUtilities::isElectron(const Int_t geantid) const { return geantid==3 ; }
266 
267 //____________________________________________________________________________________________________
268 Bool_t StEmbeddingQAUtilities::isPiPlus(const Int_t geantid) const { return geantid==8 ; }
269 
270 //____________________________________________________________________________________________________
271 Bool_t StEmbeddingQAUtilities::isPiMinus(const Int_t geantid) const { return geantid==9 ; }
272 
273 //____________________________________________________________________________________________________
274 Bool_t StEmbeddingQAUtilities::isKPlus(const Int_t geantid) const { return geantid==11 ; }
275 
276 //____________________________________________________________________________________________________
277 Bool_t StEmbeddingQAUtilities::isKMinus(const Int_t geantid) const { return geantid==12 ; }
278 
279 //____________________________________________________________________________________________________
280 Bool_t StEmbeddingQAUtilities::isProton(const Int_t geantid) const { return geantid==14 ; }
281 
282 //____________________________________________________________________________________________________
283 Bool_t StEmbeddingQAUtilities::isPBar(const Int_t geantid) const { return geantid==15 ; }
284 
285 //____________________________________________________________________________________________________
286 Bool_t StEmbeddingQAUtilities::isElectrons(const Int_t geantid) const
287 {
290 
291  return (isElectron(geantid) || isPositron(geantid));
292 }
293 
294 //____________________________________________________________________________________________________
295 Bool_t StEmbeddingQAUtilities::isPions(const Int_t geantid) const
296 {
299 
300  return (isPiPlus(geantid) || isPiMinus(geantid));
301 }
302 
303 //____________________________________________________________________________________________________
304 Bool_t StEmbeddingQAUtilities::isKaons(const Int_t geantid) const
305 {
308 
309  return (isKPlus(geantid) || isKMinus(geantid));
310 }
311 
312 //____________________________________________________________________________________________________
313 Bool_t StEmbeddingQAUtilities::isProtons(const Int_t geantid) const
314 {
317 
318  return (isProton(geantid) || isPBar(geantid)) ;
319 }
320 
321 //____________________________________________________________________________________________________
322 Bool_t StEmbeddingQAUtilities::isEPiKP(const Int_t geantid) const
323 {
325 
326  return isElectrons(geantid) || isPions(geantid) || isKaons(geantid) || isProtons(geantid) ;
327 }
328 
329 //____________________________________________________________________________________________________
330 Bool_t StEmbeddingQAUtilities::isGamma(const Int_t geantid) const
331 {
333 
334  return (geantid == 1) ;
335 }
336 
337 //____________________________________________________________________________________________________
339 {
340  // Set styles for ROOT
341 
343  const Int_t font = 42;
344 
345  //_______________________________________________________________
347  gStyle->SetOptStat(0);
348 
350  gStyle->SetPalette(1);
351 
352  //_______________________________________________________________
354  gStyle->SetPadColor(10);
355  gStyle->SetCanvasColor(10);
356  gStyle->SetFrameLineWidth(2);
357  gStyle->SetPadTickX(1);
358  gStyle->SetPadTickY(1);
359  gStyle->SetPadRightMargin(0.15);
360  gStyle->SetPadLeftMargin(0.21);
361  gStyle->SetPadTopMargin(0.10);
362  gStyle->SetPadBottomMargin(0.20);
363 
364  //_______________________________________________________________
366  gStyle->SetStatColor(10);
367 
368  //_______________________________________________________________
370  gStyle->SetTextSize(0.07);
371  gStyle->SetTextFont(font);
372 
373  //_______________________________________________________________
376  gStyle->SetNdivisions(505,"XYZ");
377 
379  gStyle->SetLabelSize(0.07, "XYZ");
380  gStyle->SetLabelOffset(0.011, "XYZ");
381  gStyle->SetLabelFont(font, "XYZ");
382 
384  gStyle->SetTitleSize(0.085, "XYZ");
385  gStyle->SetTitleOffset(1.05, "X");
386  gStyle->SetTitleOffset(1.18, "Y");
387  gStyle->SetTitleFont(font, "XYZ");
388 
390  gStyle->SetTitleFont(42, "t"); // Set pad title font if the option is not "X or Y or Z"
391 
393  gStyle->SetTitleH(0.07);
394  gStyle->SetTitleW(0.6);
395  gStyle->SetTitleBorderSize(0);
396  gStyle->SetTitleFillColor(10);
397  gStyle->SetTitleX(0.1);
398 
399  //_______________________________________________________________
401  gStyle->SetLegendBorderSize(0);
402 
404  gStyle->SetOptDate(3);
405  gStyle->GetAttDate()->SetTextFont(52);
406  gStyle->GetAttDate()->SetTextColor(10);
407  gStyle->GetAttDate()->SetTextSize(0.03);
408 }
409 
410 //____________________________________________________________________________________________________
412 {
414 
415  LOG_DEBUG << "setStyle() for " << h->GetName() << endm;
416 
418  const Int_t font = 42 ;
419  h->GetXaxis()->SetTitleFont(font);
420  h->GetYaxis()->SetTitleFont(font);
421  h->GetZaxis()->SetTitleFont(font);
422 
424  h->SetTitleSize(0.085, "X"); h->SetTitleSize(0.085, "Y"); h->SetTitleSize(0.085, "Z");
425  h->SetTitleOffset(1.05, "X");
426  h->SetTitleOffset(1.18, "Y");
427 
429  h->SetLabelSize(0.07, "X"); h->SetLabelSize(0.07, "Y"); h->SetLabelSize(0.07, "Z");
430  h->SetLabelOffset(0.011, "X"); h->SetLabelOffset(0.011, "Y"); h->SetLabelOffset(0.011, "Z");
431  h->SetLabelFont(font, "X"); h->SetLabelFont(font, "Y"); h->SetLabelFont(font, "Z");
432  h->SetNdivisions(505,"X"); h->SetNdivisions(505,"Y"); h->SetNdivisions(505,"Z");
433 
435  h->SetLineWidth(2);
436 }
437 
438 //____________________________________________________________________________________________________
440 {
442  if(!isGeantIdOk(geantid)) {
443  LOG_ERROR << Form("StEmbeddingQAUtilities::getParticleDefinition Cannot find geantid=%d in StParticleTable", geantid) << endm;
444  LOG_ERROR << "StEmbeddingQAUtilities::getParticleDefinition You should check out the latest StRoot/StarClassLibrary from CVS" << endm;
445  assert(0);
446  }
447 
448  return StParticleTable::instance()->findParticleByGeantId(geantid);
449 }
450 
451 //__________________________________________________________________________________________
452 Bool_t StEmbeddingQAUtilities::isGeantIdOk(const UInt_t geantid) const
453 {
456 
457  return StParticleTable::instance()->containsGeantId(geantid);
458 }
459 
460 //__________________________________________________________________________________________
461 Int_t StEmbeddingQAUtilities::getGeantId(const UInt_t geantid) const
462 {
465  return ( geantid > 50000 ) ? geantid%50000 : geantid ;
466 }
467 
468 //__________________________________________________________________________________________
469 Float_t StEmbeddingQAUtilities::getPtMinCut() const { return mPtMinCut ; }
470 
471 //__________________________________________________________________________________________
472 Float_t StEmbeddingQAUtilities::getPtMaxCut() const { return mPtMaxCut ; }
473 
474 //__________________________________________________________________________________________
475 Float_t StEmbeddingQAUtilities::getEtaCut() const { return mEtaCut ; }
476 
477 //__________________________________________________________________________________________
478 Short_t StEmbeddingQAUtilities::getNHitCut() const { return mNHitCut ; }
479 
480 //__________________________________________________________________________________________
481 Float_t StEmbeddingQAUtilities::getNHitToNPossCut() const { return mNHitToNPossCut ; }
482 
483 //__________________________________________________________________________________________
484 Float_t StEmbeddingQAUtilities::getDcaCut() const { return mDcaCut ; }
485 
486 //__________________________________________________________________________________________
487 Double_t StEmbeddingQAUtilities::getNSigmaCut() const { return mNSigmaCut ; }
488 
489 //__________________________________________________________________________________________
490 Bool_t StEmbeddingQAUtilities::getBTofPid() const { return mBTofPid ; }
491 
492 //__________________________________________________________________________________________
493 Float_t StEmbeddingQAUtilities::getRapidityCut() const { return mRapidityCut ; }
494 
495 //__________________________________________________________________________________________
496 Int_t StEmbeddingQAUtilities::getRefMultMinCut() const { return mRefMultMinCut ; }
497 
498 //__________________________________________________________________________________________
499 Int_t StEmbeddingQAUtilities::getRefMultMaxCut() const { return mRefMultMaxCut ; }
500 
501 //__________________________________________________________________________________________
502 Float_t StEmbeddingQAUtilities::getZVertexCut() const { return mZVertexCut ; }
503 
504 //__________________________________________________________________________________________
505 vector<UInt_t> StEmbeddingQAUtilities::getTriggerIdCut() const { return mTriggerIdCut ; }
506 
507 //__________________________________________________________________________________________
508 Float_t StEmbeddingQAUtilities::setPtMinCut(const Float_t val)
509 {
510  mPtMinCut = val ;
511  LOG_INFO << "StEmbeddingQAUtilities::setPtMinCut Minimum pt cut off = " << mPtMinCut
512  << endm;
513  return getPtMinCut() ;
514 }
515 
516 //__________________________________________________________________________________________
517 Float_t StEmbeddingQAUtilities::setPtMaxCut(const Float_t val)
518 {
519  mPtMaxCut = val ;
520  LOG_INFO << "StEmbeddingQAUtilities::setPtMaxCut Maximum pt cut off = " << mPtMaxCut
521  << endm;
522  return getPtMaxCut() ;
523 }
524 
525 //__________________________________________________________________________________________
526 Float_t StEmbeddingQAUtilities::setEtaCut(const Float_t val)
527 {
528  mEtaCut = val ;
529  LOG_INFO << "StEmbeddingQAUtilities::setEtaCut eta cut = " << mEtaCut
530  << endm;
531  return getEtaCut() ;
532 }
533 
534 //__________________________________________________________________________________________
535 Short_t StEmbeddingQAUtilities::setNHitCut(const Short_t val)
536 {
537  mNHitCut = val ;
538  LOG_INFO << "StEmbeddingQAUtilities::setNHitCut nHitsFit cut = " << mNHitCut
539  << endm;
540  return getNHitCut() ;
541 }
542 
543 //__________________________________________________________________________________________
544 Float_t StEmbeddingQAUtilities::setNHitToNPossCut(const Float_t val)
545 {
546  mNHitToNPossCut = val ;
547  LOG_INFO << "StEmbeddingQAUtilities::setNHitToNPossCut Ratio of nHitsFit to nHitsPoss cut = " << mNHitToNPossCut
548  << endm;
549  return getNHitToNPossCut() ;
550 }
551 
552 //__________________________________________________________________________________________
553 Float_t StEmbeddingQAUtilities::setDcaCut(const Float_t val)
554 {
555  mDcaCut = val ;
556  LOG_INFO << "StEmbeddingQAUtilities::setDcaCut Dca cut = " << mDcaCut
557  << endm;
558  return getDcaCut() ;
559 }
560 
561 //__________________________________________________________________________________________
562 Double_t StEmbeddingQAUtilities::setNSigmaCut(const Double_t val)
563 {
564  mNSigmaCut = val ;
565  LOG_INFO << "StEmbeddingQAUtilities::setNSigmaCut NSigma cut = " << mNSigmaCut
566  << endm;
567  return getNSigmaCut() ;
568 }
569 
570 //__________________________________________________________________________________________
571 Bool_t StEmbeddingQAUtilities::setBTofPid(const Bool_t val)
572 {
573  mBTofPid = val ;
574  LOG_INFO << "StEmbeddingQAUtilities::setBTofPid NSigma cut using BTof Pid = " << (mBTofPid?"true":"false")
575  << endm;
576  return getBTofPid() ;
577 }
578 
579 //__________________________________________________________________________________________
580 Float_t StEmbeddingQAUtilities::setRapidityCut(const Float_t val)
581 {
582  mRapidityCut = val ;
583  LOG_INFO << "StEmbeddingQAUtilities::setRapidityCut Rapidity cut = " << mRapidityCut
584  << endm;
585  return getRapidityCut() ;
586 }
587 
588 //__________________________________________________________________________________________
589 Int_t StEmbeddingQAUtilities::setRefMultMinCut(const Int_t val)
590 {
591  mRefMultMinCut = val ;
592  LOG_INFO << "StEmbeddingQAUtilities::setRefMultCut refMult cut >= " << mRefMultMinCut
593  << endm;
594  return getRefMultMinCut() ;
595 }
596 
597 //__________________________________________________________________________________________
598 Int_t StEmbeddingQAUtilities::setRefMultMaxCut(const Int_t val)
599 {
600  mRefMultMaxCut = val ;
601  LOG_INFO << "StEmbeddingQAUtilities::setRefMultCut refMult cut < " << mRefMultMaxCut
602  << endm;
603  return getRefMultMaxCut() ;
604 }
605 
606 //__________________________________________________________________________________________
607 Float_t StEmbeddingQAUtilities::setZVertexCut(const Float_t val)
608 {
609  mZVertexCut = val ;
610  LOG_INFO << "StEmbeddingQAUtilities::setZVertexCut z-vertex cut = " << mZVertexCut
611  << endm;
612  return getZVertexCut() ;
613 }
614 
615 //__________________________________________________________________________________________
616 void StEmbeddingQAUtilities::addTriggerIdCut(const UInt_t val)
617 {
618  mTriggerIdCut.push_back(val);
619  LOG_INFO << "StEmbeddingQAUtilities::addTriggerIdCut add new trigger id = " << val
620  << endm;
621 }
622 
623 //__________________________________________________________________________________________
624 Bool_t StEmbeddingQAUtilities::isPtOk(const Float_t pt) const
625 {
626  return (pt > mPtMinCut && pt < mPtMaxCut ) ;
627 }
628 
629 //__________________________________________________________________________________________
630 Bool_t StEmbeddingQAUtilities::isEtaOk(const Float_t eta) const
631 {
632  return TMath::Abs(eta) < mEtaCut ;
633 }
634 
635 //__________________________________________________________________________________________
636 Bool_t StEmbeddingQAUtilities::isNHitsFitOk(const Float_t nHitsFit) const
637 {
638  return nHitsFit > mNHitCut ;
639 }
640 //__________________________________________________________________________________________
641 Bool_t StEmbeddingQAUtilities::isNHitToNPossOk(const Float_t ratio) const
642 {
643  return ratio > mNHitToNPossCut ;
644 }
645 //__________________________________________________________________________________________
646 Bool_t StEmbeddingQAUtilities::isDcaOk(const Float_t dca) const
647 {
648  return ( dca > -mDcaCut && dca < mDcaCut ) ;
649 }
650 //__________________________________________________________________________________________
651 Bool_t StEmbeddingQAUtilities::isNSigmaOk(const Float_t nsigma) const
652 {
653  return TMath::Abs(nsigma) < mNSigmaCut ;
654 }
655 
656 //__________________________________________________________________________________________
657 Bool_t StEmbeddingQAUtilities::isRapidityOk(const Float_t y) const
658 {
659  return TMath::Abs(y) < mRapidityCut ;
660 }
661 
662 //__________________________________________________________________________________________
663 Bool_t StEmbeddingQAUtilities::isRefMultOk(const Int_t refMult) const
664 {
665  return ((refMult >= mRefMultMinCut) && (refMult < mRefMultMaxCut)) ;
666 }
667 
668 //__________________________________________________________________________________________
669 Bool_t StEmbeddingQAUtilities::isZVertexOk(const Float_t vz) const
670 {
671  return TMath::Abs(vz) < mZVertexCut ;
672 }
673 
674 //__________________________________________________________________________________________
675 Bool_t StEmbeddingQAUtilities::isTriggerOk(const UInt_t trigger) const
676 {
677  // No trigger is required
678  if ( mTriggerIdCut.empty() ) return kTRUE ;
679 
680  for(UInt_t i=0; i<mTriggerIdCut.size(); i++) {
681  if ( trigger == mTriggerIdCut[i] ) return kTRUE ;
682  }
683 
684  // doesn't match any trigger id's
685  return kFALSE ;
686 }
687 
688 //__________________________________________________________________________________________
690 {
691  LOG_INFO << "#----------------------------------------------------------------------------------------------------" << endm;
692  LOG_INFO << " StEmbeddingQAUtilities::PrintCuts()" << endm;
693  LOG_INFO << " Track-wise selections ==================================================" << endm;
694  LOG_INFO << Form(" pt cut : %1.1f - %1.1f GeV/c", getPtMinCut(), getPtMaxCut()) << endm;
695  LOG_INFO << Form(" eta cut : |eta| < %1.1f", getEtaCut()) << endm;
696  LOG_INFO << Form(" nHitsFit cut : nHitsfit > %2d", getNHitCut()) << endm;
697  LOG_INFO << Form(" nHits/nHitsMax cut : ratio > %1.2f", getNHitToNPossCut()) << endm;
698  LOG_INFO << Form(" dca cut : dca < %1.1f cm", getDcaCut()) << endm;
699  LOG_INFO << Form(" nsigma cut : nsigma < %1.1f", getNSigmaCut()) << endm;
700  LOG_INFO << Form(" using BTofPid : %s", getBTofPid()?"true":"false") << endm;
701  LOG_INFO << Form(" rapidity cut : |y| < %1.1f", getRapidityCut()) << endm;
702  LOG_INFO << " Event-wise selections ==================================================" << endm;
703  LOG_INFO << Form(" z-vertex cut : |vz| < %1.1f cm", getZVertexCut()) << endm;
704  LOG_INFO << Form(" refMult cut : %i <= refMult < %i", getRefMultMinCut(), getRefMultMaxCut()) << endm;
705  if ( !mTriggerIdCut.empty() ) {
706  for(UInt_t i=0; i<mTriggerIdCut.size(); i++) {
707  LOG_INFO << Form(" trigger id cut : id = %10d", mTriggerIdCut[i]) << endm;
708  }
709  }
710  LOG_INFO << "#----------------------------------------------------------------------------------------------------" << endm;
711 }
712 
713 
Bool_t isMatchedGlobal(const TString name) const
Check whether the track is Contaminated pair or not.
Bool_t isElectrons(const Int_t geantid) const
Check the input geantid is pbar.
void PrintCuts() const
Print all track selections.
Bool_t isKPlus(const Int_t geantid) const
Check the input geantid is pi-.
Definition: FJcore.h:367
Bool_t isGlobal(const TString name) const
Check whether the track is primary track or not.
Bool_t isEPiKP(const Int_t geantid) const
Check the input geantid is protons.
Bool_t isGhost(const TString name) const
Check whether the track is Matched pair or not.
Bool_t isReal(const TString name) const
Check whether the track is embedding pair or not.
Bool_t isPrimary(const TString name) const
Check whether the track is Contaminated pair or not.
Bool_t isEmbedding(const TString name) const
Check whether the track is global track or not.
Float_t setPtMinCut(const Float_t val)
Set track and event selections, return new value.
Category getCategory(const UInt_t id) const
Bool_t isElectron(const Int_t geantid) const
Check whether the track is real track or not.
Bool_t isGamma(const Int_t geantid) const
Check the input geantid is e/pi/K/p.
Bool_t isPBar(const Int_t geantid) const
Check the input geantid is p.
TString getCategoryName(const UInt_t id) const
Category from category id.
void setStyle() const
Check the input geantid is gamma.
Bool_t isContaminated(const TString name) const
Check whether the track is Ghost pair or not.
StParticleDefinition * getParticleDefinition(const UInt_t geantid) const
runnumber = runid - (year - 2000 + 1) * 10^6
Bool_t isPiMinus(const Int_t geantid) const
Check the input geantid is pi+.
Bool_t isProton(const Int_t geantid) const
Check the input geantid is K-.
Int_t getGeantId(const UInt_t geantid) const
Return geant id.
Bool_t isPositron(const Int_t geantid) const
Check the input geantid is e-.
Bool_t isProtons(const Int_t geantid) const
Check the input geantid is kaons.
Float_t getPtMinCut() const
Get track and event selections.
Bool_t isGeantIdOk(const UInt_t geantid) const
Check geant id is defined in StParticleTable or not.
static StEmbeddingQAUtilities * instance()
Get instance.
Bool_t isPions(const Int_t geantid) const
Check the input geantid is electrons.
Bool_t isKMinus(const Int_t geantid) const
Check the input geantid is K+.
virtual ~StEmbeddingQAUtilities()
Destructor.
TString getCategoryTitle(const UInt_t id) const
Category name from category id.
Bool_t isKaons(const Int_t geantid) const
Check the input geantid is pions.
Bool_t isMatched(const TString name) const
Check whether the track is MC track or not.
Int_t getCategoryId(const TString name) const
Category title from category id.
Bool_t isPtOk(const Float_t pt) const
Track and event cuts.
Bool_t isMc(const TString name) const
Category id from category name.
Bool_t isPiPlus(const Int_t geantid) const
Check the input geantid is e+.