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 (const std::vector< ALIstring > &wl)
 
 FittedEntriesSet (const std::vector< FittedEntriesSet * > &vSets)
 
 FittedEntriesSet (MatrixMeschach *AtWAMatrix)
 
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.

21  {
22  //- theTime = Model::MeasurementsTime();
25 
27  theEntriesErrorMatrix = AtWAMatrix;
28 
29  Fill();
30 }

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

◆ FittedEntriesSet() [2/3]

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

Definition at line 33 of file FittedEntriesSet.cc.

33  {
34  //- theTime = Model::MeasurementsTime();
35  theDate = wl[0];
36  theTime = "99:99";
37 
40 
42 }

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

◆ FittedEntriesSet() [3/3]

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

Definition at line 45 of file FittedEntriesSet.cc.

45  {
46  theDate = "99/99/99";
47  theTime = "99:99";
48 
51 
53 }

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

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

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

References DeadROCCounter::nent, and theCorrelationMatrix.

Referenced by FillCorrelations().

◆ Fill()

void FittedEntriesSet::Fill ( )

Definition at line 56 of file FittedEntriesSet.cc.

56  {
57  FillEntries();
59 }

References FillCorrelations(), and FillEntries().

Referenced by FittedEntriesSet().

◆ FillCorrelations()

void FittedEntriesSet::FillCorrelations ( )

Definition at line 80 of file FittedEntriesSet.cc.

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 }

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

Referenced by Fill().

◆ FillEntries()

void FittedEntriesSet::FillEntries ( )

Definition at line 62 of file FittedEntriesSet.cc.

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 }

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

Referenced by Fill().

◆ FillEntriesAveragingSets()

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

Definition at line 121 of file FittedEntriesSet.cc.

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 }

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

Referenced by FittedEntriesSet().

◆ FillEntriesFromFile()

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

Definition at line 112 of file FittedEntriesSet.cc.

112  {
113  ALIuint siz = wl.size();
114  for (ALIuint ii = 1; ii < siz; ii += 3) {
116  theFittedEntries.push_back(fe);
117  }
118 }

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

Referenced by FittedEntriesSet().

◆ FittedEntries()

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

◆ getDate()

ALIstring& FittedEntriesSet::getDate ( )
inline

Definition at line 43 of file FittedEntriesSet.h.

43 { return theDate; }

References theDate.

◆ getTime()

ALIstring& FittedEntriesSet::getTime ( )
inline

Definition at line 44 of file FittedEntriesSet.h.

44 { return theTime; }

References theTime.

◆ SetOptOEntries()

void FittedEntriesSet::SetOptOEntries ( )

Definition at line 150 of file FittedEntriesSet.cc.

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 }

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.

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().

ALIUtils::getFloat
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:373
FittedEntriesSet::FittedEntries
std::vector< FittedEntry * > & FittedEntries()
Definition: FittedEntriesSet.h:40
FittedEntry::getSigma
ALIdouble getSigma() const
Definition: FittedEntry.h:32
FittedEntriesSet::Fill
void Fill()
Definition: FittedEntriesSet.cc:56
FittedEntriesSet::FillCorrelations
void FillCorrelations()
Definition: FittedEntriesSet.cc:80
OpticalObject::setGlobalCoordinates
void setGlobalCoordinates()
Definition: OpticalObject.cc:587
Model::EntryList
static std::vector< Entry * > & EntryList()
Definition: Model.h:86
LaserClient_cfi.wl
wl
Definition: LaserClient_cfi.py:46
FittedEntriesSet::FillEntries
void FillEntries()
Definition: FittedEntriesSet.cc:62
mps_splice.entry
entry
Definition: mps_splice.py:68
OpticalObject::name
const ALIstring & name() const
Definition: OpticalObject.h:58
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Model::getEntryByName
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:623
FittedEntriesSet::FillEntriesAveragingSets
void FillEntriesAveragingSets(const std::vector< FittedEntriesSet * > &vSets)
Definition: FittedEntriesSet.cc:121
FittedEntriesSet::theCorrelationMatrix
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
Definition: FittedEntriesSet.h:53
FittedEntry
Definition: FittedEntry.h:17
vd
std::vector< DeviationSensor2D * > vd
Definition: DeviationsFromFileSensor2D.h:21
OpticalObject
Definition: OpticalObject.h:35
FittedEntriesSet::theFittedEntries
std::vector< FittedEntry * > theFittedEntries
Definition: FittedEntriesSet.h:47
MatrixMeschach::Mat
const MAT * Mat() const
Definition: MatrixMeschach.h:57
Model::getOptOByName
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:570
alignCSCRings.corr
dictionary corr
Definition: alignCSCRings.py:124
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Measurement::getCurrentTime
static ALIstring getCurrentTime()
Definition: Measurement.h:123
FittedEntriesSet::CreateCorrelationMatrix
void CreateCorrelationMatrix(const ALIuint nent)
Definition: FittedEntriesSet.cc:105
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
FittedEntriesSet::theMinEntryQuality
ALIint theMinEntryQuality
Definition: FittedEntriesSet.h:54
FittedEntry::getEntryName
ALIstring getEntryName() const
Definition: FittedEntry.h:29
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
Measurement::getCurrentDate
static ALIstring getCurrentDate()
Definition: Measurement.h:122
ALIuint
unsigned int ALIuint
Definition: CocoaGlobals.h:17
OpticalObject::setOriginalEntryValues
void setOriginalEntryValues()
Definition: OpticalObject.cc:823
Entry
Definition: Entry.h:18
FittedEntriesSet::theTime
ALIstring theTime
Definition: FittedEntriesSet.h:52
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
FittedEntriesSet::FillEntriesFromFile
void FillEntriesFromFile(const std::vector< ALIstring > &wl)
Definition: FittedEntriesSet.cc:112
MatrixMeschach
Definition: MatrixMeschach.h:30
FittedEntriesSet::theEntriesErrorMatrix
MatrixMeschach * theEntriesErrorMatrix
Definition: FittedEntriesSet.h:55
vvd
std::vector< std::vector< DeviationSensor2D * > > vvd
Definition: DeviationsFromFileSensor2D.h:18
ALIint
int ALIint
Definition: CocoaGlobals.h:15
DeadROCCounter.nent
nent
Definition: DeadROCCounter.py:67
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
FittedEntry::getValue
ALIdouble getValue() const
Definition: FittedEntry.h:31
cuy.ii
ii
Definition: cuy.py:590
begin
#define begin
Definition: vmac.h:32
FittedEntriesSet::theDate
ALIstring theDate
Definition: FittedEntriesSet.h:51
FittedEntry::getOptOName
ALIstring getOptOName() const
Definition: FittedEntry.h:28