Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:20

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 TagProbeFitTreeAnalyzer = cms.EDAnalyzer("TagProbeFitTreeAnalyzer",
0004     # IO parameters:
0005     InputFileNames = cms.vstring("testNewWrite.root"),
0006     InputDirectoryName = cms.string("MakeHisto"),
0007     InputTreeName = cms.string("fitter_tree"),
0008     OutputFileName = cms.string("testNewAnalyzer.root"),
0009     #numbrer of CPUs to use for fitting
0010     NumCPU = cms.uint32(8),
0011     # specifies wether to save the RooWorkspace containing the data for each bin and
0012     # the pdf object with the initial and final state snapshots
0013     SaveWorkspace = cms.bool(True),
0014 
0015     # defines all the real variables of the probes available in the input tree and intended for use in the efficiencies
0016     Variables = cms.PSet(
0017         mass = cms.vstring("Tag-Probe Mass", "2.5", "3.8", "GeV/c^{2}"),
0018         pt = cms.vstring("Probe p_{T}", "0", "1000", "GeV/c"),
0019         eta = cms.vstring("Probe #eta", "-2.5", "2.5", "")
0020     ),
0021 
0022     # defines all the discrete variables of the probes available in the input tree and intended for use in the efficiency calculations
0023     Categories = cms.PSet(
0024         mcTrue = cms.vstring("MC true", "dummy[true=1,false=0]"),
0025         passing = cms.vstring("isMuon", "dummy[pass=1,fail=0]")
0026     ),
0027 
0028     # defines all the PDFs that will be available for the efficiency calculations; uses RooFit's "factory" syntax;
0029     # each pdf needs to define "signal", "backgroundPass", "backgroundFail" pdfs, "efficiency[0.9,0,1]" and "signalFractionInPassing[0.9]" are used for initial values  
0030     PDFs = cms.PSet(
0031         gaussPlusLinear = cms.vstring(
0032             "Gaussian::signal(mass, mean[3.1,3.0,3.2], sigma[0.03,0.01,0.05])",
0033             "Chebychev::backgroundPass(mass, cPass[0,-1,1])",
0034             "Chebychev::backgroundFail(mass, cFail[0,-1,1])",
0035             "efficiency[0.9,0,1]",
0036             "signalFractionInPassing[0.9]"
0037         ),
0038         gaussPlusQuadratic = cms.vstring(
0039             "Gaussian::signal(mass, mean[3.1,3.0,3.2], sigma[0.03,0.01,0.05])",
0040             "Chebychev::backgroundPass(mass, {cPass1[0,-1,1], cPass2[0,-1,1]})",
0041             "Chebychev::backgroundFail(mass, {cFail1[0,-1,1], cFail2[0,-1,1]})",
0042             "efficiency[0.9,0,1]",
0043             "signalFractionInPassing[0.9]"
0044         )
0045     ),
0046 
0047     # defines a set of efficiency calculations, what PDF to use for fitting and how to bin the data;
0048     # there will be a separate output directory for each calculation that includes a simultaneous fit, side band subtraction and counting. 
0049     Efficiencies = cms.PSet(
0050         #the name of the parameter set becomes the name of the directory
0051         pt = cms.PSet(
0052             #specifies the efficiency of which category and state to measure 
0053             EfficiencyCategoryAndState = cms.vstring("passing","pass"),
0054             #specifies what unbinned variables to include in the dataset, the mass is needed for the fit
0055             UnbinnedVariables = cms.vstring("mass"),
0056             #specifies the binning of parameters
0057             BinnedVariables = cms.PSet(
0058                 pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0)
0059             ),
0060             #first string is the default followed by binRegExp - PDFname pairs
0061             BinToPDFmap = cms.vstring("gaussPlusLinear", "*pt_bin0*", "gaussPlusQuadratic")
0062         ),
0063         pt_mcTrue = cms.PSet(
0064             EfficiencyCategoryAndState = cms.vstring("passing","pass"),
0065             UnbinnedVariables = cms.vstring("mass"),
0066             BinnedVariables = cms.PSet(
0067                 mcTrue = cms.vstring("true"),
0068                 pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0)
0069             )
0070             #unspecified binToPDFmap means no fitting
0071         ),
0072         pt_eta = cms.PSet(
0073             EfficiencyCategoryAndState = cms.vstring("passing","pass"),
0074             UnbinnedVariables = cms.vstring("mass"),
0075             BinnedVariables = cms.PSet(
0076                 pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0),
0077                 eta = cms.vdouble(-2.1, -1.2, 0.0, 1.2, 2.1)
0078             ),
0079             BinToPDFmap = cms.vstring("gaussPlusLinear", "*pt_bin0*", "gaussPlusQuadratic")
0080         ),
0081         pt_eta_mcTrue = cms.PSet(
0082             EfficiencyCategoryAndState = cms.vstring("passing","pass"),
0083             UnbinnedVariables = cms.vstring("mass"),
0084             BinnedVariables = cms.PSet(
0085                 mcTrue = cms.vstring("true"),
0086                 pt = cms.vdouble(3.5, 4.5, 6.0, 8.0, 50.0),
0087                 eta = cms.vdouble(-2.1, -1.2, 0.0, 1.2, 2.1)
0088             )
0089         )
0090     )
0091 )
0092