CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
L3CalibBlock.cc
Go to the documentation of this file.
1 
6 #include "TH1F.h"
7 #include "TFile.h"
8 
9 // -----------------------------------------------------
10 
11 L3CalibBlock::L3CalibBlock(const int numberOfElements, const int keventweight)
12  : VEcalCalibBlock(numberOfElements), m_L3AlgoUniv(new MinL3AlgoUniv<unsigned int>(keventweight)) {
13  reset();
14 }
15 
16 // -----------------------------------------------------
17 
19 
20 // -----------------------------------------------------
21 
22 void L3CalibBlock::Fill(std::map<int, double>::const_iterator MapBegin,
23  std::map<int, double>::const_iterator MapEnd,
24  double pTk,
25  double pSubtract,
26  double sigma) {
27  // to feed the L3 algo
28  std::vector<float> energy;
29  std::vector<unsigned int> position;
30  // loop over the energies map
31  for (std::map<int, double>::const_iterator itMap = MapBegin; itMap != MapEnd; ++itMap) {
32  // translation into vectors for the L3 algo
33  position.push_back(itMap->first);
34  energy.push_back(itMap->second);
35  } // loop over the energies map
36  m_L3AlgoUniv->addEvent(energy, position, pTk - pSubtract);
37 
38  return;
39 }
40 
41 // ------------------------------------------------------------
42 
43 int L3CalibBlock::solve(int usingBlockSolver, double min, double max) {
45  return 0;
46 }
47 
48 // ------------------------------------------------------------
49 
51  //PG FIXME could it be it is not wanted to be reset?
53  return;
54 }
element for the single ECAL block intercalibration
MinL3AlgoUniv< unsigned int > * m_L3AlgoUniv
the L3 algo
Definition: L3CalibBlock.h:49
void addEvent(const std::vector< float > &myCluster, const std::vector< IDdet > &idCluster, const float &energy)
add event to the calculation of the calibration vector
L3CalibBlock(const int numberOfElements, const int keventweight=1)
ctor
Definition: L3CalibBlock.cc:11
void Fill(std::map< int, double >::const_iterator, std::map< int, double >::const_iterator, double pTk, double pSubtract, double sigma=1.) override
insert an entry
Definition: L3CalibBlock.cc:22
int solve(int usingBlockSolver, double min, double max) override
get the coefficients
Definition: L3CalibBlock.cc:43
std::map< unsigned int, float > m_coefficients
map of coefficients
void resetSolution()
reset for new iteration
IDmap getSolution(const bool resetsolution=true)
static int position[264][3]
Definition: ReadPGInfo.cc:289
void reset() override
reset the calib objects
Definition: L3CalibBlock.cc:50
~L3CalibBlock() override
dtor
Definition: L3CalibBlock.cc:18