00001 /*************************************************************************** 00002 * 00003 * $Id: StuPostScript.h,v 1.6 2003/09/02 17:58:09 perev Exp $ 00004 * 00005 * Author: Thomas Ullrich, April 2002 00006 *************************************************************************** 00007 * 00008 * Description: PostScript Event Display 00009 * The class has only one public static methods write() 00010 * which produces an encapsulated PostScript (EPS) file. 00011 * There are various options available. 00012 * 00013 * Syntax: 00014 * #include "StuPostScript.h" 00015 * 00016 * bool StuPostScript::write(const char* filename, const StEvent* event); 00017 * bool StuPostScript::write(const char* filename, const StEvent* event, 00018 * const char* options); 00019 * bool StuPostScript::write(const char* filename, const StEvent* event, 00020 * const char* options, 00021 * vector<StTrack*>* userTracks); 00022 * 00023 * filename: the name of the PostScript file. The extension should 00024 * be always '.eps'. 00025 * event: pointer to an event. 00026 * options: character string with options (see below). 00027 * userTracks: optional vector of pointers to tracks. 00028 * If present only those tracks stored in the vector 00029 * are plotted. Note that 'event' is still needed. 00030 * This option allows to select and print only certain 00031 * tracks. 00032 * Return Code: StuPostScript::write() return 'true' if successful 00033 * otherwise 'false'. 00034 * 00035 * Options (case sensitive): 00036 * b Black background, white frame. 00037 * Otherwise the frame is drawn in black and the 00038 * background is white. 00039 * p Draw beampipe. 00040 * c Use 3 colors to color tracks according to their pt. 00041 * red pt>1 GeV/c, green 0.5<pt<1 GeV/c, blue<0.5 GeV/c 00042 * C Use color spectra to color tracks according to their. 00043 * Blue lowest pt, red highest pt. 00044 * f Track drawn with fewer points (factor 4 less). 00045 * Helices are approximated by a line trough many points. 00046 * With fewer points the helices become slightly more 00047 * chiseled but files get considerable smaller. 00048 * Still sufficient for most cases. 00049 * t Add text (event, run number, trigger etc.) to the plot. 00050 * a Plot all global tracks. 00051 * Without this option short tracks 00052 * (<10 points) get suppressed. 00053 * s Plot sideview (zy) 00054 * Default is front view (xy) 00055 * h Show hits on tracks (circles) 00056 * H Show all hits (squares & circles) 00057 * Hits on tracks are drawn as circles 00058 * otherwise as squares 00059 * 00060 * StuPostScript writes PS without a dictionary. This makes the produced 00061 * files slightly bigger but the code easier to maintain. 00062 * 00063 * Known Problems: The side view and text are not compatible. It works 00064 * but doesn't look nice. 00065 *************************************************************************** 00066 * 00067 * $Log: StuPostScript.h,v $ 00068 * Revision 1.6 2003/09/02 17:58:09 perev 00069 * gcc 3.2 updates + WarnOff 00070 * 00071 * Revision 1.5 2002/10/11 17:34:15 ullrich 00072 * Hits on tracks drawn as circles not diamonds 00073 * 00074 * Revision 1.4 2002/06/25 02:43:24 ullrich 00075 * Added drawing of hits. 00076 * 00077 * Revision 1.3 2002/04/23 17:26:52 ullrich 00078 * More description. 00079 * 00080 * Revision 1.2 2002/04/23 17:17:10 ullrich 00081 * More description. 00082 * 00083 * Revision 1.1 2002/04/23 03:15:28 ullrich 00084 * Initial Revision. 00085 * 00086 **************************************************************************/ 00087 #include "StEventTypes.h" 00088 #include <Stiostream.h> 00089 #include "Stiostream.h" 00090 #include <vector> 00091 00092 class StuPostScript { 00093 public: 00094 StuPostScript(); 00095 virtual ~StuPostScript(); 00096 00097 static bool write(const char*, const StEvent*, const char* = 0, vector<StTrack*>* = 0); 00098 00099 protected: 00100 static void writeHeader(ostream&, const char*); 00101 static void writeTrailor(ostream&); 00102 static void writeDetectorFrame(ostream&); 00103 static void writeTracks(ostream&, const StEvent*); 00104 static void writeText(ostream&, const StEvent*); 00105 static void writeHits(ostream&, const StEvent*); 00106 static void hls2rgb(double, double, double, double&, double &, double &); 00107 00108 static bool mBlackBackground; 00109 static bool mDrawBeamPipe; 00110 static bool mTracksWithManyColors; 00111 static bool mTracksWithFewColors; 00112 static bool mFewerPointsPerTrack; 00113 static bool mAddText; 00114 static bool mAllGlobalTracks; 00115 static bool mSideView; 00116 static bool mShowTrackHits; 00117 static bool mShowAllHits; 00118 static const int mllx; 00119 static const int mlly; 00120 static const int murx; 00121 static const int mury; 00122 static const int mMinFitPoints; 00123 00124 static vector<StTrack*> *mUserTracks; 00125 };
1.5.9