CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 CreateCorrelationMatrix (const ALIuint nent)
 
void Fill ()
 
void Fill ()
 
void FillCorrelations ()
 
void FillCorrelations ()
 
void FillEntries ()
 
void FillEntries ()
 
void FillEntriesAveragingSets (std::vector< FittedEntriesSet * > vSets)
 
void FillEntriesAveragingSets (std::vector< FittedEntriesSet * > vSets)
 
void FillEntriesFromFile (std::vector< ALIstring > wl)
 
void FillEntriesFromFile (std::vector< ALIstring > wl)
 
std::vector< FittedEntry * > & FittedEntries ()
 
std::vector< FittedEntry * > & FittedEntries ()
 
 FittedEntriesSet (MatrixMeschach *AtWAMatrix)
 
 FittedEntriesSet (MatrixMeschach *AtWAMatrix)
 
 FittedEntriesSet (std::vector< ALIstring > wl)
 
 FittedEntriesSet (std::vector< ALIstring > wl)
 
 FittedEntriesSet (std::vector< FittedEntriesSet * > vSets)
 
 FittedEntriesSet (std::vector< FittedEntriesSet * > vSets)
 
ALIstringgetDate ()
 
ALIstringgetDate ()
 
ALIstringgetTime ()
 
ALIstringgetTime ()
 
void SetOptOEntries ()
 
void SetOptOEntries ()
 
 ~FittedEntriesSet ()
 
 ~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.

22 {
23  //- theTime = Model::MeasurementsTime();
26 
28  theEntriesErrorMatrix = AtWAMatrix;
29 
30  Fill();
31 
32 }
static ALIstring getCurrentTime()
Definition: Measurement.h:155
MatrixMeschach * theEntriesErrorMatrix
static ALIstring getCurrentDate()
Definition: Measurement.h:152
FittedEntriesSet::FittedEntriesSet ( std::vector< ALIstring wl)

Definition at line 36 of file FittedEntriesSet.cc.

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

37 {
38  //- theTime = Model::MeasurementsTime();
39  theDate = wl[0];
40  theTime = "99:99";
41 
44 
45  FillEntriesFromFile( wl );
46 
47 }
MatrixMeschach * theEntriesErrorMatrix
void FillEntriesFromFile(std::vector< ALIstring > wl)
FittedEntriesSet::FittedEntriesSet ( std::vector< FittedEntriesSet * >  vSets)

Definition at line 50 of file FittedEntriesSet.cc.

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

51 {
52  theDate = "99/99/99";
53  theTime = "99:99";
54 
57 
58  FillEntriesAveragingSets( vSets );
59 
60 }
void FillEntriesAveragingSets(std::vector< FittedEntriesSet * > vSets)
MatrixMeschach * theEntriesErrorMatrix
FittedEntriesSet::~FittedEntriesSet ( )
inline

Definition at line 31 of file FittedEntriesSet.h.

31 { };
FittedEntriesSet::FittedEntriesSet ( MatrixMeschach AtWAMatrix)
FittedEntriesSet::FittedEntriesSet ( std::vector< ALIstring wl)
FittedEntriesSet::FittedEntriesSet ( std::vector< FittedEntriesSet * >  vSets)
FittedEntriesSet::~FittedEntriesSet ( )
inline

Definition at line 31 of file FittedEntriesSet.h.

31 { };

Member Function Documentation

void FittedEntriesSet::CreateCorrelationMatrix ( const ALIuint  nent)

Definition at line 126 of file FittedEntriesSet.cc.

References theCorrelationMatrix.

Referenced by FillCorrelations().

127 {
128 
129  std::vector<ALIdouble> vd( nent, 0.);
130  std::vector< std::vector<ALIdouble> > vvd( nent, vd);
132 
133 }
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
std::vector< std::vector< DeviationSensor2D * > > vvd
std::vector< DeviationSensor2D * > vd
void FittedEntriesSet::CreateCorrelationMatrix ( const ALIuint  nent)
void FittedEntriesSet::Fill ( )

Definition at line 64 of file FittedEntriesSet.cc.

References FillCorrelations(), and FillEntries().

Referenced by FittedEntriesSet().

65 {
66 
67  FillEntries( );
69 
70 }
void FittedEntriesSet::Fill ( )
void FittedEntriesSet::FillCorrelations ( )
void FittedEntriesSet::FillCorrelations ( )

Definition at line 96 of file FittedEntriesSet.cc.

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

Referenced by Fill().

97 {
98  //------ Count the number of entries that will be in the set
99  ALIuint nent = 0;
100  std::vector<Entry*>::const_iterator vecite;
101  for ( vecite = Model::EntryList().begin();
102  vecite != Model::EntryList().end(); vecite++ ) {
103  if((*vecite)->quality() > theMinEntryQuality ) {
104  nent++;
105  }
106  }
107 
108  CreateCorrelationMatrix( nent );
109  //---------- Store correlations
110  ALIuint ii;
111  for( ii = 0; ii < nent; ii++) {
112  for(ALIuint jj = ii+1; jj < nent; jj++) {
113  ALIdouble corr = theEntriesErrorMatrix->Mat()->me[ii][jj];
114  if (corr != 0) {
115  corr /= ( sqrt(theEntriesErrorMatrix->Mat()->me[ii][ii])
116  / sqrt(theEntriesErrorMatrix->Mat()->me[jj][jj]) );
118  }
119  }
120  }
121 
122 }
long double ALIdouble
Definition: CocoaGlobals.h:11
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
MatrixMeschach * theEntriesErrorMatrix
static std::vector< Entry * > & EntryList()
Definition: Model.h:75
T sqrt(T t)
Definition: SSEVec.h:46
const MAT * Mat() const
JetCorrectorParameters corr
Definition: classes.h:9
void CreateCorrelationMatrix(const ALIuint nent)
#define begin
Definition: vmac.h:31
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntries ( )

Definition at line 74 of file FittedEntriesSet.cc.

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

Referenced by Fill().

75 {
76  //---------- Store Fitted Entries
77  //----- Iterate over entry list
78  std::vector<Entry*>::const_iterator vecite;
79  for ( vecite = Model::EntryList().begin();
80  vecite != Model::EntryList().end(); vecite++ ) {
81  //--- Only for good quality parameters (='unk')
82  if ( (*vecite)->quality() >= theMinEntryQuality ) {
83  // ALIdouble dimv = (*vecite)->ValueDimensionFactor();
84  // ALIdouble dims = (*vecite)->SigmaDimensionFactor();
85  ALIint ipos = (*vecite)->fitPos();
86  FittedEntry* fe = new FittedEntry( (*vecite), ipos, sqrt(theEntriesErrorMatrix->Mat()->me[ipos][ipos]));
87  //- std::cout << fe << "IN fit FE " << fe->theValue<< " " << fe->Sigma()<< " " << sqrt(theEntriesErrorMatrix->Mat()->me[NoEnt][NoEnt]) / dims<< std::endl;
88  theFittedEntries.push_back( fe );
89  }
90  }
91 
92 }
std::vector< FittedEntry * > theFittedEntries
MatrixMeschach * theEntriesErrorMatrix
int ALIint
Definition: CocoaGlobals.h:15
static std::vector< Entry * > & EntryList()
Definition: Model.h:75
T sqrt(T t)
Definition: SSEVec.h:46
const MAT * Mat() const
double & fe
Definition: VDTMath.h:196
#define begin
Definition: vmac.h:31
void FittedEntriesSet::FillEntries ( )
void FittedEntriesSet::FillEntriesAveragingSets ( std::vector< FittedEntriesSet * >  vSets)
void FittedEntriesSet::FillEntriesAveragingSets ( std::vector< FittedEntriesSet * >  vSets)

Definition at line 150 of file FittedEntriesSet.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, vdt::fe, FittedEntries(), FittedEntry::getSigma(), FittedEntry::getValue(), findQualityFiles::jj, and theFittedEntries.

Referenced by FittedEntriesSet().

151 {
152 
153  std::vector<FittedEntry*> vFEntry;
154  ALIuint nEntry = vSets[0]->FittedEntries().size();
155  // ALIuint setssiz = vSets.size();
156  for( ALIuint ii = 0; ii < nEntry; ii++ ){ // loop to FittedEntry's
157  if(ALIUtils::debug >= 5) std::cout << "FillEntriesAveragingSets entry " << ii << std::endl;
158  vFEntry.clear();
159  for( ALIuint jj = 0; jj < vSets.size(); jj++ ){ // look for FittedEntry ii in each Sets
160  if(ALIUtils::debug >= 5) std::cout << "FillEntriesAveragingSets set " << jj << std::endl;
161  //----- Check all have the same number of entries
162  if( vSets[jj]->FittedEntries().size() != nEntry ){
163  std::cerr << "!!! FATAL ERROR FittedEntriesSet::FillEntriesAveragingSets set number " << jj
164  << " has different number of entries = "
165  << vSets[jj]->FittedEntries().size()
166  << " than first set = " << nEntry << std::endl;
167  exit(1);
168  }
169 
170  vFEntry.push_back( vSets[jj]->FittedEntries()[ii] );
171  }
172  FittedEntry* fe = new FittedEntry( vFEntry );
173  if(ALIUtils::debug >= 5) std::cout << "FillEntriesAveragingSets new fentry " << fe->getValue() << " " << fe->getSigma() << std::endl;
174  theFittedEntries.push_back( fe );
175  }
176 
177 
178 }
std::vector< FittedEntry * > theFittedEntries
static ALIint debug
Definition: ALIUtils.h:35
ALIdouble getSigma() const
Definition: FittedEntry.h:42
std::vector< FittedEntry * > & FittedEntries()
double & fe
Definition: VDTMath.h:196
tuple cout
Definition: gather_cfg.py:121
ALIdouble getValue() const
Definition: FittedEntry.h:39
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntriesFromFile ( std::vector< ALIstring wl)

Definition at line 137 of file FittedEntriesSet.cc.

References vdt::fe, ALIUtils::getFloat(), and theFittedEntries.

Referenced by FittedEntriesSet().

138 {
139 
140  ALIuint siz = wl.size();
141  for( ALIuint ii = 1; ii< siz; ii+=3 ) {
142  FittedEntry* fe = new FittedEntry( wl[ii], ALIUtils::getFloat(wl[ii+1]), ALIUtils::getFloat(wl[ii+2]));
143  theFittedEntries.push_back( fe );
144  }
145 
146 }
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:404
double & fe
Definition: VDTMath.h:196
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntriesFromFile ( std::vector< ALIstring wl)
std::vector< FittedEntry* >& FittedEntriesSet::FittedEntries ( )
inline

Definition at line 42 of file FittedEntriesSet.h.

References theFittedEntries.

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

42  {
43  return theFittedEntries;
44  }
std::vector< FittedEntry * > theFittedEntries
std::vector< FittedEntry* >& FittedEntriesSet::FittedEntries ( )
inline

Definition at line 42 of file FittedEntriesSet.h.

References theFittedEntries.

42  {
43  return theFittedEntries;
44  }
std::vector< FittedEntry * > theFittedEntries
ALIstring& FittedEntriesSet::getDate ( )
inline

Definition at line 47 of file FittedEntriesSet.h.

References theDate.

Referenced by cmsPerfSuite.PerfSuite::printDate(), and cmsPerfSuite.PerfSuite::runCmdSet().

47  {
48  return theDate;
49  }
ALIstring& FittedEntriesSet::getDate ( )
inline

Definition at line 47 of file FittedEntriesSet.h.

References theDate.

Referenced by cmsPerfSuite.PerfSuite::printDate(), and cmsPerfSuite.PerfSuite::runCmdSet().

47  {
48  return theDate;
49  }
ALIstring& FittedEntriesSet::getTime ( )
inline

Definition at line 50 of file FittedEntriesSet.h.

References theTime.

50  {
51  return theTime;
52  }
ALIstring& FittedEntriesSet::getTime ( )
inline

Definition at line 50 of file FittedEntriesSet.h.

References theTime.

50  {
51  return theTime;
52  }
void FittedEntriesSet::SetOptOEntries ( )

Definition at line 182 of file FittedEntriesSet.cc.

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

183 {
184  if(ALIUtils::debug >= 5) std::cout << " FittedEntriesSet::SetOptOEntries " << theFittedEntries.size() << std::endl;
185 
186  std::vector< FittedEntry* >::const_iterator ite;
187  for( ite = theFittedEntries.begin();ite != theFittedEntries.end();ite++){
188  FittedEntry* fe = (*ite);
191  entry->setValue( fe->getValue() );
192  entry->setSigma( fe->getSigma() );
193 
194  if(ALIUtils::debug >= 5) std::cout << " FittedEntriesSet::SetOptOEntries() " << opto->name() << " " << entry->name() << std::endl;
195  opto->setGlobalCoordinates();
196  opto->setOriginalEntryValues();
197  }
198 }
Definition: Entry.h:18
std::vector< FittedEntry * > theFittedEntries
ALIstring getOptOName() const
Definition: FittedEntry.h:30
static OpticalObject * getOptOByName(const ALIstring &opto_name)
--— Find an OptO name in theOptOList and return a pointer to it
Definition: Model.cc:578
void setValue(ALIdouble val)
Definition: Entry.h:77
static ALIint debug
Definition: ALIUtils.h:35
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:633
void setOriginalEntryValues()
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
ALIdouble getSigma() const
Definition: FittedEntry.h:42
ALIstring getEntryName() const
Definition: FittedEntry.h:33
double & fe
Definition: VDTMath.h:196
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
ALIdouble getValue() const
Definition: FittedEntry.h:39
void setGlobalCoordinates()
void FittedEntriesSet::SetOptOEntries ( )

Member Data Documentation

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

Definition at line 61 of file FittedEntriesSet.h.

Referenced by CreateCorrelationMatrix(), and FillCorrelations().

ALIstring FittedEntriesSet::theDate
private

Definition at line 59 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getDate().

MatrixMeschach * FittedEntriesSet::theEntriesErrorMatrix
private

Definition at line 63 of file FittedEntriesSet.h.

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

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

Definition at line 62 of file FittedEntriesSet.h.

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

ALIstring FittedEntriesSet::theTime
private

Definition at line 60 of file FittedEntriesSet.h.

Referenced by FittedEntriesSet(), and getTime().