Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:40

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 class SetParameters:
0004     def __init__(self):
0005         self.parFix = cms.vint32()
0006         self.parOrder = cms.vint32()
0007         self.par = cms.vdouble()
0008         self.parStep = cms.untracked.vdouble()
0009         self.parMin  = cms.untracked.vdouble()
0010         self.parMax  = cms.untracked.vdouble()
0011 
0012     def set(self, fix, order, value, step, min, max):
0013         self.parFix.append(fix)
0014         self.parOrder.append(order)
0015         self.par.append(value)
0016         self.parStep.append(step)
0017         self.parMin.append(min)
0018         self.parMax.append(max)
0019 
0020 
0021 resolSetter = SetParameters()
0022 #fix, order, value, step, min, max
0023 resolSetter.set( 0 ,0, 0.00354277 , 0.0001,   0.,0.   ) # par[0]
0024 resolSetter.set( 0 ,0, 0.00023585 , 0.00001,  0.,0.   )
0025 resolSetter.set( 1 ,0, 0          , 0.000001, 0.,0.   )
0026 resolSetter.set( 0 ,0, 0.00654324 , 0.0001,   0.,0.   )
0027 resolSetter.set( 1 ,0, 0          , 0.00001,  0.,0.   )
0028 resolSetter.set( 1 ,0, 0          , 0.0001,   0.,0.   ) # par[5] linear left
0029 resolSetter.set( 1 ,0, 0.0418539  , 0.0001,   0.,0.   ) # par[6] quadratic left
0030 resolSetter.set( 1 ,0, -2.4       , 0.0001,   0.,0.   ) # par[7] minimum parab. left
0031 resolSetter.set( 1 ,0, 0          , 0.00001,  0.,0.   )
0032 resolSetter.set( 1 ,0, 0          , 0.0001,   0.,0.   ) # par[9] linear right    
0033 resolSetter.set( 0 ,0, 0.00526402 , 0.001,    0.,0.   ) # par[10] quadratic right 
0034 resolSetter.set( 1 ,0, 0          , 0.001,    0.,0.   ) # par[11] minimum parab. right  
0035 resolSetter.set( 1 ,0, -2.4       , 0.0001,   0.,0.   ) # par[12] floating left
0036 resolSetter.set( 1 ,0, 0          , 0.001,    0.,0.   ) # par[13] floating right
0037 resolSetter.set( 1 ,0, 0          , 0.0001,   0.,0.   )
0038 
0039 ### Test Dittmeier ------------------------
0040 ## scaleSetter = SetParameters()
0041 ## #fix, order, value, step, min, max
0042 ## scaleSetter.set( 0 ,0, 0. , 0.0000001, 0.,0. ) # par[0]
0043 ## scaleSetter.set( 1 ,0, 0.          , 0.00001,   0.,0. )
0044 ## scaleSetter.set( 0 ,0, 0.  , 0.0001,    -2.,2. )
0045 ## scaleSetter.set( 0 ,0, 0. , 0.00001,   0.,0. )
0046 ## scaleSetter.set( 0 ,0, 0.    , 0.001,     -3.1416,3.1416 )
0047 
0048 
0049 scaleSetter = SetParameters()
0050 #fix, order, value, step, min, max
0051 scaleSetter.set( 1 ,0, -6.08453e-05 , 0.0000001, 0.,0. ) # par[0]
0052 scaleSetter.set( 1 ,0, 0.          , 0.00001,   0.,0. )
0053 scaleSetter.set( 1 ,0, 0.00174819  , 0.0001,    -2.,2. )
0054 scaleSetter.set( 1 ,0, 0.000120695 , 0.00001,   0.,0. )
0055 scaleSetter.set( 1 ,0, 0.254793    , 0.001,     -3.1416,3.1416 )
0056 
0057 process = cms.Process("TEST")
0058 
0059 # process.source = cms.Source(
0060 #     "PoolSource",
0061 #     fileNames = cms.untracked.vstring(
0062 #       "file:/home/demattia/MuScleFit/PatMuons/onia2MuMuPAT_Summer10-DESIGN_36_V8-X0MAX-v2.root"
0063 #     )
0064 # )
0065 # process.maxEvents = cms.untracked.PSet(
0066 #     input = cms.untracked.int32(-1)
0067 # )
0068 
0069 # Use this when running on a tree
0070 process.source = cms.Source("EmptySource")
0071 process.maxEvents = cms.untracked.PSet(
0072     input = cms.untracked.int32(0)
0073 )
0074 
0075 process.looper = cms.Looper(
0076     "MuScleFit",
0077 
0078     # Only used when reading events from a root tree
0079     MaxEventsFromRootTree = cms.int32(-1),
0080     # Specify a file if you want to read events from a root tree in a local file.
0081     # In this case the input source should be an empty source with 0 events.
0082 
0083     # InputRootTreeFileName = cms.string("/home/castello/7TeV/CMSSW_3_8_5_patch3/src/Tree/Fall10/Tree_MCFall2010_INNtk_CRAFTRealistic_wGEN.root"),
0084     InputRootTreeFileName = cms.string("/home/castello/7TeV/CMSSW_3_8_5_patch3/src/Tree/Tree_2010AB_INNtk_ICHEPgeom_BS.root"),
0085     
0086 
0087     # Leave empty if no file should be written.
0088     OutputRootTreeFileName = cms.string("tree_data_newbinning.root"), 
0089 
0090     # Choose the kind of muons you want to run on
0091     # -------------------------------------------
0092     MuonLabel = cms.InputTag("patMuons"),
0093     # Defines what type of muons to use:
0094     # -1 = onia guys selection
0095     # -2 = onia guys selection - only GG
0096     # -3 = onia guys selection - only GT
0097     # -4 = onia guys selection - only TT
0098     # Note that the above samples are independent and represent the composition of the inclusive sample
0099     # 1 = global muon
0100     # 2 = standalone muon
0101     # 3 = tracker muon
0102     # 4 = calo muon
0103     # 10 = innerTrack of global muon
0104     MuonType = cms.int32(2),
0105 
0106     # This line allows to switch to PAT muons. Default is false.
0107     # Note that the onia selection works only with onia patTuples.
0108     PATmuons = cms.untracked.bool(True),
0109 
0110     # ---------------- #
0111     # Select resonance #
0112     # ---------------- #
0113     # The resonances are to be specified in this order:
0114     # Z0, Y(3S), Y(2S), Y(1S), Psi(2S), J/Psi
0115     # -------------------------------------------------
0116     resfind = cms.vint32(1, 0, 0, 0, 0, 0),
0117 
0118     # Likelihood settings
0119     # -------------------
0120     maxLoopNumber = cms.untracked.int32(2),
0121     # Select which fits to do in which loop (0 = do not, 1 = do)
0122     doResolFit =        cms.vint32(0,0),
0123     doScaleFit =        cms.vint32(1,0),
0124     doBackgroundFit =   cms.vint32(0,0),
0125     doCrossSectionFit = cms.vint32(0,0),
0126 
0127     # Use the probability file or not. If not it will perform a simpler selection taking the muon pair with
0128     # invariant mass closer to the pdf value and will crash if some fit is attempted.
0129     UseProbsFile = cms.untracked.bool(True),
0130 
0131     # False = use also MC information
0132     speedup = cms.bool(True),
0133     # Set this to false if you do not want to use simTracks.
0134     # (Note that this is skipped anyway if speedup == True).
0135     compareToSimTracks = cms.bool(False),
0136 
0137     # Output settings
0138     # ---------------
0139     OutputFileName = cms.untracked.string('MuScleFit_data_newbinning.root'),
0140 
0141     # BiasType=0 means no bias to muon momenta
0142     # ----------------------------------------
0143     BiasType = cms.int32(0),
0144     parBias = cms.vdouble(),
0145 
0146     # SmearType=0 means no smearing applied to muon momenta
0147     # -----------------------------------------------------
0148     SmearType = cms.int32(0),
0149     parSmear = cms.vdouble(),
0150 
0151     ### taken from J/Psi #########################
0152     ResolFitType = cms.int32(42),
0153     parResolFix = resolSetter.parFix,
0154     parResolOrder = resolSetter.parOrder,
0155     parResol = resolSetter.par,
0156     parResolStep = resolSetter.parStep,
0157     parResolMin = resolSetter.parMin,
0158     parResolMax = resolSetter.parMax,
0159 
0160 
0161     # -------------------- #
0162     # Scale fit parameters #
0163     # -------------------- #
0164 
0165     # -----------------------------------------------------------------------------------
0166     ScaleFitType = cms.int32(29),
0167     parScaleFix = scaleSetter.parFix,
0168     parScaleOrder = scaleSetter.parOrder,
0169     parScale = scaleSetter.par,
0170     parScaleStep = scaleSetter.parStep,
0171     parScaleMin = scaleSetter.parMin,
0172     parScaleMax = scaleSetter.parMax,
0173 
0174 
0175     # ---------------------------- #
0176     # Cross section fit parameters #
0177     # ---------------------------- #
0178     # Note that the cross section fit works differently than the others, it
0179     # fits ratios of parameters. Fix and Order should not be used as is, they
0180     # are there mainly for compatibility.
0181     parCrossSectionOrder = cms.vint32(0, 0, 0, 0, 0, 0),
0182     parCrossSectionFix =   cms.vint32(0, 0, 0, 0, 0, 0),
0183     parCrossSection = cms.vdouble(1.233, 2.07, 6.33, 13.9, 2.169, 127.2),
0184 
0185     # ------------------------- #
0186     # Background fit parameters #
0187     # ------------------------- #
0188 
0189     # Window factors for: Z, Upsilons and (J/Psi,Psi2S) regions
0190     LeftWindowBorder = cms.vdouble(70., 8., 1.391495),
0191     RightWindowBorder = cms.vdouble(110., 12., 5.391495),
0192 
0193     # The two parameters of BgrFitType=2 are respectively:
0194     # bgr fraction, (negative of) bgr exp. slope, bgr constant
0195     # --------------------------------------------------------
0196     # The function types for resonances in a region must be the same
0197     BgrFitType = cms.vint32(2, 2, 2), # regions
0198     # These empty parameters should be used when there is no background
0199     parBgr = cms.vdouble(0., 0.,   0., 0.,   0., 0.,
0200                          0., 0.,   0., 0.,   0., 0.,   0.,0.,   0.,0.,   0.,0.),
0201     parBgrFix = cms.vint32(0, 0,   0, 0,   0, 0,
0202                            # The rest of the parameters is used for the resonance regions. They are automatically fixed in the code
0203                            # because they are never used to fit the background, but only after the rescaling.
0204                            1, 1,   1, 1,   1, 1,   1, 1,   1, 1,   1, 1),
0205     parBgrOrder = cms.vint32(0, 0,   0, 0,   0, 0,
0206                              0, 0,   0, 0,   0, 0,   0, 0,   0, 0,   0, 0),
0207 
0208 
0209     # ----------------------- #
0210 
0211     # Set Minuit fit strategy
0212     FitStrategy = cms.int32(2),
0213 
0214     # Fit accuracy and debug parameters
0215     StartWithSimplex = cms.bool(True),
0216     ComputeMinosErrors = cms.bool(False),
0217     MinimumShapePlots = cms.bool(True),
0218 
0219     # Set the cuts on muons to be used in the fit
0220 
0221     ##    MaxMuonPt = cms.untracked.double(50.),
0222     ##    MinMuonPt = cms.untracked.double(50.),
0223     ##    MinMuonEtaFirstRange = cms.untracked.double(-0.8),
0224     ##    MaxMuonEtaFirstRange = cms.untracked.double(0.8),
0225     ##    MinMuonEtaSecondRange = cms.untracked.double(-0.8),
0226     ##    MaxMuonEtaSecondRange = cms.untracked.double(0.8),
0227     
0228     ##    ProbabilitiesFileInPath = cms.untracked.string("MuonAnalysis/MomentumScaleCalibration/test/Probs_merge.root"),
0229     # ProbabilitiesFile = cms.untracked.string("/home/castello/7TeV/CMSSW_3_8_5_patch3/src/MuonAnalysis/MomentumScaleCalibration/test/Probs_merge.root"),
0230     RapidityBinsForZ = cms.untracked.bool(False),
0231     ProbabilitiesFile = cms.untracked.string("/home/castello/Development/test/Probs_1001.root"),
0232 
0233     # The following parameters can be used to filter events
0234     TriggerResultsLabel = cms.untracked.string("TriggerResults"),
0235     TriggerResultsProcess = cms.untracked.string("HLT"),
0236     # TriggerPath: "" = No trigger requirements, "All" = No specific path
0237     # TriggerPath = cms.untracked.string("HLT_L1MuOpen"),
0238     TriggerPath = cms.untracked.string("All"),
0239     # Negate the result of the trigger
0240     NegateTrigger = cms.untracked.bool(False),
0241 
0242     debug = cms.untracked.int32(0),
0243 )