CMS 3D CMS Logo

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 fiducialCuts ()
 
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::MuonResidualsTwoBin ( bool  twoBin,
MuonResidualsFitter pos,
MuonResidualsFitter neg 
)
inline

Definition at line 17 of file MuonResidualsTwoBin.h.

18  : m_twoBin(twoBin), m_pos(pos), m_neg(neg) {}
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
tuple twoBin
Definition: align_cfg.py:29

◆ ~MuonResidualsTwoBin()

MuonResidualsTwoBin::~MuonResidualsTwoBin ( )
inline

Definition at line 19 of file MuonResidualsTwoBin.h.

References m_neg, and m_pos.

19  {
20  if (m_pos != nullptr)
21  delete m_pos;
22  if (m_neg != nullptr)
23  delete m_neg;
24  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos

Member Function Documentation

◆ antisym()

double MuonResidualsTwoBin::antisym ( int  parNum)
inline

Definition at line 78 of file MuonResidualsTwoBin.h.

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

78 { return (m_twoBin ? ((m_pos->value(parNum) - m_neg->value(parNum)) / 2.) : 0.); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
double value(int parNum)

◆ correctBField()

void MuonResidualsTwoBin::correctBField ( )
inline

Definition at line 240 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::correctBField(), and m_pos.

Referenced by MuonAlignmentFromReference::correctBField().

240  {
241  m_pos->correctBField();
242  //if (m_twoBin) m_neg->correctBField();
243  };
MuonResidualsFitter * m_pos
virtual void correctBField()=0

◆ eraseNotSelectedResiduals()

void MuonResidualsTwoBin::eraseNotSelectedResiduals ( )
inline

◆ errorerror()

double MuonResidualsTwoBin::errorerror ( int  parNum)
inline

Definition at line 74 of file MuonResidualsTwoBin.h.

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

74  {
75  return (m_twoBin ? (sqrt(pow(m_pos->errorerror(parNum), 2.) + pow(m_neg->errorerror(parNum), 2.)) / 2.)
76  : m_pos->errorerror(parNum));
77  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
T sqrt(T t)
Definition: SSEVec.h:23
double errorerror(int parNum)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ fiducialCuts()

void MuonResidualsTwoBin::fiducialCuts ( )
inline

Definition at line 245 of file MuonResidualsTwoBin.h.

References MuonResidualsFitter::fiducialCuts(), and m_pos.

Referenced by MuonAlignmentFromReference::fiducialCuts().

245 { m_pos->fiducialCuts(); };
MuonResidualsFitter * m_pos
void fiducialCuts(double xMin=-80.0, double xMax=80.0, double yMin=-80.0, double yMax=80.0, bool fidcut1=false)

◆ fill()

void MuonResidualsTwoBin::fill ( char  charge,
double *  residual 
)
inline

Definition at line 63 of file MuonResidualsTwoBin.h.

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

63  {
64  if (!m_twoBin || charge > 0)
65  m_pos->fill(residual);
66  else
67  m_neg->fill(residual);
68  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void fill(double *residual)

◆ fit()

bool MuonResidualsTwoBin::fit ( Alignable ali)
inline

Definition at line 70 of file MuonResidualsTwoBin.h.

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

Referenced by trackingPlots.Iteration::modules().

70 { return (m_twoBin ? (m_pos->fit(ali) && m_neg->fit(ali)) : m_pos->fit(ali)); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual bool fit(Alignable *ali)=0

◆ fix()

void MuonResidualsTwoBin::fix ( int  parNum,
bool  value = true 
)
inline

Definition at line 46 of file MuonResidualsTwoBin.h.

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

46  {
47  m_pos->fix(parNum, value);
48  m_neg->fix(parNum, value);
49  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void fix(int parNum, bool dofix=true)
Definition: value.py:1

◆ fixed()

bool MuonResidualsTwoBin::fixed ( int  parNum)
inline

Definition at line 51 of file MuonResidualsTwoBin.h.

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

51 { return m_pos->fixed(parNum) && m_neg->fixed(parNum); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos

◆ loglikelihood()

double MuonResidualsTwoBin::loglikelihood ( )
inline

Definition at line 79 of file MuonResidualsTwoBin.h.

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

79  {
81  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos

◆ mean()

double MuonResidualsTwoBin::mean ( int  which,
double  truncate 
)
inline

Definition at line 134 of file MuonResidualsTwoBin.h.

References m_twoBin, create_idmaps::n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), HLT_2024v14_cff::truncate, value(), and eostools::which().

134  {
135  double sum = 0.;
136  double n = 0.;
137  for (std::vector<double *>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
138  double value = (*r)[which];
139  if (fabs(value) < truncate) {
140  sum += value;
141  n += 1.;
142  }
143  }
144  if (m_twoBin) {
145  for (std::vector<double *>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
146  double value = (*r)[which];
147  if (fabs(value) < truncate) {
148  sum += value;
149  n += 1.;
150  }
151  }
152  }
153  return sum / n;
154  };
double value(int parNum)
std::vector< double * >::const_iterator residualsNeg_begin() const
Definition: value.py:1
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsPos_begin() const
std::vector< double * >::const_iterator residualsPos_end() const
def which(cmd)
Definition: eostools.py:336

◆ median()

double MuonResidualsTwoBin::median ( int  which)
inline

Definition at line 119 of file MuonResidualsTwoBin.h.

References m_twoBin, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), jetUpdater_cfi::sort, and eostools::which().

119  {
120  std::vector<double> residuals;
121  for (std::vector<double *>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
122  residuals.push_back((*r)[which]);
123  }
124  if (m_twoBin) {
125  for (std::vector<double *>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
126  residuals.push_back((*r)[which]);
127  }
128  }
129  std::sort(residuals.begin(), residuals.end());
130  int length = residuals.size();
131  return residuals[length / 2];
132  };
std::vector< double * >::const_iterator residualsNeg_begin() const
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsPos_begin() const
std::vector< double * >::const_iterator residualsPos_end() const
def which(cmd)
Definition: eostools.py:336

◆ ndata()

int MuonResidualsTwoBin::ndata ( )
inline

Definition at line 36 of file MuonResidualsTwoBin.h.

References cms::cuda::assert(), m_neg, m_pos, and MuonResidualsFitter::ndata().

36  {
37  assert(m_pos->ndata() == m_neg->ndata());
38  return m_pos->ndata();
39  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
assert(be >=bs)
virtual int ndata()=0

◆ npar()

int MuonResidualsTwoBin::npar ( )
inline

Definition at line 32 of file MuonResidualsTwoBin.h.

References cms::cuda::assert(), m_neg, m_pos, and MuonResidualsFitter::npar().

32  {
33  assert(m_pos->npar() == m_neg->npar());
34  return m_pos->npar();
35  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual int npar()=0
assert(be >=bs)

◆ numResidualsNeg()

long MuonResidualsTwoBin::numResidualsNeg ( ) const
inline

Definition at line 31 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::numResiduals().

31 { return m_neg->numResiduals(); };
MuonResidualsFitter * m_neg

◆ numResidualsPos()

long MuonResidualsTwoBin::numResidualsPos ( ) const
inline

Definition at line 30 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::numResiduals().

30 { return m_pos->numResiduals(); };
MuonResidualsFitter * m_pos

◆ numsegments()

double MuonResidualsTwoBin::numsegments ( )
inline

Definition at line 82 of file MuonResidualsTwoBin.h.

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

82 { return (m_twoBin ? (m_pos->numsegments() + m_neg->numsegments()) : m_pos->numsegments()); };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos

◆ plot()

double MuonResidualsTwoBin::plot ( std::string  name,
TFileDirectory dir,
Alignable ali 
)
inline

Definition at line 88 of file MuonResidualsTwoBin.h.

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

88  {
89  if (m_twoBin) {
90  std::string namePos = name + std::string("Pos");
91  std::string nameNeg = name + std::string("Neg");
92  double output = 0.;
93  output += m_pos->plot(namePos, dir, ali);
94  output += m_neg->plot(nameNeg, dir, ali);
95  return output;
96  } else {
97  return m_pos->plot(name, dir, ali);
98  }
99  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual double plot(std::string name, TFileDirectory *dir, Alignable *ali)=0
Definition: output.py:1

◆ plotsimple()

void MuonResidualsTwoBin::plotsimple ( std::string  name,
TFileDirectory dir,
int  which,
double  multiplier 
)
inline

Definition at line 209 of file MuonResidualsTwoBin.h.

References DeadROC_duringRun::dir, m_neg, m_pos, m_twoBin, mergeVDriftHistosByStation::name, MuonResidualsFitter::plotsimple(), AlCaHLTBitMon_QueryRunRegistry::string, and eostools::which().

209  {
210  if (m_twoBin) {
211  std::string namePos = name + std::string("Pos");
212  std::string nameNeg = name + std::string("Neg");
213  m_pos->plotsimple(namePos, dir, which, multiplier);
214  m_neg->plotsimple(nameNeg, dir, which, multiplier);
215  } else {
216  m_pos->plotsimple(name, dir, which, multiplier);
217  }
218  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void plotsimple(std::string name, TFileDirectory *dir, int which, double multiplier)
def which(cmd)
Definition: eostools.py:336

◆ plotweighted()

void MuonResidualsTwoBin::plotweighted ( std::string  name,
TFileDirectory dir,
int  which,
int  whichredchi2,
double  multiplier 
)
inline

Definition at line 220 of file MuonResidualsTwoBin.h.

References DeadROC_duringRun::dir, m_neg, m_pos, m_twoBin, mergeVDriftHistosByStation::name, MuonResidualsFitter::plotweighted(), AlCaHLTBitMon_QueryRunRegistry::string, and eostools::which().

220  {
221  if (m_twoBin) {
222  std::string namePos = name + std::string("Pos");
223  std::string nameNeg = name + std::string("Neg");
224  m_pos->plotweighted(namePos, dir, which, whichredchi2, multiplier);
225  m_neg->plotweighted(nameNeg, dir, which, whichredchi2, multiplier);
226  } else {
227  m_pos->plotweighted(name, dir, which, whichredchi2, multiplier);
228  }
229  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void plotweighted(std::string name, TFileDirectory *dir, int which, int whichredchi2, double multiplier)
def which(cmd)
Definition: eostools.py:336

◆ read()

void MuonResidualsTwoBin::read ( FILE *  file,
int  which = 0 
)
inline

Definition at line 110 of file MuonResidualsTwoBin.h.

References geometryDiff::file, m_neg, m_pos, m_twoBin, MuonResidualsFitter::read(), and eostools::which().

Referenced by edmIntegrityCheck.PublishToFileSystem::get(), and MuonAlignmentFromReference::readTmpFiles().

110  {
111  if (m_twoBin) {
112  m_pos->read(file, 2 * which);
113  m_neg->read(file, 2 * which + 1);
114  } else {
115  m_pos->read(file, which);
116  }
117  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void read(FILE *file, int which=0)
def which(cmd)
Definition: eostools.py:336

◆ residualsModel()

int MuonResidualsTwoBin::residualsModel ( ) const
inline

Definition at line 26 of file MuonResidualsTwoBin.h.

References cms::cuda::assert(), m_neg, m_pos, and MuonResidualsFitter::residualsModel().

26  {
28  return m_pos->residualsModel();
29  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
assert(be >=bs)

◆ residualsNeg_begin()

std::vector<double *>::const_iterator MuonResidualsTwoBin::residualsNeg_begin ( ) const
inline

Definition at line 258 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::residuals_begin().

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

258 { return m_neg->residuals_begin(); };
MuonResidualsFitter * m_neg
std::vector< double * >::const_iterator residuals_begin() const

◆ residualsNeg_end()

std::vector<double *>::const_iterator MuonResidualsTwoBin::residualsNeg_end ( ) const
inline

Definition at line 259 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::residuals_end().

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

259 { return m_neg->residuals_end(); };
MuonResidualsFitter * m_neg
std::vector< double * >::const_iterator residuals_end() const

◆ residualsNeg_ok_begin()

std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_begin ( ) const
inline

Definition at line 263 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::selectedResidualsFlags().

263 { return m_neg->selectedResidualsFlags().begin(); };
MuonResidualsFitter * m_neg
std::vector< bool > & selectedResidualsFlags()

◆ residualsNeg_ok_end()

std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsNeg_ok_end ( ) const
inline

Definition at line 264 of file MuonResidualsTwoBin.h.

References m_neg, and MuonResidualsFitter::selectedResidualsFlags().

264 { return m_neg->selectedResidualsFlags().end(); };
MuonResidualsFitter * m_neg
std::vector< bool > & selectedResidualsFlags()

◆ residualsPos_begin()

std::vector<double *>::const_iterator MuonResidualsTwoBin::residualsPos_begin ( ) const
inline

Definition at line 256 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::residuals_begin().

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

256 { return m_pos->residuals_begin(); };
MuonResidualsFitter * m_pos
std::vector< double * >::const_iterator residuals_begin() const

◆ residualsPos_end()

std::vector<double *>::const_iterator MuonResidualsTwoBin::residualsPos_end ( ) const
inline

Definition at line 257 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::residuals_end().

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

257 { return m_pos->residuals_end(); };
MuonResidualsFitter * m_pos
std::vector< double * >::const_iterator residuals_end() const

◆ residualsPos_ok_begin()

std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_begin ( ) const
inline

Definition at line 261 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::selectedResidualsFlags().

Referenced by MuonAlignmentFromReference::fillNtuple().

261 { return m_pos->selectedResidualsFlags().begin(); };
MuonResidualsFitter * m_pos
std::vector< bool > & selectedResidualsFlags()

◆ residualsPos_ok_end()

std::vector<bool>::const_iterator MuonResidualsTwoBin::residualsPos_ok_end ( ) const
inline

Definition at line 262 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::selectedResidualsFlags().

262 { return m_pos->selectedResidualsFlags().end(); };
MuonResidualsFitter * m_pos
std::vector< bool > & selectedResidualsFlags()

◆ selectPeakResiduals()

void MuonResidualsTwoBin::selectPeakResiduals ( double  nsigma,
int  nvar,
int *  vars 
)
inline

Definition at line 231 of file MuonResidualsTwoBin.h.

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

Referenced by MuonAlignmentFromReference::selectResidualsPeaks().

231  {
232  if (m_twoBin) {
233  m_pos->selectPeakResiduals(nsigma, nvar, vars);
234  m_neg->selectPeakResiduals(nsigma, nvar, vars);
235  } else {
236  m_pos->selectPeakResiduals(nsigma, nvar, vars);
237  }
238  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void selectPeakResiduals(double nsigma, int nvar, int *vars)
vars
Definition: DeepTauIdBase.h:60

◆ setPrintLevel()

void MuonResidualsTwoBin::setPrintLevel ( int  printLevel) const
inline

Definition at line 53 of file MuonResidualsTwoBin.h.

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

53  {
54  m_pos->setPrintLevel(printLevel);
55  m_neg->setPrintLevel(printLevel);
56  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void setPrintLevel(int printLevel)

◆ setStrategy()

void MuonResidualsTwoBin::setStrategy ( int  strategy) const
inline

Definition at line 58 of file MuonResidualsTwoBin.h.

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

58  {
61  }
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void setStrategy(int strategy)
strategy
Definition: nnet_common.h:18

◆ stdev()

double MuonResidualsTwoBin::stdev ( int  which,
double  truncate 
)
inline

Definition at line 184 of file MuonResidualsTwoBin.h.

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

184  {
185  double sum2 = 0.;
186  double sum = 0.;
187  double n = 0.;
188  for (std::vector<double *>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
189  double value = (*r)[which];
190  if (fabs(value) < truncate) {
191  sum2 += value * value;
192  sum += value;
193  n += 1.;
194  }
195  }
196  if (m_twoBin) {
197  for (std::vector<double *>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
198  double value = (*r)[which];
199  if (fabs(value) < truncate) {
200  sum2 += value * value;
201  sum += value;
202  n += 1.;
203  }
204  }
205  }
206  return sqrt(sum2 / n - pow(sum / n, 2));
207  };
double value(int parNum)
std::vector< double * >::const_iterator residualsNeg_begin() const
T sqrt(T t)
Definition: SSEVec.h:23
Definition: value.py:1
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsPos_begin() const
std::vector< double * >::const_iterator residualsPos_end() const
def which(cmd)
Definition: eostools.py:336
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ sumofweights()

double MuonResidualsTwoBin::sumofweights ( )
inline

Definition at line 83 of file MuonResidualsTwoBin.h.

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

83  {
85  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
virtual double sumofweights()=0

◆ type()

int MuonResidualsTwoBin::type ( ) const
inline

Definition at line 40 of file MuonResidualsTwoBin.h.

References cms::cuda::assert(), m_neg, m_pos, and MuonResidualsFitter::type().

Referenced by MuonAlignmentFromReference::fillNtuple(), and MuonAlignmentFromReference::selectResidualsPeaks().

40  {
41  assert(m_pos->type() == m_neg->type());
42  return m_pos->type();
43  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
assert(be >=bs)
virtual int type() const =0

◆ useRes()

int MuonResidualsTwoBin::useRes ( ) const
inline

Definition at line 44 of file MuonResidualsTwoBin.h.

References m_pos, and MuonResidualsFitter::useRes().

Referenced by MuonAlignmentFromReference::selectResidualsPeaks().

44 { return m_pos->useRes(); };
MuonResidualsFitter * m_pos
int useRes(int pattern=-1)

◆ value()

double MuonResidualsTwoBin::value ( int  parNum)
inline

◆ wmean()

double MuonResidualsTwoBin::wmean ( int  which,
int  whichredchi2,
double  truncate 
)
inline

Definition at line 156 of file MuonResidualsTwoBin.h.

References m_twoBin, create_idmaps::n, alignCSCRings::r, residualsNeg_begin(), residualsNeg_end(), residualsPos_begin(), residualsPos_end(), HLT_2024v14_cff::truncate, value(), mps_merge::weight, and eostools::which().

156  {
157  double sum = 0.;
158  double n = 0.;
159  for (std::vector<double *>::const_iterator r = residualsPos_begin(); r != residualsPos_end(); ++r) {
160  double value = (*r)[which];
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;
165  n += weight;
166  }
167  }
168  }
169  if (m_twoBin) {
170  for (std::vector<double *>::const_iterator r = residualsNeg_begin(); r != residualsNeg_end(); ++r) {
171  double value = (*r)[which];
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;
176  n += weight;
177  }
178  }
179  }
180  }
181  return sum / n;
182  };
double value(int parNum)
Definition: weight.py:1
std::vector< double * >::const_iterator residualsNeg_begin() const
Definition: value.py:1
std::vector< double * >::const_iterator residualsNeg_end() const
std::vector< double * >::const_iterator residualsPos_begin() const
std::vector< double * >::const_iterator residualsPos_end() const
def which(cmd)
Definition: eostools.py:336

◆ write()

void MuonResidualsTwoBin::write ( FILE *  file,
int  which = 0 
)
inline

Definition at line 102 of file MuonResidualsTwoBin.h.

References geometryDiff::file, m_neg, m_pos, m_twoBin, eostools::which(), and MuonResidualsFitter::write().

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

102  {
103  if (m_twoBin) {
104  m_pos->write(file, 2 * which);
105  m_neg->write(file, 2 * which + 1);
106  } else {
107  m_pos->write(file, which);
108  }
109  };
MuonResidualsFitter * m_neg
MuonResidualsFitter * m_pos
void write(FILE *file, int which=0)
def which(cmd)
Definition: eostools.py:336

Member Data Documentation

◆ m_neg

MuonResidualsFitter * MuonResidualsTwoBin::m_neg
protected

◆ m_pos

MuonResidualsFitter* MuonResidualsTwoBin::m_pos
protected

◆ m_twoBin

bool MuonResidualsTwoBin::m_twoBin
protected