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::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::FittedEntriesSet ( const std::vector< ALIstring > &  wl)

Definition at line 33 of file FittedEntriesSet.cc.

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

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::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 ( )
inline

Member Function Documentation

void FittedEntriesSet::CreateCorrelationMatrix ( const ALIuint  nent)

Definition at line 105 of file FittedEntriesSet.cc.

References theCorrelationMatrix.

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

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
void FittedEntriesSet::Fill ( )

Definition at line 56 of file FittedEntriesSet.cc.

References FillCorrelations(), and FillEntries().

Referenced by FittedEntriesSet(), and ~FittedEntriesSet().

56  {
57  FillEntries();
59 }
void FittedEntriesSet::FillCorrelations ( )

Definition at line 80 of file FittedEntriesSet.cc.

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

Referenced by Fill(), and ~FittedEntriesSet().

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) {
97  corr /= (sqrt(theEntriesErrorMatrix->Mat()->me[ii][ii]) / sqrt(theEntriesErrorMatrix->Mat()->me[jj][jj]));
99  }
100  }
101  }
102 }
long double ALIdouble
Definition: CocoaGlobals.h:11
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
const MAT * Mat() const
MatrixMeschach * theEntriesErrorMatrix
JetCorrectorParameters corr
Definition: classes.h:5
ii
Definition: cuy.py:590
void CreateCorrelationMatrix(const ALIuint nent)
#define begin
Definition: vmac.h:32
static std::vector< Entry * > & EntryList()
Definition: Model.h:86
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntries ( )

Definition at line 62 of file FittedEntriesSet.cc.

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

Referenced by Fill(), and ~FittedEntriesSet().

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
const MAT * Mat() const
MatrixMeschach * theEntriesErrorMatrix
#define begin
Definition: vmac.h:32
static std::vector< Entry * > & EntryList()
Definition: Model.h:86
void FittedEntriesSet::FillEntriesAveragingSets ( const std::vector< FittedEntriesSet * > &  vSets)

Definition at line 121 of file FittedEntriesSet.cc.

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(), and ~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
ALIdouble getSigma() const
Definition: FittedEntry.h:32
ii
Definition: cuy.py:590
ALIdouble getValue() const
Definition: FittedEntry.h:31
unsigned int ALIuint
Definition: CocoaGlobals.h:17
def exit(msg="")
void FittedEntriesSet::FillEntriesFromFile ( const std::vector< ALIstring > &  wl)

Definition at line 112 of file FittedEntriesSet.cc.

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

Referenced by FittedEntriesSet(), and ~FittedEntriesSet().

112  {
113  ALIuint siz = wl.size();
114  for (ALIuint ii = 1; ii < siz; ii += 3) {
115  FittedEntry* fe = new FittedEntry(wl[ii], ALIUtils::getFloat(wl[ii + 1]), ALIUtils::getFloat(wl[ii + 2]));
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:590
unsigned int ALIuint
Definition: CocoaGlobals.h:17
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
ALIstring& FittedEntriesSet::getDate ( )
inline

Definition at line 43 of file FittedEntriesSet.h.

References theDate.

43 { return theDate; }
ALIstring& FittedEntriesSet::getTime ( )
inline

Definition at line 44 of file FittedEntriesSet.h.

References theTime.

44 { return theTime; }
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(), Entry::setValue(), and theFittedEntries.

Referenced by ~FittedEntriesSet().

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 }
Definition: Entry.h:18
ALIstring getOptOName() const
Definition: FittedEntry.h:28
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:570
void setValue(ALIdouble val)
Definition: Entry.h:78
static ALIint debug
Definition: ALIUtils.h:34
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:623
void setOriginalEntryValues()
ALIdouble getSigma() const
Definition: FittedEntry.h:32
ALIstring getEntryName() const
Definition: FittedEntry.h:29
const ALIstring & name() const
Definition: OpticalObject.h:58
ALIdouble getValue() const
Definition: FittedEntry.h:31
void setGlobalCoordinates()

Member Data Documentation

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

Definition at line 53 of file FittedEntriesSet.h.

Referenced by CreateCorrelationMatrix(), and FillCorrelations().

ALIstring FittedEntriesSet::theDate
private

Definition at line 51 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getDate().

MatrixMeschach* FittedEntriesSet::theEntriesErrorMatrix
private

Definition at line 55 of file FittedEntriesSet.h.

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

std::vector<FittedEntry*> FittedEntriesSet::theFittedEntries
ALIint FittedEntriesSet::theMinEntryQuality
private

Definition at line 54 of file FittedEntriesSet.h.

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

ALIstring FittedEntriesSet::theTime
private

Definition at line 52 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getTime().