#include #include #include #include #include using namespace std; #include #include #include #include #define _DBG_ cerr<<__FILE__<<":"<<__LINE__<<" " #define _DGB__ _DBG_<IsOpen()){ _DBG_<<"Unable to create ROOT file \""<Branch("S", vals, "x/D:y:depth"); scan->Branch("P", ivals, "pass/I:n"); // Inform user what's going on cout<>str; // If the string is "horizontal" then process the end of pass if(str=="horizontal"){ ifile>>str; // read in "pass" string; ifile>>pass; ifile>>str; // read in "complete" string cout<<"finished pass "<Fill(); Nmeasurements_this_pass++; } cout<Write(); delete rfile; cout<<"Complete"<Project("depth", "depth:y:x"); // Create temporary histo to hold z-projections TAxis *zaxis = depth->GetZaxis(); TH1D *h = new TH1D("h","", zaxis->GetNbins(), zaxis->GetXmin(), zaxis->GetXmax()); // Loop over all bins and find mean and RMS for each TH2D *depth_mean = (TH2D*)depth2D->Clone("depth_mean"); TH2D *depth_rms = (TH2D*)depth2D->Clone("depth_rms"); for(int ibin=1; ibin<=depth->GetXaxis()->GetNbins(); ibin++){ for(int jbin=1; jbin<=depth->GetYaxis()->GetNbins(); jbin++){ h->Reset(); for(int kbin=1; kbin<=h->GetNbinsX(); kbin++){ h->SetBinContent(kbin, depth->GetBinContent(ibin, jbin, kbin)); } double mean = h->GetMean(); double rms = h->GetRMS(); depth_mean->SetBinContent(ibin, jbin, mean); depth_rms->SetBinContent(ibin, jbin, 1000.0*rms); } } delete h; // Set labels depth_mean->SetStats(0); depth_mean->SetXTitle("x (cm)"); depth_mean->SetYTitle("y (cm)"); depth_mean->SetTitle("Mean of depth measurements per ~1 in^{2}"); depth_rms->SetStats(0); depth_rms->SetXTitle("x (cm)"); depth_rms->SetYTitle("y (cm)"); depth_rms->SetTitle("RMS of depth measurements per ~1 in^{2}"); } //--------------- // ParseCommandLineArgs //--------------- void ParseCommandLineArgs(int narg, char *argv[]) { // Initialize FILENAME global FILENAME = ""; // Loop over arguments for(int i=1; i>PLANE; ss_ANGLE>>ANGLE; ss_YEAR>>YEAR; ss_MONTH>>MONTH; ss_DAY>>DAY; ss_HOUR>>HOUR; ss_MINUTE>>MINUTE; ss_SECONDS>>SECONDS; } //--------------- // Usage //--------------- void Usage(void) { cout<