Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while(getline(f, line)){
- Debug(i << "th line" << endl);
- k=0;
- stringstream iss(line);
- for (j=0; j < VARIABLES; j++){
- string val;
- stringstream convertor(val);
- getline(iss, val, ',');
- Debug(j << "th component: " << val << " " << endl);
- if(j == VARIABLES-1){
- if(val == s){
- // trees[0]->Fill();
- sDebug("signal detected" << endl);
- }
- else if(val == b){
- // trees[1]->Fill();
- sDebug("background detected" << endl);
- }
- else{
- cout << "ERROR OCCURED" << endl;
- return -1;
- }
- }
- else{
- convertor >> data[j];
- }
- }
- Debug(endl);
- i++;
- }
- tfile.Write();
- ----------------------------------------
- for(int i=0;i<SIGNALS;i++){
- TTree *t = v.at(i);
- int nentries = t->GetEntries();
- for(int j=0;j<nentries;j++){
- t->GetEntry(j);
- if(i==0)
- temphisto->Fill(data[1]);
- for(int k=0;k<VARIABLES-1;k++){
- histograms.at(i).at(k)->Fill(data[k]);
- if(i == 0 && k == 1){
- float num = data[k];
- cout << "i: " << i << "var: " << k << "val: " << num << endl;
- }
- }
- }
- for(int l=0;l<VARIABLES-1;l++){
- TH1F* histo = histograms.at(i).at(l);
- // histo->GetXaxis()->SetRange(histo->GetMinimum(),histo->GetMaximum());
- }
- }
- float *bins = temphisto->GetArray();
- for(int i=0;i<ENTRIES-1;i++){
- cout << bins[i] << " ";
- }
- //histograms.at(0).at(1)->Draw();
- temphisto->Draw();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement