CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
UECalibration Struct Reference

#include <UECalibration.h>

Public Member Functions

 UECalibration (bool isRealData=true, bool isCalo=false)
 

Public Attributes

unsigned int index
 
unsigned int ni0 [2]
 
unsigned int ni1 [2]
 
unsigned int ni2 [2]
 
unsigned int np [5]
 
float ue_interpolation_pf0 [15][344]
 
float ue_interpolation_pf1 [15][344]
 
float ue_interpolation_pf2 [15][82]
 
float ue_predictor_pf [3][15][5][2][82]
 

Detailed Description

Definition at line 11 of file UECalibration.h.

Constructor & Destructor Documentation

UECalibration::UECalibration ( bool  isRealData = true,
bool  isCalo = false 
)
inlineexplicit

Definition at line 12 of file UECalibration.h.

References recoMuon::in, index, geometryCSVtoXML::line, ni0, ni1, ni2, np, AlCaHLTBitMon_QueryRunRegistry::string, ue_interpolation_pf0, ue_interpolation_pf1, ue_interpolation_pf2, and ue_predictor_pf.

12  {
13  np[0] = 3; // Number of reduced PF ID (track, ECAL, HCAL)
14  np[1] = 15; // Number of pseudorapidity block
15  np[2] = 5; // Fourier series order
16  np[3] = 2; // Re or Im
17  np[4] = 82; // Number of feature parameter
18 
19  ni0[0] = np[1];
20  ni0[1] = 344;
21 
22  ni1[0] = np[1];
23  ni1[1] = 344;
24 
25  ni2[0] = np[1];
26  ni2[1] = 82;
27 
28  index = 0;
29 
30  unsigned int Nnp_full = np[0] * np[1] * np[2] * np[3] * np[4];
31  unsigned int Nnp = np[0] * np[1] * (1 + (np[2] - 1) * np[3]) * np[4];
32  unsigned int Nni0 = ni0[0]*ni0[1];
33  unsigned int Nni1 = ni1[0]*ni1[1];
34  unsigned int Nni2 = ni2[0]*ni2[1];
35 
36  memset(ue_predictor_pf, 0, Nnp_full * sizeof(float));
37  memset(ue_interpolation_pf0, 0, Nni0 * sizeof(float));
38  memset(ue_interpolation_pf1, 0, Nni1 * sizeof(float));
39  memset(ue_interpolation_pf2, 0, Nni2 * sizeof(float));
40 
41  std::string calibrationFile;
42 
43  if(isCalo){
44  if(isRealData) calibrationFile = "RecoHI/HiJetAlgos/data/ue_calibrations_calo_data.txt";
45  if(!isRealData) calibrationFile = "RecoHI/HiJetAlgos/data/ue_calibrations_calo_mc.txt";
46  }else{
47  if(isRealData) calibrationFile = "RecoHI/HiJetAlgos/data/ue_calibrations_pf_data.txt";
48  if(!isRealData) calibrationFile = "RecoHI/HiJetAlgos/data/ue_calibrations_pf_mc.txt";
49  }
50 
51  edm::FileInPath ueData(calibrationFile.data());
52  std::string qpDataName = ueData.fullPath();
53  std::ifstream in( qpDataName.c_str() );
55 
56  while( std::getline( in, line)){
57  if(!line.size() || line[0]=='#') {
58  continue;
59  }
60  std::istringstream linestream(line);
61  float val;
62  int bin0, bin1, bin2, bin3, bin4;
63  if(index < Nnp){
64  // cout<<"predictor "<<bin0<<" "<<bin1<<" "<<bin2<<" "<<bin3<<" "<<bin4<<" "<<val<<endl;
65  linestream>>bin0>>bin1>>bin2>>bin3>>bin4>>val;
66  ue_predictor_pf[bin0][bin1][bin2][bin3][bin4] = val;
67  }else if(index < Nnp + Nni0){
68  // cout<<"inter_0 "<<bin0<<" "<<bin1<<" "<<bin2<<" "<<bin3<<" "<<bin4<<" "<<val<<endl;
69  linestream>>bin0>>bin1>>val;
70  ue_interpolation_pf0[bin0][bin1] = val;
71  }else if(index < Nnp + Nni0 + Nni1){
72  // cout<<"inter_1 "<<bin0<<" "<<bin1<<" "<<bin2<<" "<<bin3<<" "<<bin4<<" "<<val<<endl;
73  linestream>>bin0>>bin1>>val;
74  ue_interpolation_pf1[bin0][bin1] = val;
75  }else if(index < Nnp + Nni0 + Nni1 + Nni2){
76  // cout<<"inter_2 "<<bin0<<" "<<bin1<<" "<<bin2<<" "<<bin3<<" "<<bin4<<" "<<val<<endl;
77  linestream>>bin0>>bin1>>val;
78  ue_interpolation_pf2[bin0][bin1] = val;
79  }
80  ++index;
81  }
82  }
unsigned int ni0[2]
Definition: UECalibration.h:84
unsigned int index
Definition: UECalibration.h:84
unsigned int ni2[2]
Definition: UECalibration.h:84
unsigned int np[5]
Definition: UECalibration.h:84
unsigned int ni1[2]
Definition: UECalibration.h:84
float ue_interpolation_pf0[15][344]
Definition: UECalibration.h:90
float ue_predictor_pf[3][15][5][2][82]
Definition: UECalibration.h:90
float ue_interpolation_pf1[15][344]
Definition: UECalibration.h:90
float ue_interpolation_pf2[15][82]
Definition: UECalibration.h:90

Member Data Documentation

unsigned int UECalibration::index

Definition at line 84 of file UECalibration.h.

Referenced by BeautifulSoup.PageElement::_invert(), and UECalibration().

unsigned int UECalibration::ni0[2]

Definition at line 84 of file UECalibration.h.

Referenced by UECalibration().

unsigned int UECalibration::ni1[2]

Definition at line 84 of file UECalibration.h.

Referenced by UECalibration().

unsigned int UECalibration::ni2[2]

Definition at line 84 of file UECalibration.h.

Referenced by UECalibration().

unsigned int UECalibration::np[5]

Definition at line 84 of file UECalibration.h.

Referenced by UECalibration().

float UECalibration::ue_interpolation_pf0[15][344]

Definition at line 90 of file UECalibration.h.

Referenced by VoronoiAlgorithm::subtract_momentum(), and UECalibration().

float UECalibration::ue_interpolation_pf1[15][344]

Definition at line 90 of file UECalibration.h.

Referenced by VoronoiAlgorithm::subtract_momentum(), and UECalibration().

float UECalibration::ue_interpolation_pf2[15][82]

Definition at line 90 of file UECalibration.h.

Referenced by VoronoiAlgorithm::subtract_momentum(), and UECalibration().

float UECalibration::ue_predictor_pf[3][15][5][2][82]

Definition at line 90 of file UECalibration.h.

Referenced by VoronoiAlgorithm::subtract_momentum(), and UECalibration().