CMS 3D CMS Logo

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 }
MessageLogger.h
VEcalCalibBlock
element for the single ECAL block intercalibration
Definition: VEcalCalibBlock.h:13
L3CalibBlock.h
min
T min(T a, T b)
Definition: MathUtil.h:58
MinL3AlgoUniv::getSolution
IDmap getSolution(const bool resetsolution=true)
Definition: MinL3AlgoUniv.h:184
L3CalibBlock::~L3CalibBlock
~L3CalibBlock() override
dtor
Definition: L3CalibBlock.cc:18
L3CalibBlock::reset
void reset() override
reset the calib objects
Definition: L3CalibBlock.cc:50
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
MinL3AlgoUniv::resetSolution
void resetSolution()
reset for new iteration
Definition: MinL3AlgoUniv.h:203
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
createfilelist.int
int
Definition: createfilelist.py:10
L3CalibBlock::L3CalibBlock
L3CalibBlock(const int numberOfElements, const int keventweight=1)
ctor
Definition: L3CalibBlock.cc:11
VEcalCalibBlock::m_coefficients
std::map< unsigned int, float > m_coefficients
map of coefficients
Definition: VEcalCalibBlock.h:38
L3CalibBlock::Fill
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
L3CalibBlock::solve
int solve(int usingBlockSolver, double min, double max) override
get the coefficients
Definition: L3CalibBlock.cc:43
MinL3AlgoUniv
Definition: MinL3AlgoUniv.h:20
MinL3AlgoUniv::addEvent
void addEvent(const std::vector< float > &myCluster, const std::vector< IDdet > &idCluster, const float &energy)
add event to the calculation of the calibration vector
Definition: MinL3AlgoUniv.h:142
L3CalibBlock::m_L3AlgoUniv
MinL3AlgoUniv< unsigned int > * m_L3AlgoUniv
the L3 algo
Definition: L3CalibBlock.h:49