===== Recipe to Derive the Data Pile-Up Profiles ===== * The following two centrally produced files should be used: * the pile-up JSON file [[https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions12/8TeV/PileUp/pileup_JSON_DCSONLY_190389-208686_All_2012_pixelcorr.txt|pileup_JSON_DCSONLY_190389-208686_All_2012_pixelcorr.txt]] * the list of good lumi sections [[https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions12/8TeV/Reprocessing/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt|Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt]] * The actual pile-up profile is easily generated with the command pileupCalc.py -i Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt --inputLumiJSON pileup_JSON_DCSONLY_190389-208686_All_2012_pixelcorr.txt --calcMode true --minBiasXsec 69400 --maxPileupBin 60 --numPileupBins 60 DataPUProfile_2013Jan22.root === PU-Related Links and info === * [[https://twiki.cern.ch/twiki/bin/viewauth/CMS/PileupJSONFileforData#2012_Pileup_JSON_Files|Here]] you can find info about PU JSON file for data * If you are interested in a specific run range then you have to filter the two JSON files above as described [[users:ngadiuba:tools:lumicalc|here]] * You can download directly the JSON files with the command wget --no-check-certificate https://cms-service-dqm.web.cern.ch/cms-service-dqm/CAF/certification/Collisions12/8TeV/Reprocessing/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt ===== How to calculate weights ===== * Get the MC PU distribution for the scenario of interest from [[https://twiki.cern.ch/twiki/bin/viewauth/CMS/Pileup_MC_Gen_Scenarios|here]] * Then calculate the weights using the true number of PU interactions for the in-time bunch crossing. This information is extracted in CMSSW as follows Handle > PupInfo; event.getByLabel(edm::InputTag("addPileupInfo"), PupInfo); std::vector::const_iterator PVI; float Tnpv = -1; for(PVI = PupInfo->begin(); PVI != PupInfo->end(); ++PVI) { int BX = PVI->getBunchCrossing(); if(BX == 0) { Tnpv = PVI->getTrueNumInteractions(); continue; } } ===== PUweight class for SFrame ===== * [[users:ngadiuba:tools:puweightrecipe:puweighth|PUWeight.h]] * [[users:ngadiuba:tools:puweightrecipe:puweightcxx|PUWeight.cxx]]