CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L3CalibBlock.cc
Go to the documentation of this file.
1 
10 #include "TH1F.h"
11 #include "TFile.h"
12 
13 
14 // -----------------------------------------------------
15 
16 
17 L3CalibBlock::L3CalibBlock (const int numberOfElements,
18  const int keventweight):
19  VEcalCalibBlock (numberOfElements),
20  m_L3AlgoUniv (new MinL3AlgoUniv<unsigned int>(keventweight))
21 {
22  reset () ;
23 }
24 
25 
26 // -----------------------------------------------------
27 
28 
30 {
31  delete m_L3AlgoUniv ;
32 }
33 
34 
35 // -----------------------------------------------------
36 
37 
38 void
39 L3CalibBlock::Fill (std::map<int,double>::const_iterator MapBegin,
40  std::map<int,double>::const_iterator MapEnd ,
41  double pTk,
42  double pSubtract,
43  double sigma)
44 {
45  // to feed the L3 algo
46  std::vector<float> energy ;
47  std::vector<unsigned int> position ;
48  // loop over the energies map
49  for (std::map<int,double>::const_iterator itMap = MapBegin ;
50  itMap != MapEnd ;
51  ++itMap)
52  {
53  // translation into vectors for the L3 algo
54  position.push_back (itMap->first) ;
55  energy.push_back (itMap->second) ;
56  } // loop over the energies map
57  m_L3AlgoUniv->addEvent (energy, position, pTk-pSubtract) ;
58 
59  return ;
60 }
61 
62 
63 // ------------------------------------------------------------
64 
65 
66 int
67 L3CalibBlock::solve (int usingBlockSolver, double min, double max)
68 {
70  return 0 ;
71 }
72 
73 
74 // ------------------------------------------------------------
75 
76 
77 void
79 {
80  //PG FIXME could it be it is not wanted to be reset?
82  return ;
83 }
84 
85 
element for the single ECAL block intercalibration
MinL3AlgoUniv< unsigned int > * m_L3AlgoUniv
the L3 algo
Definition: L3CalibBlock.h:56
void addEvent(const std::vector< float > &myCluster, const std::vector< IDdet > &idCluster, const float &energy)
add event to the calculation of the calibration vector
#define min(a, b)
Definition: mlp_lapack.h:161
L3CalibBlock(const int numberOfElements, const int keventweight=1)
ctor
Definition: L3CalibBlock.cc:17
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:39
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
return((rh^lh)&mask)
const T & max(const T &a, const T &b)
int solve(int usingBlockSolver, double min, double max)
get the coefficients
Definition: L3CalibBlock.cc:67
std::map< unsigned int, float > m_coefficients
map of coefficients
void resetSolution()
reset for new iteration
IDmap getSolution(const bool resetsolution=true)
~L3CalibBlock()
dtor
Definition: L3CalibBlock.cc:29
void reset()
reset the calib objects
Definition: L3CalibBlock.cc:78