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 
12 
13 L3CalibBlock::L3CalibBlock (const int numberOfElements,
14  const int keventweight):
15  VEcalCalibBlock (numberOfElements),
16  m_L3AlgoUniv (new MinL3AlgoUniv<unsigned int>(keventweight))
17 {
18  reset () ;
19 }
20 
21 
22 // -----------------------------------------------------
23 
24 
26 {
27  delete m_L3AlgoUniv ;
28 }
29 
30 
31 // -----------------------------------------------------
32 
33 
34 void
35 L3CalibBlock::Fill (std::map<int,double>::const_iterator MapBegin,
36  std::map<int,double>::const_iterator MapEnd ,
37  double pTk,
38  double pSubtract,
39  double sigma)
40 {
41  // to feed the L3 algo
42  std::vector<float> energy ;
43  std::vector<unsigned int> position ;
44  // loop over the energies map
45  for (std::map<int,double>::const_iterator itMap = MapBegin ;
46  itMap != MapEnd ;
47  ++itMap)
48  {
49  // translation into vectors for the L3 algo
50  position.push_back (itMap->first) ;
51  energy.push_back (itMap->second) ;
52  } // loop over the energies map
53  m_L3AlgoUniv->addEvent (energy, position, pTk-pSubtract) ;
54 
55  return ;
56 }
57 
58 
59 // ------------------------------------------------------------
60 
61 
62 int
63 L3CalibBlock::solve (int usingBlockSolver, double min, double max)
64 {
66  return 0 ;
67 }
68 
69 
70 // ------------------------------------------------------------
71 
72 
73 void
75 {
76  //PG FIXME could it be it is not wanted to be reset?
78  return ;
79 }
80 
81 
element for the single ECAL block intercalibration
MinL3AlgoUniv< unsigned int > * m_L3AlgoUniv
the L3 algo
Definition: L3CalibBlock.h:52
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:13
void Fill(std::map< int, double >::const_iterator, std::map< int, double >::const_iterator, double pTk, double pSubtract, double sigma=1.)
insert an entry
Definition: L3CalibBlock.cc:35
int solve(int usingBlockSolver, double min, double max)
get the coefficients
Definition: L3CalibBlock.cc:63
T min(T a, T b)
Definition: MathUtil.h:58
std::map< unsigned int, float > m_coefficients
map of coefficients
void resetSolution()
reset for new iteration
return(e1-e2)*(e1-e2)+dp *dp
IDmap getSolution(const bool resetsolution=true)
~L3CalibBlock()
dtor
Definition: L3CalibBlock.cc:25
static int position[264][3]
Definition: ReadPGInfo.cc:509
void reset()
reset the calib objects
Definition: L3CalibBlock.cc:74