Changeset 12486 for fact/tools/rootmacros
- Timestamp:
- 11/10/11 12:49:29 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/gainfit.C
r12388 r12486 67 67 68 68 cGainFit->cd(1); 69 p1->GetXaxis()->SetRangeUser( 2.5, 25);69 p1->GetXaxis()->SetRangeUser( 5, 25); 70 70 p1->Draw(); 71 71 … … 114 114 115 115 //tf->Close(); 116 string filename = InputRootFileName; 117 size_t lastslash = filename.find_last_of('/'); 118 filename = filename.substr(lastslash+1); 119 size_t firstdot = filename.find_first_of('.'); 120 filename = filename.substr(0, firstdot); 121 122 string::iterator it; 123 for (it=filename.begin(); it < filename.end(); ){ 124 125 if (!isdigit(*it)){ 126 it=filename.erase(it); 127 } 128 else 129 ++it; 130 } 131 cout << filename << endl; 132 116 133 117 134 ofstream out; 118 135 out.open( OutTextFileName ); 136 out << "pixelID/I:gain/F:fitgain:filename/l" << endl; 137 out << "# ---- the 1st line helps to use TTree::ReadFile, for reading again this txt file with root. " << endl; 119 138 out << "#" << InputRootFileName << endl; 120 139 out << "# PixelID : simple_gain : gain " << endl; 121 140 out << "# simple_gain is just the distance of the local maxima in the amplitude spektra " << endl; 122 141 out << "# 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;125 142 for (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; 127 144 128 145 }
Note:
See TracChangeset
for help on using the changeset viewer.