Send email if you have any question about Rochester Muon Momentum Correction : Jiyeon Han and Arie Bodek
Rochester Correction 

 CMS Twiki page for Rochester correction is linked HERE
 The rochester correction in this page is for CMSSW42x (2011 data) and CMSSW53x (2012 data) version.
 In 2011 data, CMSSW42x and CMSSW44x has the different muon momentm bias.
 The correction package in this webpage is not working for CMSSW44x data.
 The rochester correction in CMSSW44x data is also extracted for W charge asymmetry analysis, but the eta bin is optimized for this analysis (22 eta bins).
 The correction for CMSSW44x version can be downloaded at link of CMSSW44x correction

Instruction of applying the correction V4.1 

 Code Pakage V4.1 for 2011 correction
 rochcor_v4.1.tgz : includes rochcor.h and rochcor.C
 Changes from V4 :
One more iteration using tight mass window. The change from V4 is negligible. (within the statistical uncertainty)
Add one more input parameter, "qter", which is the muon momentum uncertainty requested by H>ZZ group.

 How to apply the correction
 Code Pakage for 2012 correction for Jan22 Rereco version used for W charge asymmetry (SMP14022)
 rochcor2012jan22_wasym_final.tgz
 This version includes the most latest updates (detector resolution update, dE/dx correction for low pt region).
 2012 Correction is preliminary now :
Used fine phi and eta bins (16x24 phi, eta bins)
Improved the detector resolution function used for the reference (pt,eta,ntracklayers dependences) :
Improved the extra smearing factor utilizing the detector resolution smearing : Gives better agreement in Z mass line shape.
Added dE/dx correction for better agreement in low pt region.
Report for the improvement in muon POG meeting is linked HERE
: Latest improvement in dE/dx correction is not updated in the slide, but the effect in high pt muon is small.
The instruction to apply the correction explained HERE
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu.
void momcor_mc(TLorentzVector& mu, float charge, int ntrk, float &qter );
: "ntrk" is the number of tracker layers, which gives slightly improvement in the extra smearing in MC. However, "ntrk=0" also gives a good performance
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu.
void momcor_data(TLorentzVector& mu, float charge, int runopt, float &qter);
: 2012 correction doesn't have run dependence, you need to set to be "runopt=0".
 Code Pakage for 2012 correction for Jan22 Rereco
 rochcor2012jan22.tgz : includes rochcor2012jan22.h and rochcor2012jan22.C
 This 2012 Correction version is for Jan22 Rereco sample. :
Format is same with 2012 Prompt version, but no run dependence. (just need to set "runopt=0")
The instruction to apply is similar with 2011 correction,
but no option for "sysdev" and need to use the class name with "rochcor2012".
If you want to run the momentum correction smearing the central correction for the systematics, you need to set
rochcor2012 *rmcor = new rochcor2012(seed); //where "seed" is the integer number, seed input for random smearing
instead of rochcor2012 *rmcor = new rochcor2012(); for the central value.
Then, the central value of correction will be smeared withing 1 sigma error.
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu.
void momcor_mc(TLorentzVector& mu, float charge, int runopt, float &qter );
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu.
void momcor_data(TLorentzVector& mu, float charge, int runopt, float &qter);
 Code Pakage for 2012 correction for Prompt Reco V2
 rochcor2012v2.tgz : includes rochcor2012v2.h and rochcor2012v2.C
 2012 Correction is preliminary now :
The eta dependent extra smearing in MC is updated.
The extra smearing is implemented in multiplicative way to consider the effect from multiple interactions (no pt dependence).
Found that 2012D data set has slightly different bias, so added an additional correction for 2012D data set.
("runopt=0" for 2012A+B+C and "runopt=1" for 2012D)
The instruction to apply is similar with 2011 correction,
but no option for "sysdev" and need to use the class name with "rochcor2012v2".
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu.
void momcor_mc(TLorentzVector& mu, float charge, int runopt, float &qter );
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu.
void momcor_data(TLorentzVector& mu, float charge, int runopt, float &qter);
 Code Pakage for 2012 correction  V1
 rochcor2012_new.tgz : includes rochcor2012.h and rochcor2012.C
 2012 Correction is preliminary now :
The correction has been tested by several groups now.
The instruction to apply is same with 2011 correction, but need to use the class name with "rochcor2012".
In addition, "runopt" should be set "0" : no run dependence in 2012 correction.

///////////
Instruction of applying the correction V4 

 Code Pakage V4
 rochcor_v4_new.tgz : includes rochcor.h and rochcor.C
 Changes from V3 :
The additional correction using mass distribution is included.
The details are posted at the presentation of Muon DPG meeting on July, 09th, 2012 : Presentation link
The correction is applied on the muon object by object, not muon pair.
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu.
void momcor_mc(TLorentzVector& mu, float charge, int sysdev, int runopt);
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu.
void momcor_data(TLorentzVector& mu, float charge, int sysdev, int runopt);
"runopt==0" for 2011A correction and "runopt==1" for 2011B correction.
The mass is set to be the generated Z mass peak after FSR with the eta dependent gaussian smearing. (Z peak = 9.09956e+01 GeV )

 How to apply the correction

/////////////
Instruction of applying the correction V3 

 Code Pakage V3
 rochcor_v3.tgz : includes rochcor.h and rochcor.C
 Changes from V2 :
"runopt" is included in the package.
"runopt==0" for 2011A correction and "runopt==1" for 2011B correction.
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_mc(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev, int runopt);
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_data(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev, int runopt);
where mu is muon and mubar is muon+.
mass option is "0" for matching Z mass peak = 91.06 GeV (generated Z mass peak after FSR),
mass option is "1" for matching Z mass peak = 9.09956e+01 GeV (generated Z mass peak with the eta dependent gaussian smearing).
The option of Z mass peak, "1", gives better match in Z mass profile vs. eta/phi between the reconstructed and generated Z mass.
If you choose mass option, "2", then you will get Z mass peak = 9.09099e+01 GeV which is Z mass of data after <1/pt> correction.
(no additional correction after <1/pt> correction in data)

 How to apply the correction

Instruction of applying the correction V2 

 CMS note for muon momentum correction V2

 Code Pakage V2
 rochcor_v2.tgz : includes rochcor.h and rochcor.C
 Changes from V1 :
The global factors, T and G, are combined into one, G factor.
For the momentum correction for MC, TLorentzVector for mu+ and mu in the reconstructed level, int mass_option, and int sysdev are the input of the correction function.
The eta dependent smearing factor is applied in the generator level and the momentum applied the eta dependent resolution smearing is used as the reference point.
The incremental correction on top of MuscleFit and SIDRA correction for the data is also provided.
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_mc(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev);
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_data(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev);
void momcor_data_muscle(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev);
: incremental correction on top of MuscleFit (MuscleFit correction should be applied before this correction)
void momcor_data_sidra(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev);
: incremental correction on top of SIDRA (SIDRA correction should be applied before this correction)
3) Z PT correction for MC : returns the event weighting factor for MC to match Z Pt distribution to the data.
float zptcor(float gen_Zpt);
where mu is muon and mubar is muon+.
mass option is "0" for matching Z mass peak = 91.06 GeV (generated Z mass peak after FSR),
mass option is "1" for matching Z mass peak = 9.09956e+01 GeV (generated Z mass peak with the eta dependent gaussian smearing).
The option of Z mass peak, "1", gives better match in Z mass profile vs. eta/phi between the reconstructed and generated Z mass.
If you choose mass option, "2", then you will get Z mass peak = 9.09099e+01 GeV which is Z mass of data after <1/pt> correction.
(no additional correction after <1/pt> correction in data)
The option, "int sysdev" is for assigining the systematic uncertainty of <1/PT> correction.
If you set sysdev = 0, then it returns the central value.
If you set sysdev = N, then it returns the correction factor shifted by N deviation of statistical uncertainty in <1/PT> correction.
=> Need to apply momentum correction for both data and MC becasue data and MC has the different misalignment bias.
Each correction for data and MC removes the different level of bias in data and MC.
At the end, MC is tuned to match to the data for Z peak and resolution.

Instruction of applying the correction V1 

 CMS note for muon momentum correction V1

 Code Pakage V1
 rochcor_v1.tgz : includes rochcor.h and rochcor.C
 rochcor package's member function for the correction :
1) momentum correction for MC : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_mc(TLorentzVector& mu, TLorentzVector& mubar, TLorentzVector& genmu, TLorentzVector& genmubar, int mass_option, int sysdev);
2) momentum correction for Data : returns reassigned (corrected) TLorentzVector &mu and TLorentzVector &mubar.
void momcor_data(TLorentzVector& mu, TLorentzVector& mubar, int mass_option, int sysdev);
3) Z PT correction for MC : returns the event weighting factor for MC to match Z Pt distribution to the data.
float zptcor(float gen_Zpt);
where mu is muon and mubar is muon+,
genmu is the generated muon and genmubar is the generated muon+,
mass option is "0" for matching Z mass peak = 91.06 GeV (generated Z mass peak after FSR),
mass option is "1" for matching Z mass peak = 90.96 GeV (generated Z mass peak with 2.2 % gaussian smearing).
The option of Z mass peak, "1", gives better match in Z mass profile vs. eta/phi between the reconstructed and generated Z mass.
If you choose mass ption, "2", then you will get Z mass peak = 90.88 GeV which is Z mass of data after <1/pt> correction.
(no additional correction after <1/pt> correction in data)
The option, "int sysdev" is for assigining the systematic uncertainty of <1/PT> correction.
If you set sysdev = 0, then it returns the central value.
If you set sysdev = N, then it returns the correction factor shifted by N deviation of statistical uncertainty in <1/PT> correction.
=> Need to apply momentum correction for both data and MC becasue data and MC has the different misalignment bias.
Each correction for data and MC removes the different level of bias in data and MC.
At the end, MC is tuned to match to the data for Z peak and resolution.

 How to apply the correction

 Brief Summary of Rochester Correction V1
 Corrections for MC
 Muon Momentum Correction : <1/pT> correction + Global corrections (T, Delta, SF, and G)
 <1/pT> correction : maches to the generated <1/pT> and removes charge, eta, and phi bias (dependence) (Figure 14 in CMS note)
 Global corrections (T, Delta, SF) : matches Z mass resolution and Z peak to the data (Table 2 in CMS note)
 Global correction (G) : matches Z mass peak to the generated Z mass peak after FSR (Table 2 in CMS note)
 Z Pt correction : the event weighting factor to match Z Pt distribution to the data
 The event weighting factor need to apply in each event (Figure 8 in CMS note)
 Corrections for Data
 Muon Momentum Correction : <1/pT> correction + Global correction (G)
 <1/pT> correction : maches to the generated <1/pT> and removes charge, eta, and phi bias (dependence) (Figure 13 in CMS note)
 Global correction (G) : matches Z mass peak to the generated Z mass peak after FSR (Table 2 in CMS note)

Comments from discussion at Muon DPG meeting 

 Summary of the discussion at Feb. 29th meeting
 comment list
1) Clarification :
print correction factors in 2 significant digits
print also the table of Dm and Da
print <1/pT> for data, MC, and expectation
=> tables for correction factors, Dm and Da, <1/pT> for data and MC after <1/pT> correction, <1/pT> expectation, <1/pT> for data and MC before <1/pT> correction.
can the binning be done such that eta=0.9 is at the bin boundary (e.g. 16 bins in eta)
=> We will use finer eta bins in the next iteration. 16x18 bins (phi vs. eta).
 could you specify precisely by which resolution distribution exactly is the smearing done
=> plot shown in SIDRA presentation
We used "resolution from MuscleFit on Data" in the plot for the eta dependent semaring factor.
 specify exact definition of Mmumu used for crosschecks and derivation of global scale (sometimes average is used and sometimes BreitWigner  can this be unified, show an example of BreitWigner fit)
=> For the reference plot to check the eta and phi dependence, we used the average of Z mass distribution.
This is only to check how the eta and phi dependence is shown before and after correction.
The average of Z mass was not used to determine any global factors.
To determine the global factor like "G" factor, we used BreitWigner fit.
To determine other global factors like, "delta" and "SF" in MC, we used the Z mass line shape (chi^2 test).
BreitWigner fit in the reconstructed level (data vs. MC)
BreitWigner fit in the generated level after the eta dependent smearing

Last updated 4Mar2012, Jiyeon Han
