CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ContainerCompact.cc
Go to the documentation of this file.
1 
3 
4 namespace hcaldqm
5 {
6  using namespace mapper;
7  using namespace axis;
8  using namespace constants;
9 
10  /* virtual */ void ContainerCompact::fill(HcalDetId const& did, double x)
11  {
12  if (x==GARBAGE_VALUE)
13  return;
14 
15  int isubdet = did.subdet()-1;
16  int iiphi = did.iphi()-1;
17  int iieta = did.ieta()<0 ? abs(did.ieta())-IETA_MIN :
18  did.ieta()-IETA_MIN+IETA_NUM/2;
19  int idepth = did.depth()-1;
20 
21  _data[isubdet][iiphi][iieta][idepth]._sum += x;
22  _data[isubdet][iiphi][iieta][idepth]._sum2 += x*x;
23  _data[isubdet][iiphi][iieta][idepth]._entries++;
24  }
25 
26  /* virtual */ void ContainerCompact::dump(Container1D* c, bool q)
27  {
28  for (int idet=0; idet<SUBDET_NUM; idet++)
29  {
31  if (idet+1==HB)
32  subd = HcalBarrel;
33  else if (idet+1==HE)
34  subd = HcalEndcap;
35  else if (idet+1==HO)
36  subd = HcalOuter;
37  else
38  subd = HcalForward;
39  for (int iiphi=0; iiphi<IPHI_NUM; iiphi++)
40  for (int iieta=0; iieta<IETA_NUM; iieta++)
41  for (int id=0; id<DEPTH_NUM; id++)
42  {
43  Compact tmp(_data[idet][iiphi][iieta][id]);
44  if (tmp._entries<=0)
45  continue;
46 
47  int iphi = iiphi+1;
48  int ieta = iieta<IETA_NUM/2 ? -(iieta+IETA_MIN) :
49  iieta-IETA_NUM/2+IETA_MIN;
50  int d = id+1;
51  HcalDetId did(subd, ieta, iphi, d);
52  double mean= tmp._sum/tmp._entries;
53  double rms = sqrt(tmp._sum2/tmp._entries -
54  mean*mean);
55  if (q)
56  c->fill(did, mean);
57  else
58  c->fill(did, rms);
59  }
60  }
61  }
62 }
63 
64 
int const IPHI_NUM
Definition: Constants.h:100
int const SUBDET_NUM
Definition: Constants.h:87
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int const IETA_NUM
Definition: Constants.h:111
int const IETA_MIN
Definition: Constants.h:108
unsigned int _entries
tuple d
Definition: ztail.py:151
int const GARBAGE_VALUE
Definition: Constants.h:168
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
T sqrt(T t)
Definition: SSEVec.h:18
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
virtual void fill(double)
Definition: Container1D.h:53
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:101
virtual void fill(HcalDetId const &, double)
int const DEPTH_NUM
Definition: Constants.h:128
virtual void dump(Container1D *, bool)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
int const HO
Definition: Constants.h:85