1 #ifndef Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
2 #define Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
79 std::string namePos = name + std::string(
"Pos");
80 std::string nameNeg = name + std::string(
"Neg");
112 std::vector<double> residuals;
114 residuals.push_back((*
r)[which]);
118 residuals.push_back((*
r)[which]);
121 std::sort(residuals.begin(), residuals.end());
122 int length = residuals.size();
123 return residuals[length/2];
126 double mean(
int which,
double truncate) {
130 double value = (*r)[which];
131 if (fabs(value) < truncate) {
138 double value = (*r)[which];
139 if (fabs(value) < truncate) {
148 double wmean(
int which,
int whichredchi2,
double truncate) {
152 double value = (*r)[which];
153 if (fabs(value) < truncate) {
154 double weight = 1./(*r)[whichredchi2];
155 if (TMath::Prob(1./weight*12, 12) < 0.99) {
163 double value = (*r)[which];
164 if (fabs(value) < truncate) {
165 double weight = 1./(*r)[whichredchi2];
166 if (TMath::Prob(1./weight*12, 12) < 0.99) {
176 double stdev(
int which,
double truncate) {
181 double value = (*r)[which];
182 if (fabs(value) < truncate) {
190 double value = (*r)[which];
191 if (fabs(value) < truncate) {
198 return sqrt(sum2/n -
pow(sum/n, 2));
203 std::string namePos = name + std::string(
"Pos");
204 std::string nameNeg = name + std::string(
"Neg");
215 std::string namePos = name + std::string(
"Pos");
216 std::string nameNeg = name + std::string(
"Neg");
235 #endif // Alignment_MuonAlignmentAlgorithms_MuonResidualsTwoBin_H
double wmean(int which, int whichredchi2, double truncate)
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void fill(char charge, double *residual)
std::vector< double * >::const_iterator residualsPos_end() const
void write(FILE *file, int which=0)
long numResiduals() const
void fix(int parNum, bool value=true)
std::vector< double * >::const_iterator residualsNeg_end() const
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)
int residualsModel() const
int residualsModel() const
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
void write(FILE *file, int which=0)
double mean(int which, double truncate)
virtual double plot(std::string name, TFileDirectory *dir, Alignable *ali)=0
std::vector< double * >::const_iterator residualsNeg_begin() const
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
double errorerror(int parNum)
void read(FILE *file, int which=0)
std::vector< double * >::const_iterator residuals_end() const
long numResidualsNeg() const
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
double errorerror(int parNum)
void plotsimple(std::string name, TFileDirectory *dir, int which, double multiplier)
std::vector< double * >::const_iterator residualsPos_begin() const
void setPrintLevel(int printLevel)
std::vector< double * >::const_iterator residuals_begin() const
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)