00001
00002
00003
00004
00006
00055 class StEvent;
00056 StEvent* event = 0;
00057
00059
00068
00069 void rd(int hits=0, bool clear=false)
00070 {
00071
00072 if (event) {
00073 if (clear) gEventDisplay->Clear();
00074 if (hits) {
00075 if (hits & 0x1 ) gEventDisplay->Hits(event,1);
00076 if (hits & 0x2 ) gEventDisplay->EmcHits(event);
00077 if (hits & 0x4 ) gEventDisplay->FtpcHits(event,1);
00078
00079 }
00080 else gEventDisplay->Tracks(event);
00081
00082 }
00083 }
00084
00085 void skipe(int nEvents=1) {
00086 if(chain) chain->Skip(nEvents);
00087 }
00088
00089
00091
00101
00102 void ae(int tracks=-1, int hits=-1)
00103 {
00104
00105
00106
00107 static int defaultTracks = 0;
00108 static int defaultHits = 3;
00109
00110 if (tracks != -1 ) defaultTracks = tracks;
00111 else tracks = defaultTracks;
00112
00113 if (hits != -1 ) defaultHits = hits;
00114 else hits = defaultHits;
00115 gEventDisplay->Clear();
00116 newevent:
00117 chain->MakeEvent();
00118 event = (StEvent*)chain->GetDataSet("StEvent");
00119 if (event && !event->trackNodes().empty())) {
00120 if (tracks) rd();
00121 if (hits) rd(hits);
00122 } else {
00123 printf(" event is empty %p\n", event);
00124 goto newevent;
00125 }
00126 }
00128
00134
00135 void Ed(const char* file =
00136 "/star/institutions/bnl/fine/testfiles/st_physics_10169042_raw_4030001.event.root"
00137 , unsigned int nEvent=1, const char * detectorNames="TPC")
00138 {
00139
00140 if ( gSystem->AccessPathName(file)) {
00141 cout << endl << endl
00142 << "** Error ** : The input file: <"<< file << "> does not exist !!!"
00143 << endl << endl
00144 << " Please select the existing one and re-call the function: "
00145 << endl
00146 << endl << " root [0] Ed(\"new file ROOT file name\")"
00147 << endl
00148 << endl << "To draw the StEvent components with no detector geometry, use: "
00149 << endl
00150 << endl << " root [0] Ed(\"new file ROOT file name\",0)"
00151 << endl
00152 << endl;
00153 return;
00154 }
00155 gROOT->Macro("Load.C");
00156 gSystem->Load("StDetectorDbMaker");
00157 gROOT->Macro(Form("bfc.C(%d,1,\"doevents\",\"%s\")",nEvent,file));
00158 delete gEventDisplay;
00159 new StuDraw3DEvent(detectorNames);
00160
00161 gEventDisplay->SetBkColor(kBlack);
00162 printf("\n The display is ready!\n");
00163 printf(" call:\n");
00164 printf("\t---\n");
00165 printf("\tae()\n");
00166 printf("\t---\n");
00167 printf("method to see the next event\n");
00168 ae();
00169 printf(" call:\n");
00170 printf("\t---\n");
00171 printf("\tae() - to draw the default setting\n");
00172 printf("\tae(1,1) - to change the default and draw the tracks and its tpc hits\n");
00173 printf("\tae(0,2) - to change the default and draw the Bemc towers\n");
00174 printf("\t---\n");
00175 printf("method to see the next event\n");
00176 }