#include #include #include #include #include #include #include #include #include "common.h" using namespace std; void problem( const char* rdo_file_name ) { // Set up the file name: string file_name = rdo_file_name; unsigned int pos = file_name.rfind( '/' ); file_name.erase( 0, pos + 1 ); // Open the RDO file: TFile *frdo = new TFile( rdo_file_name, "READ" ); // Get a hold of the tree(s): TTree *tt_truth = ( TTree* )frdo->Get( "TRUTH/200" ); // Truth information Int_t Spcl_Num; Int_t Spcl_ID [ MAX_Particle ]; Float_t Spcl_Pt [ MAX_Particle ]; tt_truth->SetBranchAddress( "Spcl_Num", &Spcl_Num ); tt_truth->SetBranchAddress( "Spcl_ID", Spcl_ID ); tt_truth->SetBranchAddress( "Spcl_Pt", Spcl_Pt ); // Making the Canvas TCanvas fastest_muons_window( "fastest_muons_window", "8500 events analysis", 800, 1100 ); fastest_muons_window.cd(); TH1I fastest_muon_hist( "fastest_muon_hist", "", 50, 0.0, 50000.0 ); fastest_muon_hist.SetLineColor( kRed ); fastest_muon_hist.AppendPad(); TH1I faster_muon_hist( "faster_muon_hist", "", 50, 0.0, 50000.0 ); faster_muon_hist.SetLineColor( kBlue ); faster_muon_hist.AppendPad(); // Asigning the Truth Muons information Float_t P1 = 0; Float_t P2 = 0; for( Int_t i = 0; i < (Int_t)tt_truth->GetEntries(); ++i ) { tt_truth->GetEntry( i ); for( Int_t j = 0; j < Spcl_Num; ++j ) { if( ( Spcl_ID[ j ] == 13 ) || ( Spcl_ID[ j ] == -13 ) ) { //Checking Which is Muon if ( Spcl_Pt[ j ] > P1 ) P1 = Spcl_Pt[ j ]; // Checking which are the Muons with biggest Pt else if ( Spcl_Pt[ j ] > P2 ) P2 = Spcl_Pt[ j ]; } } if ( P2!=0 ) { // Checks if there were 2 muons fastest_muon_hist.Fill( P1 ); faster_muon_hist.Fill( P2 ); } P1 = 0; P2 = 0; } faster_muon_hist.Draw(); fastest_muon_hist.Draw("same"); fastest_muons_window.SaveAs("2_Fast_Muons.ps"); return; }