Changeset 12486


Ignore:
Timestamp:
11/10/11 12:49:29 (13 years ago)
Author:
neise
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/gainfit.C

    r12388 r12486  
    6767
    6868        cGainFit->cd(1);
    69         p1->GetXaxis()->SetRangeUser( 2.5, 25);
     69        p1->GetXaxis()->SetRangeUser( 5, 25);
    7070        p1->Draw();
    7171
     
    114114
    115115//tf->Close(); 
     116string filename =  InputRootFileName;
     117size_t lastslash = filename.find_last_of('/');
     118filename = filename.substr(lastslash+1);
     119size_t firstdot = filename.find_first_of('.');
     120filename = filename.substr(0, firstdot);
     121
     122string::iterator it;
     123for (it=filename.begin(); it < filename.end(); ){
     124
     125        if (!isdigit(*it)){
     126                it=filename.erase(it);
     127        }
     128        else
     129                ++it;
     130}
     131cout << filename << endl;
     132
    116133
    117134ofstream out;
    118135out.open( OutTextFileName );
     136out << "pixelID/I:gain/F:fitgain:filename/l" << endl;
     137out << "# ---- the 1st line helps to use TTree::ReadFile, for reading again this txt file with root. " << endl;
    119138out << "#" << InputRootFileName << endl;
    120139out << "# PixelID : simple_gain : gain " << endl;
    121140out << "# simple_gain is just the distance of the local maxima in the amplitude spektra " << endl;
    122141out << "# gain is derived from a fit of two gaussians " << endl;
    123 out << "# ---- the following line helps to use TTree::ReadFile, for reading again this txt file with root. " << endl;
    124 out << "pixelID/I:simpleGain/F:Gain" << endl;
    125142for (int i=0; i<1440; i++){
    126         out << pixelvec[i] << "\t" << simple_gain[i] << "\t" << gain[i] << endl;
     143        out << pixelvec[i] << "\t" << simple_gain[i] << "\t" << gain[i] << "\t" << filename << endl;
    127144
    128145}
Note: See TracChangeset for help on using the changeset viewer.