CMS 3D CMS Logo

Functions
Functions.cc File Reference
#include "MuonAnalysis/MomentumScaleCalibration/interface/Functions.h"

Go to the source code of this file.

Functions

backgroundFunctionBasebackgroundFunctionService (const int identifier, const double &lowerLimit, const double &upperLimit)
 Service to build the background functor corresponding to the passed identifier. More...
 
resolutionFunctionBase< double * > * resolutionFunctionService (const int identifier)
 Service to build the resolution functor corresponding to the passed identifier. More...
 
resolutionFunctionBase< std::vector< double > > * resolutionFunctionVecService (const int identifier)
 Service to build the resolution functor corresponding to the passed identifier when receiving a std::vector<double> More...
 
scaleFunctionBase< double * > * scaleFunctionService (const int identifier)
 Service to build the scale functor corresponding to the passed identifier. More...
 
scaleFunctionBase< std::vector< double > > * scaleFunctionVecService (const int identifier)
 Service to build the scale functor corresponding to the passed identifier when receiving a std::vector<double> More...
 
smearFunctionBasesmearFunctionService (const int identifier)
 Service to build the smearing functor corresponding to the passed identifier. More...
 

Function Documentation

◆ backgroundFunctionService()

backgroundFunctionBase* backgroundFunctionService ( const int  identifier,
const double &  lowerLimit,
const double &  upperLimit 
)

Service to build the background functor corresponding to the passed identifier.

Definition at line 114 of file Functions.cc.

116  {
117  switch (identifier) {
118  case (0):
119  std::cout << "Error: background function type " << identifier << " not defined" << std::endl;
120  exit(1);
121  break;
122  case (1):
123  return new backgroundFunctionType1(lowerLimit, upperLimit);
124  break;
125  case (2):
126  return new backgroundFunctionType2(lowerLimit, upperLimit);
127  break;
128  // case ( 3 ): return new backgroundFunctionType3(lowerLimit, upperLimit); break;
129  case (4):
130  return new backgroundFunctionType4(lowerLimit, upperLimit);
131  break;
132  case (5):
133  return new backgroundFunctionType5(lowerLimit, upperLimit);
134  break;
135  case (6):
136  return new backgroundFunctionType6(lowerLimit, upperLimit);
137  break;
138  case (7):
139  return new backgroundFunctionType7(lowerLimit, upperLimit);
140  break;
141  case (8):
142  return new backgroundFunctionType8(lowerLimit, upperLimit);
143  break;
144  case (9):
145  return new backgroundFunctionType9(lowerLimit, upperLimit);
146  break; //Gul
147  case (10):
148  return new backgroundFunctionType10(lowerLimit, upperLimit);
149  break; //Gul
150  case (11):
151  return new backgroundFunctionType11(lowerLimit, upperLimit);
152  break; // SC
153  default:
154  std::cout << "Error: undefined background function type = " << identifier << std::endl;
155  exit(1);
156  break;
157  }
158 }

References gather_cfg::cout, and beamvalidation::exit().

Referenced by BackgroundFunction::BackgroundFunction(), BackgroundHandler::BackgroundHandler(), and BackgroundFunction::readParameters().

◆ resolutionFunctionService()

resolutionFunctionBase<double *>* resolutionFunctionService ( const int  identifier)

Service to build the resolution functor corresponding to the passed identifier.

Definition at line 70 of file Functions.cc.

70  {
71  switch (identifier) {
72  case (0):
74  break;
75  case (45):
77  break;
78  case (46):
80  break;
81  case (47):
83  break;
84 
85  default:
86  std::cout << "Error: undefined resolution type = " << identifier << std::endl;
87  exit(1);
88  break;
89  }
90 }

References gather_cfg::cout, and beamvalidation::exit().

◆ resolutionFunctionVecService()

resolutionFunctionBase<std::vector<double> >* resolutionFunctionVecService ( const int  identifier)

Service to build the resolution functor corresponding to the passed identifier when receiving a std::vector<double>

Definition at line 92 of file Functions.cc.

92  {
93  switch (identifier) {
94  case (0):
95  return (new resolutionFunctionType0<std::vector<double> >);
96  break;
97  case (45):
98  return (new resolutionFunctionType45<std::vector<double> >);
99  break;
100  case (46):
101  return (new resolutionFunctionType46<std::vector<double> >);
102  break;
103  case (47):
104  return (new resolutionFunctionType47<std::vector<double> >);
105  break;
106 
107  default:
108  std::cout << "Error: undefined resolution type = " << identifier << std::endl;
109  exit(1);
110  break;
111  }
112 }

References gather_cfg::cout, and beamvalidation::exit().

Referenced by ErrorsAnalyzer::fillHistograms(), ErrorsPropagationAnalyzer::fillHistograms(), MuScleFit::MuScleFit(), ResolutionAnalyzer::ResolutionAnalyzer(), and TestCorrection::TestCorrection().

◆ scaleFunctionService()

scaleFunctionBase<double *>* scaleFunctionService ( const int  identifier)

Service to build the scale functor corresponding to the passed identifier.

Definition at line 3 of file Functions.cc.

3  {
4  switch (identifier) {
5  case (0):
6  return (new scaleFunctionType0<double *>);
7  break;
8  case (50):
10  break;
11  case (64):
12  return (new scaleFunctionType64<double *>);
13  break;
14  default:
15  std::cout << "Error: wrong identifier = " << identifier << std::endl;
16  exit(1);
17  }
18 }

References gather_cfg::cout, and beamvalidation::exit().

◆ scaleFunctionVecService()

scaleFunctionBase<std::vector<double> >* scaleFunctionVecService ( const int  identifier)

Service to build the scale functor corresponding to the passed identifier when receiving a std::vector<double>

Definition at line 20 of file Functions.cc.

20  {
21  switch (identifier) {
22  case (0):
23  return (new scaleFunctionType0<std::vector<double> >);
24  break;
25  case (50):
26  return (new scaleFunctionType50<std::vector<double> >);
27  break;
28  case (64):
29  return (new scaleFunctionType64<std::vector<double> >);
30  break;
31  default:
32  std::cout << "Error: wrong identifier = " << identifier << std::endl;
33  exit(1);
34  }
35 }

References gather_cfg::cout, and beamvalidation::exit().

Referenced by MuScleFit::MuScleFit().

◆ smearFunctionService()

smearFunctionBase* smearFunctionService ( const int  identifier)

Service to build the smearing functor corresponding to the passed identifier.

Definition at line 37 of file Functions.cc.

37  {
38  switch (identifier) {
39  case (0):
40  return (new smearFunctionType0);
41  break;
42  case (1):
43  return (new smearFunctionType1);
44  break;
45  case (2):
46  return (new smearFunctionType2);
47  break;
48  case (3):
49  return (new smearFunctionType3);
50  break;
51  case (4):
52  return (new smearFunctionType4);
53  break;
54  case (5):
55  return (new smearFunctionType5);
56  break;
57  case (6):
58  return (new smearFunctionType6);
59  break;
60  case (7):
61  return (new smearFunctionType7);
62  break;
63  default:
64  std::cout << "Error: undefined smear type = " << identifier << std::endl;
65  exit(1);
66  break;
67  }
68 }

References gather_cfg::cout, and beamvalidation::exit().

Referenced by MuScleFit::MuScleFit().

backgroundFunctionType2
Exponential.
Definition: Functions.h:1500
resolutionFunctionType47
Definition: Functions.h:1205
smearFunctionType2
Definition: Functions.h:678
gather_cfg.cout
cout
Definition: gather_cfg.py:144
backgroundFunctionType8
Definition: Functions.h:2137
resolutionFunctionType0
Definition: Functions.h:926
smearFunctionType5
Definition: Functions.h:713
backgroundFunctionType4
Exponential with eta dependence.
Definition: Functions.h:1602
scaleFunctionType0
Definition: Functions.h:138
smearFunctionType6
Definition: Functions.h:725
backgroundFunctionType9
Definition: Functions.h:2252
smearFunctionType0
Definition: Functions.h:661
backgroundFunctionType10
Definition: Functions.h:2371
smearFunctionType7
Definition: Functions.h:797
resolutionFunctionType45
Definition: Functions.h:962
backgroundFunctionType5
Linear with eta dependence.
Definition: Functions.h:1653
scaleFunctionType64
Definition: Functions.h:342
smearFunctionType3
Definition: Functions.h:689
backgroundFunctionType11
Exponential binned in eta (Z, Run2012C PromptReco-v1 + PromptReco-v2)
Definition: Functions.h:2559
backgroundFunctionType1
Linear.
Definition: Functions.h:1446
resolutionFunctionType46
Definition: Functions.h:1083
scaleFunctionType50
Definition: Functions.h:164
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
backgroundFunctionType6
Exponential binned in eta.
Definition: Functions.h:1707
smearFunctionType1
Definition: Functions.h:667
smearFunctionType4
Definition: Functions.h:702
backgroundFunctionType7
Exponential binned in eta, much finer binning then type6.
Definition: Functions.h:1789