ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/auterman/SusyScan/PlotScript/IsoMassLine.cc
Revision: 1.2
Committed: Sat Nov 27 11:19:35 2010 UTC (14 years, 5 months ago) by auterman
Content type: text/plain
Branch: MAIN
Changes since 1.1: +6 -13 lines
Log Message:
templating IsoMassLine; making specialized sort function private member

File Contents

# User Rev Content
1 auterman 1.1 #include "IsoMassLine.h"
2     #include "TGraph.h"
3     #include "SusyScan.h"
4    
5     #include <cmath>
6     #include <algorithm>
7    
8    
9 auterman 1.2 template<class T>
10     TGraph * IsoMassLine<T>::get( double(*x)(const T*), double(*y)(const T*),
11     double(*func)(const T*), const double mass, const double diff )
12 auterman 1.1 {
13     TGraph * result = new TGraph(1);
14     std::sort(_scan->begin(),_scan->end(),sort_by(x));
15     int i=0;
16 auterman 1.2 for (typename std::vector<T*>::const_iterator it=_scan->begin();it!=_scan->end();++it){
17 auterman 1.1 if ( fabs(func( *it)-mass)<diff )
18     result->SetPoint(i++, x(*it), y(*it));
19     }
20     return result;
21     }
22 auterman 1.2
23     template class IsoMassLine<SusyScan>;