CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
MuonResidualsTwoBin Class Reference

#include <MuonResidualsTwoBin.h>

Public Member Functions

double antisym (int parNum)
 
void correctBField ()
 
void eraseNotSelectedResiduals ()
 
double errorerror (int parNum)
 
void fill (char charge, double *residual)
 
bool fit (Alignable *ali)
 
void fix (int parNum, bool value=true)
 
bool fixed (int parNum)
 
double loglikelihood ()
 
double mean (int which, double truncate)
 
double median (int which)
 
 MuonResidualsTwoBin (bool twoBin, MuonResidualsFitter *pos, MuonResidualsFitter *neg)
 
int ndata ()
 
int npar ()
 
long numResidualsNeg () const
 
long numResidualsPos () const
 
double numsegments ()
 
double plot (std::string name, TFileDirectory *dir, Alignable *ali)
 
void plotsimple (std::string name, TFileDirectory *dir, int which, double multiplier)
 
void plotweighted (std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
 
void read (FILE *file, int which=0)
 
int residualsModel () const
 
std::vector< double * >
::const_iterator 
residualsNeg_begin () const
 
std::vector< double * >
::const_iterator 
residualsNeg_end () const
 
std::vector< bool >::const_iterator residualsNeg_ok_begin () const
 
std::vector< bool >::const_iterator residualsNeg_ok_end () const
 
std::vector< double * >
::const_iterator 
residualsPos_begin () const
 
std::vector< double * >
::const_iterator 
residualsPos_end () const
 
std::vector< bool >::const_iterator residualsPos_ok_begin () const
 
std::vector< bool >::const_iterator residualsPos_ok_end () const
 
void selectPeakResiduals (double nsigma, int nvar, int *vars)
 
void setPrintLevel (int printLevel) const
 
void setStrategy (int strategy) const
 
double stdev (int which, double truncate)
 
double sumofweights ()
 
int type () const
 
int useRes () const
 
double value (int parNum)
 
double wmean (int which, int whichredchi2, double truncate)
 
void write (FILE *file, int which=0)
 
 ~MuonResidualsTwoBin ()
 

Protected Attributes

MuonResidualsFitterm_neg
 
MuonResidualsFitterm_pos
 
bool m_twoBin
 

Detailed Description

Date:
2011/04/15 21:51:13
Revision:
1.10
Author
J. Pivarski - Texas A&M University pivar.nosp@m.ski@.nosp@m.physi.nosp@m.cs.t.nosp@m.amu.e.nosp@m.du

Definition at line 15 of file MuonResidualsTwoBin.h.

Constructor & Destructor Documentation

MuonResidualsTwoBin::MuonResidualsTwoBin ( bool  twoBin,
MuonResidualsFitter pos,
MuonResidualsFitter neg 
)
inline

Definition at line 17 of file MuonResidualsTwoBin.h.

17 : m_twoBin(twoBin), m_pos(pos), m_neg(neg) {};
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
tuple twoBin
Definition: align_cfg.py:29
MuonResidualsTwoBin::~MuonResidualsTwoBin ( )
inline

Definition at line 18 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and NULL.

18  {
19  if (m_pos != NULL) delete m_pos;
20  if (m_neg != NULL) delete m_neg;
21  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
#define NULL
Definition: scimark2.h:8

Member Function Documentation

double MuonResidualsTwoBin::antisym ( int  parNum)
inline

Definition at line 64 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::value().

64  {
65  return (m_twoBin ? ((m_pos->value(parNum) - m_neg->value(parNum)) / 2.) : 0.);
66  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double value(int parNum)
void MuonResidualsTwoBin::correctBField ( )
inline

Definition at line 237 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::correctBField(), and m_pos.

Referenced by MuonAlignmentFromReference::correctBField().

238  {
239  m_pos->correctBField();
240  //if (m_twoBin) m_neg->correctBField();
241  };
MuonResidualsFitter * m_pos
virtual void correctBField()=0
void MuonResidualsTwoBin::eraseNotSelectedResiduals ( )
inline

Definition at line 243 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::eraseNotSelectedResiduals(), m_neg, m_pos, and m_twoBin.

Referenced by MuonAlignmentFromReference::eraseNotSelectedResiduals().

244  {
245  if (m_twoBin) {
248  }
249  else {
251  }
252  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double MuonResidualsTwoBin::errorerror ( int  parNum)
inline

Definition at line 61 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::errorerror(), m_neg, m_pos, m_twoBin, funct::pow(), and mathSSE::sqrt().

61  {
62  return (m_twoBin ? (sqrt(pow(m_pos->errorerror(parNum), 2.) + pow(m_neg->errorerror(parNum), 2.)) / 2.) : m_pos->errorerror(parNum));
63  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
T sqrt(T t)
Definition: SSEVec.h:48
double errorerror(int parNum)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void MuonResidualsTwoBin::fill ( char  charge,
double *  residual 
)
inline

Definition at line 50 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::fill(), m_neg, m_pos, and m_twoBin.

50  {
51  if (!m_twoBin || charge > 0) m_pos->fill(residual);
52  else m_neg->fill(residual);
53  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void fill(double *residual)
double charge(const std::vector< uint8_t > &Ampls)
bool MuonResidualsTwoBin::fit ( Alignable ali)
inline

Definition at line 55 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::fit(), m_neg, m_pos, and m_twoBin.

55  {
56  return (m_twoBin ? (m_pos->fit(ali) && m_neg->fit(ali)) : m_pos->fit(ali));
57  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual bool fit(Alignable *ali)=0
void MuonResidualsTwoBin::fix ( int  parNum,
bool  value = true 
)
inline

Definition at line 31 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::fix(), m_neg, m_pos, and value().

31  {
32  m_pos->fix(parNum, value);
33  m_neg->fix(parNum, value);
34  };
double value(int parNum)
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void fix(int parNum, bool val=true)
bool MuonResidualsTwoBin::fixed ( int  parNum)
inline

Definition at line 36 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::fixed(), m_neg, and m_pos.

36  {
37  return m_pos->fixed(parNum) && m_neg->fixed(parNum);
38  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
bool fixed(int parNum)
double MuonResidualsTwoBin::loglikelihood ( )
inline

Definition at line 67 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::loglikelihood(), m_neg, m_pos, and m_twoBin.

67  {
69  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double MuonResidualsTwoBin::mean ( int  which,
double  truncate 
)
inline

Definition at line 127 of file MuonResidualsTwoBin.h.

References m_twoBin, n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), and value().

127  {
128  double sum = 0.;
129  double n = 0.;
130  for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
131  double value = (*r)[which];
132  if (fabs(value) < truncate) {
133  sum += value;
134  n += 1.;
135  }
136  }
137  if (m_twoBin) {
138  for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
139  double value = (*r)[which];
140  if (fabs(value) < truncate) {
141  sum += value;
142  n += 1.;
143  }
144  }
145  }
146  return sum/n;
147  };
double value(int parNum)
std::vector< double * >::const_iterator residualsPos_end() const
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsNeg_begin() const
std::vector< double * >::const_iterator residualsPos_begin() const
double MuonResidualsTwoBin::median ( int  which)
inline

Definition at line 112 of file MuonResidualsTwoBin.h.

References m_twoBin, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), and python.multivaluedict::sort().

112  {
113  std::vector<double> residuals;
114  for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
115  residuals.push_back((*r)[which]);
116  }
117  if (m_twoBin) {
118  for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
119  residuals.push_back((*r)[which]);
120  }
121  }
122  std::sort(residuals.begin(), residuals.end());
123  int length = residuals.size();
124  return residuals[length/2];
125  };
std::vector< double * >::const_iterator residualsPos_end() const
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsNeg_begin() const
std::vector< double * >::const_iterator residualsPos_begin() const
int MuonResidualsTwoBin::ndata ( )
inline

Definition at line 27 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and MuonResidualsFitter::ndata().

27 { assert(m_pos->ndata() == m_neg->ndata()); return m_pos->ndata(); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual int ndata()=0
int MuonResidualsTwoBin::npar ( )
inline

Definition at line 26 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and MuonResidualsFitter::npar().

26 { assert(m_pos->npar() == m_neg->npar()); return m_pos->npar(); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual int npar()=0
long MuonResidualsTwoBin::numResidualsNeg ( ) const
inline

Definition at line 25 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::numResiduals().

25 { return m_neg->numResiduals(); };
MuonResidualsFitter * m_neg
long MuonResidualsTwoBin::numResidualsPos ( ) const
inline

Definition at line 24 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::numResiduals().

24 { return m_pos->numResiduals(); };
MuonResidualsFitter * m_pos
double MuonResidualsTwoBin::numsegments ( )
inline

Definition at line 70 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::numsegments().

70  {
71  return (m_twoBin ? (m_pos->numsegments() + m_neg->numsegments()) : m_pos->numsegments());
72  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double MuonResidualsTwoBin::plot ( std::string  name,
TFileDirectory dir,
Alignable ali 
)
inline

Definition at line 78 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, convertSQLitetoXML_cfg::output, MuonResidualsFitter::plot(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by cuy.FindIssue::__init__().

78  {
79  if (m_twoBin) {
80  std::string namePos = name + std::string("Pos");
81  std::string nameNeg = name + std::string("Neg");
82  double output = 0.;
83  output += m_pos->plot(namePos, dir, ali);
84  output += m_neg->plot(nameNeg, dir, ali);
85  return output;
86  }
87  else {
88  return m_pos->plot(name, dir, ali);
89  }
90  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual double plot(std::string name, TFileDirectory *dir, Alignable *ali)=0
void MuonResidualsTwoBin::plotsimple ( std::string  name,
TFileDirectory dir,
int  which,
double  multiplier 
)
inline

Definition at line 202 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, MuonResidualsFitter::plotsimple(), and AlCaHLTBitMon_QueryRunRegistry::string.

202  {
203  if (m_twoBin) {
204  std::string namePos = name + std::string("Pos");
205  std::string nameNeg = name + std::string("Neg");
206  m_pos->plotsimple(namePos, dir, which, multiplier);
207  m_neg->plotsimple(nameNeg, dir, which, multiplier);
208  }
209  else {
210  m_pos->plotsimple(name, dir, which, multiplier);
211  }
212  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void plotsimple(std::string name, TFileDirectory *dir, int which, double multiplier)
void MuonResidualsTwoBin::plotweighted ( std::string  name,
TFileDirectory dir,
int  which,
int  whichredchi2,
double  multiplier 
)
inline

Definition at line 214 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, MuonResidualsFitter::plotweighted(), and AlCaHLTBitMon_QueryRunRegistry::string.

214  {
215  if (m_twoBin) {
216  std::string namePos = name + std::string("Pos");
217  std::string nameNeg = name + std::string("Neg");
218  m_pos->plotweighted(namePos, dir, which, whichredchi2, multiplier);
219  m_neg->plotweighted(nameNeg, dir, which, whichredchi2, multiplier);
220  }
221  else {
222  m_pos->plotweighted(name, dir, which, whichredchi2, multiplier);
223  }
224  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
void MuonResidualsTwoBin::read ( FILE *  file,
int  which = 0 
)
inline
int MuonResidualsTwoBin::residualsModel ( ) const
inline

Definition at line 23 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and MuonResidualsFitter::residualsModel().

23 { assert(m_pos->residualsModel() == m_neg->residualsModel()); return m_pos->residualsModel(); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsNeg_begin ( ) const
inline

Definition at line 256 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::residuals_begin().

Referenced by mean(), median(), stdev(), and wmean().

256 { return m_neg->residuals_begin(); };
MuonResidualsFitter * m_neg
std::vector< double * >::const_iterator residuals_begin() const
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsNeg_end ( ) const
inline

Definition at line 257 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::residuals_end().

Referenced by mean(), median(), stdev(), and wmean().

257 { return m_neg->residuals_end(); };
MuonResidualsFitter * m_neg
std::vector< double * >::const_iterator residuals_end() const
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_begin ( ) const
inline

Definition at line 261 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::selectedResidualsFlags().

261 { return m_neg->selectedResidualsFlags().begin(); };
MuonResidualsFitter * m_neg
std::vector< bool > & selectedResidualsFlags()
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_end ( ) const
inline

Definition at line 262 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::selectedResidualsFlags().

262 { return m_neg->selectedResidualsFlags().end(); };
MuonResidualsFitter * m_neg
std::vector< bool > & selectedResidualsFlags()
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsPos_begin ( ) const
inline

Definition at line 254 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::residuals_begin().

Referenced by MuonAlignmentFromReference::fillNtuple(), mean(), median(), stdev(), and wmean().

254 { return m_pos->residuals_begin(); };
MuonResidualsFitter * m_pos
std::vector< double * >::const_iterator residuals_begin() const
std::vector<double*>::const_iterator MuonResidualsTwoBin::residualsPos_end ( ) const
inline

Definition at line 255 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::residuals_end().

Referenced by MuonAlignmentFromReference::fillNtuple(), mean(), median(), stdev(), and wmean().

255 { return m_pos->residuals_end(); };
MuonResidualsFitter * m_pos
std::vector< double * >::const_iterator residuals_end() const
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_begin ( ) const
inline

Definition at line 259 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::selectedResidualsFlags().

Referenced by MuonAlignmentFromReference::fillNtuple().

259 { return m_pos->selectedResidualsFlags().begin(); };
MuonResidualsFitter * m_pos
std::vector< bool > & selectedResidualsFlags()
std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_end ( ) const
inline

Definition at line 260 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::selectedResidualsFlags().

260 { return m_pos->selectedResidualsFlags().end(); };
MuonResidualsFitter * m_pos
std::vector< bool > & selectedResidualsFlags()
void MuonResidualsTwoBin::selectPeakResiduals ( double  nsigma,
int  nvar,
int *  vars 
)
inline

Definition at line 226 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::selectPeakResiduals().

Referenced by MuonAlignmentFromReference::selectResidualsPeaks().

227  {
228  if (m_twoBin) {
229  m_pos->selectPeakResiduals(nsigma, nvar, vars);
230  m_neg->selectPeakResiduals(nsigma, nvar, vars);
231  }
232  else {
233  m_pos->selectPeakResiduals(nsigma, nvar, vars);
234  }
235  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void selectPeakResiduals(double nsigma, int nvar, int *vars)
void MuonResidualsTwoBin::setPrintLevel ( int  printLevel) const
inline

Definition at line 40 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and MuonResidualsFitter::setPrintLevel().

40  {
41  m_pos->setPrintLevel(printLevel);
42  m_neg->setPrintLevel(printLevel);
43  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void setPrintLevel(int printLevel)
void MuonResidualsTwoBin::setStrategy ( int  strategy) const
inline

Definition at line 45 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, and MuonResidualsFitter::setStrategy().

45  {
46  m_pos->setStrategy(strategy);
47  m_neg->setStrategy(strategy);
48  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void setStrategy(int strategy)
double MuonResidualsTwoBin::stdev ( int  which,
double  truncate 
)
inline

Definition at line 177 of file MuonResidualsTwoBin.h.

References m_twoBin, n, funct::pow(), alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), mathSSE::sqrt(), and value().

177  {
178  double sum2 = 0.;
179  double sum = 0.;
180  double n = 0.;
181  for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
182  double value = (*r)[which];
183  if (fabs(value) < truncate) {
184  sum2 += value*value;
185  sum += value;
186  n += 1.;
187  }
188  }
189  if (m_twoBin) {
190  for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
191  double value = (*r)[which];
192  if (fabs(value) < truncate) {
193  sum2 += value*value;
194  sum += value;
195  n += 1.;
196  }
197  }
198  }
199  return sqrt(sum2/n - pow(sum/n, 2));
200  };
double value(int parNum)
std::vector< double * >::const_iterator residualsPos_end() const
std::vector< double * >::const_iterator residualsNeg_end() const
T sqrt(T t)
Definition: SSEVec.h:48
std::vector< double * >::const_iterator residualsNeg_begin() const
std::vector< double * >::const_iterator residualsPos_begin() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
double MuonResidualsTwoBin::sumofweights ( )
inline

Definition at line 73 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::sumofweights().

73  {
75  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual double sumofweights()=0
int MuonResidualsTwoBin::type ( ) const
inline
int MuonResidualsTwoBin::useRes ( ) const
inline

Definition at line 29 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::useRes().

Referenced by MuonAlignmentFromReference::selectResidualsPeaks().

29 { return m_pos->useRes(); };
MuonResidualsFitter * m_pos
double MuonResidualsTwoBin::value ( int  parNum)
inline

Definition at line 58 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::value().

Referenced by Types.int32::__nonzero__(), Types.uint32::__nonzero__(), Types.int64::__nonzero__(), Types.uint64::__nonzero__(), Types.double::__nonzero__(), Types.bool::__nonzero__(), Types.string::__nonzero__(), Vispa.Views.PropertyView.FileProperty::buttonClicked(), Types.string::configValue(), Types.FileInPath::configValue(), Mixins.UsingBlock::dumpPython(), fix(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Mixins.UsingBlock::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.FileInPath::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Vispa.Views.PropertyView.FileProperty::labelDoubleClicked(), mean(), stdev(), and wmean().

58  {
59  return (m_twoBin ? ((m_pos->value(parNum) + m_neg->value(parNum)) / 2.) : m_pos->value(parNum));
60  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double value(int parNum)
double MuonResidualsTwoBin::wmean ( int  which,
int  whichredchi2,
double  truncate 
)
inline

Definition at line 149 of file MuonResidualsTwoBin.h.

References m_twoBin, n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), value(), and histoStyle::weight.

149  {
150  double sum = 0.;
151  double n = 0.;
152  for (std::vector<double*>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
153  double value = (*r)[which];
154  if (fabs(value) < truncate) {
155  double weight = 1./(*r)[whichredchi2];
156  if (TMath::Prob(1./weight*12, 12) < 0.99) {
157  sum += weight*value;
158  n += weight;
159  }
160  }
161  }
162  if (m_twoBin) {
163  for (std::vector<double*>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
164  double value = (*r)[which];
165  if (fabs(value) < truncate) {
166  double weight = 1./(*r)[whichredchi2];
167  if (TMath::Prob(1./weight*12, 12) < 0.99) {
168  sum += weight*value;
169  n += weight;
170  }
171  }
172  }
173  }
174  return sum/n;
175  };
double value(int parNum)
std::vector< double * >::const_iterator residualsPos_end() const
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsNeg_begin() const
std::vector< double * >::const_iterator residualsPos_begin() const
int weight
Definition: histoStyle.py:50
void MuonResidualsTwoBin::write ( FILE *  file,
int  which = 0 
)
inline

Definition at line 93 of file MuonResidualsTwoBin.h.

References m_neg, m_pos, m_twoBin, and MuonResidualsFitter::write().

Referenced by pkg.AbstractPkg::generate(), and MuonAlignmentFromReference::writeTmpFiles().

93  {
94  if (m_twoBin) {
95  m_pos->write(file, 2*which);
96  m_neg->write(file, 2*which + 1);
97  }
98  else {
99  m_pos->write(file, which);
100  }
101  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void write(FILE *file, int which=0)

Member Data Documentation

MuonResidualsFitter * MuonResidualsTwoBin::m_neg
protected
MuonResidualsFitter* MuonResidualsTwoBin::m_pos
protected
bool MuonResidualsTwoBin::m_twoBin
protected