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 (ALIstring name, float value, float sigma)
 
 FittedEntry (const std::vector< FittedEntry * > &vFEntry)
 
 FittedEntry (Entry *entry, ALIint order, ALIdouble sigma)
 
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.

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 }

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

◆ FittedEntry() [3/4]

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

Definition at line 40 of file FittedEntry.cc.

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 }

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

◆ FittedEntry() [4/4]

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

Definition at line 73 of file FittedEntry.cc.

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 }

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

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

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 }

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

Referenced by FittedEntry().

◆ getEntry()

Entry* FittedEntry::getEntry ( ) const
inline

Definition at line 37 of file FittedEntry.h.

37 { return theEntry; }

References theEntry.

◆ getEntryName()

ALIstring FittedEntry::getEntryName ( ) const
inline

Definition at line 29 of file FittedEntry.h.

29 { return theEntryName; }

References theEntryName.

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

◆ getName()

ALIstring FittedEntry::getName ( ) const
inline

Definition at line 30 of file FittedEntry.h.

30 { return theName; }

References theName.

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

◆ getOptOName()

ALIstring FittedEntry::getOptOName ( ) const
inline

Definition at line 28 of file FittedEntry.h.

28 { return theOptOName; }

References theOptOName.

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

◆ getOrder()

ALIint FittedEntry::getOrder ( ) const
inline

Definition at line 35 of file FittedEntry.h.

35 { return theOrder; }

References theOrder.

Referenced by NtupleManager::FillFitParameters().

◆ getOrigSigma()

ALIdouble FittedEntry::getOrigSigma ( ) const
inline

Definition at line 34 of file FittedEntry.h.

34 { return theOrigSigma; }

References theOrigSigma.

Referenced by NtupleManager::FillFitParameters().

◆ getOrigValue()

ALIdouble FittedEntry::getOrigValue ( ) const
inline

Definition at line 33 of file FittedEntry.h.

33 { return theOrigValue; }

References theOrigValue.

Referenced by NtupleManager::FillFitParameters().

◆ getQuality()

ALIint FittedEntry::getQuality ( ) const
inline

Definition at line 36 of file FittedEntry.h.

36 { return theQuality; }

References theQuality.

Referenced by NtupleManager::FillFitParameters().

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

FittedEntry::theQuality
ALIint theQuality
Definition: FittedEntry.h:49
FittedEntry::theOrder
ALIint theOrder
Definition: FittedEntry.h:42
FittedEntry::theOrigSigma
ALIdouble theOrigSigma
Definition: FittedEntry.h:48
mps_splice.entry
entry
Definition: mps_splice.py:68
FittedEntry::theEntry
Entry * theEntry
Definition: FittedEntry.h:41
gather_cfg.cout
cout
Definition: gather_cfg.py:144
Model::getEntryByName
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
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
eventshapeDQM_cfi.order
order
Definition: eventshapeDQM_cfi.py:8
value
Definition: value.py:1
Entry
Definition: Entry.h:18
FittedEntry::BuildName
void BuildName()
Definition: FittedEntry.cc:110
FittedEntry::theName
ALIstring theName
Definition: FittedEntry.h:43
pickleFileParser.slash
slash
Definition: pickleFileParser.py:12
FittedEntry::theSigma
ALIdouble theSigma
Definition: FittedEntry.h:46
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
ALIint
int ALIint
Definition: CocoaGlobals.h:15
FittedEntry::theValue
ALIdouble theValue
Definition: FittedEntry.h:40
beamvalidation.exit
def exit(msg="")
Definition: beamvalidation.py:53
FittedEntry::theOrigValue
ALIdouble theOrigValue
Definition: FittedEntry.h:47
point
*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::theEntryName
ALIstring theEntryName
Definition: FittedEntry.h:45
EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.cerr
cerr
Definition: EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0.py:8
FittedEntry::theOptOName
ALIstring theOptOName
Definition: FittedEntry.h:44