CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
FittedEntry Class Reference

#include <FittedEntry.h>

Public Member Functions

void BuildName ()
 
 FittedEntry ()
 
 FittedEntry (Entry *entry, ALIint order, ALIdouble sigma)
 
 FittedEntry (ALIstring name, float value, float sigma)
 
 FittedEntry (const std::vector< FittedEntry *> &vFEntry)
 
EntrygetEntry () const
 
ALIstring getEntryName () const
 
ALIstring getName () const
 
ALIstring getOptOName () const
 
ALIint getOrder () const
 
ALIdouble getOrigSigma () const
 
ALIdouble getOrigValue () const
 
ALIint getQuality () const
 
ALIdouble getSigma () const
 
ALIdouble getValue () const
 
 ~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() [1/4]

FittedEntry::FittedEntry ( )
inline

Definition at line 20 of file FittedEntry.h.

20 {};

◆ FittedEntry() [2/4]

FittedEntry::FittedEntry ( Entry entry,
ALIint  order,
ALIdouble  sigma 
)

Definition at line 18 of file FittedEntry.cc.

References BuildName(), gather_cfg::cout, ALIUtils::debug, mps_splice::entry, eventshapeDQM_cfi::order, theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, and theValue.

18  {
19  theEntry = entry;
20  theOrder = order;
21  theOptOName = entry->OptOCurrent()->longName();
22  if (ALIUtils::debug >= 5)
23  std::cout << " creating FittedEntry " << theOptOName << std::endl;
24  theEntryName = entry->name();
25  BuildName();
26 
27  //------ store values and sigmas in dimensions indicated by global options
28  ALIdouble dimv = entry->OutputValueDimensionFactor();
29  ALIdouble dims = entry->OutputSigmaDimensionFactor();
30  theValue = (entry->value() + entry->valueDisplacementByFitting()) / dimv;
31  theSigma = sigma / dims;
32  theOrigValue = entry->value() / dimv;
33  theOrigSigma = entry->sigma() / dims;
34  theQuality = entry->quality();
35 
36  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
37 }
long double ALIdouble
Definition: CocoaGlobals.h:11
ALIdouble theOrigValue
Definition: FittedEntry.h:47
ALIint theOrder
Definition: FittedEntry.h:42
Entry * theEntry
Definition: FittedEntry.h:41
ALIdouble theOrigSigma
Definition: FittedEntry.h:48
ALIint theQuality
Definition: FittedEntry.h:49
static ALIint debug
Definition: ALIUtils.h:34
void BuildName()
Definition: FittedEntry.cc:110
ALIdouble theValue
Definition: FittedEntry.h:40
ALIstring theEntryName
Definition: FittedEntry.h:45
ALIdouble theSigma
Definition: FittedEntry.h:46
ALIstring theOptOName
Definition: FittedEntry.h:44

◆ FittedEntry() [3/4]

FittedEntry::FittedEntry ( ALIstring  name,
float  value,
float  sigma 
)

Definition at line 40 of file FittedEntry.cc.

References mps_splice::entry, Model::getEntryByName(), Skims_PA_cff::name, point, theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, and theValue.

40  {
41  //ar.lass1.laser.centre_X
42  theOrder = 0;
43  theOptOName = "s";
44  ALIint point = -1;
45  ALIint pointold = 0;
46  for (;;) {
47  point = name.find('.', point + 1);
48  if (point == -1)
49  break;
50  theOptOName += "/" + name.substr(pointold, point - pointold);
51  pointold = point + 1;
52  }
53  theEntryName = name.substr(pointold, name.size());
54 
55  // std::cout << " building theEntryName " << theEntryName << " " << pointold << " " << name << std::endl;
57 
58  theEntry = nullptr;
59 
60  //------ store values and sigmas in dimensions indicated by global options
61  ALIdouble dimv = entry->OutputValueDimensionFactor();
62  ALIdouble dims = entry->OutputSigmaDimensionFactor();
63  theValue = value * dimv;
64  theSigma = sigma * dims;
65  theOrigValue = value * dimv;
66  theOrigSigma = sigma * dims;
67  theQuality = 2;
68 
69  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
70 }
long double ALIdouble
Definition: CocoaGlobals.h:11
ALIdouble theOrigValue
Definition: FittedEntry.h:47
ALIint theOrder
Definition: FittedEntry.h:42
Entry * theEntry
Definition: FittedEntry.h:41
ALIdouble theOrigSigma
Definition: FittedEntry.h:48
Definition: Entry.h:18
ALIint theQuality
Definition: FittedEntry.h:49
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:615
Definition: value.py:1
ALIdouble theValue
Definition: FittedEntry.h:40
ALIstring theEntryName
Definition: FittedEntry.h:45
ALIdouble theSigma
Definition: FittedEntry.h:46
ALIstring theOptOName
Definition: FittedEntry.h:44
*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() [4/4]

FittedEntry::FittedEntry ( const std::vector< FittedEntry *> &  vFEntry)

Definition at line 73 of file FittedEntry.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, beamvalidation::exit(), theEntry, theEntryName, theOptOName, theOrder, theOrigSigma, theOrigValue, theQuality, theSigma, and theValue.

73  {
74  //----- Average the entries
75  std::vector<FittedEntry*> vFEntry = _vFEntry;
76  std::vector<FittedEntry*>::iterator ite;
77  //--- First check that all entries are from the same OptO and Entry
78  theOptOName = (vFEntry[0]->getOptOName());
79  theEntryName = (vFEntry[0]->getEntryName());
80  theOrder = (vFEntry[0]->getOrder());
81  theEntry = (vFEntry[0]->getEntry());
82  theQuality = (vFEntry[0]->getQuality());
83 
84  theValue = 0.;
85  theSigma = 0.;
86  theOrigValue = 0.;
87  theOrigSigma = 0.;
88  for (ite = vFEntry.begin(); ite != vFEntry.end(); ++ite) {
89  if ((*ite)->getOptOName() != theOptOName || (*ite)->getEntryName() != theEntryName) {
90  std::cerr << "!!! FATAL ERROR FittedEntry::FittedEntry one entry in list has different opto or entry names : "
91  << (*ite)->getOptOName() << " != " << theOptOName << " " << (*ite)->getEntryName()
92  << " != " << theEntryName << std::endl;
93  exit(1);
94  }
95 
96  theValue += (*ite)->getValue();
97  theSigma += (*ite)->getSigma();
98  theOrigValue += (*ite)->getOrigValue();
99  theOrigSigma += (*ite)->getOrigSigma();
100  }
101 
102  ALIint siz = vFEntry.size();
103  theValue /= siz;
104  theSigma /= siz;
105  theOrigValue /= siz;
106  theOrigSigma /= siz;
107 }
ALIdouble theOrigValue
Definition: FittedEntry.h:47
ALIint theOrder
Definition: FittedEntry.h:42
Entry * theEntry
Definition: FittedEntry.h:41
ALIdouble theOrigSigma
Definition: FittedEntry.h:48
ALIint theQuality
Definition: FittedEntry.h:49
int ALIint
Definition: CocoaGlobals.h:15
ALIdouble theValue
Definition: FittedEntry.h:40
ALIstring theEntryName
Definition: FittedEntry.h:45
ALIdouble theSigma
Definition: FittedEntry.h:46
ALIstring theOptOName
Definition: FittedEntry.h:44
def exit(msg="")

◆ ~FittedEntry()

FittedEntry::~FittedEntry ( )
inline

Definition at line 24 of file FittedEntry.h.

24 {};

Member Function Documentation

◆ BuildName()

void FittedEntry::BuildName ( )

Definition at line 110 of file FittedEntry.cc.

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

Referenced by FittedEntry().

110  {
111  //----- substitute '/' by '.' in opto name
112  theName = theOptOName.substr(2, theOptOName.size()); // skip the first 's/'
113  ALIint slash = -1;
114  for (;;) {
115  slash = theName.find('/', slash + 1);
116  if (slash == -1)
117  break;
118  theName[slash] = '.';
119  }
120 
121  //----- Check if there is a ' ' in entry (should not happen now)
122  ALIint space = theEntryName.rfind(' ');
123  theName.append(".");
124  ALIstring en = theEntryName;
125  if (space != -1)
126  en[space] = '_';
127 
128  //----- Merge opto and entry names
129  // now it is not used as theName theName.append( en + ".out");
130  theName.append(en);
131 }
int ALIint
Definition: CocoaGlobals.h:15
ALIstring theEntryName
Definition: FittedEntry.h:45
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIstring theName
Definition: FittedEntry.h:43
ALIstring theOptOName
Definition: FittedEntry.h:44

◆ getEntry()

Entry* FittedEntry::getEntry ( ) const
inline

Definition at line 37 of file FittedEntry.h.

References theEntry.

37 { return theEntry; }
Entry * theEntry
Definition: FittedEntry.h:41

◆ getEntryName()

ALIstring FittedEntry::getEntryName ( ) const
inline

Definition at line 29 of file FittedEntry.h.

References theEntryName.

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

29 { return theEntryName; }
ALIstring theEntryName
Definition: FittedEntry.h:45

◆ getName()

ALIstring FittedEntry::getName ( ) const
inline

Definition at line 30 of file FittedEntry.h.

References theName.

Referenced by plotting.Plot::draw(), and NtupleManager::FillFitParameters().

30 { return theName; }
ALIstring theName
Definition: FittedEntry.h:43

◆ getOptOName()

ALIstring FittedEntry::getOptOName ( ) const
inline

Definition at line 28 of file FittedEntry.h.

References theOptOName.

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

28 { return theOptOName; }
ALIstring theOptOName
Definition: FittedEntry.h:44

◆ getOrder()

ALIint FittedEntry::getOrder ( ) const
inline

Definition at line 35 of file FittedEntry.h.

References theOrder.

Referenced by NtupleManager::FillFitParameters().

35 { return theOrder; }
ALIint theOrder
Definition: FittedEntry.h:42

◆ getOrigSigma()

ALIdouble FittedEntry::getOrigSigma ( ) const
inline

Definition at line 34 of file FittedEntry.h.

References theOrigSigma.

Referenced by NtupleManager::FillFitParameters().

34 { return theOrigSigma; }
ALIdouble theOrigSigma
Definition: FittedEntry.h:48

◆ getOrigValue()

ALIdouble FittedEntry::getOrigValue ( ) const
inline

Definition at line 33 of file FittedEntry.h.

References theOrigValue.

Referenced by NtupleManager::FillFitParameters().

33 { return theOrigValue; }
ALIdouble theOrigValue
Definition: FittedEntry.h:47

◆ getQuality()

ALIint FittedEntry::getQuality ( ) const
inline

Definition at line 36 of file FittedEntry.h.

References theQuality.

Referenced by NtupleManager::FillFitParameters().

36 { return theQuality; }
ALIint theQuality
Definition: FittedEntry.h:49

◆ getSigma()

ALIdouble FittedEntry::getSigma ( ) const
inline

◆ getValue()

ALIdouble FittedEntry::getValue ( ) const
inline

Member Data Documentation

◆ theEntry

Entry* FittedEntry::theEntry
private

Definition at line 41 of file FittedEntry.h.

Referenced by FittedEntry(), and getEntry().

◆ theEntryName

ALIstring FittedEntry::theEntryName
private

Definition at line 45 of file FittedEntry.h.

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

◆ theName

ALIstring FittedEntry::theName
private

Definition at line 43 of file FittedEntry.h.

Referenced by BuildName(), and getName().

◆ theOptOName

ALIstring FittedEntry::theOptOName
private

Definition at line 44 of file FittedEntry.h.

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

◆ theOrder

ALIint FittedEntry::theOrder
private

Definition at line 42 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrder().

◆ theOrigSigma

ALIdouble FittedEntry::theOrigSigma
private

Definition at line 48 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigSigma().

◆ theOrigValue

ALIdouble FittedEntry::theOrigValue
private

Definition at line 47 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigValue().

◆ theQuality

ALIint FittedEntry::theQuality
private

Definition at line 49 of file FittedEntry.h.

Referenced by FittedEntry(), and getQuality().

◆ theSigma

ALIdouble FittedEntry::theSigma
private

Definition at line 46 of file FittedEntry.h.

Referenced by FittedEntry(), and getSigma().

◆ theValue

ALIdouble FittedEntry::theValue
private

Definition at line 40 of file FittedEntry.h.

Referenced by FittedEntry(), and getValue().