Auxiliary class for TileRawChannelMakerManyAmps.
More...
#include <TileFilterManager.h>
|
| TileFilterManager (int mode, int level, int &nPar, int &nSam, int &inTsam, int &jbsam, int &jesam, int &ncr, int &intcr, int &jBcr, int &jEcr, std::vector< double > &Shape, bool lDebug=false) |
|
| ~TileFilterManager () |
|
int | findHighestResidual (CLHEP::HepVector &digits) const |
|
int | findLowestCrossing (CLHEP::HepVector &digits) const |
|
int | fitDigits (TileFilterResult &tRes, bool lDebug=false) |
|
int | fitDigits1 (TileFilterResult &tRes, bool lDebug=false) |
|
int | fitDigits2 (TileFilterResult &tRes, bool lDebug=false) |
|
void | makeFitterOffsetTables () |
|
int | makeSPD (bool debug, std::vector< int > &vcross, CLHEP::HepMatrix &SPD) |
|
int | makeFitterArrays () |
|
void | getVcross (int nPile, int iconfig, std::vector< int > &vcross) |
|
void | getCuts (double &rchisq, double &chi) |
|
std::vector< int > & | getNfitIndex () |
|
int | getFitIndex (int nParam, std::vector< int > &vcross) |
|
std::vector< double > & | getFitterErr (int nParam, int iconfig) |
|
Auxiliary class for TileRawChannelMakerManyAmps.
Definition at line 33 of file TileFilterManager.h.
◆ TileFilterManager()
TileFilterManager::TileFilterManager |
( |
int |
mode, |
|
|
int |
level, |
|
|
int & |
nPar, |
|
|
int & |
nSam, |
|
|
int & |
inTsam, |
|
|
int & |
jbsam, |
|
|
int & |
jesam, |
|
|
int & |
ncr, |
|
|
int & |
intcr, |
|
|
int & |
jBcr, |
|
|
int & |
jEcr, |
|
|
std::vector< double > & |
Shape, |
|
|
bool |
lDebug = false |
|
) |
| |
Definition at line 24 of file TileFilterManager.cxx.
43 std::cout <<
" TileFilterManager constructor. NParamMax =" <<
m_nParamMax <<
", Ndig =" <<
m_nDig << std::endl;
63 std::cout <<
" Number of digits read =" <<
m_nDig <<
" . In-time digit has idig=" <<
m_inTdig <<
"." << std::endl;
65 for (
int icr = 0; icr <
m_nCross; icr++) {
76 std::cout <<
" Index =" <<
ind <<
" crossing # =" << icr <<
", displacement from InTdig =" << kdisp
77 <<
" crossings." << std::endl;
85 double * Xshape =
new double[
m_nDig];
86 for (
int idig = 0; idig <
m_nDig; idig++) {
87 int k = OffSet - icr + idig;
90 Xshape[idig] = Shape[
k];
96 boost::io::ios_base_all_saver coutsave(std::cout);
97 std::cout <<
" TileFilterManager: ShapingMatrix. Nshape=" <<
m_nShape <<
", InTshape=" <<
m_inTshape <<
", Ndig="
101 std::cout <<
" ind=" <<
ind <<
" Shape=";
102 for (
int idig = 0; idig <
m_nDig; idig++) {
103 std::cout <<
" " << std::setw(6) << std::setprecision(3) << Xshape[idig];
105 std::cout << std::endl;
111 std::vector<int> Crossings;
114 for (
int ipile = 0; ipile < NampMax; ipile++) {
117 std::cout <<
" Crossing configurations for Nparam=" << ipile + 2 <<
", Npileup=" << ipile <<
": " << Nmax
118 <<
" configurations." << std::endl;
119 for (
int iconfig = 0; iconfig < Nmax; iconfig++) {
122 int nParam = ipile + 2;
124 int ncr = Crossings.size();
126 std::cout <<
" Npile=" << std::setw(2) << ipile <<
", iconfig=" << std::setw(3) << iconfig <<
" (kF="
127 << std::setw(3) << kFitIndex <<
") => Vcross=";
128 for (
int icr = 0; icr < ncr; icr++) {
129 std::cout <<
" " << std::setw(3) << Crossings[icr];
131 std::cout << std::endl;
◆ ~TileFilterManager()
TileFilterManager::~TileFilterManager |
( |
| ) |
|
◆ findHighestResidual()
int TileFilterManager::findHighestResidual |
( |
CLHEP::HepVector & |
digits | ) |
const |
Definition at line 391 of file TileFilterManager.cxx.
393 double ampMax = -999.;
394 for (
int icr = 0; icr <
m_nCross; icr++) {
395 if (digits[icr] > ampMax) {
397 ampMax = digits[icr];
◆ findLowestCrossing()
int TileFilterManager::findLowestCrossing |
( |
CLHEP::HepVector & |
digits | ) |
const |
Definition at line 405 of file TileFilterManager.cxx.
407 double ampMin = +9999.;
408 for (
int icr = 0; icr <
m_nCross; icr++) {
410 if (digits[icr] < ampMin) {
412 ampMin = digits[icr];
◆ fitDigits()
int TileFilterManager::fitDigits |
( |
TileFilterResult & |
tRes, |
|
|
bool |
lDebug = false |
|
) |
| |
◆ fitDigits1()
int TileFilterManager::fitDigits1 |
( |
TileFilterResult & |
tRes, |
|
|
bool |
lDebug = false |
|
) |
| |
Definition at line 179 of file TileFilterManager.cxx.
183 CLHEP::HepVector& digits = tResult.getDigRef();
186 CLHEP::HepVector& residuals = tResult.getResidRef();
187 double& chisqRef = tResult.getChi2Ref();
188 int& Npar = tResult.getNparRef();
189 std::vector<int>& vcross = tResult.getVcrossRef();
190 int& iFitIndex = tResult.getFitIndexRef();
208 double rchisq = 999.;
210 double digSigma = tResult.getSigDig();
213 std::cout <<
" FilterManager.FitDigits1, while loop. Npar=" << Npar <<
", NParamMax=" <<
m_nParamMax << std::endl;
214 int iret = tResult.addCross(jparam);
223 std::vector<TileFitter>& vFitter =
m_vNpFitter[Npar - 2];
225 (void) tileFitter.
fitAmp(tResult,
false);
226 if (
m_debug) tResult.snapShot(2);
227 rchisq = chisqRef / (
m_nDig - Npar);
244 int Namp = vcross.size();
245 for (
int i = 1;
i < Namp;
i++) {
246 if (vcross[
i] == jparam) ldup =
true;
253 double chi = ((jcross < 0) ? 0.0 : residuals[jcross] / digSigma);
260 std::cout <<
" End of loop. icode =" << icode <<
", Npar=" << Npar << std::endl;
◆ fitDigits2()
int TileFilterManager::fitDigits2 |
( |
TileFilterResult & |
tRes, |
|
|
bool |
lDebug = false |
|
) |
| |
Definition at line 268 of file TileFilterManager.cxx.
273 CLHEP::HepVector& digits = tResult.getDigRef();
274 CLHEP::HepVector& fitAmp = tResult.getParamRef();
275 CLHEP::HepVector& fitErr = tResult.getErrRef();
277 double& chisqRef = tResult.getChi2Ref();
278 int& Npar = tResult.getNparRef();
280 std::vector<int>& vcross = tResult.getVcrossRef();
281 int& iFitIndex = tResult.getFitIndexRef();
283 boost::io::ios_base_all_saver coutsave(std::cout);
285 std::cout <<
" digits=";
287 std::cout <<
" " << std::setw(6) << std::setprecision(2) << digits[
i];
289 std::cout << std::endl;
294 for (
int iamp = 0; iamp < Namp; iamp++) {
295 tResult.addCross(iamp);
300 if (
m_debug) tResult.snapShot(0);
314 std::cout <<
" FilterManager.FitDigits2, while loop. Npar=" << Npar <<
", NParamMax=" <<
m_nParamMax << std::endl;
317 if (
m_debug) std::cout <<
" Npar=" << Npar <<
", iFitIndex=" << iFitIndex << std::endl;
318 std::vector<TileFitter>& vFitter =
m_vNpFitter[Npar - 2];
321 tileFitter.
fitAmp(tResult,
false);
322 if (
m_debug) tResult.snapShot(2);
332 double chiAmp[Ndim] = {0};
333 int iAmp[Ndim] = {0};
335 for (
int i = 2;
i < Npar;
i++) {
336 chiAmp[Npile] = fitAmp[
i] / fitErr[
i];
337 iAmp[Npile] = vcross[
i - 1];
339 std::cout <<
" set chiAmp: i=" <<
i <<
", iAmp=" << iAmp[Npile] <<
", chi=" << chiAmp[Npile] << std::endl;
345 while (ndrop < ndropMax) {
346 if (
m_debug) std::cout <<
" top of drop loop. ndrop=" << ndrop <<
", Npass=" << Npass << std::endl;
350 for (
int i = 0;
i < Npile;
i++) {
351 if (iAmp[
i] < 0)
continue;
352 if (chiAmp[
i] > chiMin)
continue;
358 std::cout <<
" end of Npile loop. idrop=" << idrop <<
", crdrop=" << crdrop <<
", ndrop=" << ndrop
361 tResult.dropCross(crdrop);
363 iAmp[idrop] = -iAmp[idrop];
366 std::cout <<
" ndrop=" << ndrop <<
", idrop=" << idrop <<
", crdrop=" << crdrop <<
", chiMin=" << chiMin
372 if (
m_debug) std::cout <<
"FitDig2: Npass=" << Npass <<
", ndrop=" << ndrop << std::endl;
374 if (
m_debug) std::cout <<
" have fallen out of drop loop. ndrop=" << ndrop <<
", Npass=" << Npass << std::endl;
382 std::cout <<
" TileFilterManager: End of pass loop. icode =" << icode <<
", Npar=" << Npar <<
", Npass=" << Npass
◆ getCuts()
void TileFilterManager::getCuts |
( |
double & |
rchisq, |
|
|
double & |
chi |
|
) |
| |
◆ getFitIndex()
int TileFilterManager::getFitIndex |
( |
int |
nParam, |
|
|
std::vector< int > & |
vcross |
|
) |
| |
Definition at line 603 of file TileFilterManager.cxx.
606 int Namp = nParam - 1;
608 std::cout <<
" TileFilterManager.getFitIndex called when Nparam=" << nParam << std::endl;
610 for (
int ipar = 0; ipar < Namp; ipar++) {
612 int jcr = vcross[ipar];
613 Index += Offset[jcr];
◆ getFitterErr()
std::vector< double > & TileFilterManager::getFitterErr |
( |
int |
nParam, |
|
|
int |
iconfig |
|
) |
| |
◆ getNfitIndex()
std::vector< int > & TileFilterManager::getNfitIndex |
( |
| ) |
|
◆ getVcross()
void TileFilterManager::getVcross |
( |
int |
nPile, |
|
|
int |
iconfig, |
|
|
std::vector< int > & |
vcross |
|
) |
| |
Definition at line 574 of file TileFilterManager.cxx.
577 int kconfig = iconfig;
579 for (
int ipile = nPileup; ipile > -1; ipile--) {
581 for (
int icross = icrmax; icross >= 0; icross--) {
584 if (Offset[icross] <= kconfig) {
587 kconfig = kconfig - Offset[icross];
588 vcross.push_back(icr);
592 std::cout <<
" ERROR!! In getVcross, kconfig=" << kconfig << std::endl;
596 sort(vcross.begin(), vcross.end());
◆ makeFitterArrays()
int TileFilterManager::makeFitterArrays |
( |
| ) |
|
Definition at line 525 of file TileFilterManager.cxx.
528 std::cout <<
" TileFilterManager::MakeFitterArrays. Will print out first matrix "
529 <<
"only for each vFitter vector (one for each value of Nparam)." << std::endl;
532 for (
int iamp = 0; iamp < NampMax; iamp++) {
533 int Nparam = iamp + 2;
536 std::cout <<
" ===> Nparam=" << Nparam <<
" => Nindex=" << Nindex <<
" TileFitter objects:" << std::endl;
537 std::vector<TileFitter> vFitter(Nindex);
541 std::vector<int> vcross;
543 CLHEP::HepMatrix SPD(Nparam,
m_nDig);
547 if (Nparam >
m_nDig - 1) Icon = 1;
548 if (Nparam >
m_nDig) Icon = 2;
550 vFitter[
index] = *tileFitter;
◆ makeFitterOffsetTables()
void TileFilterManager::makeFitterOffsetTables |
( |
| ) |
|
Definition at line 420 of file TileFilterManager.cxx.
424 int Npileup = NpileupMax;
426 std::cout <<
" Enter MakeFitterOffsetTables: Npileup=" << Npileup <<
", NampMax=" << NampMax <<
", Ncross="
447 for (
int ipile = 2; ipile < NampMax; ipile++) {
451 if (
index <= ipile) {
461 for (
int ipile = 0; ipile < NampMax; ipile++) {
464 if (ipile <= 1) Nmax = Offset[
m_nCross - 1] + 1;
474 std::cout <<
" *** TileFilter Offset table for Npileup=" << Npileup <<
" and Ncross=" <<
m_nCross << std::endl;
475 for (
int ipile = 0; ipile < NampMax; ipile++) {
477 std::cout <<
" ipile=" << std::setw(3) << ipile <<
": Offsets = ";
479 std::cout <<
" " << std::setw(3) << Offset[
index];
481 std::cout <<
"; NfitIndex=" << std::setw(3) <<
m_nFitIndex[ipile] << std::endl;
◆ makeSPD()
int TileFilterManager::makeSPD |
( |
bool |
debug, |
|
|
std::vector< int > & |
vcross, |
|
|
CLHEP::HepMatrix & |
SPD |
|
) |
| |
Definition at line 490 of file TileFilterManager.cxx.
492 int Namp = vcross.size();
493 int Nparam = Namp + 1;
495 for (
int idig = 0; idig <
m_nDig; idig++) {
499 for (
int ipar = 1; ipar < Nparam; ipar++) {
500 int jcr = vcross[ipar - 1];
502 for (
int idig = 0; idig <
m_nDig; idig++) {
503 SPD[ipar][idig] = Xshape[idig];
507 std::cout <<
" Make SPD for NP=" << Nparam <<
", vcross=";
508 for (
int iamp = 0; iamp < Namp; iamp++) {
509 std::cout <<
" " << vcross[iamp];
511 std::cout << std::endl;
512 for (
int ipar = 0; ipar < Nparam; ipar++) {
513 std::cout <<
" ip=" << ipar <<
" SPD=";
514 for (
int idig = 0; idig <
m_nDig; idig++) {
515 std::cout <<
" " << SPD[ipar][idig];
517 std::cout << std::endl;
◆ m_chiCut
double TileFilterManager::m_chiCut |
|
private |
◆ m_crossShape
std::vector<double *> TileFilterManager::m_crossShape |
|
private |
◆ m_debug
bool TileFilterManager::m_debug |
|
private |
◆ m_filterLevel
int TileFilterManager::m_filterLevel |
|
private |
◆ m_filterMode
int TileFilterManager::m_filterMode |
|
private |
◆ m_icr2indMap
int TileFilterManager::m_icr2indMap[9] |
|
private |
◆ m_ind2icrMap
int TileFilterManager::m_ind2icrMap[9] |
|
private |
◆ m_infoName
std::string TileFilterManager::m_infoName |
|
private |
◆ m_inTcross
int TileFilterManager::m_inTcross |
|
private |
◆ m_inTdig
int TileFilterManager::m_inTdig |
|
private |
◆ m_inTshape
int TileFilterManager::m_inTshape |
|
private |
◆ m_jBcross
int TileFilterManager::m_jBcross |
|
private |
◆ m_jBsamp
int TileFilterManager::m_jBsamp |
|
private |
◆ m_jEcross
int TileFilterManager::m_jEcross |
|
private |
◆ m_jEsamp
int TileFilterManager::m_jEsamp |
|
private |
◆ m_nCross
int TileFilterManager::m_nCross |
|
private |
◆ m_nDig
int TileFilterManager::m_nDig |
|
private |
◆ m_nFitIndex
std::vector<int> TileFilterManager::m_nFitIndex |
|
private |
◆ m_nParamMax
int TileFilterManager::m_nParamMax |
|
private |
◆ m_nShape
int TileFilterManager::m_nShape |
|
private |
◆ m_offsetVector
std::vector<int *> TileFilterManager::m_offsetVector |
|
private |
◆ m_rChi2Cut
double TileFilterManager::m_rChi2Cut |
|
private |
◆ m_vNparam
std::vector<TileFitter *> TileFilterManager::m_vNparam |
|
private |
◆ m_vNpFitter
std::vector<std::vector<TileFitter> > TileFilterManager::m_vNpFitter |
|
private |
The documentation for this class was generated from the following files: