1 #include "EcalTiming/EcalTiming/interface/EcalTimingEvent.h"
13 #define DS_HIGH_SKEW 0x01
14 #define DS_UNSTABLE_EN 0x02
15 #define DS_CCU_OOT 0x04
34 mutable std::map<float, float> _sumWithinNSigma, _sum2WithinNSigma, _sum3WithinNSigma,
_sumEWithinNSigma;
39 std::vector<EcalTimingEvent>::iterator maxChi2Itr;
52 inline unsigned int num()
const
56 inline float mean()
const
58 if(!
_num)
return -999.f;
64 return sqrt(
_sum2 /
_num - mean_ * mean_);
66 inline float meanError()
const
70 inline float meanE()
const
89 os << s.mean() <<
"\t" << s.
stdDev() <<
"\t" << s.num();
104 _sumWithinNSigma.clear();
105 _sum2WithinNSigma.clear();
106 _sum3WithinNSigma.clear();
112 void dumpToTree(TTree *tree,
int ix_,
int iy_,
int iz_,
unsigned int status_,
unsigned int elecID_,
int iRing_);
113 void dumpCalibToTree(TTree * tree,
int rawid_,
int ix_,
int iy_,
int iz_,
unsigned int elecID_,
int iRing_)
const;
115 bool isStableInEnergy(
float min,
float max,
float step, std::vector< std::pair<float, EcalCrystalTimingCalibration*> > &ret);
124 if(!storeEvent) _storingEvents =
false;
void calcAllWithinNSigma(float n_sigma, float maxRange=10) const
calculate sum, sum2, sum3, n for time if time within n x stdDev and store the result ...
Definition: EcalCrystalTimingCalibration.cc:43
float getMeanWithinNSigma(float sigma, float maxRange) const
average Energy (mean of the Energy distribution)
Definition: EcalCrystalTimingCalibration.cc:11
bool isStableInEnergy(float min, float max, float step, std::vector< std::pair< float, EcalCrystalTimingCalibration * > > &ret)
checks if the time measurement is stable changing the min energy threshold
Definition: EcalCrystalTimingCalibration.cc:76
float getNumWithinNSigma(float sigma, float maxRange) const
returns the num calculated within abs(mean+ n * stdDev) to reject tails
Definition: EcalCrystalTimingCalibration.cc:4
float getStdDevWithinNSigma(float sigma, float maxRange) const
returns the stdDev calculated within abs(mean+ n * stdDev) to reject tails
Definition: EcalCrystalTimingCalibration.cc:18
Definition: EcalTimingEvent.h:16
EcalCrystalTimingCalibration(bool weightMean=true)
default constructor
Definition: EcalCrystalTimingCalibration.h:44
float _sumE
scalar sum of the energy of each timingEvent: needed for average energy
Definition: EcalCrystalTimingCalibration.h:31
void dumpCalibToTree(TTree *tree, int rawid_, int ix_, int iy_, int iz_, unsigned int elecID_, int iRing_) const
Definition: EcalCrystalTimingCalibration.cc:116
float _sum2
scalar sum of the square of the time of each timingEvent
Definition: EcalCrystalTimingCalibration.h:28
float getSkewnessWithinNSigma(float sigma, float maxRange) const
returns the skewness calculated within abs(mean+ n * stdDev) to reject tails
Definition: EcalCrystalTimingCalibration.cc:32
std::vector< EcalTimingEvent > timingEvents
vector containing all the events for this crystal
Definition: EcalCrystalTimingCalibration.h:38
std::map< float, float > _sumEWithinNSigma
variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails) ...
Definition: EcalCrystalTimingCalibration.h:34
float time() const
Time is stored in a int16_t in ps. time() returns a float in ns.
Definition: EcalTimingEvent.h:37
bool add(EcalTimingEvent te_, bool storeEvent=true)
add new event for this crystal
Definition: EcalCrystalTimingCalibration.h:94
float stdDev() const
average time (mean of the time distribution)
Definition: EcalCrystalTimingCalibration.h:61
Definition: EcalCrystalTimingCalibration.h:19
float getMeanErrorWithinNSigma(float sigma, float maxRange) const
returns the error on the mean calculated within abs(mean+ n * stdDev) to reject tails ...
Definition: EcalCrystalTimingCalibration.cc:25
void dumpToTree(TTree *tree, int ix_, int iy_, int iz_, unsigned int status_, unsigned int elecID_, int iRing_)
dump the full set of events in a TTree: need an empty tree
Definition: EcalCrystalTimingCalibration.cc:175
unsigned long int _num
number of timingEvents;
Definition: EcalCrystalTimingCalibration.h:29
float _sum
scalar sum of the time of each timingEvent
Definition: EcalCrystalTimingCalibration.h:27
std::map< float, unsigned int > _numWithinNSigma
variables for calculation of mean, stdDev within n-times the origina stdDev (to remove tails) ...
Definition: EcalCrystalTimingCalibration.h:35
float energy() const
Energy is stored in a uint16_t in 10's of MeV. energy() returns a float in GeV.
Definition: EcalTimingEvent.h:39
bool insertEvent(EcalTimingEvent te_, bool storeEvent)
Definition: EcalCrystalTimingCalibration.h:122