Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:15

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("TagProbe")
0004 
0005 process.load('FWCore.MessageService.MessageLogger_cfi')
0006 
0007 process.source = cms.Source("EmptySource")
0008 
0009 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )    
0010 
0011 process.TagProbeFitTreeAnalyzer = cms.EDAnalyzer("TagProbeFitTreeAnalyzer",
0012     # IO parameters:
0013     InputFileNames = cms.vstring("testTagProbeFitTreeProducer_GEN.root"),
0014     InputDirectoryName = cms.string("MuonID"),
0015     InputTreeName = cms.string("fitter_tree"),
0016     OutputFileName = cms.string("testTagProbeFitTreeAnalyzer_GEN.root"),
0017     #numbrer of CPUs to use for fitting
0018     NumCPU = cms.uint32(1),
0019     # specifies wether to save the RooWorkspace containing the data for each bin and
0020     # the pdf object with the initial and final state snapshots
0021     SaveWorkspace = cms.bool(True),
0022 
0023     # defines all the real variables of the probes available in the input tree and intended for use in the efficiencies
0024     Variables = cms.PSet(
0025         mass = cms.vstring("Tag-Probe Mass", "40", "130", "GeV/c^{2}"),
0026         pt = cms.vstring("Probe p_{T}", "0", "100", "GeV/c"),
0027         eta = cms.vstring("Probe #eta", "-2.5", "2.5", ""),
0028         phi = cms.vstring("Probe #phi", "-3.14", "3.14", ""),
0029     ),
0030 
0031     # defines all the discrete variables of the probes available in the input tree and intended for use in the efficiency calculations
0032     Categories = cms.PSet(
0033         muon = cms.vstring("isMuon", "dummy[true=1,false=0]"),
0034     ),
0035 
0036     # defines all the PDFs that will be available for the efficiency calculations; uses RooFit's "factory" syntax;
0037     # each pdf needs to define "signal", "backgroundPass", "backgroundFail" pdfs, "efficiency[0.9,0,1]" and "signalFractionInPassing[0.9]" are used for initial values  
0038     PDFs = cms.PSet(
0039         breitWignerPlusExponential = cms.vstring(
0040             "BreitWigner::signal(mass, mean[90,80,100], width[2,1,3])",
0041             "Exponential::backgroundPass(mass, cPass[0,-1,1])",
0042             "Exponential::backgroundFail(mass, cFail[0,-1,1])",
0043             "efficiency[0.5,0,1]",
0044             "signalFractionInPassing[0.9]"
0045         ),
0046     ),
0047 
0048     # defines a set of efficiency calculations, what PDF to use for fitting and how to bin the data;
0049     # there will be a separate output directory for each calculation that includes a simultaneous fit, side band subtraction and counting. 
0050     Efficiencies = cms.PSet(
0051         #the name of the parameter set becomes the name of the directory
0052         muon_pt_eta = cms.PSet(
0053             #specifies the efficiency of which category and state to measure 
0054             EfficiencyCategoryAndState = cms.vstring("muon","true"),
0055             #specifies what unbinned variables to include in the dataset, the mass is needed for the fit
0056             UnbinnedVariables = cms.vstring("mass"),
0057             #specifies the binning of parameters
0058             BinnedVariables = cms.PSet(
0059                 pt = cms.vdouble(0.0, 100.0),
0060                 eta = cms.vdouble(-2.4, -1.8, -1.2, -0.6, 0.0, 0.6, 1.2, 1.8, 2.4),
0061             ),
0062             #first string is the default followed by binRegExp - PDFname pairs
0063             BinToPDFmap = cms.vstring("breitWignerPlusExponential")
0064         ),
0065     )
0066 )
0067 
0068 process.fitness = cms.Path(
0069     process.TagProbeFitTreeAnalyzer
0070 )
0071