00001 /*************************************************************************** 00002 * 00003 * $Id: StTrgMaker.h,v 1.5 2003/09/10 19:47:41 perev Exp $ 00004 * 00005 * Author: Herbert Ward 00006 *************************************************************************** 00007 * 00008 * Description: See the comment in the associated .cxx file. 00009 * 00010 *************************************************************************** 00011 * 00012 * $Log: StTrgMaker.h,v $ 00013 * Revision 1.5 2003/09/10 19:47:41 perev 00014 * ansi corrs 00015 * 00016 * Revision 1.4 2001/12/25 20:01:29 ward 00017 * Outputs error (closeness to edge) of track extension subsector selection. 00018 * 00019 * Revision 1.3 2001/12/22 20:10:04 ward 00020 * New code for MWC. 00021 * 00022 * Revision 1.2 2001/07/27 17:40:18 ward 00023 * Handles reversed B field, also has code for chking triggerWord. 00024 * 00025 * Revision 1.1 2001/04/23 20:00:27 ward 00026 * Outputs info for CTB calib: slat ADCs and TPC track extensions. 00027 * 00028 * 00029 **************************************************************************/ 00030 00031 // 00032 // Every header file should have these macros to protect 00033 // from being included multiple times in the same scope. 00034 // If you change the name of the class change the name 00035 // of the macro. 00036 // 00037 #ifndef StTrgMaker_hh 00038 #define StTrgMaker_hh 00039 00040 // 00041 // Include files. StMaker.h is needed since your maker 00042 // inherits from StMaker. 00043 // <string> contains the STL string class. It's a system 00044 // header therefore it is enclosed in <> and not in double 00045 // quotes. 00046 // 00047 #include "StMaker.h" 00048 #include <string> 00049 00050 // 00051 // Forward declerations. 00052 // It is always a good idea to reduce the dependencies 00053 // to other header files. This can be achieved by 00054 // forward declaring classes which are only referenced 00055 // but not contained (by value) in the class decleration. 00056 // In the implementation then one onviously has to include 00057 // the referring header. Another advantage of this 00058 // technique is that the these classes do not get passed 00059 // through rootcint. 00060 // 00061 class StEvent; 00062 class StTrack; 00063 class TFile; 00064 class TNtuple; 00065 00066 // 00067 // On some systems (e.g. Sun) the STL is contained in 00068 // namespace 'std'. We have to tell the compiler where 00069 // to look for string. Since not all compilers 00070 // use namespaces we have to protects is by using the 00071 // ST_NO_NAMESPACES macro which is automatically set 00072 // (or unset) when compiling the code with 'cons'. 00073 // 00074 #ifndef ST_NO_NAMESPACES 00075 using std::string; 00076 #endif 00077 00078 // 00079 // The class declaration. Every maker has to 00080 // inherit from StMaker. 00081 // 00082 class StTrgMaker : public StMaker { 00083 public: 00084 00085 StTrgMaker(const Char_t *name="analysis"); // constructor 00086 ~StTrgMaker(); // destructor 00087 00088 void Clear(Option_t *option=""); // called after every event to cleanup 00089 Int_t Init(); // called once at the beginning of your job 00090 Int_t Make(); // invoked for every event 00091 Int_t Finish(); // called once at the end 00092 00093 private: 00094 // 00095 // Add your data member and new methods here. 00096 // The "//!" means that rootcint is not adding 00097 // the data member to the streamer. Don't worry 00098 // if you don't know what this means. 00099 // In general it is a good idea in analysis makers 00100 // to always add the //! after a member. 00101 // 00102 00103 // 00104 // Methods (== member functions) 00105 // Remember: these are just examples! 00106 // 00107 double mMagneticField; 00108 bool accept(StEvent*); // this method serves as an event filter 00109 bool accept(StTrack*); // and this is used to select tracks 00110 void DoOneTrackCtb(FILE *oo,long q,double curvature,double phi0, 00111 double psi,double r0,double tanl,double z0); 00112 void DoOneTrackMwc(FILE *oo,long q,double curvature,double phi0, 00113 double psi,double r0,double tanl,double z0); 00114 void CalcCenterOfCircleDefinedByTrack(int q,double radius,double psi,double r0, 00115 double phi0,double *xcenter,double *ycenter); 00116 void Location2Sector(double tanl,double xAtMwc,double yAtMwc, 00117 int *sector,int *subsector,double *errDistPhi,double *errDistRad); 00118 void FindIntersectionOfTwoCircles( 00119 double center1x,double center1y,double radius1, /* input (circle 1) */ 00120 double center2x,double center2y,double radius2, /* input (circle 2) */ 00121 int *numIntersectionPoints, /* output */ 00122 double *intersection1x,double *intersection1y, /* output */ 00123 double *intersection2x,double *intersection2y /* output */); 00124 int TrayNumber(double x,double y,double z); 00125 void FakeInfo(FILE*, int); 00126 00127 // 00128 // Data members 00129 // Note, that it is recommended to start all member names with 00130 // an 'm'. This makes it easier to read the code later. 00131 // 00132 int mEventCounter; 00133 string mFileName; 00134 TFile *mFile; 00135 TNtuple *mTuple; 00136 00137 // 00138 // This is needed to make your maker known to root4star. 00139 // It must be always the last statement in the class. 00140 // Note that this is a macro, that's why the ';' is missing. 00141 // 00142 ClassDef(StTrgMaker,0) 00143 }; 00144 #endif
1.5.9