-
Notifications
You must be signed in to change notification settings - Fork 18
Arrangements for the new sample set
Weights: Stitching weights, Pileup weights, generator weights
- Cross section
- Generator weight, set by CrossSectionWeightProducer in Artus.
- HLT Prescale weight, set by HltProducer in Artus.
- ID Iso weight (_1) for electron = 1 by default in the code
- Identification weight (_1) for electron
- Number of generated events weight = 1/N_generated_events, set by NumberGeneratedEventsWeightProducer in Artus.
- Pileup weight, set by PUWeightProducer in Artus.
- Trigger weight (_1) for electron
Generator Weight: In the normal cases the weight that needs to be applied is the weight_per_event/sum_of_weight, where sum_of_weights = N_pos - N_neg. The way how it is implemented in the framework is summarised as follows:
- getGeneratorWeight.pyis used to calculate an effective weight to take into account the negative and positive weights, placed under Artus/KappaAnalysis/scripts
- GeneratorWeightProducer.cc is used to to get the weight of a single event and normalise it to the effective weight
- Number of generated event weight, which is 1/Nevents, should be applied to finalise the generator weight calculation.
The information how to use the "getGeneratorWeight.py" to calculate the weights to be added to the dataset.json file is explained here: https://github.com/cms-analysis/HiggsAnalysis-KITHiggsToTauTau/wiki/Performing-a-Skim#nlo-generator-weights
Pileup Weights: In 2017 samples, it is suggested that the MC templates will be obtained from the MC samples itself by using "getTrueNumInteractions" function instead of using the numbers given here for example. The true number of interactions are already stored in Kappa. The next step would be to create weight files for each sample individually by comparing the data template and MC samples templates. Pileup weights can be calculated by "puWeightCalc.py", placed under Artus/KappaAnalysis/scripts/. This script contains various functions such as "getDataFromPileupCalc" to calculate the PU template from data, and "getDistributionFromSkim" and "getDistributionFromFile" to calculate/get the PU template for MC samples. For 2017 samples, you should use the skimmed samples to calculate the weight per sample by giving the filelist as following:
puWeightCalc.py <Cert_JSON.txt> </mc/skim/*.root> -i <pileup_JSON.txt> [options]
puWeightCalc.py <Cert_JSON.txt> `cat <$CMSSW_BASE/src/HiggsAnalysis/KITHiggsToTauTau/data/Samples/XROOTD_sample_..._recent.txt>` -i <pileup_JSON.txt>
Note: In Kappa, the number of interactions is obtained by using both "getTrueNumInteractions" and "getPU_NumInteractions". The differences are explained in this twiki.
Pileup Data_Template Calculation: One needs to use pileupCalc.py script of CMSSW, an example usage is:
pileupCalc.py -i <Cert_JSON.txt> --inputLumiJSON <pileup_JSON.txt> --calcmode true --minBiasXsec <69200> --maxPileupBin <80> --numPileupBins <1600> <outputfile.root>
- Lepton ID or trigger scale factors are provided in this github page (https://github.com/CMS-HTT/LeptonEfficiencies). The explanation of how they are calculated is given in the HiggsToTauTauWorking Twiki (https://twiki.cern.ch/twiki/bin/viewauth/CMS/HiggsToTauTauWorking2016#Muon_efficiencies).
- The provided root files include the efficiencies of both MC and Data histograms separately. For artus input, you need one root file that includes the efficiency for data and one for MC. This can be done using the following script
convertEfficienciesToArtusRootInput.py -i <input-dir-to-LeptonEfficiency-RootFiles>
e.g. convertEfficienciesToArtusRootInput.py -i $CMSSW_BASE/src/LeptonEfficiencies/LepEffInterface/data/2017/
which is placed under script directory of the HiggsAnalysis repository. Note: Under the input-dir, there should be folders for the corresponding SF with name "Electron" or "Muon", because the binning is arranged depending on the name of the directory.
- Those input files are used in TriggerWeightProducer and IdentificationWeightProducer based on DataMcScaleFactorProducers, and the weights are calculated.
- However, if you have an input for the RooWorkSpace, then you could use the RooWorkSpaceWeightProducer which also calculates the weights for identification and trigger. Note: This is provided by Andrew Gilbert for 2016 sample.
Tau ID Scale Factor: It is implemented in the cut strings script as an extra weight,
TauIso*((gen_match_2 == 5)*SF(WPs) + (gen_match_2 != 5)).
Tau Trigger Scale Factor Tau Trigger scale factor can be found under the github page linked here (https://github.com/truggles/TauTriggerSFs2017/tree/tauTriggers2017_MCv2_PreReMiniaod). The explanation if given in this presentation (https://github.com/truggles/TauTriggerSFs2017/tree/tauTriggers2017_MCv2_PreReMiniaod)
- If you request a quantity with "weight" in its name to be added to the output ntuple and this weight is not calculated in any producer, there is no warning like for other quantities but it is just put to 1, as seen in https://github.com/artus-analysis/Artus/blob/master/KappaAnalysis/interface/Consumers/KappaLambdaNtupleConsumer.h#L120-L133 . Note: if this behaviour is not wanted, one would just have to delete the marked code in the above link and add lambda functions in all weight producers as for other quantities