**Summary**: the code is done see here https://github.com/Lycoris2017/KPiX-Analysis/blob/experimental/core/include/rawData.h

The analysis procedure is:

**Pedestal & MAD:**operated on__charge over all cycles__, per bucket, per channel, per kpix.**Pedestal median**:__left is from new, right is from old__- Exactly the same results:
**channel at bucket ==0 with charge response == 0**:__left from new, right from old__**DONE**check into these channels and find what are the charge response of them. to understand what happened inside.- Notice the following difference
- old one determine a median out of ADC/slope values
- new one uses the original ADCs
- how to get the slopes: old one look over fit results from every channel's calibration graph, new one take a csv input dumped from slope_vs_channel histo with a precision to a certain digits.

- Difference comes from how the slopes are dealt, Uwe's pedestal + cluster analysis code does not filter slope==0, I did it. that s why:
- if you check the
**pedestal value**of**pedestal tree**output from Uwe: you get**6144 channels**with bucket ==0 - do the same check with the
**test tree with new framework:**you get**6123 channels**with bucket==0 - Then you check how many channels of the calibration slopes: you have
**6144 lines** - however, check it out, there are many with slope==0 or close to 0 see below:

Left is print out of running pedestal_tree.cxx, right is the slope database for new analysis

- if you check the

- Notice the following difference

**Noise & fC response**after Pedestal & CM removal: per bucket, per channel, per kpix.**Common mode noise**: calculated__per cycle__with conditions of__MAD!=0 & slope is valid__**fC response**:**left**is from**new**,**right**is from**cluster_analysis.cxx**- Noise distribution: left is new, right is from cluster_analysis.cxx