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

Auxiliary class for TileRawChannelMakerManyAmps. More...

#include <TileFilterResult.h>

Collaboration diagram for TileFilterResult:

Public Member Functions

 TileFilterResult (std::vector< float > &dig, double sigma)
 
 ~TileFilterResult ()
 
double getSigDig () const
 
CLHEP::HepVector & getDigRef ()
 
std::vector< int > & getVcrossRef ()
 
int & getFitIndexRef ()
 
int & getNparRef ()
 
CLHEP::HepVector & getParamRef ()
 
CLHEP::HepVector & getErrRef ()
 
CLHEP::HepVector & getResidRef ()
 
double & getChi2Ref ()
 
int addCross (int kcrIndex)
 
int dropCross (int kcrIndex)
 
void printFitParam ()
 
double getInTime (double &, double &, double &, double &, double &)
 
void snapShot (int imode)
 

Private Attributes

bool m_debug
 
CLHEP::HepVector m_digits
 
double m_sigDigit
 
int m_nParam
 
int m_nPileup
 
int m_iFitIndex
 
std::vector< int > m_vCross
 
CLHEP::HepVector m_fitParam
 
CLHEP::HepVector m_fitErr
 
CLHEP::HepVector m_residuals
 
double m_chi2
 

Detailed Description

Auxiliary class for TileRawChannelMakerManyAmps.

Definition at line 21 of file TileFilterResult.h.

Constructor & Destructor Documentation

◆ TileFilterResult()

TileFilterResult::TileFilterResult ( std::vector< float > &  dig,
double  sigma 
)

Definition at line 18 of file TileFilterResult.cxx.

18  {
19  m_debug = false;
20  int ND = dig.size();
21  CLHEP::HepVector digtem(ND);
22  m_digits = digtem;
23  for (int id = 0; id < ND; id++) {
24  m_digits[id] = dig[id];
25  }
26  //int nrow = digits.num_row();
27  //int nrowtem = digtem.num_row();
28  m_sigDigit = sig;
29  // Initialize some of the variables that will be set later.
30  m_nParam = 1;
31  m_nPileup = 0;
32  m_vCross.clear();
33  m_chi2 = 999.;
34  m_iFitIndex = -1;
35 }

◆ ~TileFilterResult()

TileFilterResult::~TileFilterResult ( )

Definition at line 37 of file TileFilterResult.cxx.

37  {
38  return;
39 }

Member Function Documentation

◆ addCross()

int TileFilterResult::addCross ( int  kcrIndex)

Definition at line 133 of file TileFilterResult.cxx.

133  {
134 
135  int iret = -1;
136 
137  //Check that kcrIndex is not already in list.
138  bool ldup = false;
139  if (m_nParam > 1) {
140  int Namp = m_nParam - 1;
141  for (int icr = 0; icr < Namp; icr++) {
142  if (kcrIndex == m_vCross[icr]) {
143  ldup = true;
144  if (m_debug) {
145  std::cout << " TileFilterResult.addCross: kcrIndex=" << kcrIndex << " is already in crossing list: Kcross =";
146  for (int j = 0; j < Namp; j++) {
147  std::cout << " " << m_vCross[j];
148  }
149  std::cout << std::endl;
150  }
151  if (ldup) break;
152  }
153  } // end for loop
154  } // end "if(Nparam>1)"
155  if (ldup) {
156  iret = 1;
157  return iret;
158  }
159 
160  // Add the new crossing.
161  iret = 0;
162  m_vCross.push_back(kcrIndex);
163  std::sort(m_vCross.begin(), m_vCross.end());
164  m_nParam = m_nParam + 1;
165 
166  // Since we have a new Vcross configuration, iFitIndex is not yet defined for it.
167  m_iFitIndex = -1;
168 
169  if (m_debug) {
170  int Namp = m_nParam - 1;
171  std::cout << " TileFilterResult.addCross. Exit with Nparam=" << m_nParam << ", Vcross=";
172  for (int icr = 0; icr < Namp; icr++) {
173  std::cout << " " << std::setw(3) << m_vCross[icr];
174  }
175  std::cout << std::endl;
176  }
177 
178  return iret;
179 }

◆ dropCross()

int TileFilterResult::dropCross ( int  kcrIndex)

Definition at line 181 of file TileFilterResult.cxx.

181  {
182  // Drop the crossing stored in amplitude # iamp.
183  int iret = -1;
184  int Namp = m_nParam - 1;
185  for (int iamp = 1; iamp < Namp; iamp++) {
186  if (m_vCross[iamp] == idrop) {
187  // Erase the crossing.
188  iret = 0;
189  m_vCross.erase(m_vCross.begin() + iamp);
190  // std::sort(Vcross.begin(), Vcross.end() );
191  m_nParam = m_nParam - 1;
192  }
193  }
194  if (iret != 0) {
195  std::cout << "error in TileFilterResult.dropCross: idrop=" << idrop << "but vcross =";
196  for (int iamp = 0; iamp < Namp; iamp++) {
197  std::cout << " " << m_vCross[iamp];
198  }
199  std::cout << std::endl;
200  return iret;
201  }
202 
203  // Since we have a new Vcross configuration, iFitIndex is not yet defined for it.
204  m_iFitIndex = -1;
205 
206  if (m_debug) {
207  int Namp = m_nParam - 1;
208  std::cout << " TileFilterResult.dropCross. Exit with Nparam=" << m_nParam << ", Vcross=";
209  for (int icr = 0; icr < Namp; icr++) {
210  std::cout << " " << std::setw(3) << m_vCross[icr];
211  }
212  std::cout << std::endl;
213  }
214 
215  return iret;
216 }

◆ getChi2Ref()

double & TileFilterResult::getChi2Ref ( )

Definition at line 74 of file TileFilterResult.cxx.

74  {
75  return m_chi2;
76 }

◆ getDigRef()

CLHEP::HepVector & TileFilterResult::getDigRef ( )

Definition at line 46 of file TileFilterResult.cxx.

46  {
47  return m_digits;
48 }

◆ getErrRef()

CLHEP::HepVector & TileFilterResult::getErrRef ( )

Definition at line 66 of file TileFilterResult.cxx.

66  {
67  return m_fitErr;
68 }

◆ getFitIndexRef()

int & TileFilterResult::getFitIndexRef ( )

Definition at line 54 of file TileFilterResult.cxx.

54  {
55  return m_iFitIndex;
56 }

◆ getInTime()

double TileFilterResult::getInTime ( double &  amp,
double &  err,
double &  ped,
double &  chi2,
double &  t 
)

Definition at line 93 of file TileFilterResult.cxx.

93  {
94  amp = m_fitParam[1];
95  err = m_fitErr[1];
96  ped = m_fitParam[0];
97  chi2 = m_chi2;
98  t = 0.;
99 
100  return m_chi2;
101 }

◆ getNparRef()

int & TileFilterResult::getNparRef ( )

Definition at line 58 of file TileFilterResult.cxx.

58  {
59  return m_nParam;
60 }

◆ getParamRef()

CLHEP::HepVector & TileFilterResult::getParamRef ( )

Definition at line 62 of file TileFilterResult.cxx.

62  {
63  return m_fitParam;
64 }

◆ getResidRef()

CLHEP::HepVector & TileFilterResult::getResidRef ( )

Definition at line 70 of file TileFilterResult.cxx.

70  {
71  return m_residuals;
72 }

◆ getSigDig()

double TileFilterResult::getSigDig ( ) const

Definition at line 41 of file TileFilterResult.cxx.

41  {
42  return m_sigDigit;
43 }

◆ getVcrossRef()

std::vector< int > & TileFilterResult::getVcrossRef ( )

Definition at line 50 of file TileFilterResult.cxx.

50  {
51  return m_vCross;
52 }

◆ printFitParam()

void TileFilterResult::printFitParam ( )

Definition at line 78 of file TileFilterResult.cxx.

78  {
79  boost::io::ios_base_all_saver coutsave(std::cout);
80  std::cout << " Print fitted param from TileFilterResult: Nparam=" << m_nParam << ", chisq=" << m_chi2 << std::endl;
81  for (int ipar = 0; ipar < m_nParam; ipar++) {
82  if (ipar == 0) {
83  std::cout << " i=" << ipar << ", kcr=P" << ", A=" << std::setw(5) << std::setprecision(2) << m_fitParam[ipar]
84  << " +-" << m_fitErr[ipar] << std::endl;
85  } else {
86  std::cout << " i=" << ipar << ", kcr=" << m_vCross[ipar - 1] << ", A=" << m_fitParam[ipar] << " +-"
87  << m_fitErr[ipar] << std::endl;
88  }
89  }
90  return;
91 }

◆ snapShot()

void TileFilterResult::snapShot ( int  imode)

Definition at line 103 of file TileFilterResult.cxx.

103  {
104  boost::io::ios_base_all_saver coutsave(std::cout);
105  // This print a short snapshot of the FilterResult state.
106  std::cout << " SnapShot: imode=" << imode << ". Nparam=" << m_nParam << ", chisq=" << m_chi2 << ", iFitIndex"
107  << m_iFitIndex << ", Vcross=";
108  int Namp = m_nParam - 1;
109  for (int jamp = 0; jamp < Namp; jamp++) {
110  std::cout << " " << m_vCross[jamp];
111  }
112  std::cout << std::endl;
113  if (m_iFitIndex < 0) return;
114 
115  if (imode > 0) {
116  std::cout << " FitParam=";
117  for (int ipar = 0; ipar < m_nParam; ipar++) {
118  std::cout << std::setw(5) << std::setprecision(1) << m_fitParam[ipar] << "+-" << m_fitErr[ipar];
119  if (ipar < m_nParam - 1) std::cout << ", ";
120  }
121  std::cout << std::endl;
122  }
123  if (imode > 1) {
124  int Ndig = m_digits.num_row();
125  std::cout << " Residuals=";
126  for (int idig = 0; idig < Ndig; idig++) {
127  std::cout << " " << std::setw(4) << std::setprecision(3) << m_residuals[idig];
128  }
129  std::cout << std::endl;
130  }
131 }

Member Data Documentation

◆ m_chi2

double TileFilterResult::m_chi2
private

Definition at line 62 of file TileFilterResult.h.

◆ m_debug

bool TileFilterResult::m_debug
private

Definition at line 48 of file TileFilterResult.h.

◆ m_digits

CLHEP::HepVector TileFilterResult::m_digits
private

Definition at line 50 of file TileFilterResult.h.

◆ m_fitErr

CLHEP::HepVector TileFilterResult::m_fitErr
private

Definition at line 59 of file TileFilterResult.h.

◆ m_fitParam

CLHEP::HepVector TileFilterResult::m_fitParam
private

Definition at line 58 of file TileFilterResult.h.

◆ m_iFitIndex

int TileFilterResult::m_iFitIndex
private

Definition at line 55 of file TileFilterResult.h.

◆ m_nParam

int TileFilterResult::m_nParam
private

Definition at line 53 of file TileFilterResult.h.

◆ m_nPileup

int TileFilterResult::m_nPileup
private

Definition at line 54 of file TileFilterResult.h.

◆ m_residuals

CLHEP::HepVector TileFilterResult::m_residuals
private

Definition at line 61 of file TileFilterResult.h.

◆ m_sigDigit

double TileFilterResult::m_sigDigit
private

Definition at line 51 of file TileFilterResult.h.

◆ m_vCross

std::vector<int> TileFilterResult::m_vCross
private

Definition at line 56 of file TileFilterResult.h.


The documentation for this class was generated from the following files:
TileFilterResult::m_chi2
double m_chi2
Definition: TileFilterResult.h:62
TileFilterResult::m_fitParam
CLHEP::HepVector m_fitParam
Definition: TileFilterResult.h:58
TileFilterResult::m_iFitIndex
int m_iFitIndex
Definition: TileFilterResult.h:55
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TileFilterResult::m_sigDigit
double m_sigDigit
Definition: TileFilterResult.h:51
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:182
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
python.BuildSignatureFlags.sig
sig
Definition: BuildSignatureFlags.py:218
TileFilterResult::m_vCross
std::vector< int > m_vCross
Definition: TileFilterResult.h:56
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
TileFilterResult::m_fitErr
CLHEP::HepVector m_fitErr
Definition: TileFilterResult.h:59
TileFilterResult::m_residuals
CLHEP::HepVector m_residuals
Definition: TileFilterResult.h:61
Example_ReadSampleNoise.ped
ped
Definition: Example_ReadSampleNoise.py:45
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
TileFilterResult::m_nPileup
int m_nPileup
Definition: TileFilterResult.h:54
TileFilterResult::m_nParam
int m_nParam
Definition: TileFilterResult.h:53
TileFilterResult::m_debug
bool m_debug
Definition: TileFilterResult.h:48
TileFilterResult::m_digits
CLHEP::HepVector m_digits
Definition: TileFilterResult.h:50