StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mikesKinkCut.cxx
1 /***************************************************************************
2  *
3  * $Id: mikesKinkCut.cxx,v 1.1 2001/06/01 19:23:54 lisa Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: This is an example of a StHbtKinkCut, which cuts on StHbtKinks
9  * in the StHbtEvent. If a StHbtKink passes the cut, then it becomes a
10  * StHbtParticle to be used in the StHbtAnalysis
11  *
12  ***************************************************************************
13  *
14  * $Log: mikesKinkCut.cxx,v $
15  * Revision 1.1 2001/06/01 19:23:54 lisa
16  * new example class Cut/mikesKinkCut
17  *
18  *
19  **************************************************************************/
20 
21 #include "StHbtMaker/Cut/mikesKinkCut.h"
22 #include <cstdio>
23 
24 #ifdef __ROOT__
25 ClassImp(mikesKinkCut)
26 #endif
27 
28 mikesKinkCut::mikesKinkCut(){
29  mNKinksPassed = mNKinksFailed = 0;
30 }
31 //------------------------------
32 //mikesKinkCut::~mikesKinkCut(){
33 // /* noop */
34 //}
35 //------------------------------
36 bool mikesKinkCut::Pass(const StHbtKink* k){
37  bool goodKink =
38  ((k->DcaParentDaughter() > mDcaParentDaughter[0]) &&
39  (k->DcaParentDaughter() < mDcaParentDaughter[1]) &&
40  (k->DcaDaughterPrimaryVertex() > mDcaDaughterPrimaryVertex[0]) &&
41  (k->DcaDaughterPrimaryVertex() < mDcaDaughterPrimaryVertex[1]) &&
42  (k->DcaParentPrimaryVertex() > mDcaParentPrimaryVertex[0]) &&
43  (k->DcaParentPrimaryVertex() < mDcaParentPrimaryVertex[1]) &&
44  (k->HitDistanceParentDaughter() > mHitDistanceParentDaughter[0]) &&
45  (k->HitDistanceParentDaughter() < mHitDistanceParentDaughter[1]) &&
46  (k->HitDistanceParentVertex() > mHitDistanceParentVertex[0]) &&
47  (k->HitDistanceParentVertex() < mHitDistanceParentVertex[1]) &&
48  (k->DecayAngle() > mDecayAngle[0]) &&
49  (k->DecayAngle() < mDecayAngle[1]) &&
50  (k->DecayAngleCM() > mDecayAngleCM[0]) &&
51  (k->DecayAngleCM() < mDecayAngleCM[1]));
52 
53  goodKink ? mNKinksPassed++ : mNKinksFailed++ ;
54  return (goodKink);
55 }
56 //------------------------------
57 StHbtString mikesKinkCut::Report(){
58  string Stemp;
59  char Ctemp[100];
60  sprintf(Ctemp,"\nThis is mikesKinkCut");
61  Stemp = Ctemp;
62  sprintf(Ctemp,"\nDcaParentDaughter:\t %E-%E",mDcaParentDaughter[0],mDcaParentDaughter[1]);
63  Stemp += Ctemp;
64 
65  sprintf(Ctemp,"\nDcaDaughterPrimaryVertex:\t %E-%E",mDcaDaughterPrimaryVertex[0],mDcaDaughterPrimaryVertex[1]);
66  Stemp += Ctemp;
67  sprintf(Ctemp,"\nDcaParentPrimaryVertex:\t %E-%E",mDcaParentPrimaryVertex[0],mDcaParentPrimaryVertex[1]);
68  Stemp += Ctemp;
69  sprintf(Ctemp,"\nHitDistanceParentDaughter:\t %E-%E",mHitDistanceParentDaughter[0],mHitDistanceParentDaughter[1]);
70  Stemp += Ctemp;
71  sprintf(Ctemp,"\nHitDistanceParentVertex:\t %E-%E",mHitDistanceParentVertex[0],mHitDistanceParentVertex[1]);
72  Stemp += Ctemp;
73  sprintf(Ctemp,"\nDecayAngle:\t %E-%E",mDecayAngle[0],mDecayAngle[1]);
74  Stemp += Ctemp;
75  sprintf(Ctemp,"\nDecayAngleCM:\t %E-%E",mDecayAngleCM[0],mDecayAngleCM[1]);
76  Stemp += Ctemp;
77  sprintf(Ctemp,"\nNumber of kinks which passed:\t%ld Number which failed:\t%ld",mNKinksPassed,mNKinksFailed);
78  Stemp += Ctemp;
79  StHbtString returnThis = Stemp;
80  return returnThis;
81 }