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

22 {
23  //- theTime = Model::MeasurementsTime();
26 
28  theEntriesErrorMatrix = AtWAMatrix;
29 
30  Fill();
31 
32 }
static ALIstring getCurrentTime()
Definition: Measurement.h:155
static ALIstring getCurrentDate()
Definition: Measurement.h:152
MatrixMeschach * theEntriesErrorMatrix
FittedEntriesSet::FittedEntriesSet ( const 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(const std::vector< ALIstring > &wl)
FittedEntriesSet::FittedEntriesSet ( const 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 }
MatrixMeschach * theEntriesErrorMatrix
void FillEntriesAveragingSets(const 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< DeviationSensor2D * > > vvd
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
std::vector< DeviationSensor2D * > vd
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::FillCorrelations ( )

Definition at line 96 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().

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++) {
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
int ii
Definition: cuy.py:588
static std::vector< Entry * > & EntryList()
Definition: Model.h:75
std::vector< std::vector< ALIdouble > > theCorrelationMatrix
T sqrt(T t)
Definition: SSEVec.h:18
const MAT * Mat() const
MatrixMeschach * theEntriesErrorMatrix
JetCorrectorParameters corr
Definition: classes.h:5
void CreateCorrelationMatrix(const ALIuint nent)
#define begin
Definition: vmac.h:30
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntries ( )

Definition at line 74 of file FittedEntriesSet.cc.

References begin, Model::EntryList(), 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
int ALIint
Definition: CocoaGlobals.h:15
static std::vector< Entry * > & EntryList()
Definition: Model.h:75
T sqrt(T t)
Definition: SSEVec.h:18
const MAT * Mat() const
MatrixMeschach * theEntriesErrorMatrix
#define begin
Definition: vmac.h:30
void FittedEntriesSet::FillEntriesAveragingSets ( const std::vector< FittedEntriesSet * > &  vSets)

Definition at line 150 of file FittedEntriesSet.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, gather_cfg::cout, ALIUtils::debug, cmsRelvalreport::exit, FittedEntries(), FittedEntry::getSigma(), FittedEntry::getValue(), cuy::ii, 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:36
int ii
Definition: cuy.py:588
ALIdouble getSigma() const
Definition: FittedEntry.h:42
std::vector< FittedEntry * > & FittedEntries()
tuple cout
Definition: gather_cfg.py:145
ALIdouble getValue() const
Definition: FittedEntry.h:39
unsigned int ALIuint
Definition: CocoaGlobals.h:17
void FittedEntriesSet::FillEntriesFromFile ( const std::vector< ALIstring > &  wl)

Definition at line 137 of file FittedEntriesSet.cc.

References ALIUtils::getFloat(), cuy::ii, 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
int ii
Definition: cuy.py:588
static double getFloat(const ALIstring &str)
Convert a string to an float, checking that it is really a number.
Definition: ALIUtils.cc:404
unsigned int ALIuint
Definition: CocoaGlobals.h:17
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
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  }
void FittedEntriesSet::SetOptOEntries ( )

Definition at line 182 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.

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:36
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()
ALIdouble getSigma() const
Definition: FittedEntry.h:42
ALIstring getEntryName() const
Definition: FittedEntry.h:33
list entry
Definition: mps_splice.py:62
tuple cout
Definition: gather_cfg.py:145
const ALIstring & name() const
Definition: OpticalObject.h:60
ALIdouble getValue() const
Definition: FittedEntry.h:39
void setGlobalCoordinates()

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