CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/MuonAnalysis/MomentumScaleCalibration/src/Functions.cc

Go to the documentation of this file.
00001 #include "MuonAnalysis/MomentumScaleCalibration/interface/Functions.h"
00002 
00003 scaleFunctionBase<double * > * scaleFunctionService( const int identifier )
00004 {
00005   switch ( identifier ) {
00006   case ( 0 ): return ( new scaleFunctionType0<double * > ); break;
00007   case ( 1 ): return ( new scaleFunctionType1<double * > ); break;
00008   case ( 2 ): return ( new scaleFunctionType2<double * > ); break;
00009   case ( 3 ): return ( new scaleFunctionType3<double * > ); break;
00010   case ( 4 ): return ( new scaleFunctionType4<double * > ); break;
00011   case ( 5 ): return ( new scaleFunctionType5<double * > ); break;
00012   case ( 6 ): return ( new scaleFunctionType6<double * > ); break;
00013   case ( 7 ): return ( new scaleFunctionType7<double * > ); break;
00014   case ( 8 ): return ( new scaleFunctionType8<double * > ); break;
00015   case ( 9 ): return ( new scaleFunctionType9<double * > ); break;
00016   case ( 10 ): return ( new scaleFunctionType10<double * > ); break;
00017   case ( 11 ): return ( new scaleFunctionType11<double * > ); break;
00018   case ( 12 ): return ( new scaleFunctionType12<double * > ); break;
00019   case ( 13 ): return ( new scaleFunctionType13<double * > ); break;
00020   case ( 14 ): return ( new scaleFunctionType14<double * > ); break;
00021   case ( 15 ): return ( new scaleFunctionType15<double * > ); break;
00022   case ( 16 ): return ( new scaleFunctionType16<double * > ); break;
00023   case ( 17 ): return ( new scaleFunctionType17<double * > ); break;
00024   case ( 18 ): return ( new scaleFunctionType18<double * > ); break;
00025   case ( 19 ): return ( new scaleFunctionType19<double * > ); break;
00026   case ( 20 ): return ( new scaleFunctionType20<double * > ); break;
00027   case ( 21 ): return ( new scaleFunctionType21<double * > ); break;
00028   case ( 22 ): return ( new scaleFunctionType22<double * > ); break;
00029   case ( 23 ): return ( new scaleFunctionType23<double * > ); break;
00030   case ( 24 ): return ( new scaleFunctionType24<double * > ); break;
00031   case ( 25 ): return ( new scaleFunctionType25<double * > ); break;
00032   case ( 26 ): return ( new scaleFunctionType26<double * > ); break;
00033   case ( 27 ): return ( new scaleFunctionType27<double * > ); break;
00034   default: std::cout << "Error: wrong identifier = " << identifier << std::endl; exit(1);
00035   }
00036 }
00037 
00038 scaleFunctionBase<std::vector<double> > * scaleFunctionVecService( const int identifier )
00039 {
00040   switch ( identifier ) {
00041   case ( 0 ): return ( new scaleFunctionType0<std::vector<double> > ); break;
00042   case ( 1 ): return ( new scaleFunctionType1<std::vector<double> > ); break;
00043   case ( 2 ): return ( new scaleFunctionType2<std::vector<double> > ); break;
00044   case ( 3 ): return ( new scaleFunctionType3<std::vector<double> > ); break;
00045   case ( 4 ): return ( new scaleFunctionType4<std::vector<double> > ); break;
00046   case ( 5 ): return ( new scaleFunctionType5<std::vector<double> > ); break;
00047   case ( 6 ): return ( new scaleFunctionType6<std::vector<double> > ); break;
00048   case ( 7 ): return ( new scaleFunctionType7<std::vector<double> > ); break;
00049   case ( 8 ): return ( new scaleFunctionType8<std::vector<double> > ); break;
00050   case ( 9 ): return ( new scaleFunctionType9<std::vector<double> > ); break;
00051   case ( 10 ): return ( new scaleFunctionType10<std::vector<double> > ); break;
00052   case ( 11 ): return ( new scaleFunctionType11<std::vector<double> > ); break;
00053   case ( 12 ): return ( new scaleFunctionType12<std::vector<double> > ); break;
00054   case ( 13 ): return ( new scaleFunctionType13<std::vector<double> > ); break;
00055   case ( 14 ): return ( new scaleFunctionType14<std::vector<double> > ); break;
00056   case ( 15 ): return ( new scaleFunctionType15<std::vector<double> > ); break;
00057   case ( 16 ): return ( new scaleFunctionType16<std::vector<double> > ); break;
00058   case ( 17 ): return ( new scaleFunctionType17<std::vector<double> > ); break;
00059   case ( 18 ): return ( new scaleFunctionType18<std::vector<double> > ); break;
00060   case ( 19 ): return ( new scaleFunctionType19<std::vector<double> > ); break;
00061   case ( 20 ): return ( new scaleFunctionType20<std::vector<double> > ); break;
00062   case ( 21 ): return ( new scaleFunctionType21<std::vector<double> > ); break;
00063   case ( 22 ): return ( new scaleFunctionType22<std::vector<double> > ); break;
00064   case ( 23 ): return ( new scaleFunctionType23<std::vector<double> > ); break;
00065   case ( 24 ): return ( new scaleFunctionType24<std::vector<double> > ); break;
00066   case ( 25 ): return ( new scaleFunctionType25<std::vector<double> > ); break;
00067   case ( 26 ): return ( new scaleFunctionType26<std::vector<double> > ); break;
00068   case ( 27 ): return ( new scaleFunctionType27<std::vector<double> > ); break;
00069   default: std::cout << "Error: wrong identifier = " << identifier << std::endl; exit(1);
00070   }
00071 }
00072 
00073 smearFunctionBase * smearFunctionService( const int identifier )
00074 {
00075   switch ( identifier ) {
00076   case ( 0 ): return ( new smearFunctionType0 ); break;
00077   case ( 1 ): return ( new smearFunctionType1 ); break;
00078   case ( 2 ): return ( new smearFunctionType2 ); break;
00079   case ( 3 ): return ( new smearFunctionType3 ); break;
00080   case ( 4 ): return ( new smearFunctionType4 ); break;
00081   case ( 5 ): return ( new smearFunctionType5 ); break;
00082   case ( 6 ): return ( new smearFunctionType6 ); break;
00083   case ( 7 ): return ( new smearFunctionType7 ); break;
00084   default: std::cout << "Error: undefined smear type = " << identifier << std::endl; exit(1); break;
00085   }
00086 }
00087 
00088 resolutionFunctionBase<double *> * resolutionFunctionService( const int identifier )
00089 {
00090   switch ( identifier ) {
00091   case ( 0 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00092   case ( 1 ): return ( new resolutionFunctionType1<double *> ); break;
00093   case ( 2 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00094   case ( 3 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00095   case ( 4 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00096   case ( 5 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00097   case ( 6 ): return ( new resolutionFunctionType6<double *> ); break;
00098   case ( 7 ): return ( new resolutionFunctionType7<double *> ); break;
00099   case ( 8 ): return ( new resolutionFunctionType8<double *> ); break;
00100   case ( 9 ): return ( new resolutionFunctionType9<double *> ); break;
00101   case ( 10 ): return ( new resolutionFunctionType10<double *> ); break;
00102   case ( 11 ): return ( new resolutionFunctionType11<double *> ); break;
00103   case ( 12 ): return ( new resolutionFunctionType12<double *> ); break;
00104   case ( 13 ): return ( new resolutionFunctionType13<double *> ); break;
00105   case ( 14 ): return ( new resolutionFunctionType14<double *> ); break;
00106   case ( 15 ): return ( new resolutionFunctionType15<double *> ); break;
00107   case ( 17 ): return ( new resolutionFunctionType17<double *> ); break;
00108   case ( 18 ): return ( new resolutionFunctionType18<double *> ); break;
00109   case ( 19 ): return ( new resolutionFunctionType19<double *> ); break;
00110   case ( 20 ): return ( new resolutionFunctionType20<double *> ); break;
00111   case ( 30 ): return ( new resolutionFunctionType30<double *> ); break;
00112   default: std::cout << "Error: undefined resolution type = " << identifier << std::endl; exit(1); break;
00113   }
00114 }
00115 
00116 resolutionFunctionBase<std::vector<double> > * resolutionFunctionVecService( const int identifier )
00117 {
00118   switch ( identifier ) {
00119   case ( 0 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00120   case ( 1 ): return ( new resolutionFunctionType1<std::vector<double> > ); break;
00121   case ( 2 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00122   case ( 3 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00123   case ( 4 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00124   case ( 5 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00125   case ( 6 ): return ( new resolutionFunctionType6<std::vector<double> > ); break;
00126   case ( 7 ): return ( new resolutionFunctionType7<std::vector<double> > ); break;
00127   case ( 8 ): return ( new resolutionFunctionType8<std::vector<double> > ); break;
00128   case ( 9 ): return ( new resolutionFunctionType9<std::vector<double> > ); break;
00129   case ( 10 ): return ( new resolutionFunctionType10<std::vector<double> > ); break;
00130   case ( 11 ): return ( new resolutionFunctionType11<std::vector<double> > ); break;
00131   case ( 12 ): return ( new resolutionFunctionType12<std::vector<double> > ); break;
00132   case ( 13 ): return ( new resolutionFunctionType13<std::vector<double> > ); break;
00133   case ( 14 ): return ( new resolutionFunctionType14<std::vector<double> > ); break;
00134   case ( 15 ): return ( new resolutionFunctionType15<std::vector<double> > ); break;
00135   case ( 17 ): return ( new resolutionFunctionType17<std::vector<double> > ); break;
00136   case ( 18 ): return ( new resolutionFunctionType18<std::vector<double> > ); break;
00137   case ( 19 ): return ( new resolutionFunctionType19<std::vector<double> > ); break;
00138   case ( 20 ): return ( new resolutionFunctionType20<std::vector<double> > ); break;
00139   case ( 30 ): return ( new resolutionFunctionType30<std::vector<double> > ); break;
00140   default: std::cout << "Error: undefined resolution type = " << identifier << std::endl; exit(1); break;
00141   }
00142 }
00143 
00144 backgroundFunctionBase * backgroundFunctionService( const int identifier, const double & lowerLimit, const double & upperLimit )
00145 {
00146   switch ( identifier ) {
00147   case ( 0 ): std::cout << "Error: background function type " << identifier << " not defined" << std::endl; exit(1); break;
00148   case ( 1 ): return new backgroundFunctionType1(lowerLimit, upperLimit); break;
00149   case ( 2 ): return new backgroundFunctionType2(lowerLimit, upperLimit); break;
00150   // case ( 3 ): return new backgroundFunctionType3(lowerLimit, upperLimit); break;
00151   case ( 4 ): return new backgroundFunctionType4(lowerLimit, upperLimit); break;
00152   case ( 5 ): return new backgroundFunctionType5(lowerLimit, upperLimit); break;
00153   default: std::cout << "Error: undefined background function type = " << identifier << std::endl; exit(1); break;
00154   }
00155 }