The plots shown here are from NA62 2016 data and are produced by modifications of code written by Giuseppe Ruggiero and Connor Graham.
     The plots show comparisons of data with MC for
     K+ ->  pi+  + pi0
    
Data - black, MC - green.  Plots are shown only when there are entries in both data and MC.
The object of this study is to compare  the data and MC distributions and to compare
the effects of the event selections  on data and MC  at a stage in the analysis
when a reasonably clean selection of the   K+ -> Pi+ Pi0  decay channel has been made. 
COMPARISON of DATA WITH MC  after K+ -> Pi+ Pi0 selection
---------------------------------------------------------
Comparison plots are here:   KaonEventAnalysis    
The plots have been made in the function KaonEventAnalysis::PiP0Analysis
The plots 214 - 222 show  the fMMiss ( missing mass squared  to K+ Pi+ ) at the 
following points in code: at start of code, and after the following cuts:  time ,
beam kinematics, Z-vertex, highToT, interaction, CHANTI, kinematic tails.
The number of events is reduced  from 435 ( plot 214)  to 326 (plot 221)
by these cuts.
Within statistics,  the shape of the data MM distributions  agree well with those
produced by the MC.
Subsequently, the following selection (S) is made:
 if (fTrigControl && !isPhoton && !positron && !muonRA && !isEarly
 && fIsOneParticle && !isSegment && !isBadMMiss && isRICHLikePion
 && isRingCandidate && isFinalBeam && isKineCut) {
The number of events rejected by each of these cuts is shown in Plots 223 - 229.
For example, plot 225 shows that 81 events are rejected by the muonRA cut. 
The plots show the missing mass distributions for the rejected events.
This selection, S, reduces the number of events from 326 to 164, see
plots 204 - 209, 212  which compare data and MC.  Plots 212, 213   show the
fMMiss distributions for selected and rejected events, respectively. 
Evidently  the selection, S, rejects  good Pi+ Pi0  events;
there is some evidence for increased tails in the missing
mass distribution for rejected events. 
Finally, plots 204 - 211  compare data and MC for different variables.
In all cases there is good agreement between data and MC. Notice that
the Pi0 mass is better estimated using the gammas than using the K+,Pi+
(compare 204 , 205).
Summary of effect of cuts
              DATA                           MC       
 cuts         Events       fraction          Events      fraction
 start        435                            6938                      <-  events at input to PiP0Analysis() 
 first set    326          0.75              5547        0.8           <-  events remaing after first cuts 
 trigger        1                               0                      <-  events rejected by cuts 'S'
 photon        45          0.10               231        0.03                    | 
 e+             5          0.01               139        0.02                    |
 muonRA        81          0.19              1239        0.18                    V
 one particle  14          0.03                 0
 segment       20          0.05                 0
 RICHpion      52          0.12               388        0.06
 Ringcand.     30          0.07               645        0.09
 finalbeam      6          0.01                27        0.004  
 KineCut       10          0.02                89        0.01
                                data              MC
total selected(all cuts)        164               3549
rejected  by  cuts 'S'          162               1998
 Data Missing mass squared accepted 
 Data Missing mass squared rejected 
 MC  Missing mass squared accepted 
 MC  Missing mass squared rejected 
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------
COMPARISON Of DATA WITH MC  after K+ -> MU+ nu  selection
---------------------------------------------------------
The  Table below shows the numbers of events either remaining or
rejected after cuts in the function Kmu2Analysis;  ~50000 muons have been input from MC.
This version of Kmu2Analysis does not use Connors latest muon selection.
Initial cuts are: beam kinematics, beam background cut, kinematic tails.
This is followed by  the 15-35 muon momentum  selection and
if (!isPhoton && !positron && !isEarly && fIsOneParticle && !isSegment && isRICHLikeMuon  && muon && fTrack->GetIsMip() && !isMult && isFinalBeam){
( cut "S" )
Cut                  Data      fraction       MC       Fraction
Start                12220                    24650                   No 15 -35 cut.
initial cuts          8135     0.67           17770    0.72           number after intial cuts
photon (plot 227)     1554 (473)                 13                   this and the numbers following
positron               167                       39                   are the numbers of events rejected by the selections
early                   15                        2                   in cut "S" (including the 15-35 cut)
onepart                247 (133)                  0
segment                218 (117)                  0
rich                   893 (65)                  13                   numbers in () are the number of
muon                   816                      166                   events in the mu missing mass peak.
mip                   1418 (496)               1208
mult                   833 (166)                120
beam                    63 (36)                   0
mu final               745                     3887                   final number of muons
mu rej                2035                     1396                   number rejected 
 Data Missing mass squared accepted  
 Data Missing mass squared rejected  
Remove "mip" requirement since , for MC, it rejects good muon events.
 
-----------------------------------------
After  removal of the "Mip"  requirement:
-----------------------------------------
Apply selection:
if (!isPhoton && !positron && !isEarly && fIsOneParticle && !isSegment && isRICHLikeMuon  && muon  && !isMult && isFinalBeam){
( cut "S" )
Fig. 1 Data Missing mass squared accepted  1000 muons accepted ( plot 235 Fig 5)
Fig. 2  Data Missing mass squared rejected  ~ 690 good muons rejected (plot 236 Fig 6)
Fig. 3 MC  Missing mass squared accepted  4893 muons accepted
Fig. 4 MC  Missing mass squared rejected  356 good muons rejected
Overall numbers from Figs 1 and 2:
                 
                    data        MC
mu final            1000        4893
   rej              1780         390
 Figs 5. Comparison plots data/MC  data - black , MC - green 
 Plots 227 -234 show the missing mass spectra of rejected events
 for each of the rejections isPhoton, positron etc (cuts "S" above).
 In most cases,  rejected events have a component that shows a good 
 muon missing mass peak that is also in time with the trigger -
 see next plots.
 Figs 6. Data time plots   see plots  107 -113: accepted events,
plots 114 -120:  rejected events with missing mass**2 < 0.01 GeV**2
and selections as defined above. Times are for GTK, Ktag etc.
Note time  similarity of accepted and rejected events.
Some out-of-time events are present for both accepted and rejected events.
There is a 1 ns time shift for the LKr relative to FineTriggerTime.
MUON SUMMARY
Fig. 1 shows that for data, 1000 muons are accepted.
Fig 2 shows the corresponding mass spectra for events that are rejected by cuts "S" (defined above with no "mips" rejection). Of the rejected events, 697 events appear to be good muon events (have missing mass**2 < 0.01, implying that ~40% of good muon events are rejected by the cuts "S". This is is reasonable agreement with G.R.'s estimate of the random veto (~30%).
Figs. 3 and 4 show the corresponding results for MC events. For MC, 7% of good muon events are rejected by the cuts.
The time plots of Figs 5 and 6 show a well defined peak, slightly shifted off zero, with low-level tails of off-time events. The rejected events have larger tails than the accepted events but are otherwise identical.
Details of photon rejection for muons
Two-constraint Kmu2 missing mass fits
4 constraint Kpi2 fits - comparison of data and MC