]> jspc29.x-matter.uni-frankfurt.de Git - radhard.git/commitdiff
Merge branch 'master' of jspc29.x-matter.uni-frankfurt.de:radhard
authorDennis Doering <doering@physik.uni-frankfurt.de>
Thu, 24 Sep 2015 10:04:38 +0000 (12:04 +0200)
committerDennis Doering <doering@physik.uni-frankfurt.de>
Thu, 24 Sep 2015 10:04:38 +0000 (12:04 +0200)
Conflicts:
MABS_run_analyzer/ChargeSpektrum.c
Merge branch 'master' of jspc29.x-matter.uni-frankfurt.de:radhard

Conflicts:
MABS_run_analyzer/ChargeSpektrum.c

1  2 
MABS_run_analyzer/ChargeSpektrum.c
MABS_run_analyzer/ChargeSpektrumFunctions.c
MABS_run_analyzer/Run.c

index 452f09a884177b7058d234fea574871841755823,9029615ef043f250b49e077e1d6c32bc634d410a..bbc02087d245f17e88473813714f2f3ab6888065
@@@ -123,13 -123,13 +123,15 @@@ void ChargeSpektrum(TString runnumber 
                  runs[runi]->useDynamicalNoise(true);
                  runs[runi]->useCommonModeFilter(false);
                  runs[runi]->setFixedThresholdValueElectrons(1440);
--                
++                              runs[runi]->selectSubMatrixFSBB("A0");
  //                 runs[runi]->analyzeFrame(57826);
  //                 runs[runi]->analyzeFrame(57827);
--//                 runs[runi]->analyzeFrame(983603); 
--                
++                // runs[runi]->analyzeFrame(32); 
++               //  runs[runi]->analyzeFrame(1390); 
++                          runs[runi]->analyzeFrame(8229); 
++              //      runs[runi]->analyzeFrame(133); 
                  // creates or opens .root file, can analyze the RAW data
--                runs[runi]->error=runs[runi]->analyzeRun(false); // creates or opens .root file, can analyze the RAW data
++          //      runs[runi]->error=runs[runi]->analyzeRun(true); // creates or opens .root file, can analyze the RAW data
                  if (!runs[runi]->error)
                  {
              //         gROOT->SetBatch(kTRUE);
                      //         runs[runi]->plotNoise();
                      if (!isBatch)
                          gROOT->SetBatch(kFALSE);
-                     runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogram);
-                     runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramthreshold);
-                     runs[runi]->compareHistogramClassVector.push_back(runs[runi]->dennismegacut);
 -                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogram->calibrated);
 -                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramthreshold->calibrated);
 -                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->dennismegacut->calibrated);
 -                    runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramfixedthreshold->calibrated);
--                    runs[runi]->plotCompareHistograms();
-                     // runs[runi]->plotAllHistograms(runs[runi]->histogram->calibrated);
-                     // runs[runi]->plotAllHistograms(runs[runi]->dennismegacut->calibrated);
-                     // runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->Seed, "landau");
-                     // runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->calibrated->Seed, "landau");
-                      compareHistogramClassVector.push_back(runs[runi]->histogram);
-                                        compareHistogramClassVector.push_back(runs[runi]->dennismegacut);
 -                    runs[runi]->plotAllHistograms(runs[runi]->histogram->calibrated);
 -                    runs[runi]->plotAllHistograms(runs[runi]->dennismegacut->calibrated);
 -                    runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->Seed, "landau");
 -                    runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->calibrated->Seed, "landau");
 -                    compareHistogramClassVector.push_back(runs[runi]->histogram->calibrated);
 -                    compareHistogramVector.push_back(runs[runi]->histogram->Seed);
++    //                runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogram);
++    //                runs[runi]->compareHistogramClassVector.push_back(runs[runi]->histogramthreshold);
++    //                runs[runi]->compareHistogramClassVector.push_back(runs[runi]->dennismegacut);
++    //                runs[runi]->plotCompareHistograms();
++
++  //                  runs[runi]->plotAllHistograms(runs[runi]->histogram->calibrated);
++  //                  runs[runi]->plotAllHistograms(runs[runi]->dennismegacut->calibrated);
++  //                  runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->Seed, "landau");
++  //                  runs[runi]->plot1DHistogram(runs[runi]->histogram->calibrated, runs[runi]->histogram->calibrated->Seed, "landau");
++                //    compareHistogramClassVector.push_back(runs[runi]->histogram);
++                                      compareHistogramClassVector.push_back(runs[runi]->histogramFSBB);
++                                      compareHistogramClassVector.push_back(runs[runi]->histogramFSBB2);
++                //    compareHistogramVector.push_back(runs[runi]->histogram->Seed);
++                //    compareHistogramVector.push_back(runs[runi]->histogram->Sum);
++                                      compareHistogramVector.push_back(runs[runi]->histogramFSBB2->Seed);
++                                      compareHistogramVector.push_back(runs[runi]->histogramFSBB2->Sum);
  //                     runs[runi]->integrateSr90Spectra(&runs[runi]->histogramfixedthresholdCalibrated, runs[runi]->histogramfixedthresholdCalibrated.Seed, 0); 
  //                     runs[runi]->plot1DHistogram(&runs[runi]->histogramfixedthresholdCalibrated, runs[runi]->histogramfixedthresholdCalibrated.Seed, "landau");
  //                     runs[runi]->plot1DHistogram(&runs[runi]->histogramthresholdCalibrated, runs[runi]->histogramthresholdCalibrated.Seed, "landau");
          }
      }
      plotAllRuns();
++      setCustomPath("/Excel");
+     writeObservableToFile();
  //     plotAllRuns("seed threshold calibrated");
-       setCustomPath("Excel/");
 -//    setCustomPath("Excel/");
 -//     writeObservableToFile("seed threshold calibrated");
 + //    writeDataToExcel();
  //    writeObservableToFile("seed threshold");
  //    writeObservableToFile("seed threshold");
  //    writeObservableToFile("sum threshold");
index 40a43debe47ffb9e9bb605348ca676d035018b2b,eabe580ee3847a0ce02462c23d27856d1b36da1c..1b36ac76a830074c5797890429f4f9dfe03ed376
@@@ -171,68 -93,29 +93,84 @@@ Bool_t writeObservableToFile(
                  }
              }
          }
-         *fout<<endl;
-     }
-     fout->close();
-     
+         filename+=".dat";
+         fstream* fout = new fstream(filename,ios::out);
+         header += Form("#");
+         for (vector<TH1F*>::iterator curHistogram = compareHistogramVector.begin(); curHistogram != compareHistogramVector.end(); curHistogram++)  {
+             header += Form("bin\t%s\t",(*curHistogram)->GetName());
+         }
+         *fout << header << endl;
+         TString outline;
+         for(Int_t bin=1;bin<=runs[0]->cursystemparam.nbins;bin++)
+         {
+             outline ="";
+             for (vector<TH1F*>::iterator curHistogram = compareHistogramVector.begin(); curHistogram != compareHistogramVector.end(); curHistogram++)  {
+                 outline+=Form("%.1f\t%.1f\t", (*curHistogram)->GetBinCenter(bin), (*curHistogram)->GetBinContent(bin));
+             }
+             *fout<<outline<<endl;
+         }
+         fout->close();
+         return 0;
+         
+     }    
      return 0;
  }
 +Bool_t writeDataToExcel()
 +{     
 +    system("mkdir "+ runs[0]->savepathresults + " -p");
 +    TString headerInfo = "";
 +    for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
 +    {
 +        headerInfo+=runs[runi]->runcode+"\t\t\t";
 +    }
 +    TH1F* plothistogrampointer = runs[0]->plothistogrampointer;
 +    TString runnumberListe="";
 +    TString header="";
 +      cout<<"komme ich hierher3"<<endl;
 +      for (UInt_t histogrami=0; histogrami < compareHistogramClassVector.size(); histogrami++)
 +        {
 +            HistogramType* curhistogramclassp = compareHistogramClassVector.at(histogrami);
 +            TH1F* curhistogramclone;
 +            curhistogramclone = (TH1F*) curhistogramclassp->Seed->Clone();
 +                      runnumberListe+=Form("%d_",curhistogramclassp->labbook.runnumber);
 +         //   header+=Form("%d\t%s\t\t\t", runs[runi]->labbook.runnumber, curhistogramclone->GetTitle());
 +                      
 +              }
  
 +    // TString filename= runs[0]->savepathresults + "/" + ownpath + runnumberListe + Form("%s",plothistogrampointer->GetName())+"histogram.dat";
 +      // fstream* fout = new fstream(filename,ios::out);
 +    // *fout << headerInfo << endl;
 +    // *fout << header << endl;
 +      
 +      
 +    // for(Int_t bini=0;bini<plothistogrampointer->GetNbinsX();bini++)
 +    // {
 +        // for(Int_t runi=0;runi<numberRuns;runi++) // loop over runs read from file
 +        // {
 +            // if (runs[runi] != nullptr)
 +            // {
 +                // if (!runs[runi]->error)
 +                // {
 +                    // plothistogrampointer = runs[runi]->plothistogrampointer;
 +                    // TString outline;
 +                                      // Double_t binContentNorm=plothistogrampointer->GetBinContent(bini)/runs[runi]->labbook.frames_foundDB*10000000;
 +                                      // Double_t binSumme=0.0;
 +                                      // for(Int_t binSummei=bini;binSummei<plothistogrampointer->GetNbinsX();binSummei++)//Sum up from bini beginning (cut condition for detection eff.)
 +                                      // {
 +                                              // Double_t binContentNormInSumme=plothistogrampointer->GetBinContent(binSummei)/runs[runi]->labbook.frames_foundDB*10000000;
 +                                              // binSumme=binSumme+binContentNormInSumme;
 +                                      // }
 +                                      // outline=Form("%.1f\t%.1f\t%.1f\t%.1f\t",plothistogrampointer->GetBinCenter(bini),plothistogrampointer->GetBinContent(bini),binContentNorm,binSumme);
 +                    // *fout<<outline;
 +                // }
 +            // }
 +        // }
 +        // *fout<<endl;
 +    // }
 +  //  fout->close();
 +    
 +    return 0;
 +}
  
  
  Bool_t plotAllRuns()
Simple merge