CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
FittedEntry Class Reference

#include <FittedEntry.h>

Public Member Functions

void BuildName ()
 
void BuildName ()
 
 FittedEntry ()
 
 FittedEntry ()
 
 FittedEntry (Entry *entry, ALIint order, ALIdouble sigma)
 
 FittedEntry (Entry *entry, ALIint order, ALIdouble sigma)
 
 FittedEntry (ALIstring name, float value, float sigma)
 
 FittedEntry (ALIstring name, float value, float sigma)
 
 FittedEntry (std::vector< FittedEntry * > vFEntry)
 
 FittedEntry (std::vector< FittedEntry * > vFEntry)
 
EntrygetEntry () const
 
EntrygetEntry () const
 
ALIstring getEntryName () const
 
ALIstring getEntryName () const
 
ALIstring getName () const
 
ALIstring getName () const
 
ALIstring getOptOName () const
 
ALIstring getOptOName () const
 
ALIint getOrder () const
 
ALIint getOrder () const
 
ALIdouble getOrigSigma () const
 
ALIdouble getOrigSigma () const
 
ALIdouble getOrigValue () const
 
ALIdouble getOrigValue () const
 
ALIint getQuality () const
 
ALIint getQuality () const
 
ALIdouble getSigma () const
 
ALIdouble getSigma () const
 
ALIdouble getValue () const
 
ALIdouble getValue () const
 
 ~FittedEntry ()
 
 ~FittedEntry ()
 

Private Attributes

EntrytheEntry
 
ALIstring theEntryName
 
ALIstring theName
 
ALIstring theOptOName
 
ALIint theOrder
 
ALIdouble theOrigSigma
 
ALIdouble theOrigValue
 
ALIint theQuality
 
ALIdouble theSigma
 
ALIdouble theValue
 

Detailed Description

Definition at line 17 of file FittedEntry.h.

Constructor & Destructor Documentation

FittedEntry::FittedEntry ( )
inline

Definition at line 22 of file FittedEntry.h.

22 { };
FittedEntry::FittedEntry ( Entry entry,
ALIint  order,
ALIdouble  sigma 
)

Definition at line 19 of file FittedEntry.cc.

References BuildName(), gather_cfg::cout, ALIUtils::debug, OpticalObject::longName(), Entry::name(), Entry::OptOCurrent(), Entry::OutputSigmaDimensionFactor(), Entry::OutputValueDimensionFactor(), Entry::quality(), Entry::sigma(), theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, theValue, Entry::value(), and Entry::valueDisplacementByFitting().

20 {
21  theEntry = entry;
22  theOrder = order;
23  theOptOName = entry->OptOCurrent()->longName();
24  if(ALIUtils::debug >= 5) std::cout << " creating FittedEntry " << theOptOName << std::endl;
25  theEntryName = entry->name();
26  BuildName();
27 
28  //------ store values and sigmas in dimensions indicated by global options
29  ALIdouble dimv = entry->OutputValueDimensionFactor();
30  ALIdouble dims = entry->OutputSigmaDimensionFactor();
31  theValue = ( entry->value() + entry->valueDisplacementByFitting() ) / dimv;
32  theSigma = sigma / dims;
33  theOrigValue = entry->value() / dimv;
34  theOrigSigma = entry->sigma() / dims;
35  theQuality = entry->quality();
36 
37  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
38 }
long double ALIdouble
Definition: CocoaGlobals.h:11
virtual ALIdouble OutputValueDimensionFactor() const
Definition: Entry.h:39
ALIdouble theOrigValue
Definition: FittedEntry.h:70
ALIint theOrder
Definition: FittedEntry.h:65
ALIdouble theOrigSigma
Definition: FittedEntry.h:71
ALIdouble valueDisplacementByFitting() const
Definition: Entry.h:63
virtual ALIdouble OutputSigmaDimensionFactor() const
Definition: Entry.h:40
ALIint theQuality
Definition: FittedEntry.h:72
ALIdouble value() const
Definition: Entry.h:55
static ALIint debug
Definition: ALIUtils.h:35
Entry * theEntry
Definition: FittedEntry.h:64
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
void BuildName()
Definition: FittedEntry.cc:114
const ALIstring longName() const
const ALIstring & name() const
Definition: Entry.h:52
ALIdouble theValue
Definition: FittedEntry.h:63
ALIstring theEntryName
Definition: FittedEntry.h:68
ALIint quality() const
Definition: Entry.h:59
tuple cout
Definition: gather_cfg.py:121
ALIdouble theSigma
Definition: FittedEntry.h:69
OpticalObject * OptOCurrent() const
Definition: Entry.h:61
ALIstring theOptOName
Definition: FittedEntry.h:67
ALIdouble sigma() const
Definition: Entry.h:57
FittedEntry::FittedEntry ( ALIstring  name,
float  value,
float  sigma 
)

Definition at line 42 of file FittedEntry.cc.

References Model::getEntryByName(), Entry::OutputSigmaDimensionFactor(), Entry::OutputValueDimensionFactor(), point, theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, and theValue.

43 {
44  //ar.lass1.laser.centre_X
45  theOrder = 0;
46  theOptOName = "s";
47  ALIint point = -1;
48  ALIint pointold = 0;
49  for( ;; ){
50  point = name.find( ".", point+1 );
51  if( point == -1 ) break;
52  theOptOName += "/" + name.substr( pointold, point-pointold);
53  pointold = point+1;
54  }
55  theEntryName = name.substr( pointold, name.size() );
56 
57  // std::cout << " building theEntryName " << theEntryName << " " << pointold << " " << name << std::endl;
59 
60  theEntry = 0;
61 
62  //------ store values and sigmas in dimensions indicated by global options
63  ALIdouble dimv = entry->OutputValueDimensionFactor();
64  ALIdouble dims = entry->OutputSigmaDimensionFactor();
65  theValue = value * dimv;
66  theSigma = sigma * dims;
67  theOrigValue = value * dimv;
68  theOrigSigma = sigma * dims;
69  theQuality = 2;
70 
71  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
72 }
long double ALIdouble
Definition: CocoaGlobals.h:11
virtual ALIdouble OutputValueDimensionFactor() const
Definition: Entry.h:39
ALIdouble theOrigValue
Definition: FittedEntry.h:70
ALIint theOrder
Definition: FittedEntry.h:65
ALIdouble theOrigSigma
Definition: FittedEntry.h:71
Definition: Entry.h:18
virtual ALIdouble OutputSigmaDimensionFactor() const
Definition: Entry.h:40
ALIint theQuality
Definition: FittedEntry.h:72
int ALIint
Definition: CocoaGlobals.h:15
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
Entry * theEntry
Definition: FittedEntry.h:64
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
ALIdouble theValue
Definition: FittedEntry.h:63
ALIstring theEntryName
Definition: FittedEntry.h:68
ALIdouble theSigma
Definition: FittedEntry.h:69
ALIstring theOptOName
Definition: FittedEntry.h:67
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
FittedEntry::FittedEntry ( std::vector< FittedEntry * >  vFEntry)

Definition at line 76 of file FittedEntry.cc.

References dtNoiseDBValidation_cfg::cerr, cmsRelvalreport::exit, theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, and theValue.

77 {
78  //----- Average the entries
79 
80  std::vector<FittedEntry*>::iterator ite;
81  //--- First check that all entries are from the same OptO and Entry
82  theOptOName = (vFEntry[0]->getOptOName() );
83  theEntryName = (vFEntry[0]->getEntryName() );
84  theOrder = (vFEntry[0]->getOrder() );
85  theEntry = (vFEntry[0]->getEntry() );
86  theQuality = (vFEntry[0]->getQuality() );
87 
88  theValue = 0.;
89  theSigma = 0.;
90  theOrigValue = 0.;
91  theOrigSigma = 0.;
92  for( ite = vFEntry.begin(); ite != vFEntry.end(); ite++) {
93  if( (*ite)->getOptOName() != theOptOName || (*ite)->getEntryName() != theEntryName ){
94  std::cerr << "!!! FATAL ERROR FittedEntry::FittedEntry one entry in list has different opto or entry names : " << (*ite)->getOptOName() << " != " << theOptOName << " " << (*ite)->getEntryName() << " != " << theEntryName << std::endl;
95  exit(1);
96  }
97 
98  theValue += (*ite)->getValue();
99  theSigma += (*ite)->getSigma();
100  theOrigValue += (*ite)->getOrigValue();
101  theOrigSigma += (*ite)->getOrigSigma();
102  }
103 
104  ALIint siz = vFEntry.size();
105  theValue /= siz;
106  theSigma /= siz;
107  theOrigValue /= siz;
108  theOrigSigma /= siz;
109 
110 }
ALIdouble theOrigValue
Definition: FittedEntry.h:70
ALIint theOrder
Definition: FittedEntry.h:65
ALIdouble theOrigSigma
Definition: FittedEntry.h:71
ALIint theQuality
Definition: FittedEntry.h:72
int ALIint
Definition: CocoaGlobals.h:15
Entry * theEntry
Definition: FittedEntry.h:64
ALIdouble theValue
Definition: FittedEntry.h:63
ALIstring theEntryName
Definition: FittedEntry.h:68
ALIdouble theSigma
Definition: FittedEntry.h:69
ALIstring theOptOName
Definition: FittedEntry.h:67
FittedEntry::~FittedEntry ( )
inline

Definition at line 26 of file FittedEntry.h.

26 { };
FittedEntry::FittedEntry ( )
inline

Definition at line 22 of file FittedEntry.h.

22 { };
FittedEntry::FittedEntry ( Entry entry,
ALIint  order,
ALIdouble  sigma 
)
FittedEntry::FittedEntry ( ALIstring  name,
float  value,
float  sigma 
)
FittedEntry::FittedEntry ( std::vector< FittedEntry * >  vFEntry)
FittedEntry::~FittedEntry ( )
inline

Definition at line 26 of file FittedEntry.h.

26 { };

Member Function Documentation

void FittedEntry::BuildName ( )

Definition at line 114 of file FittedEntry.cc.

References pickleFileParser::slash, theEntryName, theName, and theOptOName.

Referenced by FittedEntry().

115 {
116  //----- substitute '/' by '.' in opto name
117  theName = theOptOName.substr( 2, theOptOName.size() ); // skip the first 's/'
118  ALIint slash = -1;
119  for(;;){
120  slash = theName.find('/', slash+1);
121  if( slash == -1 ) break;
122  theName[slash] = '.';
123  }
124 
125  //----- Check if there is a ' ' in entry (should not happen now)
126  ALIint space = theEntryName.rfind(' ');
127  theName.append(".");
128  ALIstring en = theEntryName;
129  if( space != -1) en[space] = '_';
130 
131  //----- Merge opto and entry names
132  // now it is not used as theName theName.append( en + ".out");
133  theName.append( en);
134 
135 }
int ALIint
Definition: CocoaGlobals.h:15
ALIstring theEntryName
Definition: FittedEntry.h:68
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIstring theName
Definition: FittedEntry.h:66
ALIstring theOptOName
Definition: FittedEntry.h:67
void FittedEntry::BuildName ( )
Entry* FittedEntry::getEntry ( ) const
inline

Definition at line 57 of file FittedEntry.h.

References theEntry.

57  {
58  return theEntry;
59  }
Entry * theEntry
Definition: FittedEntry.h:64
Entry* FittedEntry::getEntry ( ) const
inline

Definition at line 57 of file FittedEntry.h.

References theEntry.

57  {
58  return theEntry;
59  }
Entry * theEntry
Definition: FittedEntry.h:64
ALIstring FittedEntry::getEntryName ( ) const
inline

Definition at line 33 of file FittedEntry.h.

References theEntryName.

Referenced by NtupleManager::FillFitParameters(), and FittedEntriesSet::SetOptOEntries().

33  {
34  return theEntryName;
35  }
ALIstring theEntryName
Definition: FittedEntry.h:68
ALIstring FittedEntry::getEntryName ( ) const
inline

Definition at line 33 of file FittedEntry.h.

References theEntryName.

33  {
34  return theEntryName;
35  }
ALIstring theEntryName
Definition: FittedEntry.h:68
ALIstring FittedEntry::getName ( ) const
inline

Definition at line 36 of file FittedEntry.h.

References theName.

Referenced by NtupleManager::FillFitParameters().

36  {
37  return theName;
38  }
ALIstring theName
Definition: FittedEntry.h:66
ALIstring FittedEntry::getName ( ) const
inline

Definition at line 36 of file FittedEntry.h.

References theName.

36  {
37  return theName;
38  }
ALIstring theName
Definition: FittedEntry.h:66
ALIstring FittedEntry::getOptOName ( ) const
inline

Definition at line 30 of file FittedEntry.h.

References theOptOName.

Referenced by NtupleManager::FillFitParameters(), and FittedEntriesSet::SetOptOEntries().

30  {
31  return theOptOName;
32  }
ALIstring theOptOName
Definition: FittedEntry.h:67
ALIstring FittedEntry::getOptOName ( ) const
inline

Definition at line 30 of file FittedEntry.h.

References theOptOName.

30  {
31  return theOptOName;
32  }
ALIstring theOptOName
Definition: FittedEntry.h:67
ALIint FittedEntry::getOrder ( ) const
inline

Definition at line 51 of file FittedEntry.h.

References theOrder.

Referenced by NtupleManager::FillFitParameters().

51  {
52  return theOrder;
53  }
ALIint theOrder
Definition: FittedEntry.h:65
ALIint FittedEntry::getOrder ( ) const
inline

Definition at line 51 of file FittedEntry.h.

References theOrder.

51  {
52  return theOrder;
53  }
ALIint theOrder
Definition: FittedEntry.h:65
ALIdouble FittedEntry::getOrigSigma ( ) const
inline

Definition at line 48 of file FittedEntry.h.

References theOrigSigma.

Referenced by NtupleManager::FillFitParameters().

48  {
49  return theOrigSigma;
50  }
ALIdouble theOrigSigma
Definition: FittedEntry.h:71
ALIdouble FittedEntry::getOrigSigma ( ) const
inline

Definition at line 48 of file FittedEntry.h.

References theOrigSigma.

48  {
49  return theOrigSigma;
50  }
ALIdouble theOrigSigma
Definition: FittedEntry.h:71
ALIdouble FittedEntry::getOrigValue ( ) const
inline

Definition at line 45 of file FittedEntry.h.

References theOrigValue.

45  {
46  return theOrigValue;
47  }
ALIdouble theOrigValue
Definition: FittedEntry.h:70
ALIdouble FittedEntry::getOrigValue ( ) const
inline

Definition at line 45 of file FittedEntry.h.

References theOrigValue.

Referenced by NtupleManager::FillFitParameters().

45  {
46  return theOrigValue;
47  }
ALIdouble theOrigValue
Definition: FittedEntry.h:70
ALIint FittedEntry::getQuality ( ) const
inline

Definition at line 54 of file FittedEntry.h.

References theQuality.

54  {
55  return theQuality;
56  }
ALIint theQuality
Definition: FittedEntry.h:72
ALIint FittedEntry::getQuality ( ) const
inline

Definition at line 54 of file FittedEntry.h.

References theQuality.

Referenced by NtupleManager::FillFitParameters().

54  {
55  return theQuality;
56  }
ALIint theQuality
Definition: FittedEntry.h:72
ALIdouble FittedEntry::getSigma ( ) const
inline

Definition at line 42 of file FittedEntry.h.

References theSigma.

42  {
43  return theSigma;
44  }
ALIdouble theSigma
Definition: FittedEntry.h:69
ALIdouble FittedEntry::getSigma ( ) const
inline
ALIdouble FittedEntry::getValue ( ) const
inline

Definition at line 39 of file FittedEntry.h.

References theValue.

39  {
40  return theValue;
41  }
ALIdouble theValue
Definition: FittedEntry.h:63
ALIdouble FittedEntry::getValue ( ) const
inline

Member Data Documentation

Entry * FittedEntry::theEntry
private

Definition at line 64 of file FittedEntry.h.

Referenced by FittedEntry(), and getEntry().

ALIstring FittedEntry::theEntryName
private

Definition at line 68 of file FittedEntry.h.

Referenced by BuildName(), FittedEntry(), and getEntryName().

ALIstring FittedEntry::theName
private
ALIstring FittedEntry::theOptOName
private

Definition at line 67 of file FittedEntry.h.

Referenced by BuildName(), FittedEntry(), and getOptOName().

ALIint FittedEntry::theOrder
private

Definition at line 65 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrder().

ALIdouble FittedEntry::theOrigSigma
private

Definition at line 71 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigSigma().

ALIdouble FittedEntry::theOrigValue
private

Definition at line 70 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigValue().

ALIint FittedEntry::theQuality
private

Definition at line 72 of file FittedEntry.h.

Referenced by FittedEntry(), and getQuality().

ALIdouble FittedEntry::theSigma
private

Definition at line 69 of file FittedEntry.h.

Referenced by FittedEntry(), and getSigma().

ALIdouble FittedEntry::theValue
private

Definition at line 63 of file FittedEntry.h.

Referenced by FittedEntry(), and getValue().