diff --git a/EOverPCalibration/bin/CalibrationMomentum.cpp b/EOverPCalibration/bin/CalibrationMomentum.cpp index db51c1bad74..3a39dd6fc6f 100644 --- a/EOverPCalibration/bin/CalibrationMomentum.cpp +++ b/EOverPCalibration/bin/CalibrationMomentum.cpp @@ -131,6 +131,10 @@ int main(int argc, char** argv) if(Options.existsAs("usePUweights")) usePUweights = Options.getParameter("usePUweights"); + int chargeValue = -1; + if(Options.existsAs("chargeValue")) + chargeValue = Options.getParameter("chargeValue"); + cout << " Basic Configuration " << endl; cout << " Tree Name = " << TreeName << endl; cout << " infileDATA = " << infileDATA << endl; @@ -145,6 +149,7 @@ int main(int argc, char** argv) cout << " rebinEB = " << rebinEB << endl; cout << " rebinEE = " << rebinEE << endl; cout << " usePUweights = " << usePUweights << endl; + cout << " chargeValue = " << chargeValue << endl; cout << "Making calibration plots for Momentum scale studies " << endl; @@ -155,15 +160,15 @@ int main(int argc, char** argv) float eta2Max = 2.5; //--- weights for MC - TFile weightsFile (WeightforMC.c_str(), "READ"); - TH1F* hweights = (TH1F*)weightsFile.Get("pileup"); + // TFile weightsFile (WeightforMC.c_str(), "READ"); + // TH1F* hweights = (TH1F*)weightsFile.Get("pileup"); - float w[100]; + /* float w[100]; for (int ibin = 1; ibin < hweights->GetNbinsX() + 1; ibin++) { w[ibin - 1] = hweights->GetBinContent(ibin); // bin 1 --> nvtx = 0 } weightsFile.Close(); - + */ //histos to get the bin in phi given the electron phi TH1F* hPhiBinEB = new TH1F("hphiEB", "hphiEB", nPhiBinsEB, -1.*TMath::Pi(), 1.*TMath::Pi()); TH1F* hPhiBinEE = new TH1F("hphiEE", "hphiEE", nPhiBinsEE, -1.*TMath::Pi(), 1.*TMath::Pi()); @@ -180,15 +185,14 @@ int main(int argc, char** argv) // observables // int isW; - float invMass_SC; + float invMass_ECAL_ele; float etaSCEle[3], phiSCEle[3]; float etaEle[3], phiEle[3]; float energySCEle[3], rawEnergySCEle[3], R9Ele[3]; - int chargeEle[3]; + Short_t chargeEle[3]; float pAtVtxGsfEle[3]; - float seedXSCEle[3], seedYSCEle[3]; + float xSeedSC[3], ySeedSC[3]; int NPU[1]; - float PtEle[3]; int ele1_iz, ele2_iz; // Set branch addresses for Data @@ -202,22 +206,20 @@ int main(int argc, char** argv) ntu_DA->SetBranchAddress("etaSCEle", &etaSCEle); ntu_DA->SetBranchStatus("phiSCEle", 1); ntu_DA->SetBranchAddress("phiSCEle", &phiSCEle); - ntu_DA->SetBranchStatus("energySCEle", 1); - ntu_DA->SetBranchAddress("energySCEle", &energySCEle); + ntu_DA->SetBranchStatus("energy_ECAL_ele", 1); + ntu_DA->SetBranchAddress("energy_ECAL_ele", &energySCEle); ntu_DA->SetBranchStatus("rawEnergySCEle", 1); ntu_DA->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle); - ntu_DA->SetBranchStatus("PtEle", 1); - ntu_DA->SetBranchAddress("PtEle", &PtEle); - ntu_DA->SetBranchStatus("invMass_SC", 1); - ntu_DA->SetBranchAddress("invMass_SC", &invMass_SC); + ntu_DA->SetBranchStatus("invMass_ECAL_ele", 1); + ntu_DA->SetBranchAddress("invMass_ECAL_ele", &invMass_ECAL_ele); ntu_DA->SetBranchStatus("chargeEle", 1); ntu_DA->SetBranchAddress("chargeEle", &chargeEle); ntu_DA->SetBranchStatus("pAtVtxGsfEle", 1); ntu_DA->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle); - ntu_DA->SetBranchStatus("seedXSCEle", 1); - ntu_DA->SetBranchAddress("seedXSCEle", &seedXSCEle); - ntu_DA->SetBranchStatus("seedYSCEle", 1); - ntu_DA->SetBranchAddress("seedYSCEle", &seedYSCEle); + ntu_DA->SetBranchStatus("xSeedSC", 1); + ntu_DA->SetBranchAddress("xSeedSC", &xSeedSC); + ntu_DA->SetBranchStatus("ySeedSC", 1); + ntu_DA->SetBranchAddress("ySeedSC", &ySeedSC); // Set branch addresses for MC @@ -231,22 +233,20 @@ int main(int argc, char** argv) ntu_MC->SetBranchAddress("etaSCEle", &etaSCEle); ntu_MC->SetBranchStatus("phiSCEle", 1); ntu_MC->SetBranchAddress("phiSCEle", &phiSCEle); - ntu_MC->SetBranchStatus("energySCEle", 1); - ntu_MC->SetBranchAddress("energySCEle", &energySCEle); + ntu_MC->SetBranchStatus("energy_ECAL_ele", 1); + ntu_MC->SetBranchAddress("energy_ECAL_ele", &energySCEle); ntu_MC->SetBranchStatus("rawEnergySCEle", 1); ntu_MC->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle); - ntu_MC->SetBranchStatus("PtEle", 1); - ntu_MC->SetBranchAddress("PtEle", &PtEle); - ntu_MC->SetBranchStatus("invMass_SC", 1); - ntu_MC->SetBranchAddress("invMass_SC", &invMass_SC); + ntu_MC->SetBranchStatus("invMass_ECAL_ele", 1); + ntu_MC->SetBranchAddress("invMass_ECAL_ele", &invMass_ECAL_ele); ntu_MC->SetBranchStatus("chargeEle", 1); ntu_MC->SetBranchAddress("chargeEle", &chargeEle); ntu_MC->SetBranchStatus("pAtVtxGsfEle", 1); ntu_MC->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle); - ntu_MC->SetBranchStatus("seedXSCEle", 1); - ntu_MC->SetBranchAddress("seedXSCEle", &seedXSCEle); - ntu_MC->SetBranchStatus("seedYSCEle", 1); - ntu_MC->SetBranchAddress("seedYSCEle", &seedYSCEle); + ntu_MC->SetBranchStatus("xSeedSC", 1); + ntu_MC->SetBranchAddress("xSeedSC", &xSeedSC); + ntu_MC->SetBranchStatus("ySeedSC", 1); + ntu_MC->SetBranchAddress("ySeedSC", &ySeedSC); if(usePUweights) { ntu_MC->SetBranchStatus("NPU", 1); @@ -440,8 +440,8 @@ int main(int argc, char** argv) // if( isW == 1 ) continue; if( fabs(etaSCEle[0]) > etaMax ) continue; if( fabs(etaSCEle[1]) > eta2Max ) continue; - if( PtEle[0] < 20. ) continue; - if( PtEle[1] < 20. ) continue; + if( (energySCEle[0]/cosh(etaEle[0])) < 20. ) continue; + if( (energySCEle[1]/cosh(etaEle[1])) < 20. ) continue; if ( fabs(etaEle[0]) < 1.479) ele1_iz = 0; else if (etaEle[0] > 0) ele1_iz = 1; @@ -453,11 +453,12 @@ int main(int argc, char** argv) //--- PU weights float ww = 1.; - if( usePUweights ) ww *= w[NPU[0]]; + // if( usePUweights ) ww *= w[NPU[0]]; + if( (chargeEle[1]<0 && chargeValue<0) || (chargeEle[1]>0 && chargeValue>0)) { //--- set the mass for ele1 - // var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; - var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; + // var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; + var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; // simulate e+/e- asymmetry //if( chargeEle[0] > 0 ) ww *= 1.*(6/5); //else ww *= 1.*(4/5); @@ -465,7 +466,7 @@ int main(int argc, char** argv) // MC - BARREL - ele1 if( ele1_iz == 0 ) { // fill MC templates - int modPhi = int(seedYSCEle[0] / (360. / nPhiBinsTempEB)); + int modPhi = int(ySeedSC[0] / (360. / nPhiBinsTempEB)); if( modPhi == nPhiBinsTempEB ) modPhi = 0; int regionId = templIndexEB(typeEB, etaEle[0], chargeEle[0], R9Ele[0]); @@ -484,10 +485,10 @@ int main(int argc, char** argv) // MC - ENDCAP - ele1 else { - int iphi = eRings->GetEndcapIphi(seedXSCEle[0], seedYSCEle[0], ele1_iz); + int iphi = eRings->GetEndcapIphi(xSeedSC[0], ySeedSC[0], ele1_iz); - if( ele1_iz == 1 )mapConversionEEp -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]); - if( ele1_iz == -1 )mapConversionEEm -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]); + if( ele1_iz == 1 )mapConversionEEp -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]); + if( ele1_iz == -1 )mapConversionEEm -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]); // fill MC templates @@ -507,12 +508,13 @@ int main(int argc, char** argv) (h_EoP_EE.at(PhibinEE)).at(regionId) -> Fill(var * var, ww); // This is MC h_phi_mc_EE[regionId] -> Fill(phiSCEle[0], ww); } + } - + else{ //--- set the mass for ele2 - // var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; - var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; + // var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; + var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; // simulate e+/e- asymmetry //if( chargeEle[0] > 0 ) ww *= 1.*(6/5); //else ww *= 1.*(4/5); @@ -520,7 +522,7 @@ int main(int argc, char** argv) // MC - BARREL - ele2 if( ele2_iz == 0) { // fill MC templates - int modPhi = int (seedYSCEle[1] / (360. / nPhiBinsTempEB)); + int modPhi = int (ySeedSC[1] / (360. / nPhiBinsTempEB)); if( modPhi == nPhiBinsTempEB ) modPhi = 0; int regionId = templIndexEB(typeEB, etaEle[1], chargeEle[1], R9Ele[1]); @@ -539,10 +541,10 @@ int main(int argc, char** argv) // MC - ENDCAP - ele2 else { - if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]); - if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]); + if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]); + if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]); - int iphi = eRings->GetEndcapIphi(seedXSCEle[1], seedYSCEle[1], ele2_iz); + int iphi = eRings->GetEndcapIphi(xSeedSC[1], ySeedSC[1], ele2_iz); // fill MC templates @@ -562,9 +564,10 @@ int main(int argc, char** argv) (h_EoP_EE.at(PhibinEE)).at(regionId) -> Fill(var * var, ww); // This is MC h_phi_mc_EE[regionId]->Fill(phiSCEle[1], ww); } + } - h_et_mc ->Fill(PtEle[0], ww); - h_et_mc ->Fill(PtEle[1], ww); + h_et_mc ->Fill((energySCEle[0]/cosh(etaEle[0])), ww); + h_et_mc ->Fill((energySCEle[1]/cosh(etaEle[1])), ww); } @@ -584,8 +587,8 @@ int main(int argc, char** argv) // if( isW == 1 ) continue; if( fabs(etaSCEle[0]) > etaMax ) continue; if( fabs(etaSCEle[1]) > eta2Max ) continue; - if( PtEle[0] < 20. ) continue; - if( PtEle[1] < 20. ) continue; + if( (energySCEle[0]/cosh(etaEle[0])) < 20. ) continue; + if( (energySCEle[1]/cosh(etaEle[1])) < 20. ) continue; float ww = 1.; @@ -597,12 +600,12 @@ int main(int argc, char** argv) else if (etaEle[1] > 0) ele2_iz = 1; else ele2_iz = -1; - + if( (chargeEle[1]<0 && chargeValue<0) || (chargeEle[1]>0 && chargeValue>0)) { //--- set the mass for ele1 - // if( ele1_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; - // else var = ( invMass_SC * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; - if( ele1_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; - else var = ( invMass_SC * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; + // if( ele1_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; + // else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0]/energySCEle[0]) * sqrt(scEneReg2/energySCEle[1]) ) / 91.19; + if( ele1_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; + else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[0] / energySCEle[0]) ) / 91.19; // simulate e+/e- asymmetry //if( chargeEle[0] > 0 ) ww *= 1.*(6/5); //else ww *= 1.*(4/5); @@ -622,8 +625,8 @@ int main(int argc, char** argv) // DATA - ENDCAP - ele1 else { - if( ele1_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]); - if( ele1_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[0], seedYSCEle[0], etaSCEle[0]); + if( ele1_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]); + if( ele1_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[0], ySeedSC[0], etaSCEle[0]); int PhibinEE = hPhiBinEE->FindBin(phiEle[0]) - 1; if( PhibinEE == nPhiBinsEE ) PhibinEE = 0; @@ -635,14 +638,14 @@ int main(int argc, char** argv) (h_Phi_EE.at(PhibinEE)).at(regionId) -> Fill(phiEle[0]); h_phi_data_EE[regionId] -> Fill(phiEle[0]); } + } - - + else{ //--- set the mass for ele2 - // if( ele2_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; - // else var = ( invMass_SC * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; - if( ele2_iz == 0 ) var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; - else var = ( invMass_SC * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; + // if( ele2_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; + // else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1]/energySCEle[1]) * sqrt(scEneReg/energySCEle[0]) ) / 91.19; + if( ele2_iz == 0 ) var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; + else var = ( invMass_ECAL_ele * sqrt(pAtVtxGsfEle[1] / energySCEle[1]) ) / 91.19; // simulate e+/e- asymmetry //if( chargeEle[0]Ele[1] > 0 ) ww *= 1.*(6/5); //else ww *= 1.*(4/5); @@ -659,8 +662,8 @@ int main(int argc, char** argv) (h_Phi_EB.at(PhibinEB)).at(regionId) -> Fill(phiEle[1]); h_phi_data_EB[regionId] -> Fill(phiEle[1]); } else { - if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]); - if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(seedXSCEle[1], seedYSCEle[1], etaSCEle[1]); + if( ele2_iz == 1 ) mapConversionEEp -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]); + if( ele2_iz == -1 ) mapConversionEEm -> SetBinContent(xSeedSC[1], ySeedSC[1], etaSCEle[1]); int PhibinEE = hPhiBinEE->FindBin(phiEle[1]) - 1; if( PhibinEE == nPhiBinsEE ) PhibinEE = 0; @@ -672,9 +675,10 @@ int main(int argc, char** argv) (h_Phi_EE.at(PhibinEE)).at(regionId) -> Fill(phiEle[1]); h_phi_data_EE[regionId] ->Fill(phiEle[1]); } + } - h_et_data ->Fill(PtEle[0]); - h_et_data ->Fill(PtEle[1]); + h_et_data ->Fill((energySCEle[0]/cosh(etaEle[0]))); + h_et_data ->Fill((energySCEle[1]/cosh(etaEle[1]))); } std::cout << "End loop: Analyze events " << endl; diff --git a/EOverPCalibration/cfg/calibrationMomentum_cfg.py b/EOverPCalibration/cfg/calibrationMomentum_cfg.py index 50ee397d421..37f9de31654 100644 --- a/EOverPCalibration/cfg/calibrationMomentum_cfg.py +++ b/EOverPCalibration/cfg/calibrationMomentum_cfg.py @@ -17,9 +17,10 @@ nPhiBinsTempEE = cms.int32(1), rebinEB = cms.int32(10), rebinEE = cms.int32(20), - outputFile = cms.string("output/MomentumCalibration2016.root"), + outputFile = cms.string("output/MomentumCalibration2016"), typeEB = cms.string("eta1"), - typeEE = cms.string("eta1") + typeEE = cms.string("eta1"), + chargeValue = cms.int32(-1) ) diff --git a/EOverPCalibration/cfg/listDATA_momentumCalibration.txt b/EOverPCalibration/cfg/listDATA_momentumCalibration.txt index 79cb419a477..4a09bf02cea 100644 --- a/EOverPCalibration/cfg/listDATA_momentumCalibration.txt +++ b/EOverPCalibration/cfg/listDATA_momentumCalibration.txt @@ -1,18 +1,10 @@ ##MULTIFIT -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-279588.root -#eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras2/DoubleEG-Run2016G-ZSkim-Prompt-v1-279589-279931.root - -##WEIGHTS -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco/273150-275376/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco-273150-275376.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco/275420-276283/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco-275420-276283.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco/276315-276811/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco-276315-276811.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco/276830-277420/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco-276830-277420.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco/277820-278808/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco-277820-278808.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/278817-279588/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-278817-279588.root -eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/279589-279931/271036_279931-Cal_Sep2016/withExtras/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-279589-279931.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-280385/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-280385.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v2/281207-284035/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016H-ZSkim-Prompt-v2-281207-284035.root +eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v3/284036-284068/271036_284044-23Sep2016/newNtuples/DoubleEG-Run2016H-ZSkim-Prompt-v3-284036-284068.root diff --git a/EOverPCalibration/interface/FastCalibratorEB.h b/EOverPCalibration/interface/FastCalibratorEB.h index 5c6c179d788..c95d0a27d35 100644 --- a/EOverPCalibration/interface/FastCalibratorEB.h +++ b/EOverPCalibration/interface/FastCalibratorEB.h @@ -34,7 +34,7 @@ public : ///! List of class methods - FastCalibratorEB(TTree *tree, std::vector & inputMomentumScale, std::vector & inputEnergyScale, const std::string& typeEB, TString outEPDistribution = "NULL"); + FastCalibratorEB(TTree *tree, std::vector & inputMomentumScaleElectrons, std::vector & inputMomentumScalePositrons, const std::string& typeEB, TString outEPDistribution = "NULL"); virtual ~FastCalibratorEB(); @@ -63,8 +63,8 @@ public : // Public Variables - std::vector myMomentumScale; - std::vector myEnergyScale; + std::vector myMomentumScaleElectrons; + std::vector myMomentumScalePositrons; std::string myTypeEB; TTree *fChain; //!pointer to the analyzed TTree or TChain @@ -78,7 +78,7 @@ public : Int_t isW; Int_t isZ; - Int_t chargeEle[3]; + Short_t chargeEle[3]; Float_t etaEle[3]; Float_t PtEle[3]; Float_t phiEle[3]; diff --git a/EOverPCalibration/interface/FastCalibratorEE.h b/EOverPCalibration/interface/FastCalibratorEE.h index 14faf08f3cc..18c4a45c1d8 100644 --- a/EOverPCalibration/interface/FastCalibratorEE.h +++ b/EOverPCalibration/interface/FastCalibratorEE.h @@ -34,7 +34,7 @@ class FastCalibratorEE public : ///! Class methods - FastCalibratorEE(TTree *tree, std::vector & inputMomentumScale, std::vector & inputEnergyScale, const std::string& typeEE, TString outEPDistribution = "NULL"); + FastCalibratorEE(TTree *tree, std::vector & inputMomentumScaleElectrons, std::vector & inputMomentumScalePositrons, const std::string& typeEE, TString outEPDistribution = "NULL"); virtual ~FastCalibratorEE(); @@ -60,8 +60,8 @@ public : virtual bool CheckDeadXtal(const int & iX, const int & iY, const int & iZ); - std::vector myMomentumScale; - std::vector myEnergyScale; + std::vector myMomentumScaleElectrons; + std::vector myMomentumScalePositrons; std::string myTypeEE; TTree *fChain; //!pointer to the analyzed TTree or TChain @@ -76,7 +76,7 @@ public : Int_t isW; Int_t isZ; - Int_t chargeEle[3]; + Short_t chargeEle[3]; Float_t etaEle[3]; Float_t PtEle[3]; Float_t phiEle[3]; diff --git a/EOverPCalibration/src/DrawingUtils.cc b/EOverPCalibration/src/DrawingUtils.cc index 4ace9d88097..6377b0f62c3 100644 --- a/EOverPCalibration/src/DrawingUtils.cc +++ b/EOverPCalibration/src/DrawingUtils.cc @@ -16,7 +16,7 @@ void DrawICMap(TH2F* h2, const std::string& fileName, const std::string& fileTyp h2 -> GetXaxis() -> SetNdivisions(418); h2 -> GetXaxis() -> SetTitle("i#phi"); h2 -> GetYaxis() -> SetTitle("i#eta"); - h2 -> GetZaxis() -> SetRangeUser(0.90, 1.10); + h2 -> GetZaxis() -> SetRangeUser(0.95, 1.05); } else { c = new TCanvas("c", fileName.c_str(), 0, 0, 700, 600); c -> SetGridx(); @@ -25,7 +25,7 @@ void DrawICMap(TH2F* h2, const std::string& fileName, const std::string& fileTyp h2 -> GetXaxis() -> SetNdivisions(510); h2 -> GetXaxis() -> SetTitle("ix"); h2 -> GetYaxis() -> SetTitle("iy"); - h2 -> GetZaxis() -> SetRangeUser(0.70, 1.30); + h2 -> GetZaxis() -> SetRangeUser(0.90, 1.10); } h2 -> Draw("COLZ"); diff --git a/EOverPCalibration/src/FastCalibratorEB.cc b/EOverPCalibration/src/FastCalibratorEB.cc index 1debb46c300..754c017ec27 100644 --- a/EOverPCalibration/src/FastCalibratorEB.cc +++ b/EOverPCalibration/src/FastCalibratorEB.cc @@ -16,7 +16,7 @@ ///==== Default constructor Contructor -FastCalibratorEB::FastCalibratorEB(TTree *tree, std::vector & inputMomentumScale, std::vector & inputEnergyScale, const std::string& typeEB, TString outEPDistribution): +FastCalibratorEB::FastCalibratorEB(TTree *tree, std::vector & inputMomentumScaleElectrons, std::vector & inputMomentumScalePositrons, const std::string& typeEB, TString outEPDistribution): outEPDistribution_p(outEPDistribution) { @@ -32,8 +32,8 @@ FastCalibratorEB::FastCalibratorEB(TTree *tree, std::vector & inp Init(tree); // Set my momentum scale using the input graphs - myMomentumScale = inputMomentumScale; - myEnergyScale = inputEnergyScale; + myMomentumScaleElectrons = inputMomentumScaleElectrons; + myMomentumScalePositrons = inputMomentumScalePositrons; myTypeEB = typeEB; } @@ -136,20 +136,20 @@ void FastCalibratorEB::Init(TTree *tree) fChain->SetBranchAddress("chargeEle", chargeEle); fChain->SetBranchStatus("etaEle", 1); fChain->SetBranchAddress("etaEle", &etaEle, &b_etaEle); - fChain->SetBranchStatus("PtEle", 1); - fChain->SetBranchAddress("PtEle", &PtEle, &b_PtEle); + // fChain->SetBranchStatus("PtEle", 1); + //fChain->SetBranchAddress("PtEle", &PtEle, &b_PtEle); fChain->SetBranchStatus("phiEle", 1); fChain->SetBranchAddress("phiEle", &phiEle, &b_phiEle); fChain->SetBranchStatus("rawEnergySCEle", 1); fChain->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle, &b_rawEnergySCEle); - fChain->SetBranchStatus("energySCEle_must", 1); - fChain->SetBranchAddress("energySCEle_must", &energySCEle, &b_energySCEle); + fChain->SetBranchStatus("energy_ECAL_ele", 1); + fChain->SetBranchAddress("energy_ECAL_ele", &energySCEle, &b_energySCEle); //OLD ENERGY: energySCEle_must // fChain->SetBranchStatus("energySCEle", 1); fChain->SetBranchAddress("energySCEle", &energySCEle, &b_energySCEle); fChain->SetBranchStatus("etaSCEle", 1); fChain->SetBranchAddress("etaSCEle", &etaSCEle, &b_etaSCEle); fChain->SetBranchStatus("esEnergySCEle", 1); fChain->SetBranchAddress("esEnergySCEle", &esEnergySCEle, &b_esEnergySCEle); - fChain->SetBranchStatus("pAtVtxGsfEle", 1); + fChain->SetBranchStatus("pAtVtxGsfEle", 1); //please test also with: pModeGsfEle fChain->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle, &b_pAtVtxGsfEle); fChain->SetBranchStatus("fbremEle", 1); fChain->SetBranchAddress("fbremEle", &fbremEle, &b_fbremEle); @@ -269,8 +269,8 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u FdiEta = energySCEle[0] / rawEnergySCEle[0]; /// FEta approximation if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) - FdiEta /= myEnergyScale[0] -> Eval( phiEle[0] ); + // if (applyEnergyCorrection) + // FdiEta /= myEnergyScale[0] -> Eval( phiEle[0] ); float thisE = 0; int iseed = 0 ; @@ -323,8 +323,10 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if(!isMCTruth) { pIn = pAtVtxGsfEle[0]; // int regionId = templIndexEB(myTypeEB,etaEle[0],chargeEle[0],thisE3x3/thisE); - if (applyMomentumCorrection) - pIn /= myMomentumScale[0] -> Eval( phiEle[0] ); + if (applyMomentumCorrection) { + if (chargeEle[0]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[0] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[0] ); + } } else { pIn = energyMCEle[0]; ele1_DR = TMath::Sqrt((etaMCEle[0] - etaEle[0]) * (etaMCEle[0] - etaEle[0]) + (phiMCEle[0] - phiEle[0]) * (phiMCEle[0] - phiEle[0])) ; @@ -338,7 +340,7 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if( fabs(fbremEle[0]) > fbremMax && isfbrem == true ) skipElectron = true; /// fbrem Selection - if( PtEle[0] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[0]/cosh(etaEle[0])) < PtMin && isPtCut == true ) skipElectron = true; /// Save electron E/p in a chain of histogramm each for eta bin if(!skipElectron) hC_EoP_eta_ele -> Fill(eta_seed + 85, thisE / pIn); @@ -352,8 +354,8 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u FdiEta = energySCEle[1] / rawEnergySCEle[1]; /// FEta approximation if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) - FdiEta /= myEnergyScale[0] -> Eval( phiEle[1] ); + // if (applyEnergyCorrection) + // FdiEta /= myEnergyScale[0] -> Eval( phiEle[1] ); float thisE = 0; int iseed = 0 ; @@ -407,9 +409,10 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if(!isMCTruth) { pIn = pAtVtxGsfEle[1]; // int regionId = templIndexEB(myTypeEB,etaEle[1],ele2_charge,thisE3x3/thisE); - if (applyMomentumCorrection) - pIn /= myMomentumScale[0] -> Eval( phiEle[0] ); - // pIn /= myMomentumScale[regionId] -> Eval( phiEle[1] ); + if (applyMomentumCorrection) { + if (chargeEle[1]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[1] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[1] ); + } } else { pIn = energyMCEle[1]; ele2_DR = TMath::Sqrt((etaMCEle[1] - etaEle[1]) * (etaMCEle[1] - etaEle[1]) + (phiMCEle[1] - phiEle[1]) * (phiMCEle[1] - phiEle[1])) ; @@ -423,7 +426,7 @@ void FastCalibratorEB::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if( fabs(fbremEle[1]) > fbremMax && isfbrem == true ) skipElectron = true; /// fbrem Selection - if( PtEle[1] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[1]/cosh(etaEle[1])) < PtMin && isPtCut == true ) skipElectron = true; /// Save E/p electron information if(!skipElectron) hC_EoP_eta_ele -> Fill(eta_seed + 85, thisE / pIn); @@ -582,8 +585,8 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in FdiEta = energySCEle[0] / rawEnergySCEle[0]; if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) - FdiEta /= myEnergyScale[0] -> Eval( phiEle[0] ); + // if (applyEnergyCorrection) + // FdiEta /= myEnergyScale[0] -> Eval( phiEle[0] ); float thisE = 0; int iseed = 0 ; @@ -636,8 +639,10 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in if(!isMCTruth) { pIn = pAtVtxGsfEle[0]; // int regionId = templIndexEB(myTypeEB,etaEle[0],chargeEle[0],thisE3x3/thisE); - if (applyMomentumCorrection) - pIn /= myMomentumScale[0] -> Eval( phiEle[0] ); + if (applyMomentumCorrection) { + if (chargeEle[0]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[0] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[0] ); + } } else { pIn = energyMCEle[0]; ele1_DR = TMath::Sqrt((etaMCEle[0] - etaEle[0]) * (etaMCEle[0] - etaEle[0]) + (phiMCEle[0] - phiEle[0]) * (phiMCEle[0] - phiEle[0])); @@ -653,7 +658,7 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in if( fabs(thisE / pIn - 1) > 0.3 && isEPselection == true ) skipElectron = true; if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[0]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[0] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[0]/cosh(etaEle[0])) < PtMin && isPtCut == true ) skipElectron = true; if( thisE / pIn < EoPHisto->GetXaxis()->GetXmin() || thisE / pIn > EoPHisto->GetXaxis()->GetXmax()) skipElectron = true; if( !skipElectron) { @@ -722,8 +727,8 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in FdiEta = energySCEle[1] / rawEnergySCEle[1]; if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) - FdiEta /= myEnergyScale[0] -> Eval( phiEle[1] ); + // if (applyEnergyCorrection) + // FdiEta /= myEnergyScale[0] -> Eval( phiEle[1] ); // Electron energy float thisE = 0; @@ -779,8 +784,10 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in if(!isMCTruth) { pIn = pAtVtxGsfEle[1]; // int regionId = templIndexEB(myTypeEB,etaEle[1],ele2_charge,thisE3x3/thisE); - if (applyMomentumCorrection) - pIn /= myMomentumScale[0] -> Eval( phiEle[1] ); + if (applyMomentumCorrection) { + if (chargeEle[1]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[1] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[1] ); + } } else { pIn = energyMCEle[1]; ele2_DR = TMath::Sqrt((etaMCEle[1] - etaEle[1]) * (etaMCEle[1] - etaEle[1]) + (phiMCEle[1] - phiEle[1]) * (phiMCEle[1] - phiEle[1])); @@ -794,7 +801,7 @@ void FastCalibratorEB::Loop( int nentries, int useZ, int useW, int splitStat, in if( fabs(thisE / pIn - 1) > 0.3 && isEPselection == true ) skipElectron = true; if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[1]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[1] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[1]/cosh(etaEle[1])) < PtMin && isPtCut == true ) skipElectron = true; if( !skipElectron ) { diff --git a/EOverPCalibration/src/FastCalibratorEE.cc b/EOverPCalibration/src/FastCalibratorEE.cc index 9b834c4f0f9..fcc4c98c2c5 100644 --- a/EOverPCalibration/src/FastCalibratorEE.cc +++ b/EOverPCalibration/src/FastCalibratorEE.cc @@ -7,7 +7,7 @@ /// Default constructor -FastCalibratorEE::FastCalibratorEE(TTree *tree, std::vector & inputMomentumScale, std::vector & inputEnergyScale, const std::string& typeEE, TString outEPDistribution): +FastCalibratorEE::FastCalibratorEE(TTree *tree, std::vector & inputMomentumScaleElectrons, std::vector & inputMomentumScalePositrons, const std::string& typeEE, TString outEPDistribution): outEPDistribution_p(outEPDistribution) { @@ -34,8 +34,8 @@ FastCalibratorEE::FastCalibratorEE(TTree *tree, std::vector & inp Init(tree); // Set my momentum scale using the input graphs - myMomentumScale = inputMomentumScale; - myEnergyScale = inputEnergyScale; + myMomentumScaleElectrons = inputMomentumScaleElectrons; + myMomentumScalePositrons = inputMomentumScalePositrons; myTypeEE = typeEE; } @@ -137,14 +137,14 @@ void FastCalibratorEE::Init(TTree *tree) fChain->SetBranchAddress("chargeEle", chargeEle); fChain->SetBranchStatus("etaEle", 1); fChain->SetBranchAddress("etaEle", &etaEle, &b_etaEle); - fChain->SetBranchStatus("PtEle", 1); - fChain->SetBranchAddress("PtEle", &PtEle, &b_PtEle); + // fChain->SetBranchStatus("PtEle", 1); + // fChain->SetBranchAddress("PtEle", &PtEle, &b_PtEle); fChain->SetBranchStatus("phiEle", 1); fChain->SetBranchAddress("phiEle", &phiEle, &b_phiEle); fChain->SetBranchStatus("rawEnergySCEle", 1); fChain->SetBranchAddress("rawEnergySCEle", &rawEnergySCEle, &b_rawEnergySCEle); - fChain->SetBranchStatus("energySCEle_must", 1); - fChain->SetBranchAddress("energySCEle_must", &energySCEle, &b_energySCEle); + fChain->SetBranchStatus("energy_ECAL_ele", 1); + fChain->SetBranchAddress("energy_ECAL_ele", &energySCEle, &b_energySCEle); //OLD energy: energySCEle_must fChain->SetBranchStatus("etaSCEle", 1); fChain->SetBranchAddress("etaSCEle", &etaSCEle, &b_etaSCEle); fChain->SetBranchStatus("esEnergySCEle", 1); @@ -279,10 +279,10 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u FdiEta = energySCEle[0] / (rawEnergySCEle[0] + esEnergySCEle[0]); /// Cluster containment approximation using ps infos if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) { - int regionId = templIndexEE(myTypeEE, etaEle[0], chargeEle[0], 1.); - FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[0] ); - } + // if (applyEnergyCorrection) { + // int regionId = templIndexEE(myTypeEE, etaEle[0], chargeEle[0], 1.); + // FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[0] ); + //} float thisE = 0; int iseed = 0 ; @@ -338,8 +338,8 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if(!isMCTruth) { pIn = pAtVtxGsfEle[0]; if (applyMomentumCorrection) { - // int regionId = templIndexEE(myTypeEE,etaEle[0],chargeEle[0],thisE3x3/thisE); - pIn /= myMomentumScale[0] -> Eval( phiEle[0] ); + if (chargeEle[0]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[0] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[0] ); } } else { pIn = energyMCEle[0]; @@ -356,7 +356,7 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[0]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[0] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[0]/cosh(etaEle[0])) < PtMin && isPtCut == true ) skipElectron = true; // std::cout< Fill(ir_seed, thisE / (pIn - esEnergySCEle[0])); @@ -368,10 +368,10 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u FdiEta = energySCEle[1] / (rawEnergySCEle[1] + esEnergySCEle[1]); if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) { - int regionId = templIndexEE(myTypeEE, etaEle[1], chargeEle[1], 1.); - FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[1] ); - } + // if (applyEnergyCorrection) { + // int regionId = templIndexEE(myTypeEE, etaEle[1], chargeEle[1], 1.); + // FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[1] ); + //} float thisE = 0; int iseed = 0 ; @@ -424,8 +424,8 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if(!isMCTruth) { pIn = pAtVtxGsfEle[1]; if (applyMomentumCorrection) { - // int regionId = templIndexEE(myTypeEE,etaEle[1],chargeEle[1],thisE3x3/thisE); - pIn /= myMomentumScale[0] -> Eval( phiEle[1] ); + if (chargeEle[1]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[1] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[1] ); } } else { pIn = energyMCEle[1]; @@ -442,7 +442,7 @@ void FastCalibratorEE::BuildEoPeta_ele(int iLoop, int nentries , int useW, int u if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[1]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[1] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[1]/cosh(etaEle[1])) < PtMin && isPtCut == true ) skipElectron = true; if(!skipElectron) hC_EoP_ir_ele -> Fill(ir_seed, thisE / (pIn - esEnergySCEle[1])); @@ -596,10 +596,10 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in FdiEta = energySCEle[0] / (rawEnergySCEle[0] + esEnergySCEle[0]); if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) { - int regionId = templIndexEE(myTypeEE, etaEle[0], chargeEle[0], 1.); - FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[0] ); - } + // if (applyEnergyCorrection) { + // int regionId = templIndexEE(myTypeEE, etaEle[0], chargeEle[0], 1.); + // FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[0] ); + //} float thisE = 0; float thisE3x3 = 0 ; @@ -659,8 +659,8 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in if(!isMCTruth) { pIn = pAtVtxGsfEle[0]; if (applyMomentumCorrection) { - // int regionId = templIndexEE(myTypeEE,etaEle[0],chargeEle[0],thisE3x3/thisE); - pIn /= myMomentumScale[0] -> Eval( phiEle[0] ); + if (chargeEle[0]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[0] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[0] ); } } else { pIn = energyMCEle[0]; @@ -681,7 +681,7 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[0]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[0] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[0]/cosh(etaEle[0])) < PtMin && isPtCut == true ) skipElectron = true; if( thisE / (pIn - esEnergySCEle[0]) < EoPHisto->GetXaxis()->GetXmin() || thisE / (pIn - esEnergySCEle[0]) > EoPHisto->GetXaxis()->GetXmax() ) skipElectron = true; @@ -795,10 +795,10 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in FdiEta = energySCEle[1] / (rawEnergySCEle[1] + esEnergySCEle[1]); if (useRawEnergy == 1) FdiEta = 1.; - if (applyEnergyCorrection) { - int regionId = templIndexEE(myTypeEE, etaEle[1], chargeEle[1], 1.); - FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[1] ); - } + // if (applyEnergyCorrection) { + // int regionId = templIndexEE(myTypeEE, etaEle[1], chargeEle[1], 1.); + // FdiEta /= myEnergyScale[regionId] -> Eval( phiEle[1] ); + //} float thisE = 0; float thisE3x3 = 0 ; @@ -854,8 +854,8 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in if(!isMCTruth) { pIn = pAtVtxGsfEle[1]; if (applyMomentumCorrection) { - // int regionId = templIndexEE(myTypeEE,etaEle[1],chargeEle[1],thisE3x3/thisE); - pIn /= myMomentumScale[0] -> Eval( phiEle[1] ); + if (chargeEle[1]<0) pIn /= myMomentumScaleElectrons[0] -> Eval( phiEle[1] ); + else pIn /= myMomentumScalePositrons[0] -> Eval( phiEle[1] ); } } else { pIn = energyMCEle[1]; @@ -877,7 +877,7 @@ void FastCalibratorEE::Loop( int nentries, int useZ, int useW, int splitStat, in if( fabs(thisE3x3 / thisE) < R9Min && isR9selection == true ) skipElectron = true; if( fabs(fbremEle[1]) > fbremMax && isfbrem == true ) skipElectron = true; - if( PtEle[1] < PtMin && isPtCut == true ) skipElectron = true; + if( (energySCEle[1]/cosh(etaEle[1])) < PtMin && isPtCut == true ) skipElectron = true; if( thisE / (pIn - esEnergySCEle[1]) < EoPHisto->GetXaxis()->GetXmin() || diff --git a/EOverPCalibration/src/LaserMonitoringEoP.cc b/EOverPCalibration/src/LaserMonitoringEoP.cc index b1d323e839a..9a3d6a3ba91 100644 --- a/EOverPCalibration/src/LaserMonitoringEoP.cc +++ b/EOverPCalibration/src/LaserMonitoringEoP.cc @@ -59,40 +59,40 @@ void LaserMonitoringEoP::Init(TTree *tree, TTree *treeMC, int useRegression) fChain->SetBranchStatus("*", 0); fChain->SetBranchStatus("runNumber", 1); - fChain->SetBranchStatus("runTime", 1); + fChain->SetBranchStatus("eventTime", 1); fChain->SetBranchStatus("nPU", 1); fChain->SetBranchStatus("nPV", 1); - fChain->SetBranchStatus("avgLCSCEle", 1); + fChain->SetBranchStatus("avgLCSC", 1); // fChain->SetBranchStatus("seedLaserAlphaSCEle1",1); // fChain->SetBranchStatus("ele1_EOverP",1); fChain->SetBranchStatus("etaSCEle", 1); fChain->SetBranchStatus("phiSCEle", 1); - fChain->SetBranchStatus("energySCEle_must", 1); - fChain->SetBranchStatus("energySCEle_corr", 1); + fChain->SetBranchStatus("energy_ECAL_ele", 1); + fChain->SetBranchStatus("energyEle", 1); fChain->SetBranchStatus("esEnergySCEle", 1); fChain->SetBranchStatus("pAtVtxGsfEle", 1); - fChain->SetBranchStatus("seedXSCEle", 1); - fChain->SetBranchStatus("seedYSCEle", 1); + fChain->SetBranchStatus("xSeedSC", 1); + fChain->SetBranchStatus("ySeedSC", 1); // fChain->SetBranchStatus("ele1_seedZside",1); fChain->SetBranchAddress("runNumber", &runNumber); - fChain->SetBranchAddress("runTime", &runTime); + fChain->SetBranchAddress("eventTime", &runTime); fChain->SetBranchAddress("nPU", &nPU); fChain->SetBranchAddress("nPV", &nPV); - fChain->SetBranchAddress("avgLCSCEle", &avgLCSCEle[0]); + fChain->SetBranchAddress("avgLCSC", &avgLCSCEle[0]); //fChain->SetBranchAddress("seedLaserAlphaSCEle1", &seedLaserAlphaSCEle1); // fChain->SetBranchAddress("ele1_EOverP", &EoP); fChain->SetBranchAddress("etaSCEle", &etaSCEle); fChain->SetBranchAddress("phiSCEle", &phiSCEle); if( useRegression < 1 ) - fChain->SetBranchAddress("energySCEle_must", &energySCEle); + fChain->SetBranchAddress("energy_ECAL_ele", &energySCEle); else - fChain->SetBranchAddress("energySCEle_corr", &energySCEle_corr); + fChain->SetBranchAddress("energy_ECAL_ele", &energySCEle_corr); // fChain->SetBranchAddress("energySCEle_corr", &energySCEle); fChain->SetBranchAddress("esEnergySCEle", &esEnergySCEle); fChain->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle); - fChain->SetBranchAddress("seedXSCEle", &seedXSCEle); - fChain->SetBranchAddress("seedYSCEle", &seedYSCEle); + fChain->SetBranchAddress("xSeedSC", &seedXSCEle); + fChain->SetBranchAddress("ySeedSC", &seedYSCEle); // fChain->SetBranchAddress("ele1_seedZside", &seedZside); @@ -108,40 +108,40 @@ void LaserMonitoringEoP::Init(TTree *tree, TTree *treeMC, int useRegression) fChainMC->SetBranchStatus("*", 0); fChainMC->SetBranchStatus("runNumber", 1); - fChainMC->SetBranchStatus("runTime", 1); + fChainMC->SetBranchStatus("eventTime", 1); fChainMC->SetBranchStatus("nPU", 1); fChainMC->SetBranchStatus("nPV", 1); - fChainMC->SetBranchStatus("avgLCSCEle", 1); + fChainMC->SetBranchStatus("avgLCSC", 1); // fChainMC->SetBranchStatus("seedLaserAlphaSCEle1",1); // fChainMC->SetBranchStatus("ele1_EOverP",1); fChainMC->SetBranchStatus("etaSCEle", 1); fChainMC->SetBranchStatus("phiSCEle", 1); - fChainMC->SetBranchStatus("energySCEle_must", 1); - fChainMC->SetBranchStatus("energySCEle_corr", 1); + fChainMC->SetBranchStatus("energy_ECAL_ele", 1); + fChainMC->SetBranchStatus("energyEle", 1); fChainMC->SetBranchStatus("esEnergySCEle", 1); fChainMC->SetBranchStatus("pAtVtxGsfEle", 1); - fChainMC->SetBranchStatus("seedXSCEle", 1); - fChainMC->SetBranchStatus("seedYSCEle", 1); + fChainMC->SetBranchStatus("xSeedSC", 1); + fChainMC->SetBranchStatus("ySeedSC", 1); // fChainMC->SetBranchStatus("ele1_seedZside",1); fChainMC->SetBranchAddress("runNumber", &runNumber); - fChainMC->SetBranchAddress("runTime", &runTime); + fChainMC->SetBranchAddress("eventTime", &runTime); fChainMC->SetBranchAddress("nPU", &nPU); fChainMC->SetBranchAddress("nPV", &nPV); - fChainMC->SetBranchAddress("avgLCSCEle", &avgLCSCEle[0]); + fChainMC->SetBranchAddress("avgLCSC", &avgLCSCEle[0]); //fChainMC->SetBranchAddress("seedLaserAlphaSCEle1", &seedLaserAlphaSCEle1); // fChainMC->SetBranchAddress("ele1_EOverP", &EoP); fChainMC->SetBranchAddress("etaSCEle", &etaSCEle); fChainMC->SetBranchAddress("phiSCEle", &phiSCEle); if( useRegression < 1 ) - fChainMC->SetBranchAddress("energySCEle_must", &energySCEle); + fChainMC->SetBranchAddress("energy_ECAL_ele", &energySCEle); else - fChainMC->SetBranchAddress("energySCEle_corr", &energySCEle_corr); + fChainMC->SetBranchAddress("energy_ECAL_ele", &energySCEle_corr); // fChainMC->SetBranchAddress("energySCEle_corr", &energySCEle); fChainMC->SetBranchAddress("esEnergySCEle", &esEnergySCEle); fChainMC->SetBranchAddress("pAtVtxGsfEle", &pAtVtxGsfEle); - fChainMC->SetBranchAddress("seedXSCEle", &seedXSCEle); - fChainMC->SetBranchAddress("seedYSCEle", &seedYSCEle); + fChainMC->SetBranchAddress("xSeedSC", &seedXSCEle); + fChainMC->SetBranchAddress("ySeedSC", &seedYSCEle); // fChainMC->SetBranchAddress("ele1_seedZside", &seedZside); } @@ -263,6 +263,7 @@ void LaserMonitoringEoP::Loop( float yMIN, float yMAX, std::string EBEE, int evt // Define in/outfiles std::string folderName = std::string(EBEE) + "_" + dayMinLabel + "_" + dayMaxLabel; + /* if( (absEtaMin != -1.) && (absEtaMax != -1.) ) { char absEtaBuffer[50]; sprintf(absEtaBuffer, "_%.2f-%.2f", absEtaMin, absEtaMax); @@ -274,7 +275,7 @@ void LaserMonitoringEoP::Loop( float yMIN, float yMAX, std::string EBEE, int evt sprintf(absEtaBuffer, "_Ieta_%d-%d_Iphi_%d-%d", IetaMin, IetaMax, IphiMin, IphiMax); folderName += std::string(absEtaBuffer); } - + */ gSystem->mkdir(folderName.c_str()); TFile* o = new TFile((folderName + "/" + folderName + "_histos.root").c_str(), "RECREATE"); @@ -1645,6 +1646,7 @@ void LaserMonitoringEoP::Loop( float yMIN, float yMAX, std::string EBEE, int evt //ciao + /* for(int i = 0; i < nBins; ++i) { gStyle->SetOptFit(1111); @@ -1656,6 +1658,7 @@ void LaserMonitoringEoP::Loop( float yMIN, float yMAX, std::string EBEE, int evt // // h_Cvl[i] -> Write(); } + */ o -> Close(); diff --git a/EOverPCalibration/src/TEndcapRings.cc b/EOverPCalibration/src/TEndcapRings.cc index 94e2d09c666..fa0c0a00879 100644 --- a/EOverPCalibration/src/TEndcapRings.cc +++ b/EOverPCalibration/src/TEndcapRings.cc @@ -14,7 +14,7 @@ TEndcapRings::TEndcapRings() iEndcapRing[ix][iy][iz] = -1; FILE *fRing; - fRing = fopen("/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/EOverPCalibration/CommonTools/eerings.dat", "r"); + fRing = fopen("/afs/cern.ch/user/l/lbrianza/work/public/EoP_additionalFiles/eerings.dat", "r"); std::cout << "Inizializing endcap geometry from: eerings.dat" << std::endl; int ix, iy, iz, ir; while(fscanf(fRing, "(%d,%d,%d) %d \n", &ix, &iy, &iz, &ir) != EOF ) { diff --git a/ZFitter/bin/ZFitter.cpp b/ZFitter/bin/ZFitter.cpp index 0df8d964b0e..adb03f4560b 100644 --- a/ZFitter/bin/ZFitter.cpp +++ b/ZFitter/bin/ZFitter.cpp @@ -289,8 +289,8 @@ int main(int argc, char **argv) float EPMin; int smoothCut; int miscalibMethod; - std::string inputMomentumScale; - std::string inputEnergyScale; + std::string inputMomentumScaleElectrons; + std::string inputMomentumScalePositrons; std::string typeEB; std::string typeEE; std::string outputFile; @@ -462,9 +462,9 @@ int main(int argc, char **argv) ("isR9selection", po::value(&isR9selection)->default_value(false), "apply R9 selection") ("R9Min", po::value(&R9Min)->default_value(-1.), "R9 treshold") ("applyPcorr", po::value(&applyPcorr)->default_value(true), "apply momentum correction") - ("inputMomentumScale", po::value(&inputMomentumScale)->default_value("/afs/cern.ch/user/l/lbrianza/work/public/EoP_additionalFiles/MomentumCalibration2015_eta1_eta1.root"), "input momentum scale") + ("inputMomentumScaleElectrons", po::value(&inputMomentumScaleElectrons)->default_value("/afs/cern.ch/user/l/lbrianza/work/public/EoP_additionalFiles/MomentumCalibration2015_eta1_eta1.root"), "input momentum scale for electrons") ("applyEcorr", po::value(&applyEcorr)->default_value(false), "apply energy correction") - ("inputEnergyScale", po::value(&inputEnergyScale)->default_value("/afs/cern.ch/user/l/lbrianza/work/public/EoP_additionalFiles/momentumCalibration2015_EB_scE.root"), "input energy scale") + ("inputMomentumScalePositrons", po::value(&inputMomentumScalePositrons)->default_value("/afs/cern.ch/user/l/lbrianza/work/public/EoP_additionalFiles/momentumCalibration2015_EB_scE.root"), "input momentum scale for positrons") ("typeEB", po::value(&typeEB)->default_value("eta1"), "") ("typeEE", po::value(&typeEE)->default_value("eta1"), "") ("outputFile", po::value(&outputFile)->default_value("FastCalibrator_Oct2015_runD"), "output file for E/P calibration") @@ -1156,29 +1156,32 @@ int main(int argc, char **argv) std::cout << "---- START E/P CALIBRATION: ENDCAP ----" << std::endl; } - int nRegions = (isEB) ? GetNRegionsEB(typeEB) : GetNRegionsEE(typeEE); + // int nRegions = (isEB) ? GetNRegionsEB(typeEB) : GetNRegionsEE(typeEE); system(("mkdir -p " + outDirFitResData).c_str()); - /// open calibration momentum graph - TFile* momentumscale = new TFile((inputMomentumScale.c_str()));//+"_"+typeEB+"_"+typeEE+".root").c_str()); + /// open calibration momentum graph (electrons) + TFile* momentumscaleElectrons = new TFile((inputMomentumScaleElectrons.c_str()));//+"_"+typeEB+"_"+typeEE+".root").c_str()); std::vector g_EoC; TString Name = (isEB) ? "g_EoC_EB_0" : "g_EoC_EE_0"; - g_EoC.push_back( (TGraphErrors*)(momentumscale->Get(Name)) ); + g_EoC.push_back( (TGraphErrors*)(momentumscaleElectrons->Get(Name)) ); - std::cout << "momentum calibration file correctly opened" << std::endl; + std::cout << "momentum calibration file for electrons correctly opened" << std::endl; - /// open calibration energy graph - TFile* energyscale = new TFile((inputEnergyScale.c_str())); + /// open calibration momentum graph (positrons) + TFile* momentumscalePositrons = new TFile((inputMomentumScalePositrons.c_str())); std::vector g_EoE; + g_EoE.push_back( (TGraphErrors*)(momentumscalePositrons->Get(Name)) ); + + std::cout << "momentum calibration file for positrons correctly opened" << std::endl; + + /* for(int i = 0; i < nRegions; ++i) { TString Name = "g_pData_" + partition + Form("_0_%d", i); - g_EoE.push_back( (TGraphErrors*)(energyscale->Get(Name)) ); - } - - std::cout << "energy calibration file correctly opened" << std::endl; + g_EoE.push_back( (TGraphErrors*)(momentumscalePositrons->Get(Name)) ); + } */ ///Use the whole sample statistics if numberOfEvents < 0 if ( numberOfEvents < 0 ) numberOfEvents = data->GetEntries(); @@ -1201,14 +1204,14 @@ int main(int argc, char **argv) std::cout << "start calibration. " << std::endl; - FastCalibratorEB analyzerEB(data, g_EoC, g_EoE, typeEB, outEPDistribution); - FastCalibratorEE analyzerEE(data, g_EoC, g_EoE, typeEE, outEPDistribution); if(isEB) { + FastCalibratorEB analyzerEB(data, g_EoC, g_EoE, typeEB, outEPDistribution); analyzerEB.bookHistos(nLoops); analyzerEB.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzerEB.Loop(numberOfEvents, useZ, useW, splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); analyzerEB.saveHistos(outputName); } else { + FastCalibratorEE analyzerEE(data, g_EoC, g_EoE, typeEE, outEPDistribution); analyzerEE.bookHistos(nLoops); analyzerEE.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzerEE.Loop(numberOfEvents, useZ, useW, splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); @@ -1228,35 +1231,32 @@ int main(int argc, char **argv) name2 = name1; name2.ReplaceAll("even", "odd"); - TFile *outputName1 = new TFile(outDirFitResData + name1, "RECREATE"); - TFile *outputName2 = new TFile(outDirFitResData + name2, "RECREATE"); + TFile *outputName1 = new TFile(name1, "RECREATE"); + TFile *outputName2 = new TFile(name2, "RECREATE"); TString DeadXtal = Form("%s", inputFileDeadXtal.c_str()); - /// Run on odd - FastCalibratorEB analyzer_even_EB(data, g_EoC, g_EoE, typeEB); - FastCalibratorEB analyzer_odd_EB(data, g_EoC, g_EoE, typeEB); - - FastCalibratorEE analyzer_even_EE(data, g_EoC, g_EoE, typeEE); - FastCalibratorEE analyzer_odd_EE(data, g_EoC, g_EoE, typeEE); if(isEB) { + FastCalibratorEB analyzer_even_EB(data, g_EoC, g_EoE, typeEB); analyzer_even_EB.bookHistos(nLoops); analyzer_even_EB.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzer_even_EB.Loop(numberOfEvents, useZ, useW, splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); analyzer_even_EB.saveHistos(outputName1); + FastCalibratorEB analyzer_odd_EB(data, g_EoC, g_EoE, typeEB); analyzer_odd_EB.bookHistos(nLoops); analyzer_odd_EB.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzer_odd_EB.Loop(numberOfEvents, useZ, useW, -splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); analyzer_odd_EB.saveHistos(outputName2); } else { + FastCalibratorEE analyzer_even_EE(data, g_EoC, g_EoE, typeEE); analyzer_even_EE.bookHistos(nLoops); analyzer_even_EE.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzer_even_EE.Loop(numberOfEvents, useZ, useW, splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); analyzer_even_EE.saveHistos(outputName1); - + FastCalibratorEE analyzer_odd_EE(data, g_EoC, g_EoE, typeEE); analyzer_odd_EE.bookHistos(nLoops); analyzer_odd_EE.AcquireDeadXtal(DeadXtal, isDeadTriggerTower); analyzer_odd_EE.Loop(numberOfEvents, useZ, useW, -splitStat, nLoops, applyPcorr, applyEcorr, useRawEnergy, isMiscalib, isSaveEPDistribution, isEPselection, isR9selection, R9Min, EPMin, smoothCut, isfbrem, fbremMax, isPtCut, PtMin, isMCTruth, miscalibMethod, miscalibMap); diff --git a/ZFitter/script/submit_calibration_jobs_multifit.py b/ZFitter/script/submit_calibration_jobs_multifit.py index 21f8c3eadbb..0259bc34a08 100644 --- a/ZFitter/script/submit_calibration_jobs_multifit.py +++ b/ZFitter/script/submit_calibration_jobs_multifit.py @@ -1,4 +1,4 @@ -1#! /usr/bin/env python +#! /usr/bin/env python import os import glob import math @@ -21,12 +21,12 @@ applyPcorr = ["True"]; #decide if you want to apply momentum correction or not applyEcorr = ["False"]; #decide if you want to apply energy correction or not split = ["0","1"]; #0=full statistics, 1=even/odd -cut = ["0.15","0.20","0.30","100"];#size of the E/p cut window (default is 0.15) +cut = ["0.15","0.20","100."];#size of the E/p cut window (default is 0.15) #cut = ["0.15"] smoothCut = ["1"]; #0=use step-function to reweight, 1=use the E/p distribution energyType = ["0"]; #0=regression, 1=raw energy -nLoops = "20"; #number of iterations -ntupleName = "Run2016BCDEFG_WZSkim_Cal_Sep2016_final_v3_multifit" +nLoops = "15"; #number of iterations +ntupleName = "Run2016BCDEFGH_WZSkim_Cal_Jan2017_ref_multifit" #ntupleName = "DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1-allRange" #options: "data-Run2015D-25ns-multifit", "data-Run2015D-25ns-multifit" or "data-Run2015D-25ns-stream". #For the MC use: "DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1-allRange" #ntuplelist = ["data-SingleElectron-Run2016BCD_WSkim_12p9fb_multifit","data-DoubleEG-Run2016BCD_ZSkim_12p9fb_multifit"] @@ -36,48 +36,52 @@ #folder = "/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1/allRange/246908-258750-Prompt_25ns-v1-esPlanes/" #folder containing the MC ntuples ntuplelist = [ -"DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376", -"DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283", -"DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811", -"DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420", -"DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808", -"DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-279588", -"DoubleEG-Run2016G-ZSkim-Prompt-v1-279589-279931", -"SingleElectron-Run2016B-WSkim-Prompt_v2-273150-275376", -"SingleElectron-Run2016C-WSkim-Prompt_v2-275420-276283", -"SingleElectron-Run2016D-WSkim-Prompt_v2-276315-276811", -"SingleElectron-Run2016E-WSkim-Prompt-v2-276830-277420", -"SingleElectron-Run2016F-WSkim-Prompt-v1-277820-278808", -"SingleElectron-Run2016G-WSkim-Prompt-v1-278817-279588", -"SingleElectron-Run2016G-WSkim-Prompt-v1-279589-279931" +"DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root", +"DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root", +"DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root", +"DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root", +"DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root", +"DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-280385.root", +"DoubleEG-Run2016H-ZSkim-Prompt-v2-281207-284035.root", +"DoubleEG-Run2016H-ZSkim-Prompt-v3-284036-284068.root", +"SingleElectron-Run2016B-WSkim-Prompt_v2-273150-275376.root", +"SingleElectron-Run2016C-WSkim-Prompt_v2-275420-276283.root", +"SingleElectron-Run2016D-WSkim-Prompt_v2-276315-276811.root", +"SingleElectron-Run2016E-WSkim-Prompt-v2-276830-277420.root", +"SingleElectron-Run2016F-WSkim-Prompt-v1-277820-278808.root", +"SingleElectron-Run2016G-WSkim-Prompt-v1-278817-280385.root", +"SingleElectron-Run2016H-WSkim-Prompt-v2-281207-284035.root", +"SingleElectron-Run2016H-WSkim-Prompt-v3-284036-284068.root" ] #folderlist=["/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntupleEoP/"] folderlist=[ -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016B-WSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016C-WSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016D-WSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016E-WSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016F-WSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras/" +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-280385/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v2/281207-284035/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v3/284036-284068/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016B-WSkim-Prompt_v2/273150-275376/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016C-WSkim-Prompt_v2/275420-276283/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016D-WSkim-Prompt_v2/276315-276811/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016E-WSkim-Prompt-v2/276830-277420/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016F-WSkim-Prompt-v1/277820-278808/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016G-WSkim-Prompt-v1/278817-280385/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v2/281207-284035/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v3/284036-284068/271036_284044-23Sep2016/newNtuples/" ] TOP=currentDir #cmscaf1nd -#os.system("mkdir Job_"+ntupleName+""+nLoops+"loop_2016_newPcorr") -os.system("mkdir Job_"+ntupleName+""+nLoops+"2016_newPcorr") -os.system("mkdir cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr") -os.system("mkdir ICset_"+ntupleName+"_"+nLoops+"2016_newPcorr") +#os.system("mkdir Job_"+ntupleName+""+nLoops+"loop__pCorr2016") +os.system("mkdir Job_"+ntupleName+""+nLoops+"_separateElePosCorr") +os.system("mkdir cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr") +os.system("mkdir ICset_"+ntupleName+"_"+nLoops+"_separateElePosCorr") ##RUN CALIBRATION ON BARREL for b in range(len(split)): @@ -86,9 +90,9 @@ for e in range(len(applyPcorr)): for f in range(len(applyEcorr)): for g in range(len(energyType)): - fn = "Job_"+ntupleName+""+nLoops+"2016_newPcorr/Job_"+"EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + fn = "Job_"+ntupleName+""+nLoops+"_separateElePosCorr/Job_"+"EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; outScript = open(fn+".sh","w"); - command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outputPath output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputEnergyScale momentumCalibration2015_EB_scE.root" + command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outDirFitResData output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScaleElectrons ELECTRONS_MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputMomentumScalePositrons POSITRONS_MomentumCalibration2016_eta1_eta1.root" print command; outScript.write('#!/bin/bash'); outScript.write("\n"+'cd '+CMSSWDir); @@ -99,23 +103,24 @@ for j in range(len(ntuplelist)): outScript.write("\necho \"copy main tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+" ./") outScript.write("\necho \"copy extracalib tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+" ./") outScript.write("\necho \"copiy additional files\" "); # outScript.write("\ncp -v /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/* .") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EB_pTk.root ./") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EB_scE.root ./") outScript.write("\ncmsStage "+folder_dat+"EoverPcalibration_batch_"+ntupleName+".dat ./") - outScript.write("\ncmsStage "+folder_dat+"MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"ELECTRONS_MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"POSITRONS_MomentumCalibration2016_eta1_eta1.root ./") outScript.write("\necho \"end copy\" "); outScript.write("\nls") outScript.write("\necho \"eseguo: "+command+"\" ") outScript.write("\n"+command); outScript.write("\nls") - outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) + outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) outScript.close(); os.system("chmod 777 "+currentDir+"/"+fn+".sh"); command2 = "bsub -q cmscaf1nw -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; @@ -131,9 +136,9 @@ for e in range(len(applyPcorr)): for f in range(len(applyEcorr)): for g in range(len(energyType)): - fn = "Job_"+ntupleName+""+nLoops+"2016_newPcorr/Job_"+"EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + fn = "Job_"+ntupleName+""+nLoops+"_separateElePosCorr/Job_"+"EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; outScript = open(fn+".sh","w"); - command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outputPath output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EE"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputEnergyScale momentumCalibration2015_EE_scE.root" + command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outDirFitResData output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScaleElectrons ELECTRONS_MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputMomentumScalePositrons POSITRONS_MomentumCalibration2016_eta1_eta1.root" print command; outScript.write('#!/bin/bash'); outScript.write("\n"+'cd '+CMSSWDir); @@ -144,22 +149,23 @@ for j in range(len(ntuplelist)): outScript.write("\necho \"copy main tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+" ./") outScript.write("\necho \"copy extracalib tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+" ./") outScript.write("\necho \"copy additional files\" "); # outScript.write("\ncp -v /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/* .") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EE_pTk.root ./") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EE_scE.root ./") outScript.write("\ncmsStage "+folder_dat+"EoverPcalibration_batch_"+ntupleName+".dat ./") - outScript.write("\ncmsStage "+folder_dat+"MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"ELECTRONS_MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"POSITRONS_MomentumCalibration2016_eta1_eta1.root ./") outScript.write("\necho \"end copy\" "); outScript.write("\nls") outScript.write("\necho \"eseguo: "+command+"\" ") outScript.write("\n"+command); outScript.write("\nls") - outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) + outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) outScript.close(); os.system("chmod 777 "+currentDir+"/"+fn+".sh"); command2 = "bsub -q cmscaf1nw -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; @@ -170,7 +176,7 @@ ##CREATE CFG FILES TO PRODUCE CALIBRATION PLOTS LATER -createAndPlotIC = "createAndPlotIC_"+ntupleName+"_"+nLoops+"2016_newPcorr.sh" +createAndPlotIC = "createAndPlotIC_"+ntupleName+"_"+nLoops+"_separateElePosCorr.sh" out2 = open(createAndPlotIC,"w") #for b in range(len(split)): @@ -180,15 +186,15 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "EB"+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - fn = "cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr/calibrationPlots_"+name+".py"; - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + fn = "cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr/calibrationPlots_"+name+".py"; + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" outScript = open(fn,"w"); outScript.write("import FWCore.ParameterSet.Config as cms"); outScript.write("\nprocess = cms.Process(\"calibrationPlotsEBparameters\")") outScript.write("\nprocess.Options = cms.PSet(") - outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB.root\"),") - outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_even.root\"),") - outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_odd.root\"),") + outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB.root\"),") + outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB_even.root\"),") + outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB_odd.root\"),") outScript.write("\n\tnEtaBinsEB = cms.int32(1),") outScript.write("\n\tnEtaBinsEE = cms.int32(1),") outScript.write("\n\tis2012Calib = cms.bool(False),") @@ -211,15 +217,15 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "EE"+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - fn = "cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr/calibrationPlots_"+name+".py"; - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + fn = "cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr/calibrationPlots_"+name+".py"; + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" outScript = open(fn,"w"); outScript.write("import FWCore.ParameterSet.Config as cms"); outScript.write("\nprocess = cms.Process(\"calibrationPlotsEEparameters\")") outScript.write("\nprocess.Options = cms.PSet(") - outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE.root\"),") - outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_even.root\"),") - outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_odd.root\"),") + outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE.root\"),") + outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE_even.root\"),") + outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE_odd.root\"),") outScript.write("\n\tnEtaBinsEB = cms.int32(1),") outScript.write("\n\tnEtaBinsEE = cms.int32(1),") outScript.write("\n\tis2012Calib = cms.bool(False),") @@ -234,7 +240,7 @@ ##CREATE FOLDER CONTAINING THE FINAL SET OF IC (EB+EE) -newFolder = "ICset_"+ntupleName+"_"+nLoops+"2016_newPcorr" +newFolder = "ICset_"+ntupleName+"_"+nLoops+"_separateElePosCorr" for c in range(len(cut)): for d in range(len(smoothCut)): @@ -242,6 +248,6 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "IC_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" out2.write("\ncat "+folder+"IC_EB*txt "+folder+"IC_EE*txt > "+newFolder+"/"+name+".txt") diff --git a/ZFitter/script/submit_calibration_jobs_weights.py b/ZFitter/script/submit_calibration_jobs_weights.py index 6b017ab793f..5e2dcd0950a 100644 --- a/ZFitter/script/submit_calibration_jobs_weights.py +++ b/ZFitter/script/submit_calibration_jobs_weights.py @@ -1,4 +1,4 @@ -1#! /usr/bin/env python +#! /usr/bin/env python import os import glob import math @@ -21,12 +21,12 @@ applyPcorr = ["True"]; #decide if you want to apply momentum correction or not applyEcorr = ["False"]; #decide if you want to apply energy correction or not split = ["0","1"]; #0=full statistics, 1=even/odd -cut = ["0.15","0.20","0.30","100"];#size of the E/p cut window (default is 0.15) -#cut = ["0.10"] +cut = ["0.15","0.20","100."];#size of the E/p cut window (default is 0.15) +#cut = ["0.15"] smoothCut = ["1"]; #0=use step-function to reweight, 1=use the E/p distribution energyType = ["0"]; #0=regression, 1=raw energy nLoops = "15"; #number of iterations -ntupleName = "Run2016BCDEFG_WZSkim_Cal_Sep2016_final_v3_weights" +ntupleName = "Run2016BCDEFGH_WZSkim_Cal_Jan2017_ref_weights" #ntupleName = "DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1-allRange" #options: "data-Run2015D-25ns-multifit", "data-Run2015D-25ns-multifit" or "data-Run2015D-25ns-stream". #For the MC use: "DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1-allRange" #ntuplelist = ["data-SingleElectron-Run2016BCD_WSkim_12p9fb_multifit","data-DoubleEG-Run2016BCD_ZSkim_12p9fb_multifit"] @@ -36,48 +36,52 @@ #folder = "/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARECOSIM/DYToEE_powheg_13TeV-RunIISpring15DR74-Asym25n-v1/allRange/246908-258750-Prompt_25ns-v1-esPlanes/" #folder containing the MC ntuples ntuplelist = [ -"DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco-273150-275376", -"DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco-275420-276283", -"DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco-276315-276811", -"DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco-276830-277420", -"DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco-277820-278808", -"DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-278817-279588", -"DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-279589-279931", -"SingleElectron-Run2016B-WSkim-Prompt_v2-weightsReco-273150-275376", -"SingleElectron-Run2016C-WSkim-Prompt_v2-weightsReco-275420-276283", -"SingleElectron-Run2016D-WSkim-Prompt_v2-weightsReco-276315-276811", -"SingleElectron-Run2016E-WSkim-Prompt-v2-weightsReco-276830-277420", -"SingleElectron-Run2016F-WSkim-Prompt-v1-weightsReco-277820-278808", -"SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco-278817-279588", -"SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco-279589-279931" +"DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco-273150-275376.root", +"DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco-275420-276283.root", +"DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco-276315-276811.root", +"DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco-276830-277420.root", +"DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco-277820-278808.root", +"DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco-278817-280385.root", +#"DoubleEG-Run2016H-ZSkim-Prompt-v2-weightsReco-281207-284035.root", +"DoubleEG-Run2016H-ZSkim-Prompt-v3-weightsReco-284036-284068.root", +"SingleElectron-Run2016B-WSkim-Prompt_v2-weightsReco-273150-275376.root", +"SingleElectron-Run2016C-WSkim-Prompt_v2-weightsReco-275420-276283.root", +"SingleElectron-Run2016D-WSkim-Prompt_v2-weightsReco-276315-276811.root", +"SingleElectron-Run2016E-WSkim-Prompt-v2-weightsReco-276830-277420.root", +"SingleElectron-Run2016F-WSkim-Prompt-v1-weightsReco-277820-278808.root", +"SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco-278817-280385.root", +#"SingleElectron-Run2016H-WSkim-Prompt-v2-weightsReco-281207-284035.root", +"SingleElectron-Run2016H-WSkim-Prompt-v3-weightsReco-284036-284068.root" ] #folderlist=["/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntupleEoP/"] folderlist=[ -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco/273150-275376/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco/275420-276283/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco/276315-276811/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco/276830-277420/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco/277820-278808/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/278817-279588/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/279589-279931/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016B-WSkim-Prompt_v2-weightsReco/273150-275376/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016C-WSkim-Prompt_v2-weightsReco/275420-276283/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016D-WSkim-Prompt_v2-weightsReco/276315-276811/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016E-WSkim-Prompt-v2-weightsReco/276830-277420/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016F-WSkim-Prompt-v1-weightsReco/277820-278808/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco/278817-279588/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco/279589-279931/271036_279931-Cal_Sep2016/withExtras/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016B-ZSkim-Prompt_v2-weightsReco/273150-275376/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016C-ZSkim-Prompt_v2-weightsReco/275420-276283/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016D-ZSkim-Prompt_v2-weightsReco/276315-276811/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016E-ZSkim-Prompt-v2-weightsReco/276830-277420/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016F-ZSkim-Prompt-v1-weightsReco/277820-278808/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016G-ZSkim-Prompt-v1-weightsReco/278817-280385/271036_284044-23Sep2016/newNtuples/", +#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v2-weightsReco/281207-284035/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/DoubleEG-Run2016H-ZSkim-Prompt-v3-weightsReco/284036-284068/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016B-WSkim-Prompt_v2-weightsReco/273150-275376/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016C-WSkim-Prompt_v2-weightsReco/275420-276283/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016D-WSkim-Prompt_v2-weightsReco/276315-276811/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016E-WSkim-Prompt-v2-weightsReco/276830-277420/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016F-WSkim-Prompt-v1-weightsReco/277820-278808/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016G-WSkim-Prompt-v1-weightsReco/278817-280385/271036_284044-23Sep2016/newNtuples/", +#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v2-weightsReco/281207-284035/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v3-weightsReco/284036-284068/271036_284044-23Sep2016/newNtuples/" ] TOP=currentDir #cmscaf1nd -#os.system("mkdir Job_"+ntupleName+""+nLoops+"loop_2016_newPcorr") -os.system("mkdir Job_"+ntupleName+""+nLoops+"2016_newPcorr") -os.system("mkdir cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr") -os.system("mkdir ICset_"+ntupleName+"_"+nLoops+"2016_newPcorr") +#os.system("mkdir Job_"+ntupleName+""+nLoops+"loop__pCorr2016") +os.system("mkdir Job_"+ntupleName+""+nLoops+"_separateElePosCorr") +os.system("mkdir cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr") +os.system("mkdir ICset_"+ntupleName+"_"+nLoops+"_separateElePosCorr") ##RUN CALIBRATION ON BARREL for b in range(len(split)): @@ -86,9 +90,9 @@ for e in range(len(applyPcorr)): for f in range(len(applyEcorr)): for g in range(len(energyType)): - fn = "Job_"+ntupleName+""+nLoops+"2016_newPcorr/Job_"+"EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + fn = "Job_"+ntupleName+""+nLoops+"_separateElePosCorr/Job_"+"EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; outScript = open(fn+".sh","w"); - command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outputPath output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputEnergyScale momentumCalibration2015_EB_scE.root" + command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outDirFitResData output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScaleElectrons ELECTRONS_MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputMomentumScalePositrons POSITRONS_MomentumCalibration2016_eta1_eta1.root" print command; outScript.write('#!/bin/bash'); outScript.write("\n"+'cd '+CMSSWDir); @@ -99,23 +103,24 @@ for j in range(len(ntuplelist)): outScript.write("\necho \"copy main tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+" ./") outScript.write("\necho \"copy extracalib tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+" ./") outScript.write("\necho \"copiy additional files\" "); # outScript.write("\ncp -v /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/* .") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EB_pTk.root ./") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EB_scE.root ./") outScript.write("\ncmsStage "+folder_dat+"EoverPcalibration_batch_"+ntupleName+".dat ./") - outScript.write("\ncmsStage "+folder_dat+"MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"ELECTRONS_MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"POSITRONS_MomentumCalibration2016_eta1_eta1.root ./") outScript.write("\necho \"end copy\" "); outScript.write("\nls") outScript.write("\necho \"eseguo: "+command+"\" ") outScript.write("\n"+command); outScript.write("\nls") - outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) + outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) outScript.close(); os.system("chmod 777 "+currentDir+"/"+fn+".sh"); command2 = "bsub -q cmscaf1nw -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; @@ -131,9 +136,9 @@ for e in range(len(applyPcorr)): for f in range(len(applyEcorr)): for g in range(len(energyType)): - fn = "Job_"+ntupleName+""+nLoops+"2016_newPcorr/Job_"+"EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; + fn = "Job_"+ntupleName+""+nLoops+"_separateElePosCorr/Job_"+"EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]; outScript = open(fn+".sh","w"); - command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outputPath output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EE"+" --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputEnergyScale momentumCalibration2015_EE_scE.root" + command = "ZFitter.exe -f EoverPcalibration_batch_"+ntupleName+".dat --EOverPCalib --outDirFitResData output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --splitStat "+split[b]+" --nLoops "+nLoops+" --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScaleElectrons ELECTRONS_MomentumCalibration2016_eta1_eta1.root --applyEcorr "+applyEcorr[f]+" useRawEnergy "+energyType[g]+" --inputMomentumScalePositrons POSITRONS_MomentumCalibration2016_eta1_eta1.root" print command; outScript.write('#!/bin/bash'); outScript.write("\n"+'cd '+CMSSWDir); @@ -144,22 +149,23 @@ for j in range(len(ntuplelist)): outScript.write("\necho \"copy main tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+""+ntuplelist[j]+" ./") outScript.write("\necho \"copy extracalib tree\" "); - outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+".root ./") + outScript.write("\ncmsStage "+folderlist[j]+"extraCalibTree-"+ntuplelist[j]+" ./") outScript.write("\necho \"copy additional files\" "); # outScript.write("\ncp -v /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/* .") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EE_pTk.root ./") outScript.write("\ncmsStage "+folder_dat+"momentumCalibration2015_EE_scE.root ./") outScript.write("\ncmsStage "+folder_dat+"EoverPcalibration_batch_"+ntupleName+".dat ./") - outScript.write("\ncmsStage "+folder_dat+"MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"ELECTRONS_MomentumCalibration2016_eta1_eta1.root ./") + outScript.write("\ncmsStage "+folder_dat+"POSITRONS_MomentumCalibration2016_eta1_eta1.root ./") outScript.write("\necho \"end copy\" "); outScript.write("\nls") outScript.write("\necho \"eseguo: "+command+"\" ") outScript.write("\n"+command); outScript.write("\nls") - outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) + outScript.write("\ncp -v -r output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ "+currentDir) outScript.close(); os.system("chmod 777 "+currentDir+"/"+fn+".sh"); command2 = "bsub -q cmscaf1nw -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; @@ -170,7 +176,7 @@ ##CREATE CFG FILES TO PRODUCE CALIBRATION PLOTS LATER -createAndPlotIC = "createAndPlotIC_"+ntupleName+"_"+nLoops+"2016_newPcorr.sh" +createAndPlotIC = "createAndPlotIC_"+ntupleName+"_"+nLoops+"_separateElePosCorr.sh" out2 = open(createAndPlotIC,"w") #for b in range(len(split)): @@ -180,15 +186,15 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "EB"+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - fn = "cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr/calibrationPlots_"+name+".py"; - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + fn = "cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr/calibrationPlots_"+name+".py"; + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" outScript = open(fn,"w"); outScript.write("import FWCore.ParameterSet.Config as cms"); outScript.write("\nprocess = cms.Process(\"calibrationPlotsEBparameters\")") outScript.write("\nprocess.Options = cms.PSet(") - outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB.root\"),") - outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_even.root\"),") - outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_odd.root\"),") + outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB.root\"),") + outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB_even.root\"),") + outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EB_odd.root\"),") outScript.write("\n\tnEtaBinsEB = cms.int32(1),") outScript.write("\n\tnEtaBinsEE = cms.int32(1),") outScript.write("\n\tis2012Calib = cms.bool(False),") @@ -211,15 +217,15 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "EE"+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - fn = "cfg_"+ntupleName+"_"+nLoops+"2016_newPcorr/calibrationPlots_"+name+".py"; - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + fn = "cfg_"+ntupleName+"_"+nLoops+"_separateElePosCorr/calibrationPlots_"+name+".py"; + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" outScript = open(fn,"w"); outScript.write("import FWCore.ParameterSet.Config as cms"); outScript.write("\nprocess = cms.Process(\"calibrationPlotsEEparameters\")") outScript.write("\nprocess.Options = cms.PSet(") - outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE.root\"),") - outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_even.root\"),") - outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_odd.root\"),") + outScript.write("\n\tinFileName = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE.root\"),") + outScript.write("\n\tinFileNameEven = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE_even.root\"),") + outScript.write("\n\tinFileNameOdd = cms.string(\""+TOP+"/"+folder+"FastCalibrator_Oct2015_runD_EE_odd.root\"),") outScript.write("\n\tnEtaBinsEB = cms.int32(1),") outScript.write("\n\tnEtaBinsEE = cms.int32(1),") outScript.write("\n\tis2012Calib = cms.bool(False),") @@ -234,7 +240,7 @@ ##CREATE FOLDER CONTAINING THE FINAL SET OF IC (EB+EE) -newFolder = "ICset_"+ntupleName+"_"+nLoops+"2016_newPcorr" +newFolder = "ICset_"+ntupleName+"_"+nLoops+"_separateElePosCorr" for c in range(len(cut)): for d in range(len(smoothCut)): @@ -242,6 +248,6 @@ for f in range(len(applyEcorr)): for g in range(len(energyType)): name = "IC_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] - folder = "output_"+ntupleName+"_"+nLoops+"2016_newPcorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" + folder = "output_"+ntupleName+"_"+nLoops+"_separateElePosCorr_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/" out2.write("\ncat "+folder+"IC_EB*txt "+folder+"IC_EE*txt > "+newFolder+"/"+name+".txt") diff --git a/ZFitter/script/submit_monitoring_jobs_multifit.py b/ZFitter/script/submit_monitoring_jobs_multifit.py index f0296235b7f..d0c93c2b1f8 100644 --- a/ZFitter/script/submit_monitoring_jobs_multifit.py +++ b/ZFitter/script/submit_monitoring_jobs_multifit.py @@ -16,7 +16,8 @@ (options, args) = parser.parse_args() #ntupleName = "data-DoubleEG-Run2016BCD_ZSkim_12p9fb_multifit" -ntupleName = "Run2016BCDEFG_WZSkim_Cal_Sep2016_final_v3_multifit" +ntupleName = "Run2016BCDEFGH_WZSkim_Cal_Jan2017_ref_multifit" +#ntupleName = "Run2016BCDEFGH_WZSkim_Cal_Jan2017_ped_v1_multifit" #ntupleName = "data-SingleElectron-Run2016BCD_WSkim_12p9fb_weights" #options: "data-Run2015D-25ns-multifit", "data-Run2015D-25ns-multifit" or "data-Run2015D-25ns-stream". folder = "/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntupleEoP/" @@ -26,53 +27,30 @@ #yMIN = ["0.95","0.95","0.95","0.95","0.95","0.95","0.95","0.95","0.95","0.95","0.95","0.95"] #categories = ["EEp","EEp_1479_2","EEp_2_25","EEm","EEm_1479_2","EEm_2_25"] #yMIN = ["0.65","0.65","0.40","0.65","0.65","0.40"] -#ntuplelist = ["data-SingleElectron-Run2016BCD_WSkim_12p9fb_weights"] -#ntuplelist = ["data-DoubleEG-Run2016BCD_ZSkim_12p9fb_multifit"] -#ntuplelist = ["data-SingleElectron-Run2016BCD_WSkim_12p9fb_multifit","data-DoubleEG-Run2016BCD_ZSkim_12p9fb_multifit"] -#ntuplelist = ["SingleElectron-Run2016B-WSkim-Prompt_v2-273150-275376","SingleElectron-Run2016C-WSkim-Prompt_v2-275420-276283","SingleElectron-Run2016D-WSkim-Prompt_v2-276315-276811","SingleElectron-Run2016E-WSkim-Prompt_v1-276830-277420","SingleElectron-Run2016F-WSkim-Prompt_v1-277820-278808","SingleElectron-Run2016G-WSkim-Prompt_v1-278817-279488"] -#ntuplelist=["DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376.root","DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283.root","DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811.root", -#"DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420.root","DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808.root","DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-279588.root","DoubleEG-Run2016G-ZSkim-Prompt-v1-279589-279931.root"] ntuplelist = [ -#"DoubleEG-Run2016B-ZSkim-Prompt_v2-273150-275376", -#"DoubleEG-Run2016C-ZSkim-Prompt_v2-275420-276283", -#"DoubleEG-Run2016D-ZSkim-Prompt_v2-276315-276811", -#"DoubleEG-Run2016E-ZSkim-Prompt-v2-276830-277420", -#"DoubleEG-Run2016F-ZSkim-Prompt-v1-277820-278808", -#"DoubleEG-Run2016G-ZSkim-Prompt-v1-278817-279588", -#"DoubleEG-Run2016G-ZSkim-Prompt-v1-279589-279931", "SingleElectron-Run2016B-WSkim-Prompt_v2-273150-275376", "SingleElectron-Run2016C-WSkim-Prompt_v2-275420-276283", "SingleElectron-Run2016D-WSkim-Prompt_v2-276315-276811", "SingleElectron-Run2016E-WSkim-Prompt-v2-276830-277420", "SingleElectron-Run2016F-WSkim-Prompt-v1-277820-278808", -"SingleElectron-Run2016G-WSkim-Prompt-v1-278817-279588", -"SingleElectron-Run2016G-WSkim-Prompt-v1-279589-279931" +"SingleElectron-Run2016G-WSkim-Prompt-v1-278817-280385", +"SingleElectron-Run2016H-WSkim-Prompt-v2-281207-284035", +"SingleElectron-Run2016H-WSkim-Prompt-v3-284036-284068" ] folderlist=[ -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras2/", -#"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras2/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016B-WSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016C-WSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016D-WSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016E-WSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016F-WSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras/", -"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/SingleElectron-Run2016G-WSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras/" +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016B-WSkim-Prompt_v2/273150-275376/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016C-WSkim-Prompt_v2/275420-276283/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016D-WSkim-Prompt_v2/276315-276811/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016E-WSkim-Prompt-v2/276830-277420/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016F-WSkim-Prompt-v1/277820-278808/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016G-WSkim-Prompt-v1/278817-280385/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v2/281207-284035/271036_284044-23Sep2016/newNtuples/", +"/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Jan2017_ref/SingleElectron-Run2016H-WSkim-Prompt-v3/284036-284068/271036_284044-23Sep2016/newNtuples/" ] -#folderlist=["/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntupleEoP/"] -#folderlist=["/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016B-WSkim-Prompt_v2/273150-275376/271036_276811-ICHEP/withExtrasTest/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016C-WSkim-Prompt_v2/275420-276283/271036_276811-ICHEP/withExtrasTest/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016D-WSkim-Prompt_v2/276315-276811/271036_276811-ICHEP/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016E-WSkim-Prompt_v1/276830-277420/276830-277420/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016F-WSkim-Prompt_v1/277820-278808/271036-278808/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/80X_dataRun2_Prompt_v10/SingleElectron-Run2016G-WSkim-Prompt_v1/278817-279488/271036-279116/"] - -#folderlist=["/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016B-ZSkim-Prompt_v2/273150-275376/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016C-ZSkim-Prompt_v2/275420-276283/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016D-ZSkim-Prompt_v2/276315-276811/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016E-ZSkim-Prompt-v2/276830-277420/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016F-ZSkim-Prompt-v1/277820-278808/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/278817-279588/271036_279931-Cal_Sep2016/withExtras2/","/store/group/dpg_ecal/alca_ecalcalib/ecalelf/ntuples/13TeV/ALCARERECO/Cal_Sep2016_final_v3/DoubleEG-Run2016G-ZSkim-Prompt-v1/279589-279931/271036_279931-Cal_Sep2016/withExtras2/"] - currentDir = os.getcwd(); CMSSWDir = currentDir+"/../"; @@ -83,16 +61,16 @@ fn = "Job_monitoring_"+ntupleName+"/Job_"+categories[i]; outScript = open(fn+".sh","w"); - command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint 200000 --laserMonitoringEP --EBEE "+categories[i]+" --yMIN 0.95 --yMAX 1.05 --LUMI 24.1 --dayMin 15-03-2016 --dayMax 15-09-2016 --EoPvsPU 1" #use this if you want to run vs Nvtx -# command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint 200000 --laserMonitoringEP --EBEE "+categories[i]+" --yMIN 0.8 --yMAX 1.20 --LUMI 24.1 --dayMin 15-03-2016 --dayMax 15-09-2016" #use this if you want to run E/p vs LC -# command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint "+events[i]+" --laserMonitoringEP --EBEE "+categories[i]+" --yMIN "+yMIN[i]+" --yMAX 1.15 --LUMI 24.1 --dayMin 15-03-2016 --dayMax 15-09-2016" #default, to be run for E/p vs time +# command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint 200000 --laserMonitoringEP --EBEE "+categories[i]+" --yMIN 0.95 --yMAX 1.05 --LUMI 24.1 --dayMin 15-03-2016 --dayMax 30-12-2016 --EoPvsPU 1 --noPU" #use this if you want to run vs Nvtx +# command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint 200000 --laserMonitoringEP --EBEE "+categories[i]+" --yMIN 0.8 --yMAX 1.20 --LUMI 24.1 --dayMin 15-03-2016 --dayMax 30-12-2016 --noPU" #use this if you want to run E/p vs LC + command = "ZFitter.exe -f EoverPmonitoring_batch_"+ntupleName+".dat --evtsPerPoint "+events[i]+" --laserMonitoringEP --EBEE "+categories[i]+" --yMIN "+yMIN[i]+" --yMAX 1.15 --LUMI 36.4 --dayMin 15-03-2016 --dayMax 30-12-2016 --noPU" #default, to be run for E/p vs time print command; outScript.write('#!/bin/bash'); outScript.write("\n"+'cd '+CMSSWDir); outScript.write("\n"+'eval `scram runtime -sh`'); outScript.write("\n"+'cd -'); outScript.write("\necho $PWD"); - outScript.write("mkdir "+categories[i]+"__"); + outScript.write("\nmkdir "+categories[i]+"__"); outScript.write("\nll"); for j in range(len(ntuplelist)): diff --git a/ZFitter/script/submit_monitoring_jobs_weights.py b/ZFitter/script/submit_monitoring_jobs_weights.py index bf184f524c4..4482a4adbaa 100644 --- a/ZFitter/script/submit_monitoring_jobs_weights.py +++ b/ZFitter/script/submit_monitoring_jobs_weights.py @@ -91,7 +91,7 @@ outScript.write("\n"+'eval `scram runtime -sh`'); outScript.write("\n"+'cd -'); outScript.write("\necho $PWD"); - outScript.write("mkdir "+categories[i]+"__"); + outScript.write("\nmkdir "+categories[i]+"__"); outScript.write("\nll"); for j in range(len(ntuplelist)):