CMS 3D CMS Logo

Public Member Functions | Private Attributes

FittedEntry Class Reference

#include <FittedEntry.h>

List of all members.

Public Member Functions

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

{ };
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().

{
  theEntry = entry;
  theOrder = order;
  theOptOName = entry->OptOCurrent()->longName();
  if(ALIUtils::debug >= 5) std::cout << " creating FittedEntry " << theOptOName << std::endl;
  theEntryName = entry->name();
  BuildName();

  //------ store values and sigmas in dimensions indicated by global options
  ALIdouble dimv = entry->OutputValueDimensionFactor();
  ALIdouble dims = entry->OutputSigmaDimensionFactor();
  theValue = ( entry->value() + entry->valueDisplacementByFitting() ) / dimv;
  theSigma = sigma / dims;
  theOrigValue = entry->value() / dimv;
  theOrigSigma = entry->sigma() / dims;
  theQuality = entry->quality();

  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
}
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.

{ 
  //ar.lass1.laser.centre_X
  theOrder = 0;
  theOptOName = "s";
  ALIint point = -1;
  ALIint pointold = 0;
  for( ;; ){
    point = name.find( ".", point+1 );
    if( point == -1 ) break;
    theOptOName += "/" + name.substr( pointold, point-pointold);
    pointold = point+1;
  }
  theEntryName = name.substr( pointold, name.size() );

  //  std::cout << " building theEntryName " << theEntryName << " " << pointold << " " << name << std::endl;
  Entry* entry = Model::getEntryByName( theOptOName, theEntryName ); 

  theEntry = 0;

  //------ store values and sigmas in dimensions indicated by global options
  ALIdouble dimv = entry->OutputValueDimensionFactor();
  ALIdouble dims = entry->OutputSigmaDimensionFactor();
  theValue = value * dimv;
  theSigma = sigma * dims;
  theOrigValue = value * dimv;
  theOrigSigma = sigma * dims;
  theQuality = 2;

  //-std::cout << this << " FE value" << this->theValue << "sigma" << this->theSigma << std::endl;
}
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.

{
  //----- Average the entries

  std::vector<FittedEntry*>::iterator ite;
  //--- First check that all entries are from the same OptO and Entry
  theOptOName = (vFEntry[0]->getOptOName() );
  theEntryName = (vFEntry[0]->getEntryName() );
  theOrder = (vFEntry[0]->getOrder() );
  theEntry = (vFEntry[0]->getEntry() );
  theQuality = (vFEntry[0]->getQuality() );

  theValue = 0.;
  theSigma = 0.;
  theOrigValue = 0.;
  theOrigSigma = 0.;
  for( ite = vFEntry.begin(); ite != vFEntry.end(); ite++) {
    if( (*ite)->getOptOName() != theOptOName || (*ite)->getEntryName() != theEntryName ){
      std::cerr << "!!! FATAL ERROR FittedEntry::FittedEntry  one entry in list has different opto or entry names : " << (*ite)->getOptOName() << " !=  " << theOptOName << " " << (*ite)->getEntryName() << " != " << theEntryName << std::endl;
      exit(1);
    }

    theValue += (*ite)->getValue();
    theSigma += (*ite)->getSigma();
    theOrigValue += (*ite)->getOrigValue();
    theOrigSigma += (*ite)->getOrigSigma();
  }

  ALIint siz = vFEntry.size();
  theValue /= siz;
  theSigma /= siz;
  theOrigValue /= siz;
  theOrigSigma /= siz;

}
FittedEntry::~FittedEntry ( ) [inline]

Definition at line 26 of file FittedEntry.h.

{ };
FittedEntry::FittedEntry ( ) [inline]

Definition at line 22 of file FittedEntry.h.

{ };
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.

{ };

Member Function Documentation

void FittedEntry::BuildName ( )

Definition at line 114 of file FittedEntry.cc.

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

Referenced by FittedEntry().

{
  //----- substitute '/' by '.' in opto name
  theName = theOptOName.substr( 2, theOptOName.size() );  // skip the first 's/'
  ALIint slash = -1;
  for(;;){
    slash =  theName.find('/', slash+1);
    if( slash == -1 ) break;
    theName[slash] = '.';
  }

  //----- Check if there is a ' ' in entry (should not happen now)
  ALIint space = theEntryName.rfind(' ');
  theName.append(".");
  ALIstring en = theEntryName;
  if( space != -1) en[space] = '_';

  //----- Merge opto and entry names
  // now it is not used as theName   theName.append( en + ".out");
  theName.append( en);

}
void FittedEntry::BuildName ( )
Entry* FittedEntry::getEntry ( ) const [inline]

Definition at line 57 of file FittedEntry.h.

References theEntry.

                          {
    return theEntry;
  }
Entry* FittedEntry::getEntry ( ) const [inline]

Definition at line 57 of file FittedEntry.h.

References theEntry.

                          {
    return theEntry;
  }
ALIstring FittedEntry::getEntryName ( ) const [inline]

Definition at line 33 of file FittedEntry.h.

References theEntryName.

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

                                 {
   return theEntryName;
  }
ALIstring FittedEntry::getEntryName ( ) const [inline]

Definition at line 33 of file FittedEntry.h.

References theEntryName.

                                 {
   return theEntryName;
  }
ALIstring FittedEntry::getName ( ) const [inline]

Definition at line 36 of file FittedEntry.h.

References theName.

Referenced by NtupleManager::FillFitParameters().

                            {
   return theName;
  }
ALIstring FittedEntry::getName ( ) const [inline]

Definition at line 36 of file FittedEntry.h.

References theName.

                            {
   return theName;
  }
ALIstring FittedEntry::getOptOName ( ) const [inline]

Definition at line 30 of file FittedEntry.h.

References theOptOName.

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

                                {
   return theOptOName;
  }
ALIstring FittedEntry::getOptOName ( ) const [inline]

Definition at line 30 of file FittedEntry.h.

References theOptOName.

                                {
   return theOptOName;
  }
ALIint FittedEntry::getOrder ( ) const [inline]

Definition at line 51 of file FittedEntry.h.

References theOrder.

Referenced by NtupleManager::FillFitParameters().

                          {
    return theOrder;
  }
ALIint FittedEntry::getOrder ( ) const [inline]

Definition at line 51 of file FittedEntry.h.

References theOrder.

                          {
    return theOrder;
  }
ALIdouble FittedEntry::getOrigSigma ( ) const [inline]

Definition at line 48 of file FittedEntry.h.

References theOrigSigma.

Referenced by NtupleManager::FillFitParameters().

                                 {
   return theOrigSigma;
  }
ALIdouble FittedEntry::getOrigSigma ( ) const [inline]

Definition at line 48 of file FittedEntry.h.

References theOrigSigma.

                                 {
   return theOrigSigma;
  }
ALIdouble FittedEntry::getOrigValue ( ) const [inline]

Definition at line 45 of file FittedEntry.h.

References theOrigValue.

                                 {
   return theOrigValue;
  }
ALIdouble FittedEntry::getOrigValue ( ) const [inline]

Definition at line 45 of file FittedEntry.h.

References theOrigValue.

Referenced by NtupleManager::FillFitParameters().

                                 {
   return theOrigValue;
  }
ALIint FittedEntry::getQuality ( ) const [inline]

Definition at line 54 of file FittedEntry.h.

References theQuality.

                            {
    return theQuality;
  }
ALIint FittedEntry::getQuality ( ) const [inline]

Definition at line 54 of file FittedEntry.h.

References theQuality.

Referenced by NtupleManager::FillFitParameters().

                            {
    return theQuality;
  }
ALIdouble FittedEntry::getSigma ( ) const [inline]

Definition at line 42 of file FittedEntry.h.

References theSigma.

                             {
   return theSigma;
  }
ALIdouble FittedEntry::getSigma ( ) const [inline]
ALIdouble FittedEntry::getValue ( ) const [inline]

Definition at line 39 of file FittedEntry.h.

References theValue.

                             {
   return theValue;
  }
ALIdouble FittedEntry::getValue ( ) const [inline]

Member Data Documentation

Definition at line 64 of file FittedEntry.h.

Referenced by FittedEntry(), and getEntry().

Definition at line 68 of file FittedEntry.h.

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

Definition at line 66 of file FittedEntry.h.

Referenced by BuildName(), and getName().

Definition at line 67 of file FittedEntry.h.

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

Definition at line 65 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrder().

Definition at line 71 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigSigma().

Definition at line 70 of file FittedEntry.h.

Referenced by FittedEntry(), and getOrigValue().

Definition at line 72 of file FittedEntry.h.

Referenced by FittedEntry(), and getQuality().

Definition at line 69 of file FittedEntry.h.

Referenced by FittedEntry(), and getSigma().

Definition at line 63 of file FittedEntry.h.

Referenced by FittedEntry(), and getValue().