CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/Calibration/EcalCalibAlgos/src/L3CalibBlock.cc

Go to the documentation of this file.
00001 
00008 #include "Calibration/EcalCalibAlgos/interface/L3CalibBlock.h"
00009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00010 #include "TH1F.h"
00011 #include "TFile.h"
00012 
00013 
00014 // -----------------------------------------------------
00015 
00016 
00017 L3CalibBlock::L3CalibBlock (const int numberOfElements, 
00018                             const int keventweight):
00019   VEcalCalibBlock (numberOfElements), 
00020   m_L3AlgoUniv (new MinL3AlgoUniv<unsigned int>(keventweight))
00021 {
00022   reset () ;
00023 }
00024 
00025 
00026 // -----------------------------------------------------
00027 
00028 
00029 L3CalibBlock::~L3CalibBlock()
00030 {
00031   delete m_L3AlgoUniv ;
00032 }
00033 
00034 
00035 // -----------------------------------------------------
00036 
00037 
00038 void
00039 L3CalibBlock::Fill (std::map<int,double>::const_iterator MapBegin,
00040                     std::map<int,double>::const_iterator MapEnd ,
00041                     double pTk,
00042                     double pSubtract,
00043                     double sigma)
00044 {
00045   // to feed the L3 algo
00046   std::vector<float> energy ;
00047   std::vector<unsigned int> position ;
00048   // loop over the energies map
00049   for (std::map<int,double>::const_iterator itMap = MapBegin ; 
00050        itMap != MapEnd ; 
00051        ++itMap)
00052     {
00053       // translation into vectors for the L3 algo
00054       position.push_back (itMap->first) ;
00055       energy.push_back (itMap->second) ;
00056     } // loop over the energies map
00057   m_L3AlgoUniv->addEvent (energy, position, pTk-pSubtract) ;
00058 
00059   return ;
00060 }
00061 
00062 
00063 // ------------------------------------------------------------
00064 
00065 
00066 int
00067 L3CalibBlock::solve (int usingBlockSolver, double min, double max)
00068 {
00069   m_coefficients = m_L3AlgoUniv->getSolution () ;
00070   return 0 ;
00071 }
00072 
00073 
00074 // ------------------------------------------------------------
00075 
00076 
00077 void 
00078 L3CalibBlock::reset () 
00079 {
00080   //PG FIXME could it be it is not wanted to be reset?
00081   m_L3AlgoUniv->resetSolution () ;
00082   return ;
00083 }
00084 
00085