Changeset 12521
- Timestamp:
- 11/15/11 11:56:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/fpeak_cfd.C
r12502 r12521 23 23 #define HAVE_ZLIB 24 24 #include "fits.h" 25 #include "FOpenCalibFile.c" 25 26 #include "openFits.h" 27 #include "openFits.c" 26 28 27 29 #include "discriminator.h" … … 50 52 UInt_t NumberOfPixels; 51 53 52 size_t drs_n; 53 vector<float> drs_basemean; 54 vector<float> drs_gainmean; 55 vector<float> drs_triggeroffsetmean; 54 size_t TriggerOffsetROI, RC; 55 vector<float> Offset, Gain, TriggerOffset; 56 56 57 57 vector<float> Ameas(FAD_MAX_SAMPLES); // copy of the data (measured amplitude … … 102 102 int avg1 = 8, 103 103 int avg2 = 8, 104 float threshold = 5.0, 104 105 int verbosityLevel = 1, // different verbosity levels can be implemented here 105 106 bool ProduceGraphic = true … … 115 116 histogramtitle += " "; 116 117 117 histogramtitle += avg1; 118 histogramtitle += " "; 119 histogramtitle += avg2; 120 // histogramtitle += " 3.0 100"; 121 cout << histogramtitle.Data() << endl; 118 histogramtitle += avg1; 119 histogramtitle += " "; 120 histogramtitle += avg2; 121 histogramtitle += " "; 122 histogramtitle += threshold ; 123 histogramtitle += " 100"; 124 cout << histogramtitle.Data() << endl; 122 125 123 126 … … 141 144 // Parameters to the data file. So they are filled with 142 145 // raw data as soon as datafile->GetRow(int) is called. 143 NEvents = OpenDataFile( datafilename, &datafile,146 NEvents = openDataFits( datafilename, &datafile, 144 147 AllPixelDataVector, StartCellVector, CurrentEventID, 145 148 RegionOfInterest, NumberOfPixels, PXLxROI, verbosityLevel); … … 162 165 cout <<"of, which "<< npixel << "will be processed"<< endl; 163 166 164 165 166 //Get the DRS calibration 167 FOpenCalibFile( drsfilename, 168 drs_basemean, 169 drs_gainmean, 170 drs_triggeroffsetmean, 171 drs_n); 167 RC = openCalibFits( drsfilename, Offset, Gain, TriggerOffset, TriggerOffsetROI); 168 if (RC == 0){ 169 cout << "return code of openCalibFits:" << drsfilename << endl; 170 cout << "is zero -> aborting." << endl; 171 return 1; 172 } 172 173 173 174 BookHistos( histogramtitle ); … … 187 188 188 189 applyDrsCalibration( Ameas,pix,12,12, 189 drs_basemean, drs_gainmean, drs_triggeroffsetmean,190 Offset, Gain, TriggerOffset, 190 191 RegionOfInterest, AllPixelDataVector, StartCellVector); 191 192 … … 210 211 EnlargeRegion( *zXings, 10, 10); 211 212 findAbsMaxInRegions( *zXings, Vslide); 212 // removeMaximaBelow( *zXings, 3.0, 0); 213 // removeRegionWithMaxOnEdge( *zXings, 2); 214 // removeRegionOnFallingEdge( *zXings, 100); 215 213 removeMaximaBelow( *zXings, threshold, 0); 214 removeRegionWithMaxOnEdge( *zXings, 2); 215 removeRegionOnFallingEdge( *zXings, 100); 216 216 217 217 // fill maxima in Histogram
Note:
See TracChangeset
for help on using the changeset viewer.