CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Types | Protected Attributes
hcaldqm::RecoRunSummary Class Reference

#include <RecoRunSummary.h>

Inheritance diagram for hcaldqm::RecoRunSummary:
hcaldqm::DQClient hcaldqm::DQModule

Public Member Functions

virtual void beginRun (edm::Run const &, edm::EventSetup const &)
 
virtual std::vector< flag::FlagendJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
virtual void endLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
 RecoRunSummary (std::string const &, std::string const &, edm::ParameterSet const &)
 
virtual ~RecoRunSummary ()
 
- Public Member Functions inherited from hcaldqm::DQClient
 DQClient (std::string const &, std::string const &, edm::ParameterSet const &)
 
virtual ~DQClient ()
 
- Public Member Functions inherited from hcaldqm::DQModule
 DQModule (edm::ParameterSet const &)
 
virtual ~DQModule ()
 

Protected Types

enum  RecoFlag { fTCDS = 0, fUniSlotHF =1, nRecoFlag =2 }
 

Protected Attributes

double _thresh_tcds
 
double _thresh_unihf
 
- Protected Attributes inherited from hcaldqm::DQClient
HcalElectronicsMap const * _emap
 
int _maxProcessedLS
 
std::string _taskname
 
int _totalLS
 
std::vector< uint32_t > _vcdaqEids
 
std::vector< int > _vFEDs
 
std::vector< uint32_t > _vhashFEDs
 
ContainerXXX< uint32_t > _xQuality
 
- Protected Attributes inherited from hcaldqm::DQModule
int _currentLS
 
int _debug
 
int _evsPerLS
 
int _evsTotal
 
Logger _logger
 
int _maxLS
 
ModuleType _mtype
 
std::string _name
 
ProcessingType _ptype
 
std::string _runkeyName
 
int _runkeyVal
 
std::string _subsystem
 

Detailed Description

Definition at line 9 of file RecoRunSummary.h.

Member Enumeration Documentation

Enumerator
fTCDS 
fUniSlotHF 
nRecoFlag 

Definition at line 26 of file RecoRunSummary.h.

Constructor & Destructor Documentation

hcaldqm::RecoRunSummary::RecoRunSummary ( std::string const &  name,
std::string const &  taskname,
edm::ParameterSet const &  ps 
)

Definition at line 5 of file RecoRunSummary.cc.

References _thresh_tcds, _thresh_unihf, and edm::ParameterSet::getUntrackedParameter().

6  :
7  DQClient(name, taskname, ps)
8  {
9  _thresh_unihf = ps.getUntrackedParameter<double>("thresh_unihf",
10  0.2);
11  _thresh_tcds = ps.getUntrackedParameter<double>("thresh_tcds",
12  1.5);
13  }
DQClient(std::string const &, std::string const &, edm::ParameterSet const &)
Definition: DQClient.cc:5
virtual hcaldqm::RecoRunSummary::~RecoRunSummary ( )
inlinevirtual

Definition at line 14 of file RecoRunSummary.h.

14 {}

Member Function Documentation

void hcaldqm::RecoRunSummary::beginRun ( edm::Run const &  r,
edm::EventSetup const &  es 
)
virtual

Reimplemented from hcaldqm::DQClient.

Definition at line 15 of file RecoRunSummary.cc.

References hcaldqm::DQClient::beginRun().

17  {
19  }
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
Definition: DQClient.cc:15
std::vector< flag::Flag > hcaldqm::RecoRunSummary::endJob ( DQMStore::IBooker ib,
DQMStore::IGetter ig 
)
virtual

Reimplemented from hcaldqm::DQClient.

Definition at line 34 of file RecoRunSummary.cc.

References hcaldqm::DQClient::_emap, hcaldqm::DQModule::_name, hcaldqm::DQModule::_ptype, hcaldqm::DQModule::_subsystem, hcaldqm::DQClient::_taskname, _thresh_tcds, _thresh_unihf, hcaldqm::DQClient::_vcdaqEids, hcaldqm::DQClient::_vFEDs, hcaldqm::DQClient::_vhashFEDs, a, HcalElectronicsMap::allPrecisionId(), b, hcaldqm::ContainerXXX< STDTYPE >::begin(), hcaldqm::ContainerXXX< STDTYPE >::book(), hcaldqm::ContainerSingle2D::book(), hcaldqm::Container1D::book(), EnergyCorrector::c, hcaldqm::constants::CRATE_uTCA_MIN, hcaldqm::constants::CRATE_VME_MIN, hcaldqm::ContainerXXX< STDTYPE >::end(), hcaldqm::flag::fBAD, hcaldqm::electronicsmap::fD2EHashMap, hcaldqm::hashfunctions::fdepth, hcaldqm::hashfunctions::fElectronics, hcaldqm::hashfunctions::fFED, hcaldqm::hashfunctions::fFEDSlot, hcaldqm::filter::fFilter, hcaldqm::flag::fGOOD, hcaldqm::hashfunctions::fHBHEPartition, hcaldqm::constants::FIBER_uTCA_MIN1, hcaldqm::constants::FIBER_VME_MIN, hcaldqm::constants::FIBERCH_MIN, hcaldqm::quantity::fieta, spr::find(), hcaldqm::quantity::fiphi, hcaldqm::quantity::fN, hcaldqm::flag::fNCDAQ, hcaldqm::fOffline, hcaldqm::filter::fPreserver, hcaldqm::quantity::fState, fTCDS, hcaldqm::quantity::fTiming_ns, fUniSlotHF, hcaldqm::ContainerXXX< STDTYPE >::get(), hcaldqm::Container2D::getBinContent(), hcaldqm::Container1D::getMean(), HcalBarrel, HcalForward, hcaldqm::Container2D::initialize(), hcaldqm::ContainerXXX< STDTYPE >::initialize(), hcaldqm::ContainerSingle2D::initialize(), hcaldqm::filter::HashFilter::initialize(), hcaldqm::electronicsmap::ElectronicsMap::initialize(), hcaldqm::Container1D::initialize(), hcaldqm::utilities::isFEDHBHE(), hcaldqm::utilities::isFEDHF(), hcaldqm::Container1D::load(), hcaldqm::electronicsmap::ElectronicsMap::lookup(), nRecoFlag, hcaldqm::flag::Flag::reset(), hcaldqm::ContainerSingle2D::setBinContent(), hcaldqm::constants::SLOT_uTCA_MIN, and hcaldqm::constants::SPIGOT_MIN.

36  {
37 
38  if (_ptype!=fOffline)
39  return std::vector<flag::Flag>();
40 
41  // FILTERS, some useful vectors, hash maps
42  std::vector<uint32_t> vhashFEDHF;
43  vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN,
44  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
45  vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN,
46  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
47  vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN,
48  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
49  vhashFEDHF.push_back(HcalElectronicsId(22, SLOT_uTCA_MIN+6,
50  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
51  vhashFEDHF.push_back(HcalElectronicsId(29, SLOT_uTCA_MIN+6,
52  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
53  vhashFEDHF.push_back(HcalElectronicsId(32, SLOT_uTCA_MIN+6,
54  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
55  filter::HashFilter filter_FEDHF;
56  filter_FEDHF.initialize(filter::fPreserver, hashfunctions::fFED,
57  vhashFEDHF); // preserve only HF FEDs
59  ehashmap.initialize(_emap, electronicsmap::fD2EHashMap);
60  bool tcdsshift = false;
61  filter::HashFilter filter_VME;
62  filter::HashFilter filter_uTCA;
63  std::vector<uint32_t> vhashVME,vhashuTCA;
64  vhashVME.push_back(HcalElectronicsId(constants::FIBERCH_MIN,
66  vhashuTCA.push_back(HcalElectronicsId(CRATE_uTCA_MIN, SLOT_uTCA_MIN,
67  FIBER_uTCA_MIN1, FIBERCH_MIN, false).rawId());
68  filter_uTCA.initialize(filter::fFilter, hashfunctions::fElectronics,
69  vhashuTCA);
70  filter_VME.initialize(filter::fFilter, hashfunctions::fElectronics,
71  vhashVME);
72  std::vector<flag::Flag> vflags; vflags.resize(nRecoFlag);
73  vflags[fUniSlotHF]=flag::Flag("UniSlotHF");
74  vflags[fTCDS]=flag::Flag("TCDS");
75 
76 
77  // INITIALIZE
78  Container2D cOccupancy_depth, cOccupancyCut_depth;
79  ContainerSingle2D cSummary;
80  Container1D cTimingCut_HBHEPartition;
81  ContainerXXX<double> xUniHF, xUni;
82  xUni.initialize(hashfunctions::fFED);
83  xUniHF.initialize(hashfunctions::fFEDSlot);
84  cOccupancy_depth.initialize(_taskname, "Occupancy",
86  new quantity::DetectorQuantity(quantity::fieta),
87  new quantity::DetectorQuantity(quantity::fiphi),
88  new quantity::ValueQuantity(quantity::fN));
89  cOccupancyCut_depth.initialize(_taskname, "OccupancyCut",
91  new quantity::DetectorQuantity(quantity::fieta),
92  new quantity::DetectorQuantity(quantity::fiphi),
93  new quantity::ValueQuantity(quantity::fN));
94  cTimingCut_HBHEPartition.initialize(_taskname, "TimingCut",
96  new quantity::ValueQuantity(quantity::fTiming_ns),
97  new quantity::ValueQuantity(quantity::fN));
98 
99  cSummary.initialize(_name, "Summary",
100  new quantity::FEDQuantity(_vFEDs),
101  new quantity::FlagQuantity(vflags),
102  new quantity::ValueQuantity(quantity::fState));
103 
104  // BOOK
105  xUniHF.book(_emap, filter_FEDHF);
106 
107 
108  // LOAD
109  cOccupancy_depth.load(ig, _emap, _subsystem);
110  cOccupancyCut_depth.load(ig, _emap, _subsystem);
111  cTimingCut_HBHEPartition.book(ib, _emap, _subsystem);
112  cSummary.book(ib, _subsystem);
113 
114  // iterate over all channels
115  std::vector<HcalGenericDetId> gids = _emap->allPrecisionId();
116  for (std::vector<HcalGenericDetId>::const_iterator it=gids.begin();
117  it!=gids.end(); ++it)
118  {
119  if (!it->isHcalDetId())
120  continue;
121 
122  HcalDetId did(it->rawId());
123  HcalElectronicsId eid = HcalElectronicsId(ehashmap.lookup(did));
124 
125  if (did.subdet()==HcalForward)
126  xUniHF.get(eid)+=cOccupancyCut_depth.getBinContent(did);
127  }
128 
129 
130  // iphi/slot HF non uniformity
131  for (doubleCompactMap::const_iterator it=xUniHF.begin();
132  it!=xUniHF.end(); ++it)
133  {
134  uint32_t hash1 = it->first;
135  HcalElectronicsId eid1(hash1);
136  double x1 = it->second;
137  for (doubleCompactMap::const_iterator jt=xUniHF.begin();
138  jt!=xUniHF.end(); ++jt)
139  {
140  if (jt==it)
141  continue;
142 
143  double x2 = jt->second;
144  if (x2==0)
145  continue;
146  if (x1/x2<_thresh_unihf)
147  xUni.get(eid1)++;
148  }
149  }
150 
151 
152  // TCDS shift
153  double a = cTimingCut_HBHEPartition.getMean(
154  HcalDetId(HcalBarrel,1,5,1));
155  double b = cTimingCut_HBHEPartition.getMean(
156  HcalDetId(HcalBarrel,1,30,1));
157  double c = cTimingCut_HBHEPartition.getMean(
158  HcalDetId(HcalBarrel,1,55,1));
159  double dab = fabs(a-b);
160  double dac = fabs(a-c);
161  double dbc = fabs(b-c);
162  if (dab>=_thresh_tcds || dac>=_thresh_tcds || dbc>=_thresh_tcds)
163  tcdsshift = true;
164 
165  // summary flags
166  std::vector<flag::Flag> sumflags;
167  int ifed=0;
168  for (std::vector<uint32_t>::const_iterator it=_vhashFEDs.begin();
169  it!=_vhashFEDs.end(); ++it)
170  {
171  flag::Flag fSum("RECO");
172  HcalElectronicsId eid(*it);
173 
174  std::vector<uint32_t>::const_iterator cit=std::find(
175  _vcdaqEids.begin(), _vcdaqEids.end(),*it);
176  if (cit==_vcdaqEids.end())
177  {
178  // not registered @cDAQ
179  sumflags.push_back(flag::Flag("RECO", flag::fNCDAQ));
180  ifed++;
181  continue;
182  }
183 
184  // registered @cDAQ
185  if (utilities::isFEDHBHE(eid))
186  {
187  if (tcdsshift)
188  vflags[fTCDS]._state = flag::fBAD;
189  else
190  vflags[fTCDS]._state = flag::fGOOD;
191  }
192  if (utilities::isFEDHF(eid))
193  {
194  if (xUni.get(eid)>0)
195  vflags[fUniSlotHF]._state = flag::fBAD;
196  else
197  vflags[fUniSlotHF]._state = flag::fGOOD;
198  }
199 
200  // combine
201  int iflag=0;
202  for (std::vector<flag::Flag>::iterator ft=vflags.begin();
203  ft!=vflags.end(); ++ft)
204  {
205  cSummary.setBinContent(eid, iflag, ft->_state);
206  fSum+=(*ft);
207  iflag++;
208  ft->reset();
209  }
210  sumflags.push_back(fSum);
211  ifed++;
212  }
213 
214  return sumflags;
215  }
std::vector< uint32_t > _vcdaqEids
Definition: DQClient.h:64
int const CRATE_VME_MIN
Definition: Constants.h:60
std::vector< uint32_t > _vhashFEDs
Definition: DQClient.h:58
std::string _taskname
Definition: DQClient.h:47
int const SPIGOT_MIN
Definition: Constants.h:85
HcalElectronicsMap const * _emap
Definition: DQClient.h:54
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
int const FIBER_VME_MIN
Definition: Constants.h:90
int const FIBERCH_MIN
Definition: Constants.h:100
ProcessingType _ptype
Definition: DQModule.h:59
int const FIBER_uTCA_MIN1
Definition: Constants.h:93
std::vector< HcalGenericDetId > allPrecisionId() const
std::string _name
Definition: DQModule.h:57
int const CRATE_uTCA_MIN
Definition: Constants.h:65
bool isFEDHBHE(HcalElectronicsId const &)
Definition: Utilities.cc:131
std::vector< int > _vFEDs
Definition: DQClient.h:57
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
std::string _subsystem
Definition: DQModule.h:64
Readout chain identification for Hcal.
bool isFEDHF(HcalElectronicsId const &)
Definition: Utilities.cc:153
int const SLOT_uTCA_MIN
Definition: Constants.h:72
void hcaldqm::RecoRunSummary::endLuminosityBlock ( DQMStore::IBooker ib,
DQMStore::IGetter ig,
edm::LuminosityBlock const &  lb,
edm::EventSetup const &  es 
)
virtual

Reimplemented from hcaldqm::DQClient.

Definition at line 24 of file RecoRunSummary.cc.

References hcaldqm::DQClient::endLuminosityBlock().

27  {
28  DQClient::endLuminosityBlock(ib, ig, lb, es);
29  }
virtual void endLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
Definition: DQClient.cc:105

Member Data Documentation

double hcaldqm::RecoRunSummary::_thresh_tcds
protected

Definition at line 24 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().

double hcaldqm::RecoRunSummary::_thresh_unihf
protected

Definition at line 24 of file RecoRunSummary.h.

Referenced by endJob(), and RecoRunSummary().