Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:13:57

0001 #include <sPhenixStyle.C>
0002 
0003 
0004 int draw_preliminary_plot( int run_num = 50889 )
0005 {
0006 
0007   SetsPhenixStyle();
0008   string data_dir = "results/tracking/";
0009   string data = data_dir + "tracking_run" + to_string( run_num ) + ".root";
0010 
0011   TFile* tf = new TFile( data.c_str(), "READ" );
0012   tf->ls();
0013 
0014   auto list = tf->GetListOfKeys();
0015   for( int i=0; i<list->GetEntries(); i++ )
0016     {
0017       string name = list->At( i )->GetName();
0018       if( name.find( "canvas" ) == string::npos )
0019     continue;
0020 
0021       TCanvas* c = (TCanvas*)tf->Get( name.c_str() );
0022       c->Draw();
0023 
0024       string num_str = name.substr( name.find_last_of( "_" ), name.size() );
0025       string output = data_dir + "event_display_run" + to_string( run_num ) + num_str + ".pdf";
0026 
0027       cout << output << endl;
0028       c->Print( output.c_str() );
0029 
0030       c->Print();
0031       c->ls();
0032       break;
0033     }
0034 
0035   
0036   tf->Close();
0037   return 0;
0038 }