CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/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   case ( 28 ): return ( new scaleFunctionType28<double * > ); break;
00035   case ( 29 ): return ( new scaleFunctionType29<double * > ); break;
00036   case ( 30 ): return ( new scaleFunctionType30<double * > ); break;
00037   case ( 31 ): return ( new scaleFunctionType31<double * > ); break;
00038   case ( 32 ): return ( new scaleFunctionType32<double * > ); break;
00039   case ( 33 ): return ( new scaleFunctionType33<double * > ); break;
00040   case ( 34 ): return ( new scaleFunctionType34<double * > ); break;
00041   case ( 35 ): return ( new scaleFunctionType35<double * > ); break;
00042   case ( 36 ): return ( new scaleFunctionType36<double * > ); break;
00043   case ( 37 ): return ( new scaleFunctionType37<double * > ); break;
00044   case ( 38 ): return ( new scaleFunctionType38<double * > ); break;
00045   case ( 50 ): return ( new scaleFunctionType50<double * > ); break;
00046   case ( 51 ): return ( new scaleFunctionType51<double * > ); break;
00047   case ( 52 ): return ( new scaleFunctionType52<double * > ); break;
00048   default: std::cout << "Error: wrong identifier = " << identifier << std::endl; exit(1);
00049   }
00050 }
00051 
00052 scaleFunctionBase<std::vector<double> > * scaleFunctionVecService( const int identifier )
00053 {
00054   switch ( identifier ) {
00055   case ( 0 ): return ( new scaleFunctionType0<std::vector<double> > ); break;
00056   case ( 1 ): return ( new scaleFunctionType1<std::vector<double> > ); break;
00057   case ( 2 ): return ( new scaleFunctionType2<std::vector<double> > ); break;
00058   case ( 3 ): return ( new scaleFunctionType3<std::vector<double> > ); break;
00059   case ( 4 ): return ( new scaleFunctionType4<std::vector<double> > ); break;
00060   case ( 5 ): return ( new scaleFunctionType5<std::vector<double> > ); break;
00061   case ( 6 ): return ( new scaleFunctionType6<std::vector<double> > ); break;
00062   case ( 7 ): return ( new scaleFunctionType7<std::vector<double> > ); break;
00063   case ( 8 ): return ( new scaleFunctionType8<std::vector<double> > ); break;
00064   case ( 9 ): return ( new scaleFunctionType9<std::vector<double> > ); break;
00065   case ( 10 ): return ( new scaleFunctionType10<std::vector<double> > ); break;
00066   case ( 11 ): return ( new scaleFunctionType11<std::vector<double> > ); break;
00067   case ( 12 ): return ( new scaleFunctionType12<std::vector<double> > ); break;
00068   case ( 13 ): return ( new scaleFunctionType13<std::vector<double> > ); break;
00069   case ( 14 ): return ( new scaleFunctionType14<std::vector<double> > ); break;
00070   case ( 15 ): return ( new scaleFunctionType15<std::vector<double> > ); break;
00071   case ( 16 ): return ( new scaleFunctionType16<std::vector<double> > ); break;
00072   case ( 17 ): return ( new scaleFunctionType17<std::vector<double> > ); break;
00073   case ( 18 ): return ( new scaleFunctionType18<std::vector<double> > ); break;
00074   case ( 19 ): return ( new scaleFunctionType19<std::vector<double> > ); break;
00075   case ( 20 ): return ( new scaleFunctionType20<std::vector<double> > ); break;
00076   case ( 21 ): return ( new scaleFunctionType21<std::vector<double> > ); break;
00077   case ( 22 ): return ( new scaleFunctionType22<std::vector<double> > ); break;
00078   case ( 23 ): return ( new scaleFunctionType23<std::vector<double> > ); break;
00079   case ( 24 ): return ( new scaleFunctionType24<std::vector<double> > ); break;
00080   case ( 25 ): return ( new scaleFunctionType25<std::vector<double> > ); break;
00081   case ( 26 ): return ( new scaleFunctionType26<std::vector<double> > ); break;
00082   case ( 27 ): return ( new scaleFunctionType27<std::vector<double> > ); break;
00083   case ( 28 ): return ( new scaleFunctionType28<std::vector<double> > ); break;
00084   case ( 29 ): return ( new scaleFunctionType29<std::vector<double> > ); break;  
00085   case ( 30 ): return ( new scaleFunctionType30<std::vector<double> > ); break;
00086   case ( 31 ): return ( new scaleFunctionType31<std::vector<double> > ); break;
00087   case ( 32 ): return ( new scaleFunctionType32<std::vector<double> > ); break;
00088   case ( 33 ): return ( new scaleFunctionType33<std::vector<double> > ); break;
00089   case ( 34 ): return ( new scaleFunctionType34<std::vector<double> > ); break;
00090   case ( 35 ): return ( new scaleFunctionType35<std::vector<double> > ); break;
00091   case ( 36 ): return ( new scaleFunctionType36<std::vector<double> > ); break;
00092   case ( 37 ): return ( new scaleFunctionType37<std::vector<double> > ); break;
00093   case ( 38 ): return ( new scaleFunctionType38<std::vector<double> > ); break;
00094   case ( 50 ): return ( new scaleFunctionType50<std::vector<double> > ); break;
00095   case ( 51 ): return ( new scaleFunctionType51<std::vector<double> > ); break;
00096   case ( 52 ): return ( new scaleFunctionType52<std::vector<double> > ); break;
00097   default: std::cout << "Error: wrong identifier = " << identifier << std::endl; exit(1);
00098   }
00099 }
00100 
00101 smearFunctionBase * smearFunctionService( const int identifier )
00102 {
00103   switch ( identifier ) {
00104   case ( 0 ): return ( new smearFunctionType0 ); break;
00105   case ( 1 ): return ( new smearFunctionType1 ); break;
00106   case ( 2 ): return ( new smearFunctionType2 ); break;
00107   case ( 3 ): return ( new smearFunctionType3 ); break;
00108   case ( 4 ): return ( new smearFunctionType4 ); break;
00109   case ( 5 ): return ( new smearFunctionType5 ); break;
00110   case ( 6 ): return ( new smearFunctionType6 ); break;
00111   case ( 7 ): return ( new smearFunctionType7 ); break;
00112   default: std::cout << "Error: undefined smear type = " << identifier << std::endl; exit(1); break;
00113   }
00114 }
00115 
00116 resolutionFunctionBase<double *> * resolutionFunctionService( 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<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<double *> ); break;
00126   case ( 7 ): return ( new resolutionFunctionType7<double *> ); break;
00127   case ( 8 ): return ( new resolutionFunctionType8<double *> ); break;
00128   case ( 9 ): return ( new resolutionFunctionType9<double *> ); break;
00129   case ( 10 ): return ( new resolutionFunctionType10<double *> ); break;
00130   case ( 11 ): return ( new resolutionFunctionType11<double *> ); break;
00131   case ( 12 ): return ( new resolutionFunctionType12<double *> ); break;
00132   case ( 13 ): return ( new resolutionFunctionType13<double *> ); break;
00133   case ( 14 ): return ( new resolutionFunctionType14<double *> ); break;
00134   case ( 15 ): return ( new resolutionFunctionType15<double *> ); break;
00135   case ( 17 ): return ( new resolutionFunctionType17<double *> ); break;
00136   case ( 18 ): return ( new resolutionFunctionType18<double *> ); break;
00137   case ( 19 ): return ( new resolutionFunctionType19<double *> ); break;
00138   case ( 20 ): return ( new resolutionFunctionType20<double *> ); break;
00139   case ( 30 ): return ( new resolutionFunctionType30<double *> ); break;
00140   case ( 31 ): return ( new resolutionFunctionType31<double *> ); break;
00141   case ( 32 ): return ( new resolutionFunctionType32<double *> ); break;
00142   case ( 40 ): return ( new resolutionFunctionType40<double *> ); break;
00143   case ( 41 ): return ( new resolutionFunctionType41<double *> ); break;
00144   case ( 42 ): return ( new resolutionFunctionType42<double *> ); break;
00145   case ( 43 ): return ( new resolutionFunctionType43<double *> ); break;
00146   case ( 44 ): return ( new resolutionFunctionType44<double *> ); break;
00147   case ( 45 ): return ( new resolutionFunctionType45<double *> ); break;
00148   case ( 46 ): return ( new resolutionFunctionType46<double *> ); break;
00149   case ( 47 ): return ( new resolutionFunctionType47<double *> ); break;
00150   case ( 99 ): return ( new resolutionFunctionType99<double *> ); break;
00151 
00152   default: std::cout << "Error: undefined resolution type = " << identifier << std::endl; exit(1); break;
00153   }
00154 }
00155 
00156 resolutionFunctionBase<std::vector<double> > * resolutionFunctionVecService( const int identifier )
00157 {
00158   switch ( identifier ) {
00159   case ( 0 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00160   case ( 1 ): return ( new resolutionFunctionType1<std::vector<double> > ); break;
00161   case ( 2 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00162   case ( 3 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00163   case ( 4 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00164   case ( 5 ): std::cout << "Error: resolution function type " << identifier << " not defined" << std::endl; exit(1); break;
00165   case ( 6 ): return ( new resolutionFunctionType6<std::vector<double> > ); break;
00166   case ( 7 ): return ( new resolutionFunctionType7<std::vector<double> > ); break;
00167   case ( 8 ): return ( new resolutionFunctionType8<std::vector<double> > ); break;
00168   case ( 9 ): return ( new resolutionFunctionType9<std::vector<double> > ); break;
00169   case ( 10 ): return ( new resolutionFunctionType10<std::vector<double> > ); break;
00170   case ( 11 ): return ( new resolutionFunctionType11<std::vector<double> > ); break;
00171   case ( 12 ): return ( new resolutionFunctionType12<std::vector<double> > ); break;
00172   case ( 13 ): return ( new resolutionFunctionType13<std::vector<double> > ); break;
00173   case ( 14 ): return ( new resolutionFunctionType14<std::vector<double> > ); break;
00174   case ( 15 ): return ( new resolutionFunctionType15<std::vector<double> > ); break;
00175   case ( 17 ): return ( new resolutionFunctionType17<std::vector<double> > ); break;
00176   case ( 18 ): return ( new resolutionFunctionType18<std::vector<double> > ); break;
00177   case ( 19 ): return ( new resolutionFunctionType19<std::vector<double> > ); break;
00178   case ( 20 ): return ( new resolutionFunctionType20<std::vector<double> > ); break;
00179   case ( 30 ): return ( new resolutionFunctionType30<std::vector<double> > ); break;
00180   case ( 31 ): return ( new resolutionFunctionType31<std::vector<double> > ); break;
00181   case ( 32 ): return ( new resolutionFunctionType32<std::vector<double> > ); break;
00182   case ( 40 ): return ( new resolutionFunctionType40<std::vector<double> > ); break; 
00183   case ( 41 ): return ( new resolutionFunctionType41<std::vector<double> > ); break;
00184   case ( 42 ): return ( new resolutionFunctionType42<std::vector<double> > ); break;
00185   case ( 43 ): return ( new resolutionFunctionType43<std::vector<double> > ); break;
00186   case ( 44 ): return ( new resolutionFunctionType44<std::vector<double> > ); break;
00187   case ( 45 ): return ( new resolutionFunctionType45<std::vector<double> > ); break;
00188   case ( 46 ): return ( new resolutionFunctionType46<std::vector<double> > ); break;
00189   case ( 47 ): return ( new resolutionFunctionType47<std::vector<double> > ); break;
00190   case ( 99 ): return ( new resolutionFunctionType99<std::vector<double> > ); break;
00191   
00192   default: std::cout << "Error: undefined resolution type = " << identifier << std::endl; exit(1); break;
00193     }
00194  }
00195 
00196 backgroundFunctionBase * backgroundFunctionService( const int identifier, const double & lowerLimit, const double & upperLimit )
00197 {
00198   switch ( identifier ) {
00199   case ( 0 ):  std::cout << "Error: background function type " << identifier << " not defined" << std::endl; exit(1); break;
00200   case ( 1 ):  return new backgroundFunctionType1(lowerLimit, upperLimit); break;
00201   case ( 2 ):  return new backgroundFunctionType2(lowerLimit, upperLimit); break;
00202   // case ( 3 ):  return new backgroundFunctionType3(lowerLimit, upperLimit); break;
00203   case ( 4 ):  return new backgroundFunctionType4(lowerLimit, upperLimit); break;
00204   case ( 5 ):  return new backgroundFunctionType5(lowerLimit, upperLimit); break;
00205   case ( 6 ):  return new backgroundFunctionType6(lowerLimit, upperLimit); break;
00206   case ( 7 ):  return new backgroundFunctionType7(lowerLimit, upperLimit); break;
00207   case ( 8 ):  return new backgroundFunctionType8(lowerLimit, upperLimit); break;
00208   case ( 9 ):  return new backgroundFunctionType9(lowerLimit, upperLimit); break; //Gul
00209   case ( 10 ): return new backgroundFunctionType10(lowerLimit, upperLimit); break; //Gul
00210   default: std::cout << "Error: undefined background function type = " << identifier << std::endl; exit(1); break;
00211   }
00212 }