Advertisement
EstEsca

Untitled

May 7th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.   while(getline(f, line)){
  8.     Debug(i << "th line" << endl);
  9.  
  10.     k=0;
  11.     stringstream iss(line);
  12.     for (j=0; j < VARIABLES; j++){
  13.  
  14.       string val;
  15.       stringstream convertor(val);
  16.  
  17.       getline(iss, val, ',');
  18.       Debug(j << "th component: " << val << " " << endl);
  19.  
  20.       if(j == VARIABLES-1){
  21.         if(val == s){
  22. //          trees[0]->Fill();
  23.           sDebug("signal detected" << endl);
  24.         }
  25.         else if(val == b){
  26. //          trees[1]->Fill();
  27.           sDebug("background detected" << endl);
  28.         }
  29.         else{
  30.           cout << "ERROR OCCURED" << endl;
  31.           return -1;
  32.         }
  33.       }
  34.  
  35.       else{
  36.         convertor >> data[j];
  37.       }
  38.  
  39.     }
  40.  
  41.  
  42.     Debug(endl);
  43.     i++;
  44.   }
  45.  
  46.   tfile.Write();
  47. ----------------------------------------
  48.  
  49.  
  50.   for(int i=0;i<SIGNALS;i++){
  51.  
  52.     TTree *t = v.at(i);
  53.     int nentries = t->GetEntries();
  54.  
  55.     for(int j=0;j<nentries;j++){
  56.       t->GetEntry(j);
  57.       if(i==0)
  58.       temphisto->Fill(data[1]);
  59.  
  60.       for(int k=0;k<VARIABLES-1;k++){
  61.         histograms.at(i).at(k)->Fill(data[k]);
  62.         if(i == 0 && k == 1){
  63.           float num = data[k];
  64.           cout << "i: " << i << "var: " << k << "val: " << num << endl;
  65.         }
  66.       }
  67.  
  68.  
  69.     }
  70.  
  71.     for(int l=0;l<VARIABLES-1;l++){
  72.       TH1F* histo = histograms.at(i).at(l);
  73. //      histo->GetXaxis()->SetRange(histo->GetMinimum(),histo->GetMaximum());
  74.     }
  75.   }
  76.  
  77.  
  78.   float *bins = temphisto->GetArray();
  79.   for(int i=0;i<ENTRIES-1;i++){
  80.     cout << bins[i] << " ";
  81.   }
  82.   //histograms.at(0).at(1)->Draw();
  83.   temphisto->Draw();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement