StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrgMaker.h
1 /***************************************************************************
2  *
3  * $Id: StTrgMaker.h,v 1.5 2003/09/10 19:47:41 perev Exp $
4  *
5  * Author: Herbert Ward
6  ***************************************************************************
7  *
8  * Description: See the comment in the associated .cxx file.
9  *
10  ***************************************************************************
11  *
12  * $Log: StTrgMaker.h,v $
13  * Revision 1.5 2003/09/10 19:47:41 perev
14  * ansi corrs
15  *
16  * Revision 1.4 2001/12/25 20:01:29 ward
17  * Outputs error (closeness to edge) of track extension subsector selection.
18  *
19  * Revision 1.3 2001/12/22 20:10:04 ward
20  * New code for MWC.
21  *
22  * Revision 1.2 2001/07/27 17:40:18 ward
23  * Handles reversed B field, also has code for chking triggerWord.
24  *
25  * Revision 1.1 2001/04/23 20:00:27 ward
26  * Outputs info for CTB calib: slat ADCs and TPC track extensions.
27  *
28  *
29  **************************************************************************/
30 
31 //
32 // Every header file should have these macros to protect
33 // from being included multiple times in the same scope.
34 // If you change the name of the class change the name
35 // of the macro.
36 //
37 #ifndef StTrgMaker_hh
38 #define StTrgMaker_hh
39 
40 //
41 // Include files. StMaker.h is needed since your maker
42 // inherits from StMaker.
43 // <string> contains the STL string class. It's a system
44 // header therefore it is enclosed in <> and not in double
45 // quotes.
46 //
47 #include "StMaker.h"
48 #include <string>
49 
50 //
51 // Forward declerations.
52 // It is always a good idea to reduce the dependencies
53 // to other header files. This can be achieved by
54 // forward declaring classes which are only referenced
55 // but not contained (by value) in the class decleration.
56 // In the implementation then one onviously has to include
57 // the referring header. Another advantage of this
58 // technique is that the these classes do not get passed
59 // through rootcint.
60 //
61 class StEvent;
62 class StTrack;
63 class TFile;
64 class TNtuple;
65 
66 //
67 // On some systems (e.g. Sun) the STL is contained in
68 // namespace 'std'. We have to tell the compiler where
69 // to look for string. Since not all compilers
70 // use namespaces we have to protects is by using the
71 // ST_NO_NAMESPACES macro which is automatically set
72 // (or unset) when compiling the code with 'cons'.
73 //
74 #ifndef ST_NO_NAMESPACES
75 using std::string;
76 #endif
77 
78 //
79 // The class declaration. Every maker has to
80 // inherit from StMaker.
81 //
82 class StTrgMaker : public StMaker {
83 public:
84 
85  StTrgMaker(const Char_t *name="analysis"); // constructor
86  ~StTrgMaker(); // destructor
87 
88  void Clear(Option_t *option=""); // called after every event to cleanup
89  Int_t Init(); // called once at the beginning of your job
90  Int_t Make(); // invoked for every event
91  Int_t Finish(); // called once at the end
92 
93 private:
94  //
95  // Add your data member and new methods here.
96  // The "//!" means that rootcint is not adding
97  // the data member to the streamer. Don't worry
98  // if you don't know what this means.
99  // In general it is a good idea in analysis makers
100  // to always add the //! after a member.
101  //
102 
103  //
104  // Methods (== member functions)
105  // Remember: these are just examples!
106  //
107  double mMagneticField;
108  bool accept(StEvent*); // this method serves as an event filter
109  bool accept(StTrack*); // and this is used to select tracks
110  void DoOneTrackCtb(FILE *oo,long q,double curvature,double phi0,
111  double psi,double r0,double tanl,double z0);
112  void DoOneTrackMwc(FILE *oo,long q,double curvature,double phi0,
113  double psi,double r0,double tanl,double z0);
114  void CalcCenterOfCircleDefinedByTrack(int q,double radius,double psi,double r0,
115  double phi0,double *xcenter,double *ycenter);
116  void Location2Sector(double tanl,double xAtMwc,double yAtMwc,
117  int *sector,int *subsector,double *errDistPhi,double *errDistRad);
118  void FindIntersectionOfTwoCircles(
119  double center1x,double center1y,double radius1, /* input (circle 1) */
120  double center2x,double center2y,double radius2, /* input (circle 2) */
121  int *numIntersectionPoints, /* output */
122  double *intersection1x,double *intersection1y, /* output */
123  double *intersection2x,double *intersection2y /* output */);
124  int TrayNumber(double x,double y,double z);
125  void FakeInfo(FILE*, int);
126 
127  //
128  // Data members
129  // Note, that it is recommended to start all member names with
130  // an 'm'. This makes it easier to read the code later.
131  //
132  int mEventCounter;
133  string mFileName;
134  TFile *mFile;
135  TNtuple *mTuple;
136 
137  //
138  // This is needed to make your maker known to root4star.
139  // It must be always the last statement in the class.
140  // Note that this is a macro, that's why the ';' is missing.
141  //
142  ClassDef(StTrgMaker,0)
143 };
144 #endif
void Clear(Option_t *option="")
User defined functions.
Definition: StTrgMaker.cxx:86
Int_t Make()
Definition: StTrgMaker.cxx:92
Int_t Finish()
Definition: StTrgMaker.cxx:89