Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:41

0001 #include "MuonAnalysis/MomentumScaleCalibration/interface/Functions.h"
0002 
0003 scaleFunctionBase<double *> *scaleFunctionService(const int identifier) {
0004   switch (identifier) {
0005     case (0):
0006       return (new scaleFunctionType0<double *>);
0007       break;
0008     case (50):
0009       return (new scaleFunctionType50<double *>);
0010       break;
0011     case (64):
0012       return (new scaleFunctionType64<double *>);
0013       break;
0014     default:
0015       std::cout << "Error: wrong identifier = " << identifier << std::endl;
0016       exit(1);
0017   }
0018 }
0019 
0020 scaleFunctionBase<std::vector<double> > *scaleFunctionVecService(const int identifier) {
0021   switch (identifier) {
0022     case (0):
0023       return (new scaleFunctionType0<std::vector<double> >);
0024       break;
0025     case (50):
0026       return (new scaleFunctionType50<std::vector<double> >);
0027       break;
0028     case (64):
0029       return (new scaleFunctionType64<std::vector<double> >);
0030       break;
0031     default:
0032       std::cout << "Error: wrong identifier = " << identifier << std::endl;
0033       exit(1);
0034   }
0035 }
0036 
0037 smearFunctionBase *smearFunctionService(const int identifier) {
0038   switch (identifier) {
0039     case (0):
0040       return (new smearFunctionType0);
0041       break;
0042     case (1):
0043       return (new smearFunctionType1);
0044       break;
0045     case (2):
0046       return (new smearFunctionType2);
0047       break;
0048     case (3):
0049       return (new smearFunctionType3);
0050       break;
0051     case (4):
0052       return (new smearFunctionType4);
0053       break;
0054     case (5):
0055       return (new smearFunctionType5);
0056       break;
0057     case (6):
0058       return (new smearFunctionType6);
0059       break;
0060     case (7):
0061       return (new smearFunctionType7);
0062       break;
0063     default:
0064       std::cout << "Error: undefined smear type = " << identifier << std::endl;
0065       exit(1);
0066       break;
0067   }
0068 }
0069 
0070 resolutionFunctionBase<double *> *resolutionFunctionService(const int identifier) {
0071   switch (identifier) {
0072     case (0):
0073       return (new resolutionFunctionType0<double *>);
0074       break;
0075     case (45):
0076       return (new resolutionFunctionType45<double *>);
0077       break;
0078     case (46):
0079       return (new resolutionFunctionType46<double *>);
0080       break;
0081     case (47):
0082       return (new resolutionFunctionType47<double *>);
0083       break;
0084 
0085     default:
0086       std::cout << "Error: undefined resolution type = " << identifier << std::endl;
0087       exit(1);
0088       break;
0089   }
0090 }
0091 
0092 resolutionFunctionBase<std::vector<double> > *resolutionFunctionVecService(const int identifier) {
0093   switch (identifier) {
0094     case (0):
0095       return (new resolutionFunctionType0<std::vector<double> >);
0096       break;
0097     case (45):
0098       return (new resolutionFunctionType45<std::vector<double> >);
0099       break;
0100     case (46):
0101       return (new resolutionFunctionType46<std::vector<double> >);
0102       break;
0103     case (47):
0104       return (new resolutionFunctionType47<std::vector<double> >);
0105       break;
0106 
0107     default:
0108       std::cout << "Error: undefined resolution type = " << identifier << std::endl;
0109       exit(1);
0110       break;
0111   }
0112 }
0113 
0114 backgroundFunctionBase *backgroundFunctionService(const int identifier,
0115                                                   const double &lowerLimit,
0116                                                   const double &upperLimit) {
0117   switch (identifier) {
0118     case (0):
0119       std::cout << "Error: background function type " << identifier << " not defined" << std::endl;
0120       exit(1);
0121       break;
0122     case (1):
0123       return new backgroundFunctionType1(lowerLimit, upperLimit);
0124       break;
0125     case (2):
0126       return new backgroundFunctionType2(lowerLimit, upperLimit);
0127       break;
0128     // case ( 3 ):  return new backgroundFunctionType3(lowerLimit, upperLimit); break;
0129     case (4):
0130       return new backgroundFunctionType4(lowerLimit, upperLimit);
0131       break;
0132     case (5):
0133       return new backgroundFunctionType5(lowerLimit, upperLimit);
0134       break;
0135     case (6):
0136       return new backgroundFunctionType6(lowerLimit, upperLimit);
0137       break;
0138     case (7):
0139       return new backgroundFunctionType7(lowerLimit, upperLimit);
0140       break;
0141     case (8):
0142       return new backgroundFunctionType8(lowerLimit, upperLimit);
0143       break;
0144     case (9):
0145       return new backgroundFunctionType9(lowerLimit, upperLimit);
0146       break;  //Gul
0147     case (10):
0148       return new backgroundFunctionType10(lowerLimit, upperLimit);
0149       break;  //Gul
0150     case (11):
0151       return new backgroundFunctionType11(lowerLimit, upperLimit);
0152       break;  // SC
0153     default:
0154       std::cout << "Error: undefined background function type = " << identifier << std::endl;
0155       exit(1);
0156       break;
0157   }
0158 }