Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:46

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