CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
EcalCondObjectContainer< T > Class Template Reference

#include <EcalCondObjectContainer.h>

Public Types

typedef std::vector< Item >::const_iterator const_iterator
 
typedef T Item
 
typedef std::vector< ItemItems
 
typedef std::vector< Item >::iterator iterator
 
typedef EcalCondObjectContainer< Tself
 
typedef Item value_type
 

Public Member Functions

const Itembarrel (size_t hashedIndex) const
 
const ItemsbarrelItems () const
 
void clear ()
 
 EcalCondObjectContainer ()
 
const_iterator end () const
 
const Itemendcap (size_t hashedIndex) const
 
const ItemsendcapItems () const
 
const_iterator find (uint32_t rawId) const
 
const selfgetMap () const
 
void insert (std::pair< uint32_t, Item > const &a)
 
Itemoperator[] (uint32_t rawId)
 
Item operator[] (uint32_t rawId) const
 
void setValue (const uint32_t id, const Item &item)
 
size_t size () const
 
void summary (float &arg_mean_x_EB, float &arg_rms_EB, int &arg_num_x_EB, float &arg_mean_x_EE, float &arg_rms_EE, int &arg_num_x_EE) const
 
 ~EcalCondObjectContainer ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

EcalContainer< EBDetId, Itemeb_
 
EcalContainer< EEDetId, Itemee_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

template<typename T>
class EcalCondObjectContainer< T >

Definition at line 13 of file EcalCondObjectContainer.h.

Member Typedef Documentation

◆ const_iterator

template<typename T>
typedef std::vector<Item>::const_iterator EcalCondObjectContainer< T >::const_iterator

Definition at line 19 of file EcalCondObjectContainer.h.

◆ Item

template<typename T>
typedef T EcalCondObjectContainer< T >::Item

Definition at line 15 of file EcalCondObjectContainer.h.

◆ Items

template<typename T>
typedef std::vector<Item> EcalCondObjectContainer< T >::Items

Definition at line 18 of file EcalCondObjectContainer.h.

◆ iterator

template<typename T>
typedef std::vector<Item>::iterator EcalCondObjectContainer< T >::iterator

Definition at line 20 of file EcalCondObjectContainer.h.

◆ self

template<typename T>
typedef EcalCondObjectContainer<T> EcalCondObjectContainer< T >::self

Definition at line 17 of file EcalCondObjectContainer.h.

◆ value_type

template<typename T>
typedef Item EcalCondObjectContainer< T >::value_type

Definition at line 16 of file EcalCondObjectContainer.h.

Constructor & Destructor Documentation

◆ EcalCondObjectContainer()

template<typename T>
EcalCondObjectContainer< T >::EcalCondObjectContainer ( )
inline

Definition at line 22 of file EcalCondObjectContainer.h.

22 {};

◆ ~EcalCondObjectContainer()

template<typename T>
EcalCondObjectContainer< T >::~EcalCondObjectContainer ( )
inline

Definition at line 23 of file EcalCondObjectContainer.h.

23 {};

Member Function Documentation

◆ barrel()

template<typename T>
const Item& EcalCondObjectContainer< T >::barrel ( size_t  hashedIndex) const
inline

Definition at line 34 of file EcalCondObjectContainer.h.

Referenced by popcon::EcalLaserHandler::checkAPDPNs(), popcon::EcalPedestalsHandler::getNewObjectsP5(), and popcon::EcalPedestalsHandler::readPedestal2017().

34 { return eb_.item(hashedIndex); }
const Item & item(size_t hashid) const
Definition: EcalContainer.h:34
EcalContainer< EBDetId, Item > eb_
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:36

◆ barrelItems()

template<typename T>
const Items& EcalCondObjectContainer< T >::barrelItems ( ) const
inline

◆ clear()

template<typename T>
void EcalCondObjectContainer< T >::clear ( void  )
inline

Definition at line 25 of file EcalCondObjectContainer.h.

Referenced by EcalNextToDeadChannelESProducer::setupNextToDeadChannels().

25  {
26  eb_.clear();
27  ee_.clear();
28  }
EcalContainer< EEDetId, Item > ee_
EcalContainer< EBDetId, Item > eb_

◆ end()

template<typename T>
const_iterator EcalCondObjectContainer< T >::end ( void  ) const
inline

Definition at line 74 of file EcalCondObjectContainer.h.

Referenced by EcalBarrelRecHitsValidation::analyze(), EcalEndcapRecHitsValidation::analyze(), EcalRecHitsValidation::analyze(), EcalClusterLazyToolsBase::BasicClusterTime(), ecaldqm::PresampleTask::beginEvent(), EcalBoundaryInfoCalculator< EBDetId >::boundaryRecHits(), EcalBoundaryInfoCalculator< EBDetId >::checkRecHitHasDeadNeighbour(), Types.LuminosityBlockRange::cppID(), Types.EventRange::cppID(), EcalTools::deadNeighbour(), EcalMIPRecHitFilter::filter(), EcalLiteDTUCoder::findIntercalibConstant(), EcalCoder::findIntercalibConstant(), EcalLiteDTUCoder::findPedestal(), EcalMixingModuleValidation::findPedestal(), EcalBoundaryInfoCalculator< EBDetId >::gapRecHits(), DCCDataUnpacker::getChannelStatus(), EcalTPGParamBuilder::getCoeff(), EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration(), EcalLaserDbService::getLaserCorrection(), edm::DataMixingEMDigiWorker::GetPedestals(), EcalDccWeightBuilder::intercalib(), ECALpedestalPCLHarvester::isGood(), EcalTools::isNextToDead(), EcalTPSkimmer::produce(), EcalTBWeightUncalibRecHitProducer::produce(), EcalRecalibRecHitProducer::produce(), EcalDetIdToBeRecoveredProducer::produce(), ecaldqm::IntegrityClient::producePlots(), EcalRecHitWorkerSimple::run(), EcalUncalibRecHitWorkerFixedAlphaBetaFit::run(), EcalUncalibRecHitWorkerAnalFit::run(), EcalFenixLinearizer::setParameters(), and EcalEBFenixLinearizer::setParameters().

74 { return ee_.end(); }
EcalContainer< EEDetId, Item > ee_
const_iterator end() const
Definition: EcalContainer.h:82

◆ endcap()

template<typename T>
const Item& EcalCondObjectContainer< T >::endcap ( size_t  hashedIndex) const
inline

◆ endcapItems()

template<typename T>
const Items& EcalCondObjectContainer< T >::endcapItems ( ) const
inline

◆ find()

template<typename T>
const_iterator EcalCondObjectContainer< T >::find ( uint32_t  rawId) const
inline

Definition at line 53 of file EcalCondObjectContainer.h.

Referenced by EcalPFRecHitThresholdsMaker::analyze(), EcalBarrelRecHitsValidation::analyze(), EcalEndcapRecHitsValidation::analyze(), EcalRecHitsValidation::analyze(), EcalTPGParamBuilder::analyze(), EcalClusterLazyToolsBase::BasicClusterTime(), ecaldqm::PresampleTask::beginEvent(), EcalBoundaryInfoCalculator< EBDetId >::boundaryRecHits(), EcalBoundaryInfoCalculator< EBDetId >::checkRecHitHasDeadNeighbour(), ECALpedestalPCLHarvester::checkStatusCode(), ECALpedestalPCLHarvester::checkVariation(), EcalTools::deadNeighbour(), ECALpedestalPCLHarvester::dqmEndJob(), ZeeCalibration::duringLoop(), EcalMIPRecHitFilter::filter(), EcalCoder::findGains(), EcalLiteDTUCoder::findIntercalibConstant(), EcalCoder::findIntercalibConstant(), EcalLiteDTUCoder::findPedestal(), EcalCoder::findPedestal(), EcalMixingModuleValidation::findPedestal(), EcalBoundaryInfoCalculator< EBDetId >::gapRecHits(), DCCDataUnpacker::getChannelStatus(), EcalTPGParamBuilder::getCoeff(), EcalTrivialConditionRetriever::getIntercalibConstantsFromConfiguration(), EcalLaserDbService::getLaserCorrection(), edm::DataMixingEMDigiWorker::GetPedestals(), EcalDccWeightBuilder::intercalib(), ECALpedestalPCLHarvester::isGood(), EcalTools::isNextToDead(), CaloMiscalibMapEcal::print(), EcalTPSkimmer::produce(), EcalTBWeightUncalibRecHitProducer::produce(), EcalRecalibRecHitProducer::produce(), EcalDetIdToBeRecoveredProducer::produce(), pat::PATIsolatedTrackProducer::produce(), ecaldqm::IntegrityClient::producePlots(), EcalRecHitWorkerSimple::run(), EcalUncalibRecHitWorkerFixedAlphaBetaFit::run(), EcalUncalibRecHitWorkerAnalFit::run(), EcalEBFenixLinearizer::setParameters(), EcalFenixLinearizer::setParameters(), and EcalSeverityLevelAlgo::severityLevel().

53  {
54  DetId id(rawId);
55  switch (id.subdetId()) {
56  case EcalBarrel: {
57  const_iterator it = eb_.find(rawId);
58  if (it != eb_.end()) {
59  return it;
60  } else {
61  return ee_.end();
62  }
63  } break;
64  case EcalEndcap: {
65  return ee_.find(rawId);
66  } break;
67  default:
68  // FIXME (add throw)
69  return ee_.end();
70  }
71  return ee_.end();
72  }
EcalContainer< EEDetId, Item > ee_
EcalContainer< EBDetId, Item > eb_
Definition: DetId.h:17
std::vector< Item >::const_iterator const_iterator
const_iterator end() const
Definition: EcalContainer.h:82
const_iterator find(uint32_t rawId) const
Definition: EcalContainer.h:73

◆ getMap()

template<typename T>
const self& EcalCondObjectContainer< T >::getMap ( ) const
inline

◆ insert()

template<typename T>
void EcalCondObjectContainer< T >::insert ( std::pair< uint32_t, Item > const &  a)
inline

Definition at line 38 of file EcalCondObjectContainer.h.

Referenced by SequenceTypes.Schedule::_replaceIfHeldDirectly(), EcalPFRecHitThresholdsMaker::analyze(), EcalTPGParamBuilder::analyze(), popcon::EcalPulseShapesHandler::getNewObjects(), popcon::EcalPulseSymmCovariancesHandler::getNewObjects(), popcon::EcalLaser_weekly_Linearization::getNewObjects(), popcon::EcalTPGLinConstHandler::getNewObjects(), popcon::EcalTPGPedfromFile::getNewObjects(), popcon::EcalTPGLinPed::getNewObjects(), popcon::EcalTPGPedestalsHandler::getNewObjects(), popcon::EcalPedestalsHandler::getNewObjectsH2(), popcon::EcalPedestalsHandler::getNewObjectsP5(), popcon::EcalPedestalsHandler::readPedestal2017(), popcon::EcalPedestalsHandler::readPedestalFile(), and popcon::EcalPedestalsHandler::readPedestalMC().

38  {
39  DetId id(a.first);
40  switch (id.subdetId()) {
41  case EcalBarrel: {
42  eb_.insert(a);
43  } break;
44  case EcalEndcap: {
45  ee_.insert(a);
46  } break;
47  default:
48  // FIXME (add throw)
49  return;
50  }
51  }
EcalContainer< EEDetId, Item > ee_
EcalContainer< EBDetId, Item > eb_
Definition: DetId.h:17
void insert(std::pair< uint32_t, Item > const &a)
Definition: EcalContainer.h:32
double a
Definition: hdecay.h:119

◆ operator[]() [1/2]

template<typename T>
Item& EcalCondObjectContainer< T >::operator[] ( uint32_t  rawId)
inline

Definition at line 83 of file EcalCondObjectContainer.h.

83  {
84  DetId id(rawId);
85  return (id.subdetId() == EcalBarrel) ? eb_[rawId] : ee_[rawId];
86  }
EcalContainer< EEDetId, Item > ee_
EcalContainer< EBDetId, Item > eb_
Definition: DetId.h:17

◆ operator[]() [2/2]

template<typename T>
Item EcalCondObjectContainer< T >::operator[] ( uint32_t  rawId) const
inline

Definition at line 88 of file EcalCondObjectContainer.h.

88  {
89  DetId id(rawId);
90  switch (id.subdetId()) {
91  case EcalBarrel: {
92  return eb_[rawId];
93  } break;
94  case EcalEndcap: {
95  return ee_[rawId];
96  } break;
97  default:
98  // FIXME (add throw)
99  // sizeof(Item) <= sizeof(int64_t) for all Items.
100  return Item();
101  }
102  }
EcalContainer< EEDetId, Item > ee_
EcalContainer< EBDetId, Item > eb_
Definition: DetId.h:17

◆ serialize()

template<typename T>
template<class Archive >
void EcalCondObjectContainer< T >::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setValue()

template<typename T>
void EcalCondObjectContainer< T >::setValue ( const uint32_t  id,
const Item item 
)
inline

◆ size()

template<typename T>
size_t EcalCondObjectContainer< T >::size ( void  ) const
inline

◆ summary()

template<typename T>
void EcalCondObjectContainer< T >::summary ( float &  arg_mean_x_EB,
float &  arg_rms_EB,
int &  arg_num_x_EB,
float &  arg_mean_x_EE,
float &  arg_rms_EE,
int &  arg_num_x_EE 
) const
inline

calculate mean and sigma

Definition at line 104 of file EcalCondObjectContainer.h.

109  {
110  //std::stringstream ss;
111 
112  const int kSides = 2;
113  const int kBarlRings = EBDetId::MAX_IETA;
114  const int kBarlWedges = EBDetId::MAX_IPHI;
115  const int kEndcWedgesX = EEDetId::IX_MAX;
116  const int kEndcWedgesY = EEDetId::IY_MAX;
117 
119 
120  float mean_x_EB = 0;
121  float mean_xx_EB = 0;
122  int num_x_EB = 0;
123 
124  float mean_x_EE = 0;
125  float mean_xx_EE = 0;
126  int num_x_EE = 0;
127 
128  for (int sign = 0; sign < kSides; sign++) {
129  int thesign = sign == 1 ? 1 : -1;
130 
131  for (int ieta = 0; ieta < kBarlRings; ieta++) {
132  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
133  EBDetId id((ieta + 1) * thesign, iphi + 1);
134 
135  //float x= object()[id.rawId()];
136  float x = eb_[id.rawId()];
137  num_x_EB++;
138  mean_x_EB = mean_x_EB + x;
139  mean_xx_EB = mean_xx_EB + x * x;
140  }
141  }
142 
143  for (int ix = 0; ix < kEndcWedgesX; ix++) {
144  for (int iy = 0; iy < kEndcWedgesY; iy++) {
145  if (!EEDetId::validDetId(ix + 1, iy + 1, thesign))
146  continue;
147 
148  EEDetId id(ix + 1, iy + 1, thesign);
149  //float x=object()[id.rawId()];
150  float x = ee_[id.rawId()];
151  num_x_EE++;
152  mean_x_EE = mean_x_EE + x;
153  mean_xx_EE = mean_xx_EE + x * x;
154 
155  } //iy
156  } //ix
157  }
158 
159  mean_x_EB = mean_x_EB / num_x_EB;
160  mean_x_EE = mean_x_EE / num_x_EE;
161  mean_xx_EB = mean_xx_EB / num_x_EB;
162  mean_xx_EE = mean_xx_EE / num_x_EE;
163  float rms_EB = (mean_xx_EB - mean_x_EB * mean_x_EB);
164  float rms_EE = (mean_xx_EE - mean_x_EE * mean_x_EE);
165 
166  arg_mean_x_EB = mean_x_EB;
167  arg_rms_EB = rms_EB;
168  arg_num_x_EB = num_x_EB;
169 
170  arg_mean_x_EE = mean_x_EE;
171  arg_rms_EE = rms_EE;
172  arg_num_x_EE = num_x_EE;
173 
174  //ss << "ECAL BARREL Mean: "<< mean_x_EB <<" RMS: "<< rms_EB << " Nchan: "<< num_x_EB<< std::endl
175  // << "ECAL Endcap Mean: "<< mean_x_EE <<" RMS: "<< rms_EE << " Nchan: "<< num_x_EE<< std::endl ;
176 
177  //return ss.str();
178  }
static const int kBarlRings
EcalContainer< EEDetId, Item > ee_
static const int kSides
EcalContainer< EBDetId, Item > eb_
static const int kBarlWedges
static const int kEndcWedgesX
static const int IX_MAX
Definition: EEDetId.h:298
static const int MAX_IPHI
Definition: EBDetId.h:137
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
static const int MAX_IETA
Definition: EBDetId.h:136
static const int IY_MAX
Definition: EEDetId.h:302
static const int kEndcWedgesY

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename T>
friend class boost::serialization::access
friend

Definition at line 184 of file EcalCondObjectContainer.h.

◆ cond::serialization::access

template<typename T>
template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 184 of file EcalCondObjectContainer.h.

Member Data Documentation

◆ eb_

template<typename T>
EcalContainer<EBDetId, Item> EcalCondObjectContainer< T >::eb_
private

◆ ee_

template<typename T>
EcalContainer<EEDetId, Item> EcalCondObjectContainer< T >::ee_
private