CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TagProbeFitTreeAnalyzer_cfi.py
Go to the documentation of this file.
2 
3 TagProbeFitTreeAnalyzer = cms.EDAnalyzer("TagProbeFitTreeAnalyzer",
4  # IO parameters:
5  InputFileNames = cms.vstring("testNewWrite.root"),
6  InputDirectoryName = cms.string("MakeHisto"),
7  InputTreeName = cms.string("fitter_tree"),
8  OutputFileName = cms.string("testNewAnalyzer.root"),
9  #numbrer of CPUs to use for fitting
10  NumCPU = cms.uint32(8),
11  # specifies wether to save the RooWorkspace containing the data for each bin and
12  # the pdf object with the initial and final state snapshots
13  SaveWorkspace = cms.bool(True),
14 
15  # defines all the real variables of the probes available in the input tree and intended for use in the efficiencies
16  Variables = cms.PSet(
17  mass = cms.vstring("Tag-Probe Mass", "2.5", "3.8", "GeV/c^{2}"),
18  pt = cms.vstring("Probe p_{T}", "0", "1000", "GeV/c"),
19  eta = cms.vstring("Probe #eta", "-2.5", "2.5", "")
20  ),
21 
22  # defines all the discrete variables of the probes available in the input tree and intended for use in the efficiency calculations
23  Categories = cms.PSet(
24  mcTrue = cms.vstring("MC true", "dummy[true=1,false=0]"),
25  passing = cms.vstring("isMuon", "dummy[pass=1,fail=0]")
26  ),
27 
28  # defines all the PDFs that will be available for the efficiency calculations; uses RooFit's "factory" syntax;
29  # each pdf needs to define "signal", "backgroundPass", "backgroundFail" pdfs, "efficiency[0.9,0,1]" and "signalFractionInPassing[0.9]" are used for initial values
30  PDFs = cms.PSet(
31  gaussPlusLinear = cms.vstring(
32  "Gaussian::signal(mass, mean[3.1,3.0,3.2], sigma[0.03,0.01,0.05])",
33  "Chebychev::backgroundPass(mass, cPass[0,-1,1])",
34  "Chebychev::backgroundFail(mass, cFail[0,-1,1])",
35  "efficiency[0.9,0,1]",
36  "signalFractionInPassing[0.9]"
37  ),
38  gaussPlusQuadratic = cms.vstring(
39  "Gaussian::signal(mass, mean[3.1,3.0,3.2], sigma[0.03,0.01,0.05])",
40  "Chebychev::backgroundPass(mass, {cPass1[0,-1,1], cPass2[0,-1,1]})",
41  "Chebychev::backgroundFail(mass, {cFail1[0,-1,1], cFail2[0,-1,1]})",
42  "efficiency[0.9,0,1]",
43  "signalFractionInPassing[0.9]"
44  )
45  ),
46 
47  # defines a set of efficiency calculations, what PDF to use for fitting and how to bin the data;
48  # there will be a separate output directory for each calculation that includes a simultaneous fit, side band subtraction and counting.
49  Efficiencies = cms.PSet(
50  #the name of the parameter set becomes the name of the directory
51  pt = cms.PSet(
52  #specifies the efficiency of which category and state to measure
53  EfficiencyCategoryAndState = cms.vstring("passing","pass"),
54  #specifies what unbinned variables to include in the dataset, the mass is needed for the fit
55  UnbinnedVariables = cms.vstring("mass"),
56  #specifies the binning of parameters
57  BinnedVariables = cms.PSet(
58  pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0)
59  ),
60  #first string is the default followed by binRegExp - PDFname pairs
61  BinToPDFmap = cms.vstring("gaussPlusLinear", "*pt_bin0*", "gaussPlusQuadratic")
62  ),
63  pt_mcTrue = cms.PSet(
64  EfficiencyCategoryAndState = cms.vstring("passing","pass"),
65  UnbinnedVariables = cms.vstring("mass"),
66  BinnedVariables = cms.PSet(
67  mcTrue = cms.vstring("true"),
68  pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0)
69  )
70  #unspecified binToPDFmap means no fitting
71  ),
72  pt_eta = cms.PSet(
73  EfficiencyCategoryAndState = cms.vstring("passing","pass"),
74  UnbinnedVariables = cms.vstring("mass"),
75  BinnedVariables = cms.PSet(
76  pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0),
77  eta = cms.vdouble(-2.1, -1.2, 0.0, 1.2, 2.1)
78  ),
79  BinToPDFmap = cms.vstring("gaussPlusLinear", "*pt_bin0*", "gaussPlusQuadratic")
80  ),
81  pt_eta_mcTrue = cms.PSet(
82  EfficiencyCategoryAndState = cms.vstring("passing","pass"),
83  UnbinnedVariables = cms.vstring("mass"),
84  BinnedVariables = cms.PSet(
85  mcTrue = cms.vstring("true"),
86  pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0),
87  eta = cms.vdouble(-2.1, -1.2, 0.0, 1.2, 2.1)
88  )
89  )
90  )
91 )
92