diff --git a/.gitignore b/.gitignore index d175ee75b4a..30937e3b9bb 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,6 @@ prod_alcarereco *.png *.eps *.pdf + +LSF* +ZFitter/output* \ No newline at end of file diff --git a/EOverPCalibration/interface/ConvoluteTemplate.h b/EOverPCalibration/interface/ConvoluteTemplate.h new file mode 100644 index 00000000000..745b2d8945a --- /dev/null +++ b/EOverPCalibration/interface/ConvoluteTemplate.h @@ -0,0 +1,14 @@ +#ifndef ConvoluteTemplate_h +#define ConvoluteTemplate_h + +#include "histoFunc.h" + +#include "TH1.h" +#include "TF1.h" +#include "TVirtualFFT.h" + + +TH1F* ConvoluteTemplate(const std::string& name, TH1F* h_template, TH1F* h_smearing, + int nPoints, double min, double max); + +#endif diff --git a/EOverPCalibration/interface/histoFunc.h b/EOverPCalibration/interface/histoFunc.h new file mode 100644 index 00000000000..58347c6fc3b --- /dev/null +++ b/EOverPCalibration/interface/histoFunc.h @@ -0,0 +1,84 @@ +#ifndef histoFunc_h +#define histoFunc_h + +#include "TH1.h" + + + + + + +class histoFunc +{ +public: + + + //! ctor + histoFunc(TH1F* histo) + { + histo_p = histo; + }; + + + //! dtor + ~histoFunc() + {}; + + + //! operator() + double operator()(double* x, double* par) + { + double xx = par[1] * (x[0] - par[2]); + + double xMin = histo_p -> GetBinCenter(1); + double xMax = histo_p -> GetBinCenter(histo_p -> GetNbinsX()); + + + + if( (xx < xMin) || (xx >= xMax) ) + return 1.e-10; + + else { + int bin = histo_p -> FindBin(xx); + int bin1 = 0; + int bin2 = 0; + + if(xx >= histo_p -> GetBinCenter(bin)) { + bin1 = bin; + bin2 = bin + 1; + } + + else { + bin1 = bin - 1; + bin2 = bin; + } + + + double x1 = histo_p -> GetBinCenter(bin1); + double y1 = histo_p -> GetBinContent(bin1); + + double x2 = histo_p -> GetBinCenter(bin2); + double y2 = histo_p -> GetBinContent(bin2); + + double m = 1. * (y2 - y1) / (x2 - x1); + + + + if( (y1 + m * (xx - x1)) < 1.e-10) + return 1.e-10; + + + return par[0] * par[1] * (y1 + m * (xx - x1)); + } + + return 1.e-10; + } + + + +private: + + TH1F* histo_p; +}; + +#endif diff --git a/EOverPCalibration/interface/ntpleUtils2.h b/EOverPCalibration/interface/ntpleUtils2.h new file mode 100644 index 00000000000..5c5da549b8d --- /dev/null +++ b/EOverPCalibration/interface/ntpleUtils2.h @@ -0,0 +1,76 @@ +#ifndef ntupleUtils2_h +#define ntupleUtils2_h + +#include +#include +#include +#include + + +#include "TFile.h" +#include "TChain.h" +#include "TCanvas.h" +#include "TH1F.h" +#include "TF1.h" + +#ifdef _MAKECINT_ +#pragma link C++ class vector+; +#pragma link C++ class vector+; +#pragma link C++ class map+; +#pragma link C++ class map+; +#endif + + +extern TH1F* templateHisto; +extern TF1* templateFunc; + +extern std::vector* mydata; + +void FitTemplate(const bool& draw = false); + +/*** double crystall ball ***/ +double crystalBallLowHigh_v2(double* x, double* par); + +/*** time sort a tree ***/ +struct Sorter { + int time; + int entry; + + bool operator() (const Sorter& s1, const Sorter& s2) + { + return s1.time < s2.time; + } +}; + +/*** time sort a tree ***/ +struct myEvent { + int runId; + int timeStampHigh; + + int region; + + float scE; + float P; + + float scLaserCorr; + float seedLaserAlpha; + + bool operator() (const myEvent& s1, const myEvent& s2) + { + return s1.timeStampHigh < s2.timeStampHigh; + } +}; + +/*** time sort a tree ***/ +struct SorterLC { + float laserCorr; + int entry; + + bool operator() (const SorterLC& s1, const SorterLC& s2) + { + return s1.laserCorr < s2.laserCorr; + } +}; + + +#endif diff --git a/EOverPCalibration/interface/stabilityUtils.h b/EOverPCalibration/interface/stabilityUtils.h new file mode 100644 index 00000000000..e69c4d97885 --- /dev/null +++ b/EOverPCalibration/interface/stabilityUtils.h @@ -0,0 +1,20 @@ +#ifndef stabilityUtils_h +#define stabilityUtils_h + +#include "histoFunc.h" + +#include +#include + +#include "TH1F.h" +#include "TF1.h" + + + +int dateToInt(const std::string& date); + +void SetHistoStyle(TH1* h, const std::string& label = ""); + +TH1F* MellinConvolution(const std::string& name, TH1F* h_template, TH1F* h_Las); + +#endif diff --git a/EOverPCalibration/src/ConvoluteTemplate.cc b/EOverPCalibration/src/ConvoluteTemplate.cc new file mode 100644 index 00000000000..edc70fa39dd --- /dev/null +++ b/EOverPCalibration/src/ConvoluteTemplate.cc @@ -0,0 +1,153 @@ +#include "../interface/ConvoluteTemplate.h" + + + +TH1F* ConvoluteTemplate(const std::string& name, TH1F* h_template, TH1F* h_smearing, + int nPoints, double min, double max) +{ + double width = 1.*(max - min) / nPoints; + + double* FFT_re_func1 = new double[nPoints]; + double* FFT_im_func1 = new double[nPoints]; + double* FFT_re_func2 = new double[nPoints]; + double* FFT_im_func2 = new double[nPoints]; + double* FFT_re_convolution = new double[nPoints]; + double* FFT_im_convolution = new double[nPoints]; + + + + //----------------------------- + // define the initial functions + + char funcName[50]; + + + sprintf(funcName, "f_template_temp"); + histoFunc* hf_template = new histoFunc(h_template); + TF1* f_template = new TF1(funcName, hf_template, min, max, 3, "histoFunc"); + + f_template -> FixParameter(0, 1.); + f_template -> FixParameter(1, 1.); + f_template -> FixParameter(2, 0.); + + + sprintf(funcName, "f_smearing_temp"); + histoFunc* hf_smearing = new histoFunc(h_smearing); + TF1* f_smearing = new TF1(funcName, hf_smearing, min, max, 3, "histoFunc"); + f_smearing -> FixParameter(0, 1.); + f_smearing -> FixParameter(1, 1.); + f_smearing -> FixParameter(2, -1.*h_smearing->GetMean()); + + + // use a gaussian as smearing function + //TF1* f_smearing = new TF1("f_smearing","1./([0]*sqrt(2.*3.14159))*exp(-1.*x*x/(2.*[0]*[0]))",min,max); + //f_smearing -> FixParameter(0,0.05); + + + + //----------------------------------------- + // define the histograms to contain the FFT + TH1D* h_func1 = new TH1D("h_func1", "", nPoints, min, max); + TH1D* h_func1_FFT = new TH1D("h_func1_FFT", "", nPoints, min, max); + + TH1D* h_func2 = new TH1D("h_func2", "", nPoints, min, max); + TH1D* h_func2_FFT = new TH1D("h_func2_FFT", "", nPoints, min, max); + + for(int bin = 1; bin <= nPoints; ++bin) { + h_func1 -> SetBinContent(bin, f_template->Eval(min + width * (bin - 1))); + h_func2 -> SetBinContent(bin, f_smearing->Eval(min + width * (bin - 1))); + } + + //h_func1 -> Write(); + //h_func2 -> Write(); + + + + //----------- + // do the FFT + + h_func1 -> FFT(h_func1_FFT, "MAG R2C M"); + TVirtualFFT* FFT_func1 = TVirtualFFT::GetCurrentTransform(); + FFT_func1 -> GetPointsComplex(FFT_re_func1, FFT_im_func1); + FFT_func1 -> Delete(); + + h_func2 -> FFT(h_func2_FFT, "MAG R2C M"); + TVirtualFFT* FFT_func2 = TVirtualFFT::GetCurrentTransform(); + FFT_func2 -> GetPointsComplex(FFT_re_func2, FFT_im_func2); + FFT_func2 -> Delete(); + + + + //--------------------------------- + // convolution in the Fourier space + + for(int bin = 1; bin <= nPoints; ++bin) { + FFT_re_convolution[bin - 1] = FFT_re_func1[bin - 1] * FFT_re_func2[bin - 1] - FFT_im_func1[bin - 1] * FFT_im_func2[bin - 1]; + FFT_im_convolution[bin - 1] = FFT_re_func1[bin - 1] * FFT_im_func2[bin - 1] + FFT_im_func1[bin - 1] * FFT_re_func2[bin - 1]; + } + + + + //---------------- + // do the anti FFT + + TVirtualFFT* AFFT_convolution = TVirtualFFT::FFT(1, &nPoints, "C2R M K"); + AFFT_convolution -> SetPointsComplex(FFT_re_convolution, FFT_im_convolution); + AFFT_convolution -> Transform(); + + TH1* h_convolution_temp = NULL; + h_convolution_temp = TH1::TransformHisto(AFFT_convolution, h_convolution_temp, "Re"); + h_convolution_temp -> SetName("h_convolution_temp"); + h_convolution_temp -> Scale((max - min) / nPoints / nPoints); + AFFT_convolution -> Delete(); + + TH1D* h_convolution = new TH1D("h_convolution", "", nPoints, min, max); + for(int bin = 1; bin <= nPoints; ++bin) { + h_convolution -> Fill((max - min) / nPoints * (bin - 1), h_convolution_temp->GetBinContent(bin)); + } + + histoFunc* convolutionHistoFunc = new histoFunc((TH1F*)(h_convolution)); + TF1* f_convolution = new TF1("f_convolution", convolutionHistoFunc, min, max, 3, "histoFunc"); + f_convolution -> FixParameter(0, 1); + f_convolution -> FixParameter(1, 1); + f_convolution -> FixParameter(2, 0.); + + + + int nBins = h_template->GetNbinsX(); + float xMin = h_template->GetBinLowEdge(1); + float xMax = h_template->GetBinLowEdge(nBins) + h_template->GetBinWidth(nBins); + float xWidth = (xMax - xMin) / nBins; + TH1F* h_final = new TH1F(name.c_str(), "", nBins, xMin, xMax); + + for(int bin = 1; bin <= nBins; ++bin) { + float xMinBin = h_final->GetBinLowEdge(bin); + float xMaxBin = h_final->GetBinLowEdge(bin) + xWidth; + + h_final -> SetBinContent(bin, f_convolution->Integral(xMinBin, xMaxBin) / xWidth); + } + + h_final -> Scale(h_template->Integral() / h_final->Integral()); + //h_final -> Write(); + + + + f_template -> Delete(); + f_smearing -> Delete(); + + h_func1_FFT -> Delete(); + h_func1 -> Delete(); + + h_func2_FFT -> Delete(); + h_func2 -> Delete(); + + h_convolution_temp -> Delete(); + h_convolution -> Delete(); + + f_convolution -> Delete(); + delete convolutionHistoFunc; + + + + return h_final; +} diff --git a/EOverPCalibration/src/ntpleUtils2.cc b/EOverPCalibration/src/ntpleUtils2.cc new file mode 100644 index 00000000000..dcc76e2529c --- /dev/null +++ b/EOverPCalibration/src/ntpleUtils2.cc @@ -0,0 +1,77 @@ +#include "../interface/ntpleUtils2.h" + +TH1F* templateHisto; +TF1* templateFunc; + +std::vector* mydata; + +/*** fit the template ***/ +void FitTemplate(const bool& draw) +{ + TCanvas* c_template; + if( draw ) { + c_template = new TCanvas("c_template", "template"); + c_template -> cd(); + c_template -> SetGridx(); + c_template -> SetGridy(); + + templateHisto -> Scale(1. / templateHisto->GetEntries()); + templateHisto -> SetFillColor(kCyan + 2); + templateHisto -> Draw(); + } + + templateFunc = new TF1("templateFunc", crystalBallLowHigh_v2, 0., 10., 8); + templateFunc -> SetNpx(10000); + templateFunc -> SetLineWidth(2); + templateFunc -> SetLineColor(kRed); + + templateFunc -> SetParameters(templateHisto->GetMaximum(), 1., 0.05, 1., 2., 2., 1., 1.); + templateFunc -> FixParameter(7, 1.); + templateFunc -> SetParLimits(3, 0., 10.); + templateFunc -> SetParLimits(5, 0., 10.); + + templateFunc -> SetParName(0, "N"); + templateFunc -> SetParName(1, "#mu"); + templateFunc -> SetParName(2, "#sigma"); + templateFunc -> SetParName(3, "#alpha_{high}"); + templateFunc -> SetParName(4, "n_{high}"); + templateFunc -> SetParName(5, "#alpha_{low}"); + templateFunc -> SetParName(6, "n_{low}"); + + templateHisto -> Fit("templateFunc", "NQR+", "", 0.5, 3.); + + if( draw ) + templateFunc -> Draw("same"); +} + + +/*** double crystall ball ***/ +double crystalBallLowHigh_v2(double* x, double* par) +{ + //[0] = N + //[1] = mean + //[2] = sigma + //[3] = alpha + //[4] = n + //[5] = alpha2 + //[6] = n2 + //[7] = scale + double xx = x[0] * par[7]; + double mean = par[1]; + double sigma = par[2]; + double alpha = par[3]; + double n = par[4]; + double alpha2 = par[5]; + double n2 = par[6]; + if( (xx - mean) / sigma > fabs(alpha) ) { + double A = pow(n / fabs(alpha), n) * exp(-0.5 * alpha * alpha); + double B = n / fabs(alpha) - fabs(alpha); + return par[0] * par[7] * A * pow(B + (xx - mean) / sigma, -1.*n); + } else if( (xx - mean) / sigma < -1.*fabs(alpha2) ) { + double A = pow(n2 / fabs(alpha2), n2) * exp(-0.5 * alpha2 * alpha2); + double B = n2 / fabs(alpha2) - fabs(alpha2); + return par[0] * par[7] * A * pow(B - (xx - mean) / sigma, -1.*n2); + } else { + return par[0] * par[7] * exp(-1. * (xx - mean) * (xx - mean) / (2 * sigma * sigma) ); + } +} diff --git a/EOverPCalibration/src/stabilityUtils.cc b/EOverPCalibration/src/stabilityUtils.cc new file mode 100644 index 00000000000..c7188171fce --- /dev/null +++ b/EOverPCalibration/src/stabilityUtils.cc @@ -0,0 +1,93 @@ +#include "../interface/stabilityUtils.h" + + + +int dateToInt(const std::string& date) +{ + int day, month, year; + + std::stringstream ss(date); + ss >> day >> month >> year; + + tm time; + time.tm_sec = 0; + time.tm_min = 0; + time.tm_hour = 0; + time.tm_mday = day; + time.tm_mon = month - 1; + time.tm_year = year - 1900; + return timegm(&time); +} + + + + + + +void SetHistoStyle(TH1* h, const std::string& label) +{ + h -> SetLineWidth(2); + + h -> GetXaxis() -> SetTitleSize(0.04); + h -> GetXaxis() -> SetLabelSize(0.04); + + h -> GetYaxis() -> SetTitleSize(0.04); + h -> GetYaxis() -> SetLabelSize(0.04); + + h -> GetYaxis() -> SetTitleOffset(1.5); + + if( label == "EoP") { + h -> SetMarkerColor(kRed + 2); + h -> SetLineColor(kRed + 2); + h -> SetFillColor(kRed + 2); + h -> SetFillStyle(3004); + h -> SetMarkerStyle(7); + } + + if( label == "EoC") { + h -> SetMarkerColor(kGreen + 2); + h -> SetLineColor(kGreen + 2); + h -> SetFillColor(kGreen + 2); + h -> SetFillStyle(3004); + h -> SetMarkerStyle(7); + } +} + + + + + + +TH1F* MellinConvolution(const std::string& name, TH1F* h_template, TH1F* h_Las) +{ + histoFunc* templateHistoFunc = new histoFunc(h_template); + + TF1* f_template = new TF1("f_template", templateHistoFunc, 0.8 * (h_Las->GetMean()), 1.4 * (h_Las->GetMean()), 3, "histoFunc"); + + f_template -> SetNpx(10000); + f_template -> FixParameter(0, 1.); + f_template -> SetParameter(1, 1.); + f_template -> FixParameter(2, 0.); + + TH1F* h_convolutedTemplate = (TH1F*)( h_template->Clone(name.c_str()) ); + h_convolutedTemplate -> Reset(); + + for(int bin = 1; bin <= h_Las->GetNbinsX(); ++bin) { + float scale = h_Las->GetBinCenter(bin); + float weight = h_Las->GetBinContent(bin); + + if( weight > 0. ) { + f_template -> SetParameter(0, weight); + f_template -> SetParameter(1, 1. / scale); + + for(int bin2 = 1; bin2 <= h_convolutedTemplate->GetNbinsX(); ++bin2) { + float binCenter = h_convolutedTemplate -> GetBinCenter(bin2); + h_convolutedTemplate -> Fill(binCenter, f_template->Eval(binCenter)); + } + } + } + + h_convolutedTemplate -> Scale(h_template->Integral() / h_convolutedTemplate->Integral()); + + return h_convolutedTemplate; +} diff --git a/EcalAlCaRecoProducers/alcareco_datasets.dat b/EcalAlCaRecoProducers/alcareco_datasets.dat index 3e84f51c6cd..6399c430117 100644 --- a/EcalAlCaRecoProducers/alcareco_datasets.dat +++ b/EcalAlCaRecoProducers/alcareco_datasets.dat @@ -268,3 +268,5 @@ allRange /DYJetsToEE_M-50_LTbinned_100To200_5f_LO_13TeV-madgraph_pythia8/RunIIS allRange /DYJetsToEE_M-50_LTbinned_200To400_5f_LO_13TeV-madgraph_pythia8/RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2_v0-v1/MINIAODSIM DYJetsToEE_M-50_LTbinned_200To400 caf database VALID - - allRange /DYJetsToEE_M-50_LTbinned_400To800_5f_LO_13TeV-madgraph_pythia8/RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2_v0-v1/MINIAODSIM DYJetsToEE_M-50_LTbinned_400To800 caf database VALID - - allRange /DYJetsToEE_M-50_LTbinned_800To2000_5f_LO_13TeV-madgraph_pythia8/RunIISpring16MiniAODv2-PUSpring16_80X_mcRun2_asymptotic_2016_miniAODv2_v0-v1/MINIAODSIM DYJetsToEE_M-50_LTbinned_800To2000 caf database VALID - - +273149-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf database VALID RUN2016B +273149-275125 /AlCaElectron/Run2016B-v2/RAW AlCaElectron-Run2016B-v2 caf group/dpg_ecal/alca_ecalcalib/ecalelf/alcareco VALID RUN2016B diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py index e4c198f2f4f..3308905adef 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_Output_cff.py @@ -23,7 +23,7 @@ OutALCARECOEcalCalElectron_noDrop = cms.PSet( # put this if you have a filter SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalCalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalCalZSCElectron','pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalCalWElectronStream') ), outputCommands = cms.untracked.vstring( 'keep uint_bunchSpacingProducer_*_*', @@ -63,6 +63,8 @@ # pfisolation CMSSW_5_3_X 'keep *EcalRecHit*_alCaIsolatedElectrons_*_*', 'keep EcalRecHitsSorted_reducedEcalRecHitsES_*_*', + 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', #for electron stream + 'keep *_hltMetClean_*_*', #for electron stream ) ) @@ -78,6 +80,12 @@ OutALCARECOEcalCalWElectron_noDrop.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron') ) +OutALCARECOEcalCalWElectronStream=copy.deepcopy(OutALCARECOEcalCalElectron) +OutALCARECOEcalCalWElectronStream_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) +OutALCARECOEcalCalWElectronStream.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectronStream') ) +OutALCARECOEcalCalWElectronStream_noDrop.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectronStream') ) OutALCARECOEcalCalZElectron=copy.deepcopy(OutALCARECOEcalCalElectron) OutALCARECOEcalCalZElectron_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) @@ -87,5 +95,11 @@ OutALCARECOEcalCalZElectron_noDrop.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron') ) +OutALCARECOEcalCalZElectronStream=copy.deepcopy(OutALCARECOEcalCalElectron) +OutALCARECOEcalCalZElectronStream_noDrop=copy.deepcopy(OutALCARECOEcalCalElectron_noDrop) +OutALCARECOEcalCalZElectronStream.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectronStream') ) +OutALCARECOEcalCalZElectronStream_noDrop.SelectEvents = cms.untracked.PSet( + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectronStream') ) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py index ead46c318a6..896940cb63e 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalCalIsolElectron_cff.py @@ -62,6 +62,8 @@ seqALCARECOEcalCalZElectron = cms.Sequence(ZeeSkimFilterSeq * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalZSCElectron = cms.Sequence(ZSCSkimFilterSeq * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalWElectron = cms.Sequence(WenuSkimFilterSeq * ALCARECOEcalCalElectronSeq) +seqALCARECOEcalCalZElectronStream = cms.Sequence(ZeeSkimFilterSeqElectronStream * ALCARECOEcalCalElectronSeq) +seqALCARECOEcalCalWElectronStream = cms.Sequence(WenuSkimFilterSeqElectronStream * ALCARECOEcalCalElectronSeq) seqALCARECOEcalCalPhoton = cms.Sequence( alCaIsolatedElectrons + diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py index 4ee95ffca23..f431292192f 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_Output_cff.py @@ -20,10 +20,12 @@ 'drop *EcalRecHit*_reducedEcalRecHitsES*_*_*', 'drop *EcalRecHit*_*_*_*', 'keep reco*Clusters_pfElectronTranslator_*_*' + 'keep *_hltFixedGridRhoFastjetAllCaloForMuons_*_*', + 'keep *_hltMet_*_*', ) OutALCARECOEcalUncalElectron.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalUncalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalUncalWElectron', 'pathALCARECOEcalUncalWElectronStream', 'pathALCARECOEcalUncalZElectron') ) diff --git a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py index 6824c237a8d..e4803000aef 100644 --- a/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py +++ b/EcalAlCaRecoProducers/python/ALCARECOEcalUncalIsolElectron_cff.py @@ -19,3 +19,5 @@ seqALCARECOEcalUncalZSCElectron = cms.Sequence(ZSCSkimFilterSeq * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) seqALCARECOEcalUncalWElectron = cms.Sequence(WenuSkimFilterSeq * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) seqALCARECOEcalUncalElectron = cms.Sequence( ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) +seqALCARECOEcalUncalWElectronStream = cms.Sequence(WenuSkimFilterSeqElectronStream * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) +seqALCARECOEcalUncalZElectronStream = cms.Sequence(ZeeSkimFilterSeqElectronStream * ALCARECOEcalCalElectronNonECALSeq * ALCARECOEcalUncalElectronECALSeq) diff --git a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py index f1b2b6e6325..6a29838aca2 100644 --- a/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py +++ b/EcalAlCaRecoProducers/python/WZElectronSkims_cff.py @@ -139,6 +139,31 @@ ) ) + +# This are the cuts at trigger level except ecalIso +PassingVetoIdElectronStream = selectedECALElectrons.clone( + cut = cms.string( + selectedECALElectrons.cut.value() + + " && (gsfTrack.hitPattern().numberOfHits(\'MISSING_INNER_HITS\')<=2)" + " && ((isEB" + " && ( ((pfIsolationVariables().sumChargedHadronPt + max(0.0,pfIsolationVariables().sumNeutralHadronEt + pfIsolationVariables().sumPhotonEt - 0.5 * pfIsolationVariables().sumPUPt))/p4.pt)<0.164369)" + " && (sigmaIetaIeta<0.011100)" +# " && (full5x5_sigmaIetaIeta<0.011100)" #why this one cuts all the events? + " && ( - 0.252044 %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN)) ) +WenuSelectorElectronStream = cms.EDProducer("CandViewShallowCloneCombiner", + decay = cms.string("pfMet PassingVetoIdElectronStream"), # charge coniugate states are implied + checkCharge = cms.bool(False), +# cut = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN)) + cut = cms.string(("daughter(1).pt > %f") % (W_ELECTRON_ET_CUT_MIN)) +) + EleSCSelector = cms.EDProducer("CandViewShallowCloneCombiner", decay = cms.string("PassingVetoId eleSC"), @@ -224,11 +266,21 @@ cut = cms.string("40 < mass < 140") ) +EleSCSelectorElectronStream = cms.EDProducer("CandViewShallowCloneCombiner", + decay = cms.string("PassingVetoIdElectronStream eleSC"), + checkCharge = cms.bool(False), + cut = cms.string("40 < mass < 140") + ) + # for filtering events passing at least one of the filters WZSelector = cms.EDProducer("CandViewMerger", src = cms.VInputTag("WenuSelector", "ZeeSelector", "EleSCSelector") ) +WZSelectorElectronStream = cms.EDProducer("CandViewMerger", + src = cms.VInputTag("WenuSelectorElectronStream", "ZeeSelectorElectronStream", "EleSCSelectorElectronStream") + ) + ############################################################ # Filters ############################## @@ -247,6 +299,22 @@ minNumber = cms.uint32(1) ) +WenuFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("WenuSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + +ZeeFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("ZeeSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + +ZSCFilterElectronStream = cms.EDFilter("CandViewCountFilter", + src = cms.InputTag("EleSCSelectorElectronStream"), + minNumber = cms.uint32(1) + ) + + # filter for events passing at least one of the other filters WZFilter = cms.EDFilter("CandViewCountFilter", src = cms.InputTag("WZSelector"), @@ -270,8 +338,20 @@ WenuSkimFilterSeq = cms.Sequence(preFilterSeq * selectorProducerSeq * ~ZeeFilter * ~ZSCFilter * WenuFilter) +### sequences for the electron stream +selectorProducerSeqWElectronStream = cms.Sequence(eleSelSeqElectronStream * (ZeeSelectorElectronStream + WenuSelectorElectronStream + EleSCSelectorElectronStream) * WZSelectorElectronStream) + +selectorProducerSeqZElectronStream = cms.Sequence(eleSelSeqElectronStream * (ZeeSelectorElectronStream)) + +WenuSkimFilterSeqElectronStream = cms.Sequence(preFilterSeq * selectorProducerSeqWElectronStream * ~ZeeFilterElectronStream * ~ZSCFilterElectronStream * + WenuFilterElectronStream) + +ZeeSkimFilterSeqElectronStream = cms.Sequence(preFilterSeq * selectorProducerSeqZElectronStream * + ZeeFilterElectronStream) + checkMCZSeq = cms.Sequence(genEleFromZ * combZ * ZFilterMC) #sequence to check Zskim efficiency respect to the MC checkMCWSeq = cms.Sequence(genEleFromW * genNuFromW * combW * WFilterMC) #sequence to check Wskim efficiency respect to the MC FilterMuSeq = cms.Sequence(muSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector) + diff --git a/EcalAlCaRecoProducers/python/alcaSkimming.py b/EcalAlCaRecoProducers/python/alcaSkimming.py index b10f821831f..07ca8a7c3d9 100644 --- a/EcalAlCaRecoProducers/python/alcaSkimming.py +++ b/EcalAlCaRecoProducers/python/alcaSkimming.py @@ -76,6 +76,11 @@ VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.int, "50=50ns, 25=25ns,0=multifit auto,-1=weights") +options.register('electronStream', + 0, #default value False + VarParsing.VarParsing.multiplicity.singleton, # singleton or list + VarParsing.VarParsing.varType.int, # string, int, or float + "bool: isElectronStream=1 true, isElectronStream=0 false") ### setup any defaults you want options.output="alcaSkimALCARAW.root" @@ -346,11 +351,19 @@ process.ZEEHltFilter.HLTPaths = [ "HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_*"] process.filterSeq *= process.ZEEHltFilter +##for the stream +process.pathALCARECOEcalCalWElectronStream = cms.Path(seqALCARECOEcalCalWElectronStream) +process.pathALCARECOEcalUncalWElectronStream = cms.Path(seqALCARECOEcalUncalWElectronStream) +process.pathALCARECOEcalCalZElectronStream = cms.Path(seqALCARECOEcalCalZElectronStream) +process.pathALCARECOEcalUncalZElectronStream = cms.Path(seqALCARECOEcalUncalZElectronStream) + from HLTrigger.HLTfilters.hltHighLevel_cfi import * process.NtupleFilter = copy.deepcopy(hltHighLevel) process.NtupleFilter.throw = cms.bool(False) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalWElectron', 'pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalWElectron', + 'pathALCARECOEcalUncalZElectronStream', 'pathALCARECOEcalUncalWElectronStream', + 'pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalCalWElectronStream', 'pathALCARECOEcalUncalZSCElectron', 'pathALCARECOEcalCalZSCElectron', 'pathALCARECOEcalUncalSingleElectron', 'pathALCARECOEcalCalSingleElectron', ## in case of no skim ] @@ -367,11 +380,13 @@ # process.NtupleFilterSeq= cms.Sequence(process.NtupleFilter) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalZElectron', 'pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalCalZSCElectron', 'pathALCARECOEcalUncalZSCElectron', + 'pathALCARECOEcalCalZElectronStream', 'pathALCARECOEcalUncalZElectronStream', ] elif(WSkim): process.NtupleFilterSeq = cms.Sequence(process.WZFilter) # process.NtupleFilterSeq= cms.Sequence(process.NtupleFilter) - process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalUncalWElectron' ] + process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalWElectron', 'pathALCARECOEcalUncalWElectron', + 'pathALCARECOEcalCalWElectronStream', 'pathALCARECOEcalUncalWElectronStream'] elif(ZmmgSkim): process.NtupleFilterSeq = cms.Sequence(process.ZmmgSkimSeq) process.NtupleFilter.HLTPaths = [ 'pathALCARECOEcalCalZmmgPhoton', 'pathALCARECOEcalUncalZmmgPhoton' ] @@ -594,17 +609,17 @@ ############################## if(options.skim=='WSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalWElectron','pathALCARECOEcalUncalWElectronStream') ) process.outputALCARECO.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalWElectron','pathALCARECOEcalCalWElectronStream') ) elif(options.skim=='ZSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalUncalZElectron', 'pathALCARECOEcalUncalZSCElectron','pathALCARECOEcalUncalZElectronStream') ) process.outputALCARECO.SelectEvents = cms.untracked.PSet( - SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron') + SelectEvents = cms.vstring('pathALCARECOEcalCalZElectron', 'pathALCARECOEcalCalZSCElectron','pathALCARECOEcalUncalZElectronStream') ) elif(options.skim=='ZmmgSkim'): process.outputALCARAW.SelectEvents = cms.untracked.PSet( @@ -650,6 +665,9 @@ process.NtuplePath = cms.Path(process.ntupleSeq) process.schedule = cms.Schedule(process.NtuplePath, process.NtupleEndPath) process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::ALCARECO') + if (options.electronStream): + if (options.isCrab==0): + process.zNtupleDumper.WZSkimResultsCollection = cms.InputTag('TriggerResults::RECO') else: if(doAnyTree==False): process.schedule = cms.Schedule(process.pathALCARECOEcalCalZElectron, process.pathALCARECOEcalCalWElectron, @@ -790,6 +808,13 @@ process.patElectrons.reducedEndcapRecHitCollection = process.eleNewEnergiesProducer.recHitCollectionEE process.zNtupleDumper.recHitCollectionEB = process.eleNewEnergiesProducer.recHitCollectionEB process.zNtupleDumper.recHitCollectionEE = process.eleNewEnergiesProducer.recHitCollectionEE +if (options.electronStream==1): + process.zNtupleDumper.caloMetCollection = cms.InputTag('hltMetClean') + process.zNtupleDumper.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') + process.zNtupleDumper.eleID_loose = cms.string('looseElectronStream') + process.zNtupleDumper.eleID_medium = cms.string('mediumElectronStream') + process.zNtupleDumper.eleID_tight = cms.string('tightElectronStream') + process.eleSelectionProducers.rhoFastJet = cms.InputTag('hltFixedGridRhoFastjetAllCaloForMuons') if(options.type=="ALCARECOSIM"): process.zNtupleDumper.recHitCollectionES = cms.InputTag("reducedEcalRecHitsES") diff --git a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh index 228ef16d863..e7e07995d2b 100755 --- a/EcalAlCaRecoProducers/scripts/prodAlcareco.sh +++ b/EcalAlCaRecoProducers/scripts/prodAlcareco.sh @@ -203,6 +203,7 @@ fi case $DATASETPATH in */RAW) ALCATYPE="RAW2DIGI,RECO," + let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/8 ;; *SingleElectron*USER) let LUMIS_PER_JOBS=${LUMIS_PER_JOBS}/4 @@ -267,6 +268,21 @@ case $TYPE in TYPE=ALCARECO subdir=prod_alcareco ;; + ElectronStream | ALCARECO) + case $SKIM in + ZSkim) + ALCATYPE="${ALCATYPE}ALCA:EcalCalZElectronStream" + ;; + WSkim) + ALCATYPE="${ALCATYPE}ALCA:EcalCalWElectronStream" + EVENTS_PER_JOB=20000; LUMIS_PER_JOB=25 + ;; + none) EVENTS_PER_JOB=20000;; + esac + CUSTOMISE="--process=ALCARECO --customise Calibration/EcalAlCaRecoProducers/customElectronStream.StreamReco" + TYPE=ALCARECO + subdir=prod_alcareco + ;; *) echo "[ERROR] No TYPE defined. If you want to use ALCARECOSIM, use ALCARECO and option --isMC" >> /dev/stderr exit 1 diff --git a/EcalAlCaRecoProducers/scripts/prodNtuples.sh b/EcalAlCaRecoProducers/scripts/prodNtuples.sh index fc3a89c7414..0030123e839 100755 --- a/EcalAlCaRecoProducers/scripts/prodNtuples.sh +++ b/EcalAlCaRecoProducers/scripts/prodNtuples.sh @@ -27,6 +27,7 @@ FROMCRAB3=0 JOBINDEX="" ISPRIVATE=0 BUNCHSPACING=0 +ELECTRONSTREAM=0 usage(){ echo "`basename $0` {parseDatasetFile options} --type={type} [options]" @@ -50,6 +51,7 @@ usage(){ echo " --json_name jsonName: additional name in the folder structure to keep track of the used json" echo " --json jsonFile.root" echo " --weightsReco: using weights for local reco" + echo " --electronStream" echo "---------- optional common" echo " --doExtraCalibTree (needed for E/p calibration)" @@ -84,7 +86,7 @@ expertUsage(){ #------------------------------ parsing # options may be followed by one colon to indicate they have a required argument -if ! options=$(getopt -u -o hHd:n:s:r:t:f: -l help,expertHelp,datasetpath:,datasetname:,skim:,runrange:,store:,remote_dir:,scheduler:,isMC,isParticleGun,ntuple_remote_dir:,json:,tag:,type:,json_name:,ui_working_dir:,extraName:,doExtraCalibTree,doExtraStudyTree,doEleIDTree,noStandardTree,createOnly,submitOnly,check,isPrivate,file_per_job:,develRelease,weightsReco -- "$@") +if ! options=$(getopt -u -o hHd:n:s:r:t:f: -l help,expertHelp,datasetpath:,datasetname:,skim:,runrange:,store:,remote_dir:,scheduler:,isMC,isParticleGun,ntuple_remote_dir:,json:,tag:,type:,json_name:,ui_working_dir:,extraName:,doExtraCalibTree,doExtraStudyTree,doEleIDTree,noStandardTree,createOnly,submitOnly,check,isPrivate,file_per_job:,develRelease,weightsReco,electronStream, -- "$@") then # something went wrong, getopt will put out an error message for us exit 1 @@ -147,6 +149,7 @@ do ;; --isMC) isMC=1;; --isParticleGun) isPARTICLEGUN="y"; SKIM=partGun;; + --electronStream) echo "[OPTION] run for electron stream"; ELECTRONSTREAM=1;; --json) JSONFILE=$2; shift;; --json_name) JSONNAME=$2; shift;; @@ -184,7 +187,7 @@ do #echo "[OPTION] checking jobs"; CHECK=y; EXTRAOPTION="--check"; unset CREATE; unset SUBMIT;; --isPrivate) echo "[OPTION] private dataset"; ISPRIVATE=1;; - + --file_per_job) echo "[OPTION] file per job: $2"; FILE_PER_JOB=$2; shift ;; --develRelease) echo "[OPTION] Request also CMSSW release not in production!"; DEVEL_RELEASE=y;; --weightsReco) echo "[OPTION `basename $0`] using weights for local reco"; BUNCHSPACING=-1;; diff --git a/EcalAlCaRecoProducers/test/recHitsValidation.py b/EcalAlCaRecoProducers/test/recHitsValidation.py index fa7e03c978b..f84f8f21e43 100644 --- a/EcalAlCaRecoProducers/test/recHitsValidation.py +++ b/EcalAlCaRecoProducers/test/recHitsValidation.py @@ -163,6 +163,8 @@ handleRecHitsEB_ALCARECO = Handle('edm::SortedCollection >') handleRecHitsEE_ALCARECO = Handle('edm::SortedCollection >') +handleMET = Handle('std::vector') + if (file_format == 'ALCARECO'): processName="ALCASKIM" electronTAG = 'electronRecalibSCAssociator' @@ -193,7 +195,7 @@ electronTAG = 'electronRecalibSCAssociator' - +metTAG = 'hltMet' EErecHitmap_ele1 = TH2F("EErecHitmap_ele1", "EErecHitmap_ele1", 100,0,100, @@ -230,6 +232,9 @@ # print file_format, file, electronTAG electrons = handleElectrons.product() + event.getByLabel(metTAG, handleMET) + met = handleMET.product() + # event.getByLabel("reducedEcalRecHitsEB", "", processName, handleRecHitsEB) # event.getByLabel("reducedEcalRecHitsEE", "", processName, handleRecHitsEE) if(file_format=="sandbox"): diff --git a/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py b/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py new file mode 100644 index 00000000000..83c3b0f54f8 --- /dev/null +++ b/EcalAlCaRecoProducers/test/reco_RAW2DIGI_RECO_alcastreamElectron.py @@ -0,0 +1,133 @@ +# Auto generated configuration file +# using: +# Revision: 1.19 +# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v +# with command line options: reco -s RAW2DIGI,RECO -n 100 --filein=/store/data/Run2012D/SingleElectron/RAW/v1/000/208/307/0085A34B-BD3A-E211-B6E9-003048D2BC4C.root --data --conditions=auto:run2_data --nThreads=4 --dirout=./ +import FWCore.ParameterSet.Config as cms +import os, sys, imp, re +import FWCore.ParameterSet.VarParsing as VarParsing +import subprocess +import copy + + +process = cms.Process('RECO') + +# import of standard configurations +process.load('Configuration.StandardSequences.Services_cff') +process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') +process.load('FWCore.MessageService.MessageLogger_cfi') +process.load('Configuration.EventContent.EventContent_cff') +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') +process.load('Configuration.StandardSequences.RawToDigi_Data_cff') +process.load('Configuration.StandardSequences.Reconstruction_Data_cff') +process.load('Configuration.StandardSequences.EndOfProcess_cff') +process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff') + +options = VarParsing.VarParsing('standard') + +options.register ('tagFile', + "", + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.string, + "path of the file with the reReco tags") + +options.parseArguments() + +print options + +process.maxEvents = cms.untracked.PSet( + input = cms.untracked.int32(100) +) + +# Input source +process.source = cms.Source("PoolSource", + fileNames = cms.untracked.vstring('/store/data/Run2015D/AlCaElectron/RAW/v1/000/256/673/00000/5AD13995-DF5C-E511-8DDB-02163E013516.root'), +# fileNames = cms.untracked.vstring('root://xrootd.unl.edu//store/data/Run2015C/AlCaElectron/RAW/v1/000/254/313/00000/88935D49-C842-E511-BA1F-02163E014330.root'), + secondaryFileNames = cms.untracked.vstring() +) + +process.options = cms.untracked.PSet( + +) + +# Production Info +process.configurationMetadata = cms.untracked.PSet( + annotation = cms.untracked.string('reco nevts:100'), + name = cms.untracked.string('Applications'), + version = cms.untracked.string('$Revision: 1.19 $') +) + +# Output definition + +process.RECOSIMoutput = cms.OutputModule("PoolOutputModule", + dataset = cms.untracked.PSet( + dataTier = cms.untracked.string(''), + filterName = cms.untracked.string('') + ), + eventAutoFlushCompressedSize = cms.untracked.int32(5242880), + fileName = cms.untracked.string('./reco_RAW2DIGI_RECO.root'), + outputCommands = process.RECOSIMEventContent.outputCommands, + splitLevel = cms.untracked.int32(0) +) + +# Additional output definition + +# Other statements +from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag + +if(len(options.tagFile)>0): + execfile(options.tagFile) # load the GT + process.GlobalTag = RerecoGlobalTag +else: + print "******************************" + print "[ERROR] no file with tags specified" + sys.exit(1) + +#process.GlobalTag = GlobalTag(process.GlobalTag, '74X_dataRun2_Prompt_v1', '') + +# Path and EndPath definitions +process.raw2digi_step = cms.Path(process.RawToDigi) +process.reconstruction_step = cms.Path(process.reconstruction) +process.endjob_step = cms.EndPath(process.endOfProcess) +process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput) + +### some fix for the stream +process.csctfDigis.producer = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.dttfDigis.DTTF_FED_Source = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.ecalDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.ecalPreshowerDigis.sourceTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.castorDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gctDigis.inputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gtDigis.DaqGtInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.gtEvmDigis.EvmGtInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.hcalDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonCSCDigis.InputObjects = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonDTDigis.inputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.muonRPCDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.scalersRawToDigi.scalersInputTag = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.siPixelDigis.InputLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +process.siStripDigis.ProductLabel = cms.InputTag("hltSelectedElectronFEDListProducerGsf:StreamElectronRawFed") + +# Schedule definition +process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.endjob_step,process.RECOSIMoutput_step) + +#Setup FWK for multithreaded +process.options.numberOfThreads=cms.untracked.uint32(4) +process.options.numberOfStreams=cms.untracked.uint32(0) + + diff --git a/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py b/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py new file mode 100644 index 00000000000..9b44ee59587 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_alcareco_alcastreamElectron.py @@ -0,0 +1,29 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'AlCaElectron_alcareco_RUN2015D' +config.General.workArea = 'AlCaElectron_alcareco_RUN2015D' +config.section_('JobType') +config.JobType.psetName = 'reco_ALCA.py' +config.JobType.pluginName = 'Analysis' +#config.JobType.pyCfgParams = ['global_tag=74X_dataRun2_Prompt_v1', 'MC=False', 'isCrab=True'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_reco_stream_runD-00000000000000000000000000000000/USER' +config.Data.unitsPerJob = 1 +config.Data.lumiMask = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_Silver.txt' +config.JobType.maxMemoryMB = 2500 # 2.5 GB +config.JobType.maxJobRuntimeMin = 1400 +#config.Data.lumiMask = 'Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v2.txt' +config.Data.inputDBS = 'phys03' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'FileBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/AlCaElectron_alcareco_RUN2015D/' +config.Data.useParent = True +config.Data.publication = True +#config.Data.ignoreLocality = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' +#config.Site.whitelist = ['T2_US_Caltech', 'T2_US_Florida', 'T2_US_MIT', 'T2_US_Nebraska', 'T2_US_Purdue', 'T2_US_UCSD', 'T2_US_Vanderbilt'] diff --git a/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py b/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py new file mode 100644 index 00000000000..47f4a8049b6 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_ntuple_alcastreamElectron.py @@ -0,0 +1,27 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'ntuple_AlCaElectron_RUN2015D' +config.General.workArea = 'ntuple_AlCaElectron_RUN2015D' +config.section_('JobType') +config.JobType.psetName = 'EcalAlCaRecoProducers/python/alcaSkimming.py' +#config.JobType.psetName = 'processDump.py' +config.JobType.pluginName = 'Analysis' +config.JobType.outputFiles= ['ntuple.root','extraCalibTree.root'] +config.JobType.pyCfgParams = ['isCrab=1', 'skim=WSkim', 'maxEvents=-1', 'type=ALCARECO', 'tagFile=EcalAlCaRecoProducers/config/reRecoTags/test75x.py','doTreeOnly=1', 'electronStream=1','doTree=3'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +#config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_alcareco_stream_runC-e468ed1ee444b924f5c474c9b5bffcd2/USER' +config.Data.inputDataset = '/AlCaElectron/lbrianza-crab_AlCaElectron_alcareco_RUN2015D-c2f08da413a109f58849306beef921b4/USER' +config.Data.unitsPerJob = 10 +config.Data.lumiMask = '/afs/cern.ch/cms/CAF/CMSCOMM/COMM_DQM/certification/Collisions15/13TeV/Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_Silver.txt' +config.Data.inputDBS = 'phys03' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'FileBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/ntuple_AlCaElectron_RUN2015D/' +#config.Data.useParent = True +#config.Data.publication = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' diff --git a/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py b/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py new file mode 100644 index 00000000000..3853e3988d7 --- /dev/null +++ b/EcalAlCaRecoProducers/test/run_reco_alcastreamElectron_crab.py @@ -0,0 +1,25 @@ +from WMCore.Configuration import Configuration +config = Configuration() +config.section_('General') +config.General.transferOutputs = True +config.General.requestName = 'reco_stream_runD' +config.General.workArea = 'reco_stream_runD' +config.section_('JobType') +config.JobType.psetName = 'python/reco_RAW2DIGI_RECO_alcastreamElectron.py' +config.JobType.pluginName = 'Analysis' +#config.JobType.pyCfgParams = ['global_tag=74X_dataRun2_Prompt_v1', 'MC=False', 'isCrab=True'] +config.JobType.allowUndistributedCMSSW = True +#config.JobType.inputFiles = ['PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt' ] +config.section_('Data') +#config.Data.inputDataset = '/ElectronStream/Run2015B-v1/RAW' +config.Data.inputDataset = '/AlCaElectron/Run2015D-v1/RAW' +config.Data.unitsPerJob = 10 +#config.Data.lumiMask = 'json/Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v2.txt' +config.Data.inputDBS = 'global' #'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet' +config.Data.splitting = 'LumiBased' +config.Data.outLFNDirBase = '/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/AlCaElectron-Run2015D-v1-RECO/' +config.Data.publication = True +config.section_('User') +config.section_('Site') +config.Site.storageSite = 'T2_CH_CERN' +config.Site.whitelist = ['T2_CH_CERN'] diff --git a/ZFitter/data/validation/MC_EoverPcalibration.dat b/ZFitter/data/validation/MC_EoverPcalibration.dat new file mode 100644 index 00000000000..eee6da9d17f --- /dev/null +++ b/ZFitter/data/validation/MC_EoverPcalibration.dat @@ -0,0 +1,16 @@ +#################input list for the E/p calibration ############################ +#d selected /afs/cern.ch/user/l/lbrianza/work/public/ntuple_numEvent100.root +#d extraCalibTree /afs/cern.ch/user/l/lbrianza/work/public/extraCalibTree.root +#d selected /afs/cern.ch/user/l/lbrianza/work/public/RUND_DoubleElectron.root + +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit50ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit50ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_multifit25ns.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_multifit25ns.root +#d selected root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/ntuple_oldweight.root +#d extraCalibTree root://eoscms//eos/cms/store/group/dpg_ecal/alca_ecalcalib/ecalMIBI/lbrianza/DoubleElectron/extraCalibTree_oldweight.root + +d selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DYJets_amctnlo-RunIISpring15DR74-Asym25ns-allRange.root + +s selected /afs/cern.ch/user/l/lbrianza/work/public/ntupleEoP/DYJets_amctnlo-RunIISpring15DR74-Asym25ns-allRange.root + diff --git a/ZFitter/submit_on_lxbatch.py b/ZFitter/submit_on_lxbatch.py new file mode 100644 index 00000000000..d89308f2465 --- /dev/null +++ b/ZFitter/submit_on_lxbatch.py @@ -0,0 +1,123 @@ +#! /usr/bin/env python +import os +import glob +import math +from array import array +import sys +import time +import subprocess + +currentDir = os.getcwd(); +CMSSWDir = currentDir+"/../"; + +applyPcorr = ["False","True"]; +applyEcorr = ["False"]; +split = ["0","1"]; +cut = ["100.","0.05","0.10","0.15","0.20","0.30","0.50"]; +smoothCut = ["0","1"]; +energyType = ["0"]; + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + fn = "Job/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 data/validation/EoverPcalibration.dat --EOverPCalib --outputPath output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EB"+" --splitStat "+split[b]+" --nLoops 15 --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale momentumCalibration2015_EB_pTk.root --applyEcorr "+applyEcorr[f]+" --inputEnergyScale momentumCalibration2015_EB_rawE.root" + print command; + outScript.write('#!/bin/bash'); + outScript.write("\n"+'cd '+CMSSWDir); + outScript.write("\n"+'eval `scram runtime -sh`'); + outScript.write("\n"+'cd '+currentDir); + outScript.write("\n"+command); + outScript.close(); + os.system("chmod 777 "+currentDir+"/"+fn+".sh"); + command2 = "bsub -q cmscaf1nd -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; + os.system(command2); + print command2 + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + fn = "Job/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 data/validation/EoverPcalibration.dat --EOverPCalib --outputPath output_"+cut[c]+"_smooth"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g]+"/ --do"+"EE"+" --splitStat "+split[b]+" --nLoops 15 --EPMin "+cut[c]+" --noPU --smoothCut "+smoothCut[d]+" --applyPcorr "+applyPcorr[e]+" --inputMomentumScale momentumCalibration2015_EE_pTk.root --applyEcorr "+applyEcorr[f]+" --inputEnergyScale momentumCalibration2015_EE_rawE.root" + print command; + outScript.write('#!/bin/bash'); + outScript.write("\n"+'cd '+CMSSWDir); + outScript.write("\n"+'eval `scram runtime -sh`'); + outScript.write("\n"+'cd '+currentDir); + outScript.write("\n"+command); + outScript.close(); + os.system("chmod 777 "+currentDir+"/"+fn+".sh"); + command2 = "bsub -q cmscaf1nd -cwd "+currentDir+" "+currentDir+"/"+fn+".sh"; + os.system(command2); + print command2 + + +createAndPlotIC = "createAndPlotIC.sh" +out2 = open(createAndPlotIC,"w") + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + name = "EB"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] + fn = "cfg/calibrationPlots_"+name+".py"; + folder = "output_"+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("\ninFileName = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB.root\"),") + outScript.write("\ninFileNameEven = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_even.root\"),") + outScript.write("\ninFileNameOdd = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EB_odd.root\"),") + outScript.write("\nnEtaBinsEB = cms.int32(1),") + outScript.write("\nnEtaBinsEE = cms.int32(1),") + outScript.write("\nis2012Calib = cms.bool(False),") + outScript.write("\nisEB = cms.bool(True),") + outScript.write("\nevalStat = cms.int32(1),") + outScript.write("\noutputFolder = cms.string(\""+folder+"\"),") + outScript.write("\noutFileName = cms.string(\""+name+".root\"),") + outScript.write("\noutputTxt = cms.string(\"IC_"+name+"\"),") + outScript.write("\nfileType = cms.string(\"cxx\")") + outScript.write("\n)") + out2.write("\nCalibrationPlots "+fn) + + +for b in range(len(split)): + for c in range(len(cut)): + for d in range(len(smoothCut)): + for e in range(len(applyPcorr)): + for f in range(len(applyEcorr)): + for g in range(len(energyType)): + name = "EE"+"_"+split[b]+"_"+cut[c]+"_smoothCut"+smoothCut[d]+"_pCorr_"+applyPcorr[e]+"_ECorr_"+applyEcorr[f]+"_useRaw"+energyType[g] + fn = "cfg/calibrationPlots_"+name+".py"; + folder = "output_"+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("\ninFileName = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE.root\"),") + outScript.write("\ninFileNameEven = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_even.root\"),") + outScript.write("\ninFileNameOdd = cms.string(\"/afs/cern.ch/user/l/lbrianza/work/PHD/DEF_ECALELF/CHE_SUCCEDE_IN_ECALELF/CALIBRAZIONI/CMSSW_7_4_12/src/Calibration/ZFitter/"+folder+"FastCalibrator_Oct2015_runD_WZ_noEP_EE_odd.root\"),") + outScript.write("\nnEtaBinsEB = cms.int32(1),") + outScript.write("\nnEtaBinsEE = cms.int32(1),") + outScript.write("\nis2012Calib = cms.bool(False),") + outScript.write("\nisEB = cms.bool(False),") + outScript.write("\nevalStat = cms.int32(1),") + outScript.write("\noutputFolder = cms.string(\""+folder+"\"),") + outScript.write("\noutFileName = cms.string(\""+name+".root\"),") + outScript.write("\noutputTxt = cms.string(\"IC_"+name+"\"),") + outScript.write("\nfileType = cms.string(\"cxx\")") + outScript.write("\n)") + out2.write("\nCalibrationPlots "+fn) diff --git a/ZFitter/test/launch.sh b/ZFitter/test/launch.sh new file mode 100755 index 00000000000..e98a4a06539 --- /dev/null +++ b/ZFitter/test/launch.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +#data/validation/rereco/AlphaStudies2012/13Jul_Alpha*_v*.dat +#data/validation/rereco/Cal_Dic2012/Cal_Dic2012_ICcombTCphiSym_v4.dat +#data/validation/rereco/Cal_Dic2012/Cal_Dic2012_ICcombTCcomb_v5_offGT_bis.dat +#data/validation/rereco/Cal_Dic2012/Cal_Dic2012_Alphacomb_v*.dat +#data/validation/monitoring_2012_53X.dat +#data/validation/moriond2013.dat +#data/validation/rereco/ungrouped/Winter13_noLas.dat +#data/validation/rereco/ungrouped/Moriond2013_noLas.dat +#data/validation/rereco/ungrouped/Winter13.dat +#data/validation/rereco/ungrouped/Winter13_noLas.dat +#data/validation/rereco/ungrouped/Moriond2013.dat +for file in data/validation/rereco/ungrouped/Winter13_noLas.dat + do + for invMass in invMass_SC_regrCorr_ele + do + rereco=Winter13 +# rereco=Moriond13 + + ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --rereco $rereco --stability --runRangesFile=data/runRanges/runRangePlot.txt +# ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --period=RUN2012D --validation --stability --slide --rereco $rereco +# ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --period=RUN2012C --validation --stability --slide --rereco $rereco +# ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --period=RUN2012AB --validation --stability --slide --rereco $rereco +## ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --validation --period=RUN2012B +## ./script/monitoring_validation.sh -f $file --invMass_var=$invMass --validation --period=RUN2012A + done +done + + diff --git a/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h b/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h index 541bfa99c29..2399ebbe60a 100644 --- a/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h +++ b/ZNtupleDumper/interface/SimpleCutBasedElectronIDSelectionFunctor.h @@ -139,9 +139,7 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector public: // interface - enum Version_t { NONE = 0, fiducial, WP80PU, WP90PU, WP70PU, loose, medium, tight, loose25nsRun2, medium25nsRun2, tight25nsRun2, loose50nsRun2, medium50nsRun2, tight50nsRun2, medium25nsRun2Boff}; - - // SimpleCutBasedElectronIDSelectionFunctor(): {} + enum Version_t { NONE = 0, fiducial, WP80PU, WP90PU, WP70PU, loose, medium, tight, loose25nsRun2, medium25nsRun2, tight25nsRun2, loose50nsRun2, medium50nsRun2, tight50nsRun2, medium25nsRun2Boff, looseElectronStream, mediumElectronStream, tightElectronStream}; #ifdef shervin // initialize it by inserting directly the cut values in a parameter set @@ -233,6 +231,9 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector else if (versionStr.CompareTo("medium50nsRun2") == 0) version = medium50nsRun2; else if (versionStr.CompareTo("tight50nsRun2") == 0) version = tight50nsRun2; else if (versionStr.CompareTo("medium25nsRun2Boff") == 0) version = medium25nsRun2Boff; + else if (versionStr.CompareTo("looseElectronStream") == 0) version = loose25nsRun2; + else if (versionStr.CompareTo("mediumElectronStream") == 0) version = medium25nsRun2; + else if (versionStr.CompareTo("tightElectronStream") == 0) version = tight25nsRun2; else { std::cerr << "[ERROR] version type not defined" << std::endl; std::cerr << "[ERROR] using WP80PU" << std::endl; @@ -639,6 +640,122 @@ class SimpleCutBasedElectronIDSelectionFunctor : public Selector set("relEcalIso_EE", 100., false); set("relHcalIso_EB", 100., false); set("relHcalIso_EE", 100., false); + } else if (version_ == looseElectronStream) { //SPRING15. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2 + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.104); + set("hoe_EE", 0.0897); + set("deta_EB", 0.0105); + set("deta_EE", 0.00814); + set("dphi_EB", 0.115); + set("dphi_EE", 0.182); + set("sihih_EB", 0.0103); + set("sihih_EE", 0.0301); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100., false); //0.0261); + set("d0vtx_EE", 100., false); //0.118); + set("dzvtx_EB", 100., false); //0.41); + set("dzvtx_EE", 100., false); //0.822); + set("pfIso_EB", 0.0893); + set("pfIso_EE", 0.121); + set("pfIsoLowPt_EB", 0.0893); + set("pfIsoLowPt_EE", 0.121); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } else if (version_ == looseElectronStream) { //SPRING15. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2 + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.104); + set("hoe_EE", 0.0897); + set("deta_EB", 0.0105); + set("deta_EE", 0.00814); + set("dphi_EB", 0.115); + set("dphi_EE", 0.182); + set("sihih_EB", 0.0103); + set("sihih_EE", 0.0301); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100., false); //0.0261); + set("d0vtx_EE", 100., false); //0.118); + set("dzvtx_EB", 100., false); //0.41); + set("dzvtx_EE", 100., false); //0.822); + set("pfIso_EB", 0.0893); + set("pfIso_EE", 0.121); + set("pfIsoLowPt_EB", 0.0893); + set("pfIsoLowPt_EE", 0.121); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } else if (version_ == mediumElectronStream) { //SPRING15. See https://twiki.cern.ch/twiki/bin/viewauth/CMS/CutBasedElectronIdentificationRun2 + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.0876); + set("hoe_EE", 0.0678); + set("deta_EB", 0.0103); + set("deta_EE", 0.00733); + set("dphi_EB", 0.0336); + set("dphi_EE", 0.114); + set("sihih_EB", 0.0101); + set("sihih_EE", 0.0283); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100., false); //0.0118 ); + set("d0vtx_EE", 100., false); //0.0739); + set("dzvtx_EB", 100., false); //0.373); + set("dzvtx_EE", 100., false); //0.602); + set("pfIso_EB", 0.0766); + set("pfIso_EE", 0.0678); + set("pfIsoLowPt_EB", 0.0766); + set("pfIsoLowPt_EE", 0.0678); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); + } else if (version_ == tightElectronStream) { + //set("fiducial"); + set("maxNumberOfExpectedMissingHits_EB", 2); + set("maxNumberOfExpectedMissingHits_EE", 1); + set("hasMatchedConversion"); + set("hoe_EB", 0.0597); + set("hoe_EE", 0.0615); + set("deta_EB", 0.00926); + set("deta_EE", 0.00724); + set("dphi_EB", 0.0336); + set("dphi_EE", 0.0918); + set("sihih_EB", 0.0101); + set("sihih_EE", 0.0279); + set("ooemoop_EB", 100., false); + set("ooemoop_EE", 100., false); + set("d0vtx_EB", 100., false); + set("d0vtx_EE", 100., false); + set("dzvtx_EB", 100., false); + set("dzvtx_EE", 100., false); + set("pfIso_EB", 0.0354); + set("pfIso_EE", 0.0646); + set("pfIsoLowPt_EB", 0.0354); + set("pfIsoLowPt_EE", 0.0646); + set("relTrackIso_EB", 100., false); + set("relTrackIso_EE", 100., false); + set("relEcalIso_EB", 100., false); + set("relEcalIso_EE", 100., false); + set("relHcalIso_EB", 100., false); + set("relHcalIso_EE", 100., false); } } diff --git a/ZNtupleDumper/plugins/EleSelectionProducers.cc b/ZNtupleDumper/plugins/EleSelectionProducers.cc index 1e8292e7441..e1c1c5fd863 100644 --- a/ZNtupleDumper/plugins/EleSelectionProducers.cc +++ b/ZNtupleDumper/plugins/EleSelectionProducers.cc @@ -106,6 +106,9 @@ class EleSelectionProducers : public edm::EDProducer SimpleCutBasedElectronIDSelectionFunctor medium50nsRun2_selector; SimpleCutBasedElectronIDSelectionFunctor tight50nsRun2_selector; SimpleCutBasedElectronIDSelectionFunctor medium25nsRun2Boff_selector; + SimpleCutBasedElectronIDSelectionFunctor looseElectronStream_selector; + SimpleCutBasedElectronIDSelectionFunctor mediumElectronStream_selector; + SimpleCutBasedElectronIDSelectionFunctor tightElectronStream_selector; }; @@ -147,7 +150,14 @@ EleSelectionProducers::EleSelectionProducers(const edm::ParameterSet& iConfig): tight50nsRun2_selector("tight50nsRun2", electronsHandle, conversionsHandle, bsHandle, vertexHandle, chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), medium25nsRun2Boff_selector("medium25nsRun2Boff", electronsHandle, conversionsHandle, bsHandle, vertexHandle, - chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle) + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + looseElectronStream_selector("looseElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + mediumElectronStream_selector("mediumElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle), + tightElectronStream_selector("tightElectronStream", electronsHandle, conversionsHandle, bsHandle, vertexHandle, + chIsoValsHandle, emIsoValsHandle, nhIsoValsHandle, rhoHandle) + { //register your products /* Examples @@ -173,6 +183,9 @@ EleSelectionProducers::EleSelectionProducers(const edm::ParameterSet& iConfig): produces< SelectionMap >("medium50nsRun2"); produces< SelectionMap >("tight50nsRun2"); produces< SelectionMap >("medium25nsRun2Boff"); + produces< SelectionMap >("looseElectronStream"); + produces< SelectionMap >("mediumElectronStream"); + produces< SelectionMap >("tightElectronStream"); //now do what ever other initialization is needed } @@ -226,6 +239,12 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i std::vector medium25nsRun2Boff_vec; std::auto_ptr mediumMap25nsRun2Boff(new SelectionMap()); + std::vector looseElectronStream_vec; + std::vector mediumElectronStream_vec; + std::vector tightElectronStream_vec; + std::auto_ptr looseElectronStreamMap(new SelectionMap()); + std::auto_ptr mediumElectronStreamMap(new SelectionMap()); + std::auto_ptr tightElectronStreamMap(new SelectionMap()); //------------------------------ ELECTRON iEvent.getByToken(electronsToken_, electronsHandle); @@ -279,6 +298,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i pat::strbitset medium50nsRun2_ret; pat::strbitset tight50nsRun2_ret; pat::strbitset medium25nsRun2Boff_ret; + pat::strbitset looseElectronStream_ret; + pat::strbitset mediumElectronStream_ret; + pat::strbitset tightElectronStream_ret; fiducial_selector(eleRef, fiducial_ret); @@ -320,6 +342,13 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium25nsRun2Boff_selector(eleRef, medium25nsRun2Boff_ret); medium25nsRun2Boff_vec.push_back(medium25nsRun2Boff_selector.result()); + looseElectronStream_selector(eleRef, looseElectronStream_ret); + mediumElectronStream_selector(eleRef, mediumElectronStream_ret); + tightElectronStream_selector(eleRef, tightElectronStream_ret); + looseElectronStream_vec.push_back(looseElectronStream_selector.result()); + mediumElectronStream_vec.push_back(mediumElectronStream_selector.result()); + tightElectronStream_vec.push_back(tightElectronStream_selector.result()); + if(((bool)tight_selector.result())) { if(!(bool) medium_selector.result() || !(bool) loose_selector.result()) { edm::LogError("Incoherent selection") << "passing tight but not medium or loose"; @@ -362,9 +391,23 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i } } + if(((bool)tightElectronStream_selector.result())) { + if(!(bool) mediumElectronStream_selector.result() || !(bool) looseElectronStream_selector.result()) { + edm::LogError("Incoherent selection") << "passing tight but not medium or loose for electron stream"; + exit (1); + } + } + + if(((bool)mediumElectronStream_selector.result())) { + if( !(bool) looseElectronStream_selector.result()) { + edm::LogError("Incoherent selection") << "passing medium but not loose for electron stream"; + exit (1); + } + } // WP80_PU_vec.push_back((SelectionValue_t)WP80_PU_selector.bitMask()); // WP90_PU_vec.push_back((SelectionValue_t)WP90_PU_selector.bitMask()); + #ifdef DEBUG std::cout << "[DEBUG] WP80 ret=" << WP80_PU_selector.bitMask() << std::endl; std::cout << "[DEBUG] WP80 ret= (float)" << (SelectionValue_t) WP80_PU_selector.bitMask() << std::endl; @@ -390,6 +433,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i SelectionMap::Filler medium50nsRun2_filler(*mediumMap50nsRun2); SelectionMap::Filler tight50nsRun2_filler(*tightMap50nsRun2); SelectionMap::Filler medium25nsRun2Boff_filler(*mediumMap25nsRun2Boff); + SelectionMap::Filler looseElectronStream_filler(*looseElectronStreamMap); + SelectionMap::Filler mediumElectronStream_filler(*mediumElectronStreamMap); + SelectionMap::Filler tightElectronStream_filler(*tightElectronStreamMap); //fill and insert valuemap fiducial_filler.insert(electronsHandle, fiducial_vec.begin(), fiducial_vec.end()); @@ -406,6 +452,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium50nsRun2_filler.insert(electronsHandle, medium50nsRun2_vec.begin(), medium50nsRun2_vec.end()); tight50nsRun2_filler.insert(electronsHandle, tight50nsRun2_vec.begin(), tight50nsRun2_vec.end()); medium25nsRun2Boff_filler.insert(electronsHandle, medium25nsRun2Boff_vec.begin(), medium25nsRun2Boff_vec.end()); + looseElectronStream_filler.insert(electronsHandle,looseElectronStream_vec.begin(),looseElectronStream_vec.end()); + mediumElectronStream_filler.insert(electronsHandle,mediumElectronStream_vec.begin(),mediumElectronStream_vec.end()); + tightElectronStream_filler.insert(electronsHandle,tightElectronStream_vec.begin(),tightElectronStream_vec.end()); fiducial_filler.fill(); @@ -422,6 +471,9 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i medium50nsRun2_filler.fill(); tight50nsRun2_filler.fill(); medium25nsRun2Boff_filler.fill(); + looseElectronStream_filler.fill(); + mediumElectronStream_filler.fill(); + tightElectronStream_filler.fill(); //------------------------------ @@ -440,6 +492,10 @@ void EleSelectionProducers::produce(edm::Event& iEvent, const edm::EventSetup& i iEvent.put(mediumMap50nsRun2, "medium50nsRun2"); iEvent.put(tightMap50nsRun2, "tight50nsRun2"); iEvent.put(mediumMap25nsRun2Boff, "medium25nsRun2Boff"); + iEvent.put(looseElectronStreamMap, "looseElectronStream"); + iEvent.put(mediumElectronStreamMap, "mediumElectronStream"); + iEvent.put(tightElectronStreamMap, "tightElectronStream"); + } // ------------ method called once each job just before starting event loop ------------ diff --git a/ZNtupleDumper/plugins/ZNtupleDumper.cc b/ZNtupleDumper/plugins/ZNtupleDumper.cc index 61113922588..1a323f93b9d 100644 --- a/ZNtupleDumper/plugins/ZNtupleDumper.cc +++ b/ZNtupleDumper/plugins/ZNtupleDumper.cc @@ -120,7 +120,9 @@ #include "DataFormats/METReco/interface/PFMET.h" #include "DataFormats/METReco/interface/PFMETFwd.h" - +#include "DataFormats/METReco/interface/CaloMET.h" +#include "DataFormats/METReco/interface/CaloMETFwd.h" +#include "DataFormats/METReco/interface/CaloMETCollection.h" // HLT trigger #include "FWCore/Framework/interface/TriggerNamesService.h" #include @@ -149,7 +151,6 @@ class ZNtupleDumper : public edm::EDAnalyzer static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - private: virtual void beginJob() ; virtual void analyze(const edm::Event&, const edm::EventSetup&); @@ -184,6 +185,7 @@ class ZNtupleDumper : public edm::EDAnalyzer edm::Handle< GenEventInfoProduct > GenEventInfoHandle; edm::Handle conversionsHandle; edm::Handle< reco::PFMETCollection > metHandle; + edm::Handle< reco::CaloMETCollection > caloMetHandle; edm::Handle triggerResultsHandle; edm::Handle WZSkimResultsHandle; edm::Handle ESRechitsHandle; @@ -214,6 +216,7 @@ class ZNtupleDumper : public edm::EDAnalyzer edm::EDGetTokenT > pileupInfoToken_; edm::EDGetTokenT conversionsProducerToken_; edm::EDGetTokenT metToken_; + edm::EDGetTokenT caloMetToken_; edm::EDGetTokenT triggerResultsToken_; edm::EDGetTokenT WZSkimResultsToken_; edm::InputTag triggerResultsTAG, WZSkimResultsTAG; @@ -221,9 +224,8 @@ class ZNtupleDumper : public edm::EDAnalyzer private: std::string foutName; - bool doExtraCalibTree; ///< bool to activate the dump of the extra calib tree for E/p ICs - bool doExtraStudyTree; ///< bool to activate the dump of the extra tree for study with values for single recHits - bool doEleIDTree; ///< bool to activate the dump of the electronID variables in a separate tree + bool doExtraCalibTree; + bool doEleIDTree; edm::Service fs; //< output file for extra ntuples @@ -236,7 +238,6 @@ class ZNtupleDumper : public edm::EDAnalyzer Long64_t eventNumber; ///< Int_t lumiBlock; ///< lumi section UInt_t runTime; ///< unix time - Int_t nBX; ///< bunch crossing Float_t mcGenWeight; ///< weight in generator for MC @@ -271,10 +272,9 @@ class ZNtupleDumper : public edm::EDAnalyzer Float_t seedLCSCEle[3]; ///< laser correction of the SC seed crystal Float_t avgLCSCEle[3]; - Float_t alphaSeedSCEle[3]; //alpha of the seed Float_t energyMCEle[3]; ///< Electron MC true energy - Float_t energyEle[3]; ///< electron.energy(), not changed by rereco + Float_t energyEle[3]; ///< electron.energy() Float_t energySCEle[3]; ///< corrected SuperCluster energy with PF. NB: in the rereco case, this is mustache too! Float_t energySCEle_must[3]; ///< corrected SuperCluster energy with mustache Float_t rawEnergySCEle[3]; ///< SC energy without cluster corrections @@ -292,11 +292,11 @@ class ZNtupleDumper : public edm::EDAnalyzer Float_t rawESEnergyPlane1SCEle[3]; ///< pre-shower rechit energy sum of Plane 1 associated to the electron Float_t rawESEnergyPlane2SCEle[3]; ///< pre-shower recHit energy sum of Plane 2 associated to the electron - Float_t energySCEle_corr[3]; ///< ecal energy: not changed by rereco + Float_t energySCEle_corr[3]; ///< ecal energy with corrections base on type of electron (see #classificationEle) Float_t e3x3SCEle[3]; //< sum of the recHit energy in 3x3 matrix centered at the seed of the SC Float_t e5x5SCEle[3]; ///< sum of the recHit energy in 5x5 matrix centered at the seed of the SC - Float_t efull5x5SCEle[3]; ///< full 5x5 from electron object (however it is computed) + Float_t efull5x5SCEle[3]; ///< full 5x5 Float_t eSeedSCEle[3]; Float_t pModeGsfEle[3]; ///< track momentum from Gsf Track (mode) Float_t pAtVtxGsfEle[3]; ///< momentum estimated at the vertex @@ -323,47 +323,42 @@ class ZNtupleDumper : public edm::EDAnalyzer Float_t invMass_mumu; Float_t etaMCEle[3], phiMCEle[3]; + #ifdef shervin Float_t invMass_inGsf; Float_t invMass_outGsf; Float_t invMass_SC_etaphiSC; - + Int_t nBX; Int_t bxPU[5]; //[nBX] Int_t tagProbe_check; Int_t nBCSCEle[3]; #endif - //============================== ExtraCalibTree (for E/p) + //============================== ExtraCalibTree TFile *extraCalibTreeFile; TTree *extraCalibTree; edm::Timestamp runTime_; Int_t nRecHitsEle[3]; Int_t nHitsSCEle[3]; + std::vector recoFlagRecHitSCEle[3]; std::vector rawIdRecHitSCEle[3]; - std::vector XRecHitSCEle[3]; - std::vector YRecHitSCEle[3]; - std::vector ZRecHitSCEle[3]; - std::vector energyRecHitSCEle[3]; - std::vector fracRecHitSCEle[3]; - std::vector recoFlagRecHitSCEle[3]; + std::vector XRecHitSCEle[3]; + std::vector YRecHitSCEle[3]; + std::vector ZRecHitSCEle[3]; + std::vector energyRecHitSCEle[3]; + std::vector LCRecHitSCEle[3]; + std::vector ICRecHitSCEle[3]; + std::vector AlphaRecHitSCEle[3]; + std::vector ootAmplisUncalibRecHitSCEle[3]; + std::vector ampliUncalibRecHitSCEle[3]; + std::vector ampliErrUncalibRecHitSCEle[3]; + std::vector pedEUncalibRecHitSCEle[3]; + std::vector jitterUncalibRecHitSCEle[3]; + std::vector jitterErrUncalibRecHitSCEle[3]; + std::vector chi2UncalibRecHitSCEle[3]; + std::vector flagsUncalibRecHitSCEle[3]; //============================== - //============================== ExtraStudyTree - TFile *extraStudyTreeFile; - TTree *extraStudyTree; - std::vector LCRecHitSCEle[3]; - std::vector AlphaRecHitSCEle[3]; - std::vector ICRecHitSCEle[3]; - std::vector > ootAmplisUncalibRecHitSCEle[3]; - std::vector ampliUncalibRecHitSCEle[3]; - std::vector ampliErrUncalibRecHitSCEle[3]; - std::vector pedEUncalibRecHitSCEle[3]; - std::vector jitterUncalibRecHitSCEle[3]; - std::vector jitterErrUncalibRecHitSCEle[3]; - std::vector chi2UncalibRecHitSCEle[3]; - std::vector flagsUncalibRecHitSCEle[3]; - - //============================== check ele-id and iso TFile *eleIDTreeFile; TTree *eleIDTree; @@ -375,17 +370,6 @@ class ZNtupleDumper : public edm::EDAnalyzer Float_t dr03HcalTowerSumEt[3]; Float_t deltaPhiSuperClusterTrackAtVtx[3]; Float_t deltaEtaSuperClusterTrackAtVtx[3]; - Float_t sigmaIEtaIEta_F5x5[3]; - Float_t R9_F5x5[3]; - Float_t E1x5_F5x5[3]; - //Float_t E2x5_F5x5[3]; - //Float_t E3x3_F5x5[3]; - Float_t E5x5_F5x5[3]; - Float_t E1x3[3]; - Float_t E2x2[3]; - Float_t S4[3]; - Float_t etaWidth[3]; - Float_t phiWidth[3]; Bool_t hasMatchedConversion[3]; Int_t maxNumberOfExpectedMissingHits[3]; Float_t pfMVA[3]; @@ -434,9 +418,9 @@ class ZNtupleDumper : public edm::EDAnalyzer void TreeSetExtraCalibVar(const pat::Photon& photon, const pat::Muon& muon1, const pat::Muon& muon2); void TreeSetExtraCalibVar(const std::vector > & hitsFracs, int index, bool isEB); - void InitExtraStudyTree(void); // the extra study tree uses the method of the extracalibtree void InitEleIDTree(void); + void TreeSetEleIDVar(const pat::Electron& electron1, int index); void TreeSetEleIDVar(const pat::Electron& electron1, const pat::Electron& electron2); void TreeSetEleIDVar(const pat::Photon& photon, const pat::Muon& muon1, const pat::Muon& muon2); @@ -456,6 +440,7 @@ class ZNtupleDumper : public edm::EDAnalyzer // --------------- selection cuts private: + Long64_t epsilonected; //------------------------------ // cluster tools @@ -477,6 +462,8 @@ class ZNtupleDumper : public edm::EDAnalyzer ZSC, ZMMG, PARTGUN, + WSTREAM, + ZSTREAM, UNKNOWN, SINGLEELE, //no skim, no preselection and no selection are applied DEBUG_T @@ -512,6 +499,7 @@ ZNtupleDumper::ZNtupleDumper(const edm::ParameterSet& iConfig): pileupInfoToken_(consumes>(iConfig.getParameter("pileupInfo"))), conversionsProducerToken_(consumes(iConfig.getParameter("conversionCollection"))), metToken_(consumes(iConfig.getParameter("metCollection"))), + caloMetToken_(consumes(iConfig.getParameter("caloMetCollection"))), //for the stream triggerResultsToken_(consumes(iConfig.getParameter("triggerResultsCollection"))), WZSkimResultsToken_(consumes(iConfig.getParameter("WZSkimResultsCollection"))), triggerResultsTAG(iConfig.getParameter("triggerResultsCollection")), @@ -520,7 +508,6 @@ ZNtupleDumper::ZNtupleDumper(const edm::ParameterSet& iConfig): SelectEvents(iConfig.getParameter >("SelectEvents")), foutName(iConfig.getParameter("foutName")), doExtraCalibTree(iConfig.getParameter("doExtraCalibTree")), - doExtraStudyTree(iConfig.getParameter("doExtraStudyTree")), doEleIDTree(iConfig.getParameter("doEleIDTree")), doPdfSystTree(false), pdfWeightTAGS(iConfig.getParameter< std::vector >("pdfWeightCollections")), @@ -642,7 +629,11 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(WZSkimResultsHandle->accept(*alcaSkimPath_itr)) { skipEvent = false; std::string hltName_str(alcaSkimPathNames.triggerName(*alcaSkimPath_itr)); - if(hltName_str.find("WElectron") != std::string::npos) + if(hltName_str.find("WElectronStream")!=std::string::npos) + eventType=WSTREAM; + else if(hltName_str.find("ZElectronStream")!=std::string::npos) + eventType=ZSTREAM; + else if(hltName_str.find("WElectron") != std::string::npos) eventType = WENU; else if(hltName_str.find("ZSCElectron") != std::string::npos) eventType = ZSC; @@ -680,6 +671,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe iEvent.getByToken(ebURHToken_, pEBUncRecHits); iEvent.getByToken(eeURHToken_, pEEUncRecHits); + //------------------------------ electrons if (eventType == ZMMG) { //------------------------------ muons @@ -699,11 +691,15 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe iEvent.getByToken(beamSpotToken_, bsHandle); iEvent.getByToken(rhoToken_, rhoHandle); - iEvent.getByToken(metToken_, metHandle); iEvent.getByToken(recHitCollectionESToken_, ESRechitsHandle); - //if(metHandle.isValid()==false) iEvent.getByType(metHandle); - reco::PFMET met = metHandle.isValid() ? ((*metHandle))[0] : reco::PFMET(); /// \todo use corrected phi distribution + iEvent.getByToken(metToken_, metHandle); + iEvent.getByToken(caloMetToken_, caloMetHandle); + + reco::MET met = ((*metHandle))[0]; + if (eventType == WSTREAM) { + met = (*caloMetHandle)[0]; + } //Here the HLTBits are filled. TriggerResults TreeSetEventSummaryVar(iEvent); @@ -748,6 +744,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe int nTight = 0; //number of electrons passing only the tight ID for preselection int nMedium = 0; //number of electrons passing only the medium ID for preselection int nLoose = 0; //number of electrons passing only the loose ID for preselection + int nEle = 0; //number of electrons saved in the electron stream //if (eventType!=ZMMG) { // count the number of electrons passing the different IDs for preselection and event type determination if (eventType != UNKNOWN) { // count the number of electrons passing the different IDs for preselection and event type determination @@ -757,6 +754,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if( eleIter1->electronID(eleID_tight) ) ++nTight; else if( eleIter1->electronID(eleID_medium) ) ++nMedium; else if( eleIter1->electronID(eleID_loose) ) ++nLoose; + nEle++; } } @@ -788,13 +786,13 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe //else we have two electrons TreeSetDiElectronVar(*eleIter1, *eleIter2); doFill = true; - if(doExtraCalibTree || doExtraStudyTree) { + if(doExtraCalibTree) { TreeSetExtraCalibVar(*eleIter1, *eleIter2); } if(doEleIDTree) { TreeSetEleIDVar(*eleIter1, *eleIter2); } - } else if(eventType == ZEE || eventType == WENU || eventType == UNKNOWN) { + } else if(eventType==ZEE || eventType==WENU || eventType==UNKNOWN || eventType==WSTREAM || eventType==ZSTREAM){ #ifdef DEBUG std::cout << "[DEBUG] Electrons in the event: " << electronsHandle->size() << std::endl; #endif @@ -805,21 +803,22 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(! elePreselection(*eleIter1)) continue; - if(eventType == WENU) { + if(eventType == WENU || eventType == WSTREAM) { if(! (eleIter1->electronID(eleID_tight)) ) continue; if( nTight != 1 || nLoose > 0 ) continue; //to be a Wenu event request only 1 ele WP70 in the event // MET/MT selection if( met.et() < 25. ) continue; if( sqrt( 2.*eleIter1->et()*met.et() * (1 - cos(eleIter1->phi() - met.phi()))) < 50. ) continue; + if( eleIter1->et() < 30) continue; doFill = true; - if(eventType == UNKNOWN) eventType = WENU; + if(eventType == UNKNOWN) eventType = WENU; //after selection it's clear that it's WENU TreeSetSingleElectronVar(*eleIter1, 0); //fill first electron TreeSetSingleElectronVar(*eleIter1, -1); // fill fake second electron - if(doExtraCalibTree || doExtraStudyTree) { + if(doExtraCalibTree) { TreeSetExtraCalibVar(*eleIter1, 0); TreeSetExtraCalibVar(*eleIter1, -1); } @@ -861,7 +860,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(eventType == UNKNOWN) eventType = ZEE; TreeSetDiElectronVar(*eleIter1, *eleIter2); - if(doExtraCalibTree || doExtraStudyTree) { + if(doExtraCalibTree) { TreeSetExtraCalibVar(*eleIter1, *eleIter2); } if(doEleIDTree) { @@ -914,7 +913,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe TreeSetMuMuGammaVar(*phoIter1, *muIter1, *muIter2); - if(doExtraCalibTree || doExtraStudyTree) { + if(doExtraCalibTree) { TreeSetExtraCalibVar(*phoIter1, *muIter1, *muIter2); } if(doEleIDTree) { @@ -998,7 +997,7 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(HighEtaSC1 != EESuperClustersHandle->end()) { doFill = true; TreeSetDiElectronVar(*PatEle1, *HighEtaSC1); - if(doExtraCalibTree || doExtraStudyTree) { + if(doExtraCalibTree) { TreeSetExtraCalibVar(*PatEle1, *HighEtaSC1); } } @@ -1006,9 +1005,8 @@ void ZNtupleDumper::analyze(const edm::Event& iEvent, const edm::EventSetup& iSe if(doFill) { tree->Fill(); - if(doExtraCalibTree) extraCalibTree->Fill(); + if(doExtraCalibTree) extraCalibTree->Fill(); if(doEleIDTree) eleIDTree->Fill(); - if(doExtraStudyTree) extraStudyTree->Fill(); } delete clustertools; return; @@ -1069,20 +1067,6 @@ void ZNtupleDumper::beginJob() InitExtraCalibTree(); } - if(doExtraStudyTree) { - extraStudyTreeFile = new TFile("extraStudyTree.root", "recreate"); - if(extraStudyTreeFile->IsZombie()) { - throw cms::Exception("OutputError") << "Output tree for extra study not created (Zombie): " << foutName; - return; - } - extraStudyTreeFile->cd(); - - extraStudyTree = new TTree("extraStudyTree", "extraStudyTree"); - extraStudyTree->SetDirectory(extraStudyTreeFile); - InitExtraStudyTree(); - } - - if(doEleIDTree) { eleIDTreeFile = new TFile("eleIDTree.root", "recreate"); if(eleIDTreeFile->IsZombie()) { @@ -1120,7 +1104,6 @@ void ZNtupleDumper::endJob() tree->BuildIndex("runNumber", "eventNumber"); if(doEleIDTree) eleIDTree->BuildIndex("runNumber", "eventNumber"); if(doExtraCalibTree) extraCalibTree->BuildIndex("runNumber", "eventNumber"); - if(doExtraStudyTree) extraStudyTree->BuildIndex("runNumber", "eventNumber"); } // save the tree into the file tree_file->cd(); @@ -1132,11 +1115,6 @@ void ZNtupleDumper::endJob() extraCalibTree->Write(); extraCalibTreeFile->Close(); } - if(doExtraStudyTree) { - extraStudyTreeFile->cd(); - extraStudyTree->Write(); - extraStudyTreeFile->Close(); - } if(doEleIDTree) { eleIDTreeFile->cd(); eleIDTree->Write(); @@ -1196,7 +1174,6 @@ void ZNtupleDumper::InitNewTree() tree->Branch("eventNumber", &eventNumber, "eventNumber/l"); tree->Branch("lumiBlock", &lumiBlock, "lumiBlock/I"); tree->Branch("runTime", &runTime, "runTime/i"); - tree->Branch("nBX", &nBX, "nBX/I"); tree->Branch("mcGenWeight", &mcGenWeight, "mcGenWeight/F"); @@ -1206,7 +1183,7 @@ void ZNtupleDumper::InitNewTree() //extraCalibTree->Branch("XRecHitSCEle1", &(XRecHitSCEle[0])); - + // tree->Branch("nBX", &nBX, "nBX/I"); // tree->Branch("nPU", nPU, "nPU[nBX]/I"); tree->Branch("nPU", nPU, "nPU[1]/I"); // tree->Branch("bxPU", bxPU, "bxPU[nBX]/I"); @@ -1235,7 +1212,6 @@ void ZNtupleDumper::InitNewTree() tree->Branch("seedLCSCEle", seedLCSCEle, "seedLCSCEle[3]/F"); tree->Branch("avgLCSCEle", avgLCSCEle, "avgLCSCEle[3]/F"); - tree->Branch("alphaSeedSCEle", alphaSeedSCEle, "alphaSeedSCEle[3]/F"); tree->Branch("gainEle", gainEle, "gainEle[3]/b"); @@ -1326,8 +1302,6 @@ void ZNtupleDumper::TreeSetEventSummaryVar(const edm::Event& iEvent) runTime = runTime_.unixTime(); runNumber = iEvent.id().run(); eventNumber = iEvent.id().event(); - nBX = iEvent.bunchCrossing(); - if( iEvent.isRealData() ) { lumiBlock = iEvent.luminosityBlock(); } else { @@ -1525,12 +1499,6 @@ void ZNtupleDumper::TreeSetSingleElectronVar(const pat::Electron& electron1, int classificationEle[index] = electron1.classification(); // return;//To be fixed - edm::ESHandle aSetup; //ALPHA PART - pSetup->get().get( aSetup ); - - EcalLaserAlpha alpha; - const EcalLaserAlphas* myalpha = aSetup->getAlphas(); - const EcalLaserAlphaMap& laserAlphaMap = myalpha->getMap(); if(electron1.ecalDrivenSeed() && sc.isNonnull()) { @@ -1541,7 +1509,6 @@ void ZNtupleDumper::TreeSetSingleElectronVar(const pat::Electron& electron1, int seedYSCEle[index] = 0; nHitsSCEle[index] = -1; avgLCSCEle[index] = -1.; - alphaSeedSCEle[index] = -1.; seedEnergySCEle[index] = -1.; seedLCSCEle[index] = -10; avgLCSCEle[index] = -10; @@ -1588,16 +1555,6 @@ void ZNtupleDumper::TreeSetSingleElectronVar(const pat::Electron& electron1, int sumE += oneHit->energy(); } avgLCSCEle[index] = sumLC_E / sumE; - - EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find( seedDetId ); - if ( italpha != laserAlphaMap.end() ) { - alpha = (*italpha); - alphaSeedSCEle[index] = alpha; - // std::cout << " ALPHA = " << alpha << std::endl; - } - // else { - // edm::LogError("EcalLaserDbService") << "error with laserAlphaMap!" << std::endl; - //} } if(seedRecHit->checkFlag(EcalRecHit::kHasSwitchToGain6)) gainEle[index] = 1; @@ -1655,14 +1612,6 @@ void ZNtupleDumper::TreeSetSingleElectronVar(const reco::SuperCluster& electron1 const edm::ESHandle& laserHandle_ = clustertools->getLaserHandle(); - edm::ESHandle aSetup; //ALPHA PART - pSetup->get().get( aSetup ); - - EcalLaserAlpha alpha; - const EcalLaserAlphas* myalpha = aSetup->getAlphas(); - const EcalLaserAlphaMap& laserAlphaMap = myalpha->getMap(); - - DetId seedDetId = electron1.seed()->seed(); if(seedDetId.null()) { seedDetId = findSCseed(electron1); @@ -1699,13 +1648,6 @@ void ZNtupleDumper::TreeSetSingleElectronVar(const reco::SuperCluster& electron1 } avgLCSCEle[index] = sumLC_E / sumE; - EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find( seedDetId ); - if ( italpha != laserAlphaMap.end() ) { - alpha = (*italpha); - alphaSeedSCEle[index] = alpha; - // std::cout << " ALPHA = " << alpha << std::endl; - } - } else avgLCSCEle[index] = -10; nHitsSCEle[index] = electron1.size(); @@ -1822,16 +1764,6 @@ void ZNtupleDumper::TreeSetSinglePhotonVar(const pat::Photon& photon, int index) //assert(recHits!=NULL); const edm::ESHandle& laserHandle_ = clustertools->getLaserHandle(); - - edm::ESHandle aSetup; //ALPHA PART - pSetup->get().get( aSetup ); - - EcalLaserAlpha alpha; - const EcalLaserAlphas* myalpha = aSetup->getAlphas(); - const EcalLaserAlphaMap& laserAlphaMap = myalpha->getMap(); - - - DetId seedDetId = photon.superCluster()->seed()->seed(); if(seedDetId.null()) { //assert(photon.trackerDrivenSeed()); // DEBUG @@ -1874,13 +1806,6 @@ void ZNtupleDumper::TreeSetSinglePhotonVar(const pat::Photon& photon, int index) } avgLCSCEle[index] = sumLC_E / sumE; - EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find( seedDetId ); - if ( italpha != laserAlphaMap.end() ) { - alpha = (*italpha); - alphaSeedSCEle[index] = alpha; - // std::cout << " ALPHA = " << alpha << std::endl; - } - } else avgLCSCEle[index] = -10; nHitsSCEle[index] = photon.superCluster()->size(); @@ -1959,11 +1884,11 @@ void ZNtupleDumper:: TreeSetDiElectronVar(const pat::Electron& electron1, const invMass = sqrt(2 * electron1.energy() * electron2.energy() * angle); - invMass_e5x5 = sqrt(2 * e5x5SCEle[0] * e5x5SCEle[1] * /// full 5x5 + invMass_e5x5 = sqrt(2 * electron1.e5x5() * electron2.e5x5() * angle); invMass_efull5x5 = sqrt(2 * electron1.full5x5_e5x5() * electron2.full5x5_e5x5() * - angle); + angle); invMass_SC = sqrt(2 * energySCEle[0] * energySCEle[1] * angle); @@ -2188,9 +2113,28 @@ void ZNtupleDumper::InitExtraCalibTree() extraCalibTree->Branch("ZRecHitSCEle2", &(ZRecHitSCEle[1])); extraCalibTree->Branch("energyRecHitSCEle1", &(energyRecHitSCEle[0])); extraCalibTree->Branch("energyRecHitSCEle2", &(energyRecHitSCEle[1])); - - extraCalibTree->Branch("fracRecHitSCEle1", &(fracRecHitSCEle[0])); - extraCalibTree->Branch("fracRecHitSCEle2", &(fracRecHitSCEle[1])); + extraCalibTree->Branch("LCRecHitSCEle1", &(LCRecHitSCEle[0])); + extraCalibTree->Branch("LCRecHitSCEle2", &(LCRecHitSCEle[1])); + extraCalibTree->Branch("ICRecHitSCEle1", &(ICRecHitSCEle[0])); + extraCalibTree->Branch("ICRecHitSCEle2", &(ICRecHitSCEle[1])); + extraCalibTree->Branch("AlphaRecHitSCEle1", &(AlphaRecHitSCEle[0])); + extraCalibTree->Branch("AlphaRecHitSCEle2", &(AlphaRecHitSCEle[1])); + extraCalibTree->Branch("ampliErrUncalibRecHitSCEle1", &(ampliErrUncalibRecHitSCEle[0])); + extraCalibTree->Branch("ampliErrUncalibRecHitSCEle2", &(ampliErrUncalibRecHitSCEle[1])); + extraCalibTree->Branch("ampliUncalibRecHitSCEle1", &(ampliUncalibRecHitSCEle[0])); + extraCalibTree->Branch("ampliUncalibRecHitSCEle2", &(ampliUncalibRecHitSCEle[1])); + extraCalibTree->Branch("chi2UncalibRecHitSCEle1", &(chi2UncalibRecHitSCEle[0])); + extraCalibTree->Branch("chi2UncalibRecHitSCEle2", &(chi2UncalibRecHitSCEle[1])); + extraCalibTree->Branch("flagsUncalibRecHitSCEle1", &(flagsUncalibRecHitSCEle[0])); + extraCalibTree->Branch("flagsUncalibRecHitSCEle2", &(flagsUncalibRecHitSCEle[1])); + extraCalibTree->Branch("jitterErrUncalibRecHitSCEle1", &(jitterErrUncalibRecHitSCEle[0])); + extraCalibTree->Branch("jitterErrUncalibRecHitSCEle2", &(jitterErrUncalibRecHitSCEle[1])); + extraCalibTree->Branch("jitterUncalibRecHitSCEle1", &(jitterUncalibRecHitSCEle[0])); + extraCalibTree->Branch("jitterUncalibRecHitSCEle2", &(jitterUncalibRecHitSCEle[1])); + extraCalibTree->Branch("ootAmplitudesUncalibRecHitSCEle1", &(ootAmplisUncalibRecHitSCEle[0])); + extraCalibTree->Branch("ootAmplitudesUncalibRecHitSCEle2", &(ootAmplisUncalibRecHitSCEle[1])); + extraCalibTree->Branch("pedUncalibRecHitSCEle1", &(pedEUncalibRecHitSCEle[0])); + extraCalibTree->Branch("pedUncalibRecHitSCEle2", &(pedEUncalibRecHitSCEle[1])); return; } @@ -2220,7 +2164,6 @@ void ZNtupleDumper::resetExtraVariables(int index) YRecHitSCEle[aidx].clear(); ZRecHitSCEle[aidx].clear(); energyRecHitSCEle[aidx].clear(); - fracRecHitSCEle[aidx].clear(); ampliErrUncalibRecHitSCEle[aidx].clear(); ampliUncalibRecHitSCEle[aidx].clear(); chi2UncalibRecHitSCEle[aidx].clear(); @@ -2264,7 +2207,6 @@ void ZNtupleDumper::TreeSetExtraCalibVar(const std::vectorenergy()); - fracRecHitSCEle[index].push_back(detitr->second); EcalUncalibratedRecHitCollection::const_iterator oneUHit = uncHits->find( (detitr -> first) ) ; if(oneUHit == uncHits->end()) { edm::LogError("ZNtupleDumper") << "No uncalibRecHit found for xtal " << (detitr->first).rawId() @@ -2275,7 +2217,7 @@ void ZNtupleDumper::TreeSetExtraCalibVar(const std::vectoroutOfTimeAmplitude(i); - ootAmplisUncalibRecHitSCEle[index].push_back(std::vector(amplis, amplis + EcalDataFrame::MAXSAMPLES)); + ootAmplisUncalibRecHitSCEle[index].push_back(amplis); ampliUncalibRecHitSCEle[index].push_back(oneUHit->amplitude()); ampliErrUncalibRecHitSCEle[index].push_back(oneUHit->amplitudeError()); pedEUncalibRecHitSCEle[index].push_back(oneUHit->pedestal()); @@ -2359,46 +2301,6 @@ void ZNtupleDumper::TreeSetExtraCalibVar(const pat::Muon& muon1, int index) return; } - -//#============================== extra study tree -void ZNtupleDumper::InitExtraStudyTree() -{ - - // tree = new TTree("selected",fChain->GetTitle()); - std::cout << "[STATUS] InitExtraStudyTree" << std::endl; - if(extraStudyTree == NULL) return; - - extraStudyTree->Branch("runNumber", &runNumber, "runNumber/I"); - extraStudyTree->Branch("eventNumber", &eventNumber, "eventNumber/l"); - extraStudyTree->Branch("lumiBlock", &lumiBlock, "lumiBlock/I"); - extraStudyTree->Branch("runTime", &runTime, " runTime/i"); - - extraStudyTree->Branch("LCRecHitSCEle1", &(LCRecHitSCEle[0])); - extraStudyTree->Branch("LCRecHitSCEle2", &(LCRecHitSCEle[1])); - extraStudyTree->Branch("AlphaRecHitSCEle1", &(AlphaRecHitSCEle[0])); - extraStudyTree->Branch("AlphaRecHitSCEle2", &(AlphaRecHitSCEle[1])); - extraStudyTree->Branch("ICRecHitSCEle1", &(ICRecHitSCEle[0])); - extraStudyTree->Branch("ICRecHitSCEle2", &(ICRecHitSCEle[1])); - extraStudyTree->Branch("ampliErrUncalibRecHitSCEle1", &(ampliErrUncalibRecHitSCEle[0])); - extraStudyTree->Branch("ampliErrUncalibRecHitSCEle2", &(ampliErrUncalibRecHitSCEle[1])); - extraStudyTree->Branch("ampliUncalibRecHitSCEle1", &(ampliUncalibRecHitSCEle[0])); - extraStudyTree->Branch("ampliUncalibRecHitSCEle2", &(ampliUncalibRecHitSCEle[1])); - extraStudyTree->Branch("chi2UncalibRecHitSCEle1", &(chi2UncalibRecHitSCEle[0])); - extraStudyTree->Branch("chi2UncalibRecHitSCEle2", &(chi2UncalibRecHitSCEle[1])); - extraStudyTree->Branch("flagsUncalibRecHitSCEle1", &(flagsUncalibRecHitSCEle[0])); - extraStudyTree->Branch("flagsUncalibRecHitSCEle2", &(flagsUncalibRecHitSCEle[1])); - extraStudyTree->Branch("jitterErrUncalibRecHitSCEle1", &(jitterErrUncalibRecHitSCEle[0])); - extraStudyTree->Branch("jitterErrUncalibRecHitSCEle2", &(jitterErrUncalibRecHitSCEle[1])); - extraStudyTree->Branch("jitterUncalibRecHitSCEle1", &(jitterUncalibRecHitSCEle[0])); - extraStudyTree->Branch("jitterUncalibRecHitSCEle2", &(jitterUncalibRecHitSCEle[1])); - extraStudyTree->Branch("ootAmplitudesUncalibRecHitSCEle1", &(ootAmplisUncalibRecHitSCEle[0])); - extraStudyTree->Branch("ootAmplitudesUncalibRecHitSCEle2", &(ootAmplisUncalibRecHitSCEle[1])); - extraStudyTree->Branch("pedUncalibRecHitSCEle1", &(pedEUncalibRecHitSCEle[0])); - extraStudyTree->Branch("pedUncalibRecHitSCEle2", &(pedEUncalibRecHitSCEle[1])); - - return; -} - //#============================== Ele ID tree void ZNtupleDumper::InitEleIDTree() { @@ -2418,17 +2320,6 @@ void ZNtupleDumper::InitEleIDTree() eleIDTree->Branch("dr03EcalRecHitSumEt", dr03EcalRecHitSumEt, "dr03EcalRecHitSumEt[3]/F"); eleIDTree->Branch("dr03HcalTowerSumEt", dr03HcalTowerSumEt, "dr03HcalTowerSumEt[3]/F"); eleIDTree->Branch("sigmaIEtaIEtaSCEle", sigmaIEtaIEtaSCEle, "sigmaIEtaIEtaSCEle[3]/F"); - eleIDTree->Branch("sigmaIEtaIEta_F5x5", sigmaIEtaIEta_F5x5); - eleIDTree->Branch("R9_F5x5", R9_F5x5, "R9_F5x5[3]/F"); - eleIDTree->Branch("E1x5_F5x5", E1x5_F5x5, "E1x5_F5x5[3]/F"); - //eleIDTree->Branch("E2x5_F5x5", E2x5_F5x5, "E2x5_F5x5[3]/F"); - //eleIDTree->Branch("E3x3_F5x5", E3x3_F5x5, "E3x3_F5x5[3]/F"); - eleIDTree->Branch("E5x5_F5x5", E5x5_F5x5, "E5x5_F5x5[3]/F"); - eleIDTree->Branch("E1x3", E1x3, "E1x3[3]/F"); - eleIDTree->Branch("E2x2", E2x2, "E2x2[3]/F"); - eleIDTree->Branch("S4", S4, "S4[3]/F"); - eleIDTree->Branch("etaWidth", etaWidth, "etaWidth[3]/F"); - eleIDTree->Branch("phiWidth", phiWidth, "phiWidth[3]/F"); // eleIDTree->Branch("sigmaIPhiIPhiSCEle", sigmaIPhiIPhiSCEle, "sigmaIPhiIPhiSCEle[3]/F"); eleIDTree->Branch("deltaEtaSuperClusterTrackAtVtx", deltaEtaSuperClusterTrackAtVtx, "deltaEtaSuperClusterTrackAtVtx[3]/F"); eleIDTree->Branch("deltaPhiSuperClusterTrackAtVtx", deltaPhiSuperClusterTrackAtVtx, "deltaPhiSuperClusterTrackAtVtx[3]/F"); @@ -2468,18 +2359,6 @@ void ZNtupleDumper::TreeSetEleIDVar(const pat::Electron& electron1, int index) hasMatchedConversion[index] = ConversionTools::hasMatchedConversion(electron1, conversionsHandle, bsHandle->position()); maxNumberOfExpectedMissingHits[index] = electron1.gsfTrack()->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS); - sigmaIEtaIEta_F5x5[index] = electron1.full5x5_sigmaIetaIeta(); - E1x5_F5x5[index] = electron1.full5x5_e1x5(); - const reco::CaloClusterPtr seed_clu = electron1.superCluster()->seed(); - E1x3[index] = clustertools->e1x3( *seed_clu ); - E2x2[index] = clustertools->e2x2( *seed_clu ); - //E2x5_F5x5[index] = electron1.full5x5_e2x5(); - //E3x3_F5x5[index] = electron1.full5x5_e3x3(); - S4[index] = clustertools->e2x2( *seed_clu ) / clustertools->e5x5( *seed_clu ); - etaWidth[index] = electron1.superCluster()->etaWidth(); - phiWidth[index] = electron1.superCluster()->phiWidth(); - - // if (primaryVertexHandle->size() > 0) { // reco::VertexRef vtx(primaryVertexHandle, 0); diff --git a/ZNtupleDumper/python/elenewenergiesproducer_cfi.py b/ZNtupleDumper/python/elenewenergiesproducer_cfi.py index 34c43a30511..6155ba003ab 100644 --- a/ZNtupleDumper/python/elenewenergiesproducer_cfi.py +++ b/ZNtupleDumper/python/elenewenergiesproducer_cfi.py @@ -5,16 +5,12 @@ # ALCARECO collections eleNewEnergiesProducer = cms.EDProducer('EleNewEnergiesProducer', scEnergyCorrectorSemiParm = cms.PSet( - ecalRecHitsEB = cms.InputTag("alCaIsolatedElectrons", "alcaBarrelHits"), - ecalRecHitsEE = cms.InputTag("alCaIsolatedElectrons", "alcaEndcapHits"), - vertexCollection = cms.InputTag("offlinePrimaryVertices"), - isHLT = cms.bool(False), - regressionKeyEB = cms.string('pfscecal_EBCorrection_offline_v2'), - uncertaintyKeyEB = cms.string('pfscecal_EBUncertainty_offline_v2'), - regressionKeyEE = cms.string('pfscecal_EECorrection_offline_v2'), - uncertaintyKeyEE = cms.string('pfscecal_EEUncertainty_offline_v2'), - ), - electronCollection = cms.InputTag("patElectrons"), - photonCollection = cms.InputTag("photons"), + ecalRecHitsEB = cms.InputTag("alCaIsolatedElectrons", "alcaBarrelHits"), + ecalRecHitsEE = cms.InputTag("alCaIsolatedElectrons", "alcaEndcapHits"), + vertexCollection = cms.InputTag("offlinePrimaryVertices"), + isHLT = cms.bool(False), + ), + electronCollection = cms.InputTag("patElectrons"), + photonCollection = cms.InputTag("photons"), - ) +) diff --git a/ZNtupleDumper/python/patSequence_cff.py b/ZNtupleDumper/python/patSequence_cff.py index 084588a0aac..caa12863953 100644 --- a/ZNtupleDumper/python/patSequence_cff.py +++ b/ZNtupleDumper/python/patSequence_cff.py @@ -53,6 +53,7 @@ # loose50nsRun2 = cms.InputTag("eleSelectionProducers", "loose50nsRun2"), # medium50nsRun2 = cms.InputTag("eleSelectionProducers", "medium50nsRun2"), # tight50nsRun2 = cms.InputTag("eleSelectionProducers", "tight50nsRun2") +# tightElectronStream = cms.InputTag("eleSelectionProducers", "tightElectronStream") # ) electronMatch.src=cms.InputTag('gedGsfElectrons') @@ -101,6 +102,9 @@ loose50nsRun2 = cms.InputTag("eleSelectionProducers", "loose50nsRun2"), medium50nsRun2 = cms.InputTag("eleSelectionProducers", "medium50nsRun2"), tight50nsRun2 = cms.InputTag("eleSelectionProducers", "tight50nsRun2"), + looseElectronStream = cms.InputTag("eleSelectionProducers", "looseElectronStream"), + mediumElectronStream = cms.InputTag("eleSelectionProducers", "mediumElectronStream"), + tightElectronStream = cms.InputTag("eleSelectionProducers", "tightElectronStream"), ), photon_config = cms.PSet( ) ) diff --git a/ZNtupleDumper/python/zntupledumper_cfi.py b/ZNtupleDumper/python/zntupledumper_cfi.py index 440da9830bd..bd44da4501b 100644 --- a/ZNtupleDumper/python/zntupledumper_cfi.py +++ b/ZNtupleDumper/python/zntupledumper_cfi.py @@ -26,6 +26,7 @@ doExtraCalibTree = cms.bool(False), doExtraStudyTree = cms.bool(False), doEleIDTree = cms.bool(False), + caloMetCollection = cms.InputTag('hltMet'), # pdfWeightCollections = cms.VInputTag(cms.InputTag('pdfWeights:cteq66'), cms.InputTag("pdfWeights:MRST2006nnlo"), cms.InputTag('pdfWeights:NNPDF10')), pdfWeightCollections = cms.VInputTag(), fsrWeightCollection = cms.InputTag("fsrWeight"),