CMS 3D CMS Logo

Enumerations | Functions
EcalFloatCondObjectContainerUtils.h File Reference
#include "CondCore/Utilities/interface/PayloadInspector.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "CondFormats/EcalObjects/interface/EcalCondObjectContainer.h"
#include "TH2F.h"
#include <string>

Go to the source code of this file.

Enumerations

enum  { kEBChannels = 61200, kEEChannels = 14648 }
 
enum  {
  MIN_IETA = 1, MIN_IPHI = 1, MAX_IETA = 85, MAX_IPHI = 360,
  EBhistEtaMax = 171
}
 
enum  {
  IX_MIN = 1, IY_MIN = 1, IX_MAX = 100, IY_MAX = 100,
  EEhistXMax = 220
}
 

Functions

template<class floatCondObj >
void fillEBMap_DiffIOV (std::shared_ptr< floatCondObj > payload, TH2F *&barrel, int irun, float pEB[], float &pEBmin, float &pEBmax)
 
template<class floatCondObj >
void fillEBMap_SingleIOV (std::shared_ptr< floatCondObj > payload, TH2F *&barrel)
 
template<class floatCondObj >
void fillEEMap_DiffIOV (std::shared_ptr< floatCondObj > payload, TH2F *&endc_m, TH2F *&endc_p, int irun, float pEE[], float &pEEmin, float &pEEmax)
 
template<class floatCondObj >
void fillEEMap_SingleIOV (std::shared_ptr< floatCondObj > payload, TH2F *&endc_m, TH2F *&endc_p)
 
void fillTableWithSummary (TH2F *&align, std::string title, const float &mean_x_EB, const float &rms_EB, const int &num_x_EB, const float &mean_x_EE, const float &rms_EE, const int &num_x_EE)
 

Enumeration Type Documentation

anonymous enum
Enumerator
kEBChannels 
kEEChannels 

Definition at line 9 of file EcalFloatCondObjectContainerUtils.h.

anonymous enum
Enumerator
MIN_IETA 
MIN_IPHI 
MAX_IETA 
MAX_IPHI 
EBhistEtaMax 

Definition at line 10 of file EcalFloatCondObjectContainerUtils.h.

anonymous enum
Enumerator
IX_MIN 
IY_MIN 
IX_MAX 
IY_MAX 
EEhistXMax 

Definition at line 11 of file EcalFloatCondObjectContainerUtils.h.

Function Documentation

template<class floatCondObj >
void fillEBMap_DiffIOV ( std::shared_ptr< floatCondObj >  payload,
TH2F *&  barrel,
int  irun,
float  pEB[],
float &  pEBmin,
float &  pEBmax 
)

Definition at line 62 of file EcalFloatCondObjectContainerUtils.h.

References diffTreeTool::diff, EcalCondObjectContainer< T >::end(), PVValHelper::eta, EcalCondObjectContainer< T >::find(), objects.autophobj::float, EBDetId::kSizeForDenseIndexing, EBDetId::MIN_HASH, PVValHelper::phi, EBDetId::unhashIndex(), and mps_merge::weight.

63  {
64 
65  for(int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
66  uint32_t rawid = EBDetId::unhashIndex(cellid);
68  if (value_ptr == payload->end())
69  continue; // cell absent from payload
70 
71  float weight = (float)(*value_ptr);
72  if(irun == 0)
73  pEB[cellid] = weight;
74  else {
75  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
76  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
77 
78  if(eta > 0.)
79  eta = eta - 0.5; // 0.5 to 84.5
80  else
81  eta = eta + 0.5; // -84.5 to -0.5
82 
83  double diff = weight - pEB[cellid];
84 
85  if(diff < pEBmin)
86  pEBmin = diff;
87  if(diff > pEBmax)
88  pEBmax = diff;
89 
90  barrel->Fill(phi, eta, diff);
91  }
92 
93  }// loop over cellid
94 
95 
96 }
Definition: weight.py:1
static const int MIN_HASH
Definition: EBDetId.h:149
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
template<class floatCondObj >
void fillEBMap_SingleIOV ( std::shared_ptr< floatCondObj >  payload,
TH2F *&  barrel 
)

Definition at line 15 of file EcalFloatCondObjectContainerUtils.h.

References EcalCondObjectContainer< T >::end(), PVValHelper::eta, EcalCondObjectContainer< T >::find(), objects.autophobj::float, EBDetId::kSizeForDenseIndexing, EBDetId::MIN_HASH, PVValHelper::phi, and EBDetId::unhashIndex().

15  {
16 
17  for(int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
18  uint32_t rawid = EBDetId::unhashIndex(cellid);
20  if (value_ptr == payload->end())
21  continue; // cell absent from payload
22 
23  float weight = (float)(*value_ptr);
24  Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
25  Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
26 
27  if(eta > 0.)
28  eta = eta - 0.5; // 0.5 to 84.5
29  else
30  eta = eta + 0.5; // -84.5 to -0.5
31 
32  barrel->Fill(phi, eta, weight);
33  }// loop over cellid
34 
35 }
Definition: weight.py:1
static const int MIN_HASH
Definition: EBDetId.h:149
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
template<class floatCondObj >
void fillEEMap_DiffIOV ( std::shared_ptr< floatCondObj >  payload,
TH2F *&  endc_m,
TH2F *&  endc_p,
int  irun,
float  pEE[],
float &  pEEmin,
float &  pEEmax 
)

Definition at line 100 of file EcalFloatCondObjectContainerUtils.h.

References diffTreeTool::diff, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), objects.autophobj::float, EEDetId::hashedIndex(), IX_MAX, IX_MIN, IY_MAX, IY_MIN, DetId::rawId(), EEDetId::validDetId(), mps_merge::weight, and EEDetId::XYMODE.

101  {
102 
103  // looping over the EE channels
104  for(int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
105  for(int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
106  for(int ix = IX_MIN; ix < IX_MAX+IX_MIN; ix++)
107  if(EEDetId::validDetId(ix, iy, iz)) {
108  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
109  uint32_t cellid = myEEId.hashedIndex();
110  uint32_t rawid = myEEId.rawId();
112 
113  if (value_ptr == payload->end())
114  continue; // cell absent from payload
115  float weight = (float)(*value_ptr);
116 
117  if(irun == 0)
118  pEE[cellid] = weight;
119  else {
120  double diff = weight - pEE[cellid];
121  if(diff < pEEmin)
122  pEEmin = diff;
123 
124  if(diff > pEEmax)
125  pEEmax = diff;
126  if(iz == 1)
127  endc_p->Fill(ix, iy, diff);
128  else
129  endc_m->Fill(ix, iy, diff);
130  }
131 
132  } // validDetId
133 
134 }
static const int XYMODE
Definition: EEDetId.h:335
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Definition: weight.py:1
int hashedIndex() const
Definition: EEDetId.h:183
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
template<class floatCondObj >
void fillEEMap_SingleIOV ( std::shared_ptr< floatCondObj >  payload,
TH2F *&  endc_m,
TH2F *&  endc_p 
)

Definition at line 39 of file EcalFloatCondObjectContainerUtils.h.

References EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), objects.autophobj::float, IX_MAX, IX_MIN, IY_MAX, IY_MIN, DetId::rawId(), EEDetId::validDetId(), and EEDetId::XYMODE.

39  {
40  // looping over the EE channels
41  for(int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
42  for(int iy = IY_MIN; iy < IY_MAX+IY_MIN; iy++)
43  for(int ix = IX_MIN; ix < IX_MAX+IX_MIN; ix++)
44  if(EEDetId::validDetId(ix, iy, iz)) {
45  EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
46  uint32_t rawid = myEEId.rawId();
48  if (value_ptr == payload->end())
49  continue; // cell absent from payload
50 
51  float weight = (float)(*value_ptr);
52  if(iz == 1)
53  endc_p->Fill(ix, iy, weight);
54  else
55  endc_m->Fill(ix, iy, weight);
56 
57  } // validDetId
58 }
static const int XYMODE
Definition: EEDetId.h:335
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
Definition: weight.py:1
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
void fillTableWithSummary ( TH2F *&  align,
std::string  title,
const float &  mean_x_EB,
const float &  rms_EB,
const int &  num_x_EB,
const float &  mean_x_EE,
const float &  rms_EE,
const int &  num_x_EE 
)

Definition at line 137 of file EcalFloatCondObjectContainerUtils.h.

139  {
140 
141  int NbRows=2;
142  align = new TH2F(title.c_str(),"EB/EE mean_x rms num_x", 4, 0, 4, NbRows, 0, NbRows);
143 
144  double row = NbRows-0.5;
145 
146  align->Fill(0.5,row,1);
147  align->Fill(1.5,row,mean_x_EB);
148  align->Fill(2.5,row,rms_EB);
149  align->Fill(3.5,row,num_x_EB);
150 
151  row--;
152 
153  align->Fill(0.5,row,2);
154  align->Fill(1.5,row,mean_x_EE);
155  align->Fill(2.5,row,rms_EE);
156  align->Fill(3.5,row,num_x_EE);
157 
158 
159  align->GetXaxis()->SetTickLength(0.);
160  align->GetXaxis()->SetLabelSize(0.);
161  align->GetYaxis()->SetTickLength(0.);
162  align->GetYaxis()->SetLabelSize(0.);
163