ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TileFilterManager Class Reference

Auxiliary class for TileRawChannelMakerManyAmps. More...

#include <TileFilterManager.h>

Collaboration diagram for TileFilterManager:

Public Member Functions

 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)
 

Private Attributes

std::string m_infoName
 
int m_filterMode
 
int m_filterLevel
 
bool m_debug
 
int m_nParamMax
 
int m_nShape
 
int m_inTshape
 
int m_nDig
 
int m_inTdig
 
int m_jBsamp
 
int m_jEsamp
 
int m_nCross
 
int m_inTcross
 
int m_jBcross
 
int m_jEcross
 
double m_rChi2Cut
 
double m_chiCut
 
std::vector< int * > m_offsetVector
 
std::vector< int > m_nFitIndex
 
std::vector< double * > m_crossShape
 
int m_ind2icrMap [9]
 
int m_icr2indMap [9]
 
std::vector< TileFitter * > m_vNparam
 
std::vector< std::vector< TileFitter > > m_vNpFitter
 

Detailed Description

Auxiliary class for TileRawChannelMakerManyAmps.

Definition at line 33 of file TileFilterManager.h.

Constructor & Destructor Documentation

◆ 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.

26  : m_ind2icrMap(), m_icr2indMap() {
27  /* Store information needed for fitting. */
28 
29  m_debug = lDebug; // Stored as a private data member.
32  m_nParamMax = npMax;
33  m_nShape = nShape;
34  m_inTshape = inShape;
35  m_nDig = nSam;
36  m_inTdig = inTdig;
37  m_jBsamp = ibSam;
38  m_jEsamp = ieSam;
39  m_jBcross = bCr;
40  m_jEcross = eCr;
43  std::cout << " TileFilterManager constructor. NParamMax =" << m_nParamMax << ", Ndig =" << m_nDig << std::endl;
44 
45  // Parameters that should be read in externally.
46  m_rChi2Cut = 4.0;
47  m_chiCut = 3.5;
48  int NParamMin = 2;
49  std::cout << " FilterMode=" << m_filterMode << ", NParamMax=" << m_nParamMax << ", NParamMin=" << NParamMin
50  << ", chiCut=" << m_chiCut << ", rchisqCut=" << m_rChi2Cut << std::endl;
51  //
52  // Create the tables of offsets for calculating Fitter indices.
53 
55 
56  //
57  // Create the maps taking us from "digit number" idig to "crossing index" ind.
58  // "idig" corresponds to the array of digits which are read out, ranging from zero
59  // to Ndig, with the in-time digit defined by InTdig. It is more convenient for
60  // fitting to re-order these so that the index of the in-time crossing is zero,
61  // and the other are sequentially numbered 1,2,..., Ncr.
62  //
63  std::cout << " Number of digits read =" << m_nDig << " . In-time digit has idig=" << m_inTdig << "." << std::endl;
64  int ind = 0;
65  for (int icr = 0; icr < m_nCross; icr++) {
66  if (icr == m_inTdig) ind = 0;
67  if (icr < m_inTdig) ind = icr - m_jBcross + 1;
68  if (icr > m_inTdig) ind = icr - m_jBcross;
69  m_icr2indMap[icr] = ind;
70  m_ind2icrMap[ind] = icr;
71  }
72  if (m_debug) {
73  for (int ind = 0; ind < m_nCross; ind++) {
74  int icr = m_ind2icrMap[ind];
75  int kdisp = icr - m_inTdig;
76  std::cout << " Index =" << ind << " crossing # =" << icr << ", displacement from InTdig =" << kdisp
77  << " crossings." << std::endl;
78  }
79  }
80  /* Create the shaping matrix. Row = crossing (of deposit), col = digit. */
81  // std::vector<double> ShapeMat[Ncross][Ndig];
82  for (int ind = 0; ind < m_nCross; ind++) {
83  int icr = m_ind2icrMap[ind];
84  int OffSet = m_inTshape;
85  double * Xshape = new double[m_nDig];
86  for (int idig = 0; idig < m_nDig; idig++) {
87  int k = OffSet - icr + idig;
88  if (k < 0) k = 0;
89  if (k >= m_nShape) k = m_nShape - 1;
90  Xshape[idig] = Shape[k];
91  }
92  m_crossShape.push_back(Xshape);
93  }
94  /* Print out the Shape Matrix. */
95  if (m_debug) {
96  boost::io::ios_base_all_saver coutsave(std::cout);
97  std::cout << " TileFilterManager: ShapingMatrix. Nshape=" << m_nShape << ", InTshape=" << m_inTshape << ", Ndig="
98  << m_nDig << ", InTdig=" << m_inTdig << ", Ncross=" << m_nCross << std::endl;
99  for (int ind = 0; ind < m_nCross; ind++) {
100  double * Xshape = m_crossShape[ind];
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];
104  }
105  std::cout << std::endl;
106  }
107  }
108 
109  // vNparam.reserve(NParamMax);
110  //Print the FitterIndex arrays.
111  std::vector<int> Crossings;
112  //int NpileMax = NParamMax - 2;
113  int NampMax = m_nParamMax - 1;
114  for (int ipile = 0; ipile < NampMax; ipile++) {
115  int Nmax = m_nFitIndex[ipile];
116  if (m_debug)
117  std::cout << " Crossing configurations for Nparam=" << ipile + 2 << ", Npileup=" << ipile << ": " << Nmax
118  << " configurations." << std::endl;
119  for (int iconfig = 0; iconfig < Nmax; iconfig++) {
120  Crossings.clear();
121  getVcross(ipile, iconfig, Crossings);
122  int nParam = ipile + 2;
123  int kFitIndex = getFitIndex(nParam, Crossings);
124  int ncr = Crossings.size();
125  if (m_debug) {
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];
130  }
131  std::cout << std::endl;
132  }
133  }
134  }
135  // Make the Fitter Arrays
136  /* int iok = */makeFitterArrays();
137 
138  /* Initialization has successfully completed. */
139  // Set debug = false for execution phase.
140  m_debug = true;
141  return;
142 }

◆ ~TileFilterManager()

TileFilterManager::~TileFilterManager ( )

Definition at line 147 of file TileFilterManager.cxx.

147  {
148 
149  for (unsigned int ind = 0; ind < m_crossShape.size(); ++ind) {
150  delete[] m_crossShape[ind];
151  }
152 
153  for (unsigned int ind = 0; ind < m_offsetVector.size(); ++ind) {
154  delete[] m_offsetVector[ind];
155  }
156 }

Member Function Documentation

◆ findHighestResidual()

int TileFilterManager::findHighestResidual ( CLHEP::HepVector &  digits) const

Definition at line 391 of file TileFilterManager.cxx.

391  {
392  int icrMax = -1;
393  double ampMax = -999.;
394  for (int icr = 0; icr < m_nCross; icr++) {
395  if (digits[icr] > ampMax) {
396  icrMax = icr;
397  ampMax = digits[icr];
398  }
399  }
400  return icrMax;
401 }

◆ findLowestCrossing()

int TileFilterManager::findLowestCrossing ( CLHEP::HepVector &  digits) const

Definition at line 405 of file TileFilterManager.cxx.

405  {
406  int icrMin = -1;
407  double ampMin = +9999.;
408  for (int icr = 0; icr < m_nCross; icr++) {
409  if (icr == m_inTdig) continue;
410  if (digits[icr] < ampMin) {
411  icrMin = icr;
412  ampMin = digits[icr];
413  }
414  }
415  return icrMin;
416 }

◆ fitDigits()

int TileFilterManager::fitDigits ( TileFilterResult tRes,
bool  lDebug = false 
)

Definition at line 160 of file TileFilterManager.cxx.

160  {
161  int icode = -1;
162 
163  // std::cout << " FitDigits: Fmode=" << Fmode << ", lDebug=" << lDebug << std::endl;
164  if (m_filterMode == 2) {
165  icode = fitDigits1(tResult, lDebug);
166  return icode;
167  }
168  if (m_filterMode == 3) {
169  icode = fitDigits2(tResult, lDebug);
170  return icode;
171  }
172  std::cout << " ERROR in TileFitDigits !! Fmode =" << m_filterMode << std::endl;
173 
174  return icode;
175 }

◆ fitDigits1()

int TileFilterManager::fitDigits1 ( TileFilterResult tRes,
bool  lDebug = false 
)

Definition at line 179 of file TileFilterManager.cxx.

179  {
180  int icode = -1;
181  m_debug = lDebug;
182  // Get references to the key variable in tResult.
183  CLHEP::HepVector& digits = tResult.getDigRef();
184  //CLHEP::HepVector& fitAmp = tResult.getParamRef();
185  //CLHEP::HepVector& fitErr = tResult.getErrRef();
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();
191 
192  // First find crossing with highest amplitude.
193  int jcross = findHighestResidual(digits);
194  int jparam = ((jcross < 0) ? 0 : m_icr2indMap[jcross]);
195  // if(debug) std::cout << " Highest crossing = " << jcross << "(cind=" << jparam
196  // << "), amp=" << digits[jcross] << std::endl;
197 
198  // Initialize fitting parameters
199  Npar = 1;
200  iFitIndex = -1;
201  chisqRef = 999.;
202 
203  jparam = 0; // Set this to be intime crossing [FSM, 7/30/04]
204  // Include in-time crossing (jparam=0) in fit even if it is not the maximum.
205  //if(jparam != 0) iret = tResult.addCross(0);
206 
207  // Start loop over fits, adding a new parameter each time until reduced chisq is OK.
208  double rchisq = 999.;
209  icode = -1;
210  double digSigma = tResult.getSigDig();
211  while (Npar < m_nParamMax) {
212  if (m_debug)
213  std::cout << " FilterManager.FitDigits1, while loop. Npar=" << Npar << ", NParamMax=" << m_nParamMax << std::endl;
214  int iret = tResult.addCross(jparam);
215  if (iret != 0) {
216  icode = iret;
217  break;
218  }
219  // if(debug) tResult.SnapShot(0);
220  iFitIndex = getFitIndex(Npar, vcross);
221  // cppcheck-suppress negativeContainerIndex
222  // Npar is changed as a side-effect of calling addCross() above.
223  std::vector<TileFitter>& vFitter = m_vNpFitter[Npar - 2];
224  TileFitter& tileFitter = vFitter[iFitIndex];
225  (void) tileFitter.fitAmp(tResult, false);
226  if (m_debug) tResult.snapShot(2);
227  rchisq = chisqRef / (m_nDig - Npar);
228 
229  // Chisq is small enough, so the fit has been successful.
230  if (rchisq < m_rChi2Cut) {
231  icode = 0;
232  break;
233  }
234  // Have hit max param even though chisq is still big (problem!).
235  if (Npar == m_nParamMax) {
236  icode = 5;
237  break;
238  }
239  // Find index of the highest residual.
240  jcross = findHighestResidual(residuals);
241  jparam = ((jcross < 0) ? 0 : m_icr2indMap[jcross]);
242  // If jparam is already in list, terminate search (problem?).
243  bool ldup = false;
244  int Namp = vcross.size();
245  for (int i = 1; i < Namp; i++) {
246  if (vcross[i] == jparam) ldup = true;
247  }
248  if (ldup) {
249  icode = 4;
250  break;
251  }
252 
253  double chi = ((jcross < 0) ? 0.0 : residuals[jcross] / digSigma);
254  if (chi < m_chiCut) {
255  icode = 3;
256  break;
257  }
258  }
259  if (m_debug) {
260  std::cout << " End of loop. icode =" << icode << ", Npar=" << Npar << std::endl;
261  tResult.snapShot(1);
262  }
263  return icode;
264 }

◆ fitDigits2()

int TileFilterManager::fitDigits2 ( TileFilterResult tRes,
bool  lDebug = false 
)

Definition at line 268 of file TileFilterManager.cxx.

268  {
269  //int iret = -1;
270  int icode = 0;
271  m_debug = lDebug;
272  // Get references to the key variable in tResult.
273  CLHEP::HepVector& digits = tResult.getDigRef();
274  CLHEP::HepVector& fitAmp = tResult.getParamRef();
275  CLHEP::HepVector& fitErr = tResult.getErrRef();
276  //CLHEP::HepVector& residuals = tResult.getResidRef();
277  double& chisqRef = tResult.getChi2Ref();
278  int& Npar = tResult.getNparRef();
279  int Namp = Npar - 1;
280  std::vector<int>& vcross = tResult.getVcrossRef();
281  int& iFitIndex = tResult.getFitIndexRef();
282  if (m_debug) {
283  boost::io::ios_base_all_saver coutsave(std::cout);
284  // tResult.SnapShot(0);
285  std::cout << " digits=";
286  for (int i = 0; i < m_nDig; i++) {
287  std::cout << " " << std::setw(6) << std::setprecision(2) << digits[i];
288  }
289  std::cout << std::endl;
290  }
291 
292  // Make a crossing vector that contains all allowed amplitudes.
293  Namp = m_filterLevel - 1;
294  for (int iamp = 0; iamp < Namp; iamp++) {
295  /*iret =*/tResult.addCross(iamp);
296  }
297 
298  //Namp and Npar could have changed. Npar is incremented by addCross.
299  Namp = Npar - 1;
300  if (m_debug) tResult.snapShot(0);
301 
302  // Initialize fitting parameters
303  iFitIndex = -1;
304  chisqRef = 999.;
305 
306  // Start loop over fits, removing one or more amplitudes each time.
307  // double rchisq = 999.;
308  icode = -1;
309 
310  int Npass = 0;
311  while (Npar > 1) {
312  Npass += 1;
313  if (m_debug)
314  std::cout << " FilterManager.FitDigits2, while loop. Npar=" << Npar << ", NParamMax=" << m_nParamMax << std::endl;
315  // if(debug) tResult.SnapShot(0);
316  iFitIndex = getFitIndex(Npar, vcross);
317  if (m_debug) std::cout << " Npar=" << Npar << ", iFitIndex=" << iFitIndex << std::endl;
318  std::vector<TileFitter>& vFitter = m_vNpFitter[Npar - 2];
319  TileFitter& tileFitter = vFitter[iFitIndex];
320  // if(debug) std::cout << " Ready to call tileFitter.FitAmp" << std::endl;
321  /*iret =*/tileFitter.fitAmp(tResult, false);
322  if (m_debug) tResult.snapShot(2);
323  // If Npar is down to 2 parameters (ped + inTime), terminate fitting search.
324  if (Npar <= 2) {
325  icode = 3;
326  break;
327  }
328 
329  // Calculate significance chi of each fit parameter..
330  // double chiCutLow[4] = {chiCut, 1.50, 0.75, 0.};
331  const int Ndim = 12;
332  double chiAmp[Ndim] = {0};
333  int iAmp[Ndim] = {0};
334  int Npile = 0;
335  for (int i = 2; i < Npar; i++) {
336  chiAmp[Npile] = fitAmp[i] / fitErr[i];
337  iAmp[Npile] = vcross[i - 1];
338  if (m_debug)
339  std::cout << " set chiAmp: i=" << i << ", iAmp=" << iAmp[Npile] << ", chi=" << chiAmp[Npile] << std::endl;
340  Npile += 1;
341  }
342  int ndrop = 0;
343  int crdrop = 0;
344  int ndropMax = 4;
345  while (ndrop < ndropMax) {
346  if (m_debug) std::cout << " top of drop loop. ndrop=" << ndrop << ", Npass=" << Npass << std::endl;
347  double chiMin = m_chiCut;
348  // chiMin = chiCutLow[ndrop];
349  int idrop = -1;
350  for (int i = 0; i < Npile; i++) {
351  if (iAmp[i] < 0) continue;
352  if (chiAmp[i] > chiMin) continue;
353  chiMin = chiAmp[i];
354  idrop = i;
355  crdrop = iAmp[i];
356  }
357  if (m_debug)
358  std::cout << " end of Npile loop. idrop=" << idrop << ", crdrop=" << crdrop << ", ndrop=" << ndrop
359  << std::endl;
360  if (idrop > -1) {
361  /*iret =*/tResult.dropCross(crdrop);
362  ndrop += 1;
363  iAmp[idrop] = -iAmp[idrop];
364  icode = 1;
365  if (m_debug)
366  std::cout << " ndrop=" << ndrop << ", idrop=" << idrop << ", crdrop=" << crdrop << ", chiMin=" << chiMin
367  << std::endl;
368  } else {
369  icode = 6;
370  break;
371  }
372  if (m_debug) std::cout << "FitDig2: Npass=" << Npass << ", ndrop=" << ndrop << std::endl;
373  } // end of ndrop loop
374  if (m_debug) std::cout << " have fallen out of drop loop. ndrop=" << ndrop << ", Npass=" << Npass << std::endl;
375  if (ndrop == 0) {
376  icode = 0;
377  break;
378  }
379  } // end of while loop
380 
381  if (m_debug) {
382  std::cout << " TileFilterManager: End of pass loop. icode =" << icode << ", Npar=" << Npar << ", Npass=" << Npass
383  << std::endl;
384  tResult.snapShot(2);
385  }
386  return icode;
387 }

◆ getCuts()

void TileFilterManager::getCuts ( double &  rchisq,
double &  chi 
)

Definition at line 566 of file TileFilterManager.cxx.

566  {
567  rchisqC = m_rChi2Cut;
568  chiC = m_chiCut;
569  return;
570 }

◆ getFitIndex()

int TileFilterManager::getFitIndex ( int  nParam,
std::vector< int > &  vcross 
)

Definition at line 603 of file TileFilterManager.cxx.

603  {
604 
605  int Index = 0;
606  int Namp = nParam - 1;
607  if (Namp <= 0) {
608  std::cout << " TileFilterManager.getFitIndex called when Nparam=" << nParam << std::endl;
609  }
610  for (int ipar = 0; ipar < Namp; ipar++) {
611  int * Offset = m_offsetVector[ipar];
612  int jcr = vcross[ipar];
613  Index += Offset[jcr];
614  }
615 
616  // if(debug) {
617  // std::cout << " getFitIndex: Nparam=" << Nparam << ", Index=" << Index
618  // << ", Vcross=";
619  // for(int ipar=0; ipar<Namp; ipar++) {
620  // std::cout << " " << vcross[ipar];
621  // }
622  // std::cout << std::endl;
623  // }
624 
625  return Index;
626 }

◆ getFitterErr()

std::vector< double > & TileFilterManager::getFitterErr ( int  nParam,
int  iconfig 
)

Definition at line 630 of file TileFilterManager.cxx.

630  {
631  int ipile = nParam - 2;
632  std::vector<TileFitter>& vFitter = m_vNpFitter[ipile];
633  TileFitter& tileFitter = vFitter[iconfig];
634  std::vector<double>& fitErr = tileFitter.getErr();
635  return fitErr;
636 }

◆ getNfitIndex()

std::vector< int > & TileFilterManager::getNfitIndex ( )

Definition at line 560 of file TileFilterManager.cxx.

560  {
561  return m_nFitIndex;
562 }

◆ getVcross()

void TileFilterManager::getVcross ( int  nPile,
int  iconfig,
std::vector< int > &  vcross 
)

Definition at line 574 of file TileFilterManager.cxx.

574  {
575 
576  vcross.clear();
577  int kconfig = iconfig;
578  int icrmax = m_nCross - 1;
579  for (int ipile = nPileup; ipile > -1; ipile--) {
580  int * Offset = m_offsetVector[ipile];
581  for (int icross = icrmax; icross >= 0; icross--) {
582  // std::cout << "icross=" << icross << ", Offset[icross]=" << Offset[icross]
583  // << ", kconfig=" << kconfig << ", icrmax=" << icrmax << std::endl;
584  if (Offset[icross] <= kconfig) {
585  int icr = icross;
586  icrmax = icross - 1;
587  kconfig = kconfig - Offset[icross];
588  vcross.push_back(icr);
589  break;
590  }
591  if (kconfig < 0) {
592  std::cout << " ERROR!! In getVcross, kconfig=" << kconfig << std::endl;
593  }
594  }
595  }
596  sort(vcross.begin(), vcross.end());
597 
598  return;
599 }

◆ makeFitterArrays()

int TileFilterManager::makeFitterArrays ( )

Definition at line 525 of file TileFilterManager.cxx.

525  {
526 
527  if (m_debug)
528  std::cout << " TileFilterManager::MakeFitterArrays. Will print out first matrix "
529  << "only for each vFitter vector (one for each value of Nparam)." << std::endl;
530  bool cdebug = false;
531  int NampMax = m_nParamMax - 1;
532  for (int iamp = 0; iamp < NampMax; iamp++) {
533  int Nparam = iamp + 2; // number of parameters in this series of fits.
534  int Nindex = m_nFitIndex[iamp]; // number of configurations for this Nparam.
535  if (m_debug)
536  std::cout << " ===> Nparam=" << Nparam << " => Nindex=" << Nindex << " TileFitter objects:" << std::endl;
537  std::vector<TileFitter> vFitter(Nindex);
538  for (int index = 0; index < Nindex; index++) {
539  // if(debug) cdebug = (index==0)||(index==Nindex-1);
540  if (m_debug) cdebug = (index == Nindex - 1);
541  std::vector<int> vcross;
542  getVcross(iamp, index, vcross);
543  CLHEP::HepMatrix SPD(Nparam, m_nDig);
544  makeSPD(cdebug, vcross, SPD); // fill the matrix elements
545  // If constraints are needed, set Icon.
546  int Icon = 0;
547  if (Nparam > m_nDig - 1) Icon = 1;
548  if (Nparam > m_nDig) Icon = 2;
549  TileFitter * tileFitter = new TileFitter(cdebug, Nparam, m_nDig, index, SPD, Icon);
550  vFitter[index] = *tileFitter;
551  delete tileFitter;
552  }
553  m_vNpFitter.push_back(vFitter);
554  }
555  return 0;
556 }

◆ makeFitterOffsetTables()

void TileFilterManager::makeFitterOffsetTables ( )

Definition at line 420 of file TileFilterManager.cxx.

420  {
421 
422  int NpileupMax = m_nParamMax - 2;
423  int NampMax = m_nParamMax - 1;
424  int Npileup = NpileupMax;
425  if (m_debug)
426  std::cout << " Enter MakeFitterOffsetTables: Npileup=" << Npileup << ", NampMax=" << NampMax << ", Ncross="
427  << m_nCross << std::endl;
428 //For ipileup=0 (special case), offset = index of crossing.
429  int * Offset0 = new int[m_nCross];
430  for (int index = 0; index < m_nCross; index++) {
431  Offset0[index] = index;
432  }
433  m_offsetVector.push_back(Offset0);
434  //
435  //For ipileup=1, number offsets sequentially starting with zero for index=1.
436  int * Offset1 = new int[m_nCross];
437  for (int index = 0; index < m_nCross; index++) {
438  if (index < 2)
439  Offset1[index] = 0;
440  else
441  Offset1[index] = index - 1;
442  }
443  m_offsetVector.push_back(Offset1);
444 
445  // For Npileup>1, use iterative formula (offsets = coeff of binary expansion)
446  if (NampMax > 2) {
447  for (int ipile = 2; ipile < NampMax; ipile++) {
448  int * vlast = m_offsetVector[ipile - 1];
449  int * Offset = new int[m_nCross];
450  for (int index = 0; index < m_nCross; index++) {
451  if (index <= ipile) {
452  Offset[index] = 0;
453  } else {
454  Offset[index] = Offset[index - 1] + vlast[index - 1];
455  }
456  }
457  m_offsetVector.push_back(Offset);
458  }
459  }
460  // Find the number of FitIndex values for each number of parameters.
461  for (int ipile = 0; ipile < NampMax; ipile++) {
462  int Nmax;
463  int * Offset = m_offsetVector[ipile];
464  if (ipile <= 1) Nmax = Offset[m_nCross - 1] + 1;
465  if (ipile > 1) {
466  int * vlast = m_offsetVector[ipile - 1];
467  Nmax = Offset[m_nCross - 1] + vlast[m_nCross - 1];
468  }
469  m_nFitIndex.push_back(Nmax);
470  }
471 
472  // Print out the Offset table.
473  if (m_debug) {
474  std::cout << " *** TileFilter Offset table for Npileup=" << Npileup << " and Ncross=" << m_nCross << std::endl;
475  for (int ipile = 0; ipile < NampMax; ipile++) {
476  int * Offset = m_offsetVector[ipile];
477  std::cout << " ipile=" << std::setw(3) << ipile << ": Offsets = ";
478  for (int index = 0; index < m_nCross; index++) {
479  std::cout << " " << std::setw(3) << Offset[index];
480  }
481  std::cout << "; NfitIndex=" << std::setw(3) << m_nFitIndex[ipile] << std::endl;
482  }
483  }
484 
485  return;
486 }

◆ makeSPD()

int TileFilterManager::makeSPD ( bool  debug,
std::vector< int > &  vcross,
CLHEP::HepMatrix &  SPD 
)

Definition at line 490 of file TileFilterManager.cxx.

490  {
491  int iret = -1;
492  int Namp = vcross.size();
493  int Nparam = Namp + 1;
494  // First row of SPD is always for the pedestal.
495  for (int idig = 0; idig < m_nDig; idig++) {
496  SPD[0][idig] = 1.0;
497  }
498  // The remaining rows correspond to the crossing amplitudes specified by vcross.
499  for (int ipar = 1; ipar < Nparam; ipar++) {
500  int jcr = vcross[ipar - 1];
501  double * Xshape = m_crossShape[jcr];
502  for (int idig = 0; idig < m_nDig; idig++) {
503  SPD[ipar][idig] = Xshape[idig];
504  }
505  }
506  if (debugMakeSPD) {
507  std::cout << " Make SPD for NP=" << Nparam << ", vcross=";
508  for (int iamp = 0; iamp < Namp; iamp++) {
509  std::cout << " " << vcross[iamp];
510  }
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];
516  }
517  std::cout << std::endl;
518  }
519  } // end debugMakeSPD printout
520  return iret;
521 }

Member Data Documentation

◆ m_chiCut

double TileFilterManager::m_chiCut
private

Definition at line 103 of file TileFilterManager.h.

◆ m_crossShape

std::vector<double *> TileFilterManager::m_crossShape
private

Definition at line 107 of file TileFilterManager.h.

◆ m_debug

bool TileFilterManager::m_debug
private

Definition at line 90 of file TileFilterManager.h.

◆ m_filterLevel

int TileFilterManager::m_filterLevel
private

Definition at line 89 of file TileFilterManager.h.

◆ m_filterMode

int TileFilterManager::m_filterMode
private

Definition at line 88 of file TileFilterManager.h.

◆ m_icr2indMap

int TileFilterManager::m_icr2indMap[9]
private

Definition at line 109 of file TileFilterManager.h.

◆ m_ind2icrMap

int TileFilterManager::m_ind2icrMap[9]
private

Definition at line 108 of file TileFilterManager.h.

◆ m_infoName

std::string TileFilterManager::m_infoName
private

Definition at line 86 of file TileFilterManager.h.

◆ m_inTcross

int TileFilterManager::m_inTcross
private

Definition at line 99 of file TileFilterManager.h.

◆ m_inTdig

int TileFilterManager::m_inTdig
private

Definition at line 95 of file TileFilterManager.h.

◆ m_inTshape

int TileFilterManager::m_inTshape
private

Definition at line 93 of file TileFilterManager.h.

◆ m_jBcross

int TileFilterManager::m_jBcross
private

Definition at line 100 of file TileFilterManager.h.

◆ m_jBsamp

int TileFilterManager::m_jBsamp
private

Definition at line 96 of file TileFilterManager.h.

◆ m_jEcross

int TileFilterManager::m_jEcross
private

Definition at line 101 of file TileFilterManager.h.

◆ m_jEsamp

int TileFilterManager::m_jEsamp
private

Definition at line 97 of file TileFilterManager.h.

◆ m_nCross

int TileFilterManager::m_nCross
private

Definition at line 98 of file TileFilterManager.h.

◆ m_nDig

int TileFilterManager::m_nDig
private

Definition at line 94 of file TileFilterManager.h.

◆ m_nFitIndex

std::vector<int> TileFilterManager::m_nFitIndex
private

Definition at line 106 of file TileFilterManager.h.

◆ m_nParamMax

int TileFilterManager::m_nParamMax
private

Definition at line 91 of file TileFilterManager.h.

◆ m_nShape

int TileFilterManager::m_nShape
private

Definition at line 92 of file TileFilterManager.h.

◆ m_offsetVector

std::vector<int *> TileFilterManager::m_offsetVector
private

Definition at line 105 of file TileFilterManager.h.

◆ m_rChi2Cut

double TileFilterManager::m_rChi2Cut
private

Definition at line 102 of file TileFilterManager.h.

◆ m_vNparam

std::vector<TileFitter *> TileFilterManager::m_vNparam
private

Definition at line 110 of file TileFilterManager.h.

◆ m_vNpFitter

std::vector<std::vector<TileFitter> > TileFilterManager::m_vNpFitter
private

Definition at line 111 of file TileFilterManager.h.


The documentation for this class was generated from the following files:
TileFilterManager::m_vNpFitter
std::vector< std::vector< TileFitter > > m_vNpFitter
Definition: TileFilterManager.h:111
TileFilterManager::findHighestResidual
int findHighestResidual(CLHEP::HepVector &digits) const
Definition: TileFilterManager.cxx:391
TileFilterManager::m_nCross
int m_nCross
Definition: TileFilterManager.h:98
index
Definition: index.py:1
TileFilterManager::m_crossShape
std::vector< double * > m_crossShape
Definition: TileFilterManager.h:107
TileFilterManager::m_ind2icrMap
int m_ind2icrMap[9]
Definition: TileFilterManager.h:108
TileFilterManager::m_filterLevel
int m_filterLevel
Definition: TileFilterManager.h:89
TileFilterManager::m_jEcross
int m_jEcross
Definition: TileFilterManager.h:101
TileFilterManager::m_inTcross
int m_inTcross
Definition: TileFilterManager.h:99
TileFilterManager::m_chiCut
double m_chiCut
Definition: TileFilterManager.h:103
TileFilterManager::m_jBsamp
int m_jBsamp
Definition: TileFilterManager.h:96
TileFilterManager::m_offsetVector
std::vector< int * > m_offsetVector
Definition: TileFilterManager.h:105
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
TileFilterManager::m_rChi2Cut
double m_rChi2Cut
Definition: TileFilterManager.h:102
TileFilterManager::makeSPD
int makeSPD(bool debug, std::vector< int > &vcross, CLHEP::HepMatrix &SPD)
Definition: TileFilterManager.cxx:490
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
TileFilterManager::m_jEsamp
int m_jEsamp
Definition: TileFilterManager.h:97
Index
IndexedConstituentUserInfo::Index Index
Definition: IndexedConstituentUserInfo.cxx:12
TileFilterManager::m_filterMode
int m_filterMode
Definition: TileFilterManager.h:88
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileFilterManager::m_inTshape
int m_inTshape
Definition: TileFilterManager.h:93
TileFilterManager::m_nShape
int m_nShape
Definition: TileFilterManager.h:92
TileFilterManager::makeFitterArrays
int makeFitterArrays()
Definition: TileFilterManager.cxx:525
Preparation.mode
mode
Definition: Preparation.py:94
TileFitter::getErr
std::vector< double > & getErr()
Definition: TileFitter.cxx:187
TileFilterManager::fitDigits2
int fitDigits2(TileFilterResult &tRes, bool lDebug=false)
Definition: TileFilterManager.cxx:268
TileFilterManager::m_nDig
int m_nDig
Definition: TileFilterManager.h:94
TileFilterManager::m_nParamMax
int m_nParamMax
Definition: TileFilterManager.h:91
TileFilterManager::getVcross
void getVcross(int nPile, int iconfig, std::vector< int > &vcross)
Definition: TileFilterManager.cxx:574
TileFitter::fitAmp
int fitAmp(TileFilterResult &tResult, bool lDebug=false)
Definition: TileFitter.cxx:125
TileFilterManager::getFitIndex
int getFitIndex(int nParam, std::vector< int > &vcross)
Definition: TileFilterManager.cxx:603
DeMoScan.index
string index
Definition: DeMoScan.py:364
TileFilterManager::makeFitterOffsetTables
void makeFitterOffsetTables()
Definition: TileFilterManager.cxx:420
TileFilterManager::m_inTdig
int m_inTdig
Definition: TileFilterManager.h:95
TileFilterManager::m_jBcross
int m_jBcross
Definition: TileFilterManager.h:100
TileFitter
Definition: TileFitter.h:32
TileFilterManager::m_nFitIndex
std::vector< int > m_nFitIndex
Definition: TileFilterManager.h:106
TileFilterManager::fitDigits1
int fitDigits1(TileFilterResult &tRes, bool lDebug=false)
Definition: TileFilterManager.cxx:179
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TileFilterManager::m_debug
bool m_debug
Definition: TileFilterManager.h:90
fitman.k
k
Definition: fitman.py:528
TileFilterManager::m_icr2indMap
int m_icr2indMap[9]
Definition: TileFilterManager.h:109