1 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
2 #define Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
120 std::vector<double> residuals;
122 residuals.push_back((*
r)[which]);
126 residuals.push_back((*
r)[which]);
129 std::sort(residuals.begin(), residuals.end());
130 int length = residuals.size();
131 return residuals[length / 2];
139 if (fabs(value) < truncate) {
147 if (fabs(value) < truncate) {
161 if (fabs(value) < truncate) {
162 double weight = 1. / (*r)[whichredchi2];
163 if (TMath::Prob(1. / weight * 12, 12) < 0.99) {
164 sum += weight *
value;
172 if (fabs(value) < truncate) {
173 double weight = 1. / (*r)[whichredchi2];
174 if (TMath::Prob(1. / weight * 12, 12) < 0.99) {
175 sum += weight *
value;
190 if (fabs(value) < truncate) {
191 sum2 += value *
value;
199 if (fabs(value) < truncate) {
200 sum2 += value *
value;
206 return sqrt(sum2 / n -
pow(sum / n, 2));
271 #endif // Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
double wmean(int which, int whichredchi2, double truncate)
std::vector< double * >::const_iterator residualsPos_end() const
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
std::vector< double * >::const_iterator residualsPos_begin() const
std::vector< double * >::const_iterator residuals_begin() const
void selectPeakResiduals(double nsigma, int nvar, int *vars)
void fill(char charge, double *residual)
void write(FILE *file, int which=0)
long numResiduals() const
void eraseNotSelectedResiduals()
void read(FILE *file, int which=0)
void setPrintLevel(int printLevel) const
long numResidualsPos() const
double stdev(int which, double truncate)
virtual bool fit(Alignable *ali)=0
void fill(double *residual)
std::vector< bool >::const_iterator residualsPos_ok_end() const
std::vector< bool >::const_iterator residualsPos_ok_begin() const
int residualsModel() const
std::vector< bool >::const_iterator residualsNeg_ok_end() const
std::vector< bool >::const_iterator residualsNeg_ok_begin() const
int residualsModel() const
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
void fix(int parNum, bool dofix=true)
void write(FILE *file, int which=0)
double mean(int which, double truncate)
virtual void correctBField()=0
virtual double plot(std::string name, TFileDirectory *dir, Alignable *ali)=0
double antisym(int parNum)
MuonResidualsTwoBin(bool twoBin, MuonResidualsFitter *pos, MuonResidualsFitter *neg)
void plotsimple(std::string name, TFileDirectory *dir, int which, double multiplier)
void setStrategy(int strategy) const
void setStrategy(int strategy)
virtual double sumofweights()=0
void eraseNotSelectedResiduals()
double errorerror(int parNum)
void read(FILE *file, int which=0)
void fiducialCuts(double xMin=-80.0, double xMax=80.0, double yMin=-80.0, double yMax=80.0, bool fidcut1=false)
long numResidualsNeg() const
std::vector< double * >::const_iterator residualsNeg_begin() const
int useRes(int pattern=-1)
std::vector< bool > & selectedResidualsFlags()
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
double errorerror(int parNum)
std::vector< double * >::const_iterator residuals_end() const
void plotsimple(std::string name, TFileDirectory *dir, int which, double multiplier)
void setPrintLevel(int printLevel)
void selectPeakResiduals(double nsigma, int nvar, int *vars)
virtual int type() const =0
double plot(std::string name, TFileDirectory *dir, Alignable *ali)
void fix(int parNum, bool value=true)
Power< A, B >::type pow(const A &a, const B &b)
std::vector< double * >::const_iterator residualsNeg_end() const