CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
FittedEntriesSet Class Reference

#include <FittedEntriesSet.h>

Public Member Functions

void CreateCorrelationMatrix (const ALIuint nent)
 
void Fill ()
 
void FillCorrelations ()
 
void FillEntries ()
 
void FillEntriesAveragingSets (const std::vector< FittedEntriesSet *> &vSets)
 
void FillEntriesFromFile (const std::vector< ALIstring > &wl)
 
std::vector< FittedEntry * > & FittedEntries ()
 
 FittedEntriesSet (MatrixMeschach *AtWAMatrix)
 
 FittedEntriesSet (const std::vector< ALIstring > &wl)
 
 FittedEntriesSet (const std::vector< FittedEntriesSet *> &vSets)
 
ALIstringgetDate ()
 
ALIstringgetTime ()
 
void SetOptOEntries ()
 
 ~FittedEntriesSet ()
 

Public Attributes

std::vector< FittedEntry * > theFittedEntries
 

Private Attributes

std::vector< std::vector< ALIdouble > > theCorrelationMatrix
 
ALIstring theDate
 
MatrixMeschachtheEntriesErrorMatrix
 
ALIint theMinEntryQuality
 
ALIstring theTime
 

Detailed Description

Definition at line 22 of file FittedEntriesSet.h.

Constructor & Destructor Documentation

◆ FittedEntriesSet() [1/3]

FittedEntriesSet::FittedEntriesSet ( MatrixMeschach AtWAMatrix)

Definition at line 21 of file FittedEntriesSet.cc.

References Fill(), Measurement::getCurrentDate(), Measurement::getCurrentTime(), theDate, theEntriesErrorMatrix, theMinEntryQuality, and theTime.

21  {
22  //- theTime = Model::MeasurementsTime();
25 
27  theEntriesErrorMatrix = AtWAMatrix;
28 
29  Fill();
30 }
static ALIstring getCurrentTime()
Definition: Measurement.h:123
static ALIstring getCurrentDate()
Definition: Measurement.h:122
MatrixMeschach * theEntriesErrorMatrix

◆ FittedEntriesSet() [2/3]

FittedEntriesSet::FittedEntriesSet ( const std::vector< ALIstring > &  wl)

Definition at line 33 of file FittedEntriesSet.cc.

References FillEntriesFromFile(), theDate, theEntriesErrorMatrix, theMinEntryQuality, theTime, and LaserClient_cfi::wl.

33  {
34  //- theTime = Model::MeasurementsTime();
35  theDate = wl[0];
36  theTime = "99:99";
37 
40 
42 }
MatrixMeschach * theEntriesErrorMatrix
void FillEntriesFromFile(const std::vector< ALIstring > &wl)

◆ FittedEntriesSet() [3/3]

FittedEntriesSet::FittedEntriesSet ( const std::vector< FittedEntriesSet *> &  vSets)

Definition at line 45 of file FittedEntriesSet.cc.

References FillEntriesAveragingSets(), theDate, theEntriesErrorMatrix, theMinEntryQuality, and theTime.

45  {
46  theDate = "99/99/99";
47  theTime = "99:99";
48 
51 
53 }
MatrixMeschach * theEntriesErrorMatrix
void FillEntriesAveragingSets(const std::vector< FittedEntriesSet *> &vSets)

◆ ~FittedEntriesSet()

FittedEntriesSet::~FittedEntriesSet ( )
inline

Definition at line 29 of file FittedEntriesSet.h.

29 {};

Member Function Documentation

◆ CreateCorrelationMatrix()

void FittedEntriesSet::CreateCorrelationMatrix ( const ALIuint  nent)

Definition at line 105 of file FittedEntriesSet.cc.

References DeadROCCounter::nent, and theCorrelationMatrix.

Referenced by FillCorrelations().

105  {
106  std::vector<ALIdouble> vd(nent, 0.);
107  std::vector<std::vector<ALIdouble> > vvd(nent, vd);
109 }
std::vector< std::vector< DeviationSensor2D * > > vvd
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
std::vector< DeviationSensor2D * > vd

◆ Fill()

void FittedEntriesSet::Fill ( )

Definition at line 56 of file FittedEntriesSet.cc.

References FillCorrelations(), and FillEntries().

Referenced by FittedEntriesSet().

56  {
57  FillEntries();
59 }

◆ FillCorrelations()

void FittedEntriesSet::FillCorrelations ( )

Definition at line 80 of file FittedEntriesSet.cc.

References alignCSCRings::corr, CreateCorrelationMatrix(), Model::EntryList(), cuy::ii, findQualityFiles::jj, MatrixMeschach::Mat(), DeadROCCounter::nent, mathSSE::sqrt(), theCorrelationMatrix, theEntriesErrorMatrix, and theMinEntryQuality.

Referenced by Fill().

80  {
81  //------ Count the number of entries that will be in the set
82  ALIuint nent = 0;
83  std::vector<Entry*>::const_iterator vecite;
84  for (vecite = Model::EntryList().begin(); vecite != Model::EntryList().end(); ++vecite) {
85  if ((*vecite)->quality() > theMinEntryQuality) {
86  nent++;
87  }
88  }
89 
91  //---------- Store correlations
92  ALIuint ii;
93  for (ii = 0; ii < nent; ii++) {
94  for (ALIuint jj = ii + 1; jj < nent; jj++) {
96  if (corr != 0) {
99  }
100  }
101  }
102 }
long double ALIdouble
Definition: CocoaGlobals.h:11
dictionary corr
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
MatrixMeschach * theEntriesErrorMatrix
ii
Definition: cuy.py:589
const MAT * Mat() const
void CreateCorrelationMatrix(const ALIuint nent)
static std::vector< Entry * > & EntryList()
Definition: Model.h:86
unsigned int ALIuint
Definition: CocoaGlobals.h:17

◆ FillEntries()

void FittedEntriesSet::FillEntries ( )

Definition at line 62 of file FittedEntriesSet.cc.

References Model::EntryList(), MatrixMeschach::Mat(), mathSSE::sqrt(), theEntriesErrorMatrix, theFittedEntries, and theMinEntryQuality.

Referenced by Fill().

62  {
63  //---------- Store Fitted Entries
64  //----- Iterate over entry list
65  std::vector<Entry*>::const_iterator vecite;
66  for (vecite = Model::EntryList().begin(); vecite != Model::EntryList().end(); ++vecite) {
67  //--- Only for good quality parameters (='unk')
68  if ((*vecite)->quality() >= theMinEntryQuality) {
69  // ALIdouble dimv = (*vecite)->ValueDimensionFactor();
70  // ALIdouble dims = (*vecite)->SigmaDimensionFactor();
71  ALIint ipos = (*vecite)->fitPos();
72  FittedEntry* fe = new FittedEntry((*vecite), ipos, sqrt(theEntriesErrorMatrix->Mat()->me[ipos][ipos]));
73  //- std::cout << fe << "IN fit FE " << fe->theValue<< " " << fe->Sigma()<< " " << sqrt(theEntriesErrorMatrix->Mat()->me[NoEnt][NoEnt]) / dims<< std::endl;
74  theFittedEntries.push_back(fe);
75  }
76  }
77 }
int ALIint
Definition: CocoaGlobals.h:15
std::vector< FittedEntry * > theFittedEntries
T sqrt(T t)
Definition: SSEVec.h:19
MatrixMeschach * theEntriesErrorMatrix
const MAT * Mat() const
static std::vector< Entry * > & EntryList()
Definition: Model.h:86

◆ FillEntriesAveragingSets()

void FittedEntriesSet::FillEntriesAveragingSets ( const std::vector< FittedEntriesSet *> &  vSets)

Definition at line 121 of file FittedEntriesSet.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, gather_cfg::cout, ALIUtils::debug, beamvalidation::exit(), FittedEntries(), FittedEntry::getSigma(), FittedEntry::getValue(), cuy::ii, findQualityFiles::jj, and theFittedEntries.

Referenced by FittedEntriesSet().

121  {
122  std::vector<FittedEntry*> vFEntry;
123  ALIuint nEntry = vSets[0]->FittedEntries().size();
124  // ALIuint setssiz = vSets.size();
125  for (ALIuint ii = 0; ii < nEntry; ii++) { // loop to FittedEntry's
126  if (ALIUtils::debug >= 5)
127  std::cout << "FillEntriesAveragingSets entry " << ii << std::endl;
128  vFEntry.clear();
129  for (ALIuint jj = 0; jj < vSets.size(); jj++) { // look for FittedEntry ii in each Sets
130  if (ALIUtils::debug >= 5)
131  std::cout << "FillEntriesAveragingSets set " << jj << std::endl;
132  //----- Check all have the same number of entries
133  if (vSets[jj]->FittedEntries().size() != nEntry) {
134  std::cerr << "!!! FATAL ERROR FittedEntriesSet::FillEntriesAveragingSets set number " << jj
135  << " has different number of entries = " << vSets[jj]->FittedEntries().size()
136  << " than first set = " << nEntry << std::endl;
137  exit(1);
138  }
139 
140  vFEntry.push_back(vSets[jj]->FittedEntries()[ii]);
141  }
142  FittedEntry* fe = new FittedEntry(vFEntry);
143  if (ALIUtils::debug >= 5)
144  std::cout << "FillEntriesAveragingSets new fentry " << fe->getValue() << " " << fe->getSigma() << std::endl;
145  theFittedEntries.push_back(fe);
146  }
147 }
std::vector< FittedEntry * > & FittedEntries()
static ALIint debug
Definition: ALIUtils.h:34
std::vector< FittedEntry * > theFittedEntries
ii
Definition: cuy.py:589
ALIdouble getValue() const
Definition: FittedEntry.h:31
unsigned int ALIuint
Definition: CocoaGlobals.h:17
def exit(msg="")
ALIdouble getSigma() const
Definition: FittedEntry.h:32

◆ FillEntriesFromFile()

void FittedEntriesSet::FillEntriesFromFile ( const std::vector< ALIstring > &  wl)

Definition at line 112 of file FittedEntriesSet.cc.

References ALIUtils::getFloat(), cuy::ii, theFittedEntries, and LaserClient_cfi::wl.

Referenced by FittedEntriesSet().

112  {
113  ALIuint siz = wl.size();
114  for (ALIuint ii = 1; ii < siz; ii += 3) {
116  theFittedEntries.push_back(fe);
117  }
118 }
std::vector< FittedEntry * > theFittedEntries
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:373
ii
Definition: cuy.py:589
unsigned int ALIuint
Definition: CocoaGlobals.h:17

◆ FittedEntries()

std::vector<FittedEntry*>& FittedEntriesSet::FittedEntries ( )
inline

Definition at line 40 of file FittedEntriesSet.h.

References theFittedEntries.

Referenced by FittedEntriesManager::dumpEntriesSubstraction(), and FillEntriesAveragingSets().

40 { return theFittedEntries; }
std::vector< FittedEntry * > theFittedEntries

◆ getDate()

ALIstring& FittedEntriesSet::getDate ( )
inline

Definition at line 43 of file FittedEntriesSet.h.

References theDate.

43 { return theDate; }

◆ getTime()

ALIstring& FittedEntriesSet::getTime ( )
inline

Definition at line 44 of file FittedEntriesSet.h.

References theTime.

44 { return theTime; }

◆ SetOptOEntries()

void FittedEntriesSet::SetOptOEntries ( )

Definition at line 150 of file FittedEntriesSet.cc.

References gather_cfg::cout, ALIUtils::debug, mps_splice::entry, Model::getEntryByName(), FittedEntry::getEntryName(), Model::getOptOByName(), FittedEntry::getOptOName(), FittedEntry::getSigma(), FittedEntry::getValue(), OpticalObject::name(), OpticalObject::setGlobalCoordinates(), OpticalObject::setOriginalEntryValues(), and theFittedEntries.

150  {
151  if (ALIUtils::debug >= 5)
152  std::cout << " FittedEntriesSet::SetOptOEntries " << theFittedEntries.size() << std::endl;
153 
154  std::vector<FittedEntry*>::const_iterator ite;
155  for (ite = theFittedEntries.begin(); ite != theFittedEntries.end(); ++ite) {
156  FittedEntry* fe = (*ite);
159  entry->setValue(fe->getValue());
160  entry->setSigma(fe->getSigma());
161 
162  if (ALIUtils::debug >= 5)
163  std::cout << " FittedEntriesSet::SetOptOEntries() " << opto->name() << " " << entry->name() << std::endl;
164  opto->setGlobalCoordinates();
165  opto->setOriginalEntryValues();
166  }
167 }
ALIstring getOptOName() const
Definition: FittedEntry.h:28
Definition: Entry.h:18
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:562
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
std::vector< FittedEntry * > theFittedEntries
static Entry * getEntryByName(const ALIstring &opto_name, const ALIstring &entry_name)
--— Search an Entry name in the Entry* list and return a pointer to it
Definition: Model.cc:615
void setOriginalEntryValues()
ALIstring getEntryName() const
Definition: FittedEntry.h:29
ALIdouble getValue() const
Definition: FittedEntry.h:31
void setGlobalCoordinates()
ALIdouble getSigma() const
Definition: FittedEntry.h:32

Member Data Documentation

◆ theCorrelationMatrix

std::vector<std::vector<ALIdouble> > FittedEntriesSet::theCorrelationMatrix
private

Definition at line 53 of file FittedEntriesSet.h.

Referenced by CreateCorrelationMatrix(), and FillCorrelations().

◆ theDate

ALIstring FittedEntriesSet::theDate
private

Definition at line 51 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getDate().

◆ theEntriesErrorMatrix

MatrixMeschach* FittedEntriesSet::theEntriesErrorMatrix
private

Definition at line 55 of file FittedEntriesSet.h.

Referenced by FillCorrelations(), FillEntries(), and FittedEntriesSet().

◆ theFittedEntries

std::vector<FittedEntry*> FittedEntriesSet::theFittedEntries

◆ theMinEntryQuality

ALIint FittedEntriesSet::theMinEntryQuality
private

Definition at line 54 of file FittedEntriesSet.h.

Referenced by FillCorrelations(), FillEntries(), and FittedEntriesSet().

◆ theTime

ALIstring FittedEntriesSet::theTime
private

Definition at line 52 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getTime().