#include <vector>
#include "QuadExpr.h"
Go to the source code of this file.
|
double | Metric (const std::vector< SpaceCharge * > &scs, double alpha) |
|
double | Metric (const std::vector< CollectionWireHit * > &cwires, double alpha) |
|
QuadExpr | Metric (const SpaceCharge *sci, const SpaceCharge *scj, double alpha) |
|
double | SolvePair (CollectionWireHit *cwire, SpaceCharge *sci, SpaceCharge *scj, double xmin, double xmax, double alpha) |
|
void | Iterate (CollectionWireHit *cwire, double alpha) |
|
void | Iterate (SpaceCharge *sc, double alpha) |
|
void | Iterate (const std::vector< CollectionWireHit * > &cwires, const std::vector< SpaceCharge * > &orphanSCs, double alpha) |
|
Definition at line 263 of file Solver.cxx.
268 for(
unsigned int i = 0; i+1 <
N; ++i){
271 for(
unsigned int j = i+1; j <
N; ++j){
void AddCharge(double dq)
std::vector< SpaceCharge * > fCrossings
double SolvePair(CollectionWireHit *cwire, SpaceCharge *sci, SpaceCharge *scj, double alpha)
Definition at line 286 of file Solver.cxx.
294 const double xmin = -sc->
fPred;
299 const double chisq_new = chisq.
Eval(x);
304 const double chisq_n = chisq.
Eval(xmin);
306 if(chisq_n < chisq_new)
void AddCharge(double dq)
double Metric(double q, double p)
static int max(int a, int b)
double Eval(double x) const
Definition at line 313 of file Solver.cxx.
319 unsigned int cwireIdx = 0;
320 if (!cwires.empty()){
324 const unsigned int prime = 1299827;
325 cwireIdx = (cwireIdx+prime)%cwires.size();
326 }
while(cwireIdx != 0);
void Iterate(CollectionWireHit *cwire, double alpha)
Definition at line 83 of file Solver.cxx.
87 std::set<InductionWireHit*> iwires;
89 if(sc->fWire1) iwires.insert(sc->fWire1);
90 if(sc->fWire2) iwires.insert(sc->fWire2);
96 ret -=
alpha * sc->fPred * sc->fNeiPotential;
101 ret +=
Metric(iwire->fCharge, iwire->fPred);
double Metric(double q, double p)
Definition at line 108 of file Solver.cxx.
110 std::vector<SpaceCharge*> scs;
112 scs.insert(scs.end(), cwire->fCrossings.begin(), cwire->fCrossings.end());
double Metric(double q, double p)
Definition at line 117 of file Solver.cxx.
125 const double scip = sci->
fPred;
126 const double scjp = scj->
fPred;
155 const double qi1 = iwire1 ? iwire1->
fCharge : 0;
156 const double pi1 = iwire1 ? iwire1->
fPred : 0;
158 const double qj1 = jwire1 ? jwire1->
fCharge : 0;
159 const double pj1 = jwire1 ? jwire1->
fPred : 0;
161 if(iwire1 == jwire1){
163 if(iwire1) ret +=
Metric(qi1, pi1);
166 if(iwire1) ret +=
Metric(qi1, pi1 + x);
167 if(jwire1) ret +=
Metric(qj1, pj1 - x);
173 const double qi2 = iwire2 ? iwire2->
fCharge : 0;
174 const double pi2 = iwire2 ? iwire2->
fPred : 0;
176 const double qj2 = jwire2 ? jwire2->
fCharge : 0;
177 const double pj2 = jwire2 ? jwire2->
fPred : 0;
179 if(iwire2 == jwire2){
180 if(iwire2) ret +=
Metric(qi2, pi2);
183 if(iwire2) ret +=
Metric(qi2, pi2 + x);
184 if(jwire2) ret +=
Metric(qj2, pj2 - x);
std::vector< Neighbour > fNeighbours
double fNeiPotential
Neighbour-induced potential.
InductionWireHit * fWire2
InductionWireHit * fWire1
double Metric(double q, double p)