void FinishMC4( UInt_t chan, TString expt, TString tgt, TString thick, TString process, UInt_t effc = 0) { TString dir; dir = Form( "histograms/MonteCarlo/%s/%s_%s/%s_chan%d.root", expt.Data(), tgt.Data(), thick.Data(), process.Data(), chan); printf( "End-of-Run macro executing\n"); TFile f( dir, "recreate"); gROOT->GetList()->Write(); f.Close(); printf( "All histograms saved to %s\n", dir.Data()); if ( effc == 1) { gROOT->ProcessLine( ".L ThetaEff.C"); ThetaEff( chan, expt, tgt, thick, process, kFALSE); printf( "Theta efficiencies for experiment %s, target %s, thickness %s," " process %s, and tagger channel %d\n", expt.Data(), tgt.Data(), thick.Data(), process.Data(), chan); } else if ( effc == 2) { gROOT->ProcessLine( ".L ThetaEff.C"); CThetaEff( chan, expt, tgt, thick, process, kFALSE); printf( "Cos(Theta) efficiencies for experiment %s, target %s," " thickness %s, process %s, and tagger channel %d\n", expt.Data(), tgt.Data(), thick.Data(), process.Data(), chan); } else if ( effc == 3) { gROOT->ProcessLine( ".L ThetaEff.C"); ThetaEff( chan, expt, tgt, thick, process, kFALSE); CThetaEff( chan, expt, tgt, thick, process, kFALSE); printf( "Both efficiencies for experiment %s, target %s," " thickness %s, process %s, and tagger channel %d\n", expt.Data(), tgt.Data(), thick.Data(), process.Data(), chan); } }
void EffRange( UInt_t start, UInt_t end, TString experiment = "pi0", TString encl = "LH2_10cm", TString proc = "pi0_p", UInt_t rebin = 20) { UInt_t i; for ( i = start; i <= end; ThetaEff( i++, experiment, encl, proc, kFALSE, rebin)); }