15 TEventList *event_list = 0;
17 Int_t current_event=0;
20 void viewEEmcDisplay(
const Char_t *fname,
const Char_t fopts=
"" )
26 file =
new TFile( fname );
31 mTree->SetBranchAddress(
"display",&display);
33 event_list =
new TEventList(
"event_list",
"List of user-selected events");
34 mTree->Draw(
">>event_list",
"" );
35 gStyle->SetPalette(1);
36 gStyle->SetHistMinimumZero();
43 std::cout << std::endl;
44 std::cout <<
"available commands"<<std::endl;
45 std::cout <<
"---------------------------------------------------------------------------------------------" << std::endl;
46 std::cout <<
"list_events() -- to get a list of events available for display" << std::endl;
47 std::cout <<
"list_events(Char_t *) -- list events which satisfy some set of cuts" << std::endl;
48 std::cout << std::endl;
49 std::cout <<
"load_event(Int_t) -- loads specified event"<< std::endl;
50 std::cout <<
"load_next() -- loads the next event in the event list" << std::endl;
51 std::cout <<
"show_event() -- displays towers and points for the current event" << std::endl;
52 std::cout <<
"show_sector(Int_t) -- zooms in on specified sector and shows smd strips/clusters"<< std::endl;
53 std::cout <<
"print(Char_t*) -- eg print(\".gif\"), print(\".ps\"), print(\".root\"), etc..." <<std::endl;
54 std::cout << std::endl;
55 std::cout <<
"help() -- show this message"<<std::endl;
56 std::cout << std::endl;
60 void load_event( Long64_t i ) { display->
clear(); mTree->GetEntry(i); }
63 if ( current_event > event_list -> GetN() ) current_event = 0;
64 Int_t entry = event_list->GetEntry(current_event);
66 std::cout << entry << Form(
"\t") << display->GetTitle()<<endl;
71 if ( current_event == 0 )
72 current_event = event_list->GetN();
75 Int_t entry = event_list->GetEntry(current_event);
77 std::cout << entry << Form(
"\t") << display->GetTitle()<<endl;
80 void show_event() { towers=display->
DrawPoints(
"box"); }
82 void show_sector( Int_t sector=-1, Option_t *topts=
"box", Option_t *sopts=
"" )
84 if ( sector<1||sector>12 )
86 std::cout <<
"specify a sector 1..12" << std::endl;
89 if ( !towers ) show_event();
90 Int_t mysector = sector-1;
91 Float_t xmin = 5.0 * (Float_t)mysector - 1.0;
92 Float_t xmax = xmin+6.0;
93 TCanvas *ctowers=display->
getEEmc();
98 towers->GetXaxis()->SetRangeUser(xmin,xmax);
100 if(ctowers)ctowers->Modified();
107 TH2F *hothers[3]={pre1,pre2,post};
111 for ( Int_t i=0;i<3;i++ )
113 if ( others[i] ) others[i]->cd();
114 if ( hothers[i] ) _zoom( sector, hothers[i] );
115 if ( others[i] ) others[i]->Modified();
120 void _zoom( Int_t sector, TH2 *h )
122 Int_t mysector = sector-1;
123 Float_t xmin = 5.0 * (Float_t)mysector - 1.0;
124 Float_t xmax = xmin+6.0;
125 h->GetXaxis()->SetRangeUser(xmin,xmax);
129 void show_layer(
const Char_t *name, Int_t sector=0, Option_t *opts=
"box,text" )
137 TString myname(name);
141 if ( myname.Contains(
"pre1") ) ilayer=1;
142 if ( myname.Contains(
"pre2") ) ilayer=2;
143 if ( myname.Contains(
"post") ) ilayer=3;
145 if ( myname.Contains(
"all") )
147 show_layer(
"pre1",sector,opts);
148 show_layer(
"pre2",sector,opts);
149 show_layer(
"post",sector,opts);
153 TH2F *histo=display->
DrawLayer( ilayer, opts );
155 Int_t mysector = sector-1;
156 Float_t xmin = 5.0 * (Float_t)mysector - 1.0;
157 Float_t xmax = xmin+6.0;
158 histo->GetXaxis()->SetRangeUser(xmin,xmax);
170 void print(
const Char_t *type )
173 for ( Int_t i=0;i<3;i++ ) {
174 TCanvas *ctowers = (TCanvas*)gROOT->GetListOfCanvases()->At(i);
176 ctowers->Print( TString(ctowers->GetName())+type );
184 mTree->Draw(
">>event_list",
"");
187 Long64_t nevents=mTree->GetEntries();
188 std::cout <<
"nentries="<<nevents<<endl;
189 for ( Long64_t i=0;i<nevents;i++ )
192 std::cout << i << Form(
"\t") << display->GetTitle()<<endl;
197 void list_events(
const Char_t *cuts )
200 mTree->Draw(
">>event_list",cuts );
202 for ( Int_t i=0;i<event_list->GetN();i++ )
204 Int_t entry=event_list->GetEntry(i);
206 std::cout << entry << Form(
"\t") << display->GetTitle()<<endl;
215 gROOT -> LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
216 loadSharedLibraries();
218 gSystem->Load(
"StDbLib");
219 gSystem->Load(
"StDbBroker");
220 gSystem->Load(
"St_db_Maker");
221 gSystem->Load(
"StEEmcUtil");
222 gSystem->Load(
"StEEmcDbMaker");
223 gSystem->Load(
"StEEmcSimulatorMaker");
225 gSystem->Load(
"StEEmcA2EMaker");
226 gSystem->Load(
"StEEmcClusterMaker");
227 gSystem->Load(
"StEEmcPointMaker");
228 gSystem->Load(
"StEEmcPi0Mixer");
230 gSystem->Load(
"StEEmcDisplayMaker");
void clear()
clears all storage arrays, deletes all canvases and histograms
TH1F * DrawClusters(Int_t sector, Int_t plane, Option_t *opts="")
TH2F * DrawPoints(Option_t *opts="box")
TH2F * DrawLayer(Int_t layer, Option_t *opts="box,text")