CMS 3D CMS Logo

Classes | Functions | Variables
HcalObjRepresent Namespace Reference

Classes

class  ADataRepr
 
class  HcalDataContainer
 

Functions

int CalcEtaBin (int subdet, int ieta, int depth)
 
int CalcIeta (int subdet, int eta, int depth)
 
int CalcIeta (int eta, int depth)
 
void drawTable (int nbRows, int nbColumns)
 
void Fill (HcalDetId &id, double val, std::vector< TH2F > &depth)
 
void fillOneGain (std::vector< TH2F > &graphData, HcalGains::tAllContWithNames &allContainers, std::string name, int id, std::string units="")
 
void FillUnphysicalHEHFBins (std::vector< TH2F > &hh)
 
void FillUnphysicalHEHFBins (TH2F &hh)
 
std::string getBitsSummary (uint32_t bits, std::string statusBitArray[], short unsigned int bitMap[])
 
std::vector< std::string > HcalEtaPhiHistNames ()
 
std::string IntToBinary (unsigned int number)
 
const bool isBitSet (unsigned int bitnumber, unsigned int status)
 
bool isHB (int etabin, int depth)
 
bool isHE (int etabin, int depth)
 
bool isHF (int etabin, int depth)
 
bool isHO (int etabin, int depth)
 
bool isSiPM (int ieta, int iphi, int depth)
 
void Reset (std::vector< TH2F > &depth)
 
std::string SciNotatStr (float num)
 
void setBinLabels (std::vector< TH2F > &depth)
 
void SetEtaPhiLabels (TH2F &h)
 
void setup (std::vector< TH2F > &depth, std::string name, std::string units="")
 
bool validDetId (HcalSubdetector sd, int ies, int ip, int dp)
 

Variables

const int binmapd2 []
 
const int binmapd3 [] = {-28, -27, -9999, -16, -9999, 16, -9999, 27, 28}
 

Function Documentation

◆ CalcEtaBin()

int HcalObjRepresent::CalcEtaBin ( int  subdet,
int  ieta,
int  depth 
)
inline

Definition at line 621 of file HcalObjRepresent.h.

References funct::abs(), hcalRecHitTable_cff::depth, HcalEndcap, HcalForward, HcalOuter, and hcalRecHitTable_cff::ieta.

621  {
622  // This takes the eta value from a subdetector and return an eta counter value as used by eta-phi array
623  // (ieta=-41 corresponds to bin 0, +41 to bin 85 -- there are two offsets to deal with the overlap at |ieta|=29).
624  // For HO, ieta = -15 corresponds to bin 0, and ieta=15 is bin 30
625  // For HE depth 3, things are more complicated, but feeding the ieta value will give back the corresponding counter eta value
626 
627  // The CalcEtaBin value is the value as used within our array counters, and thus starts at 0.
628  // If you are using it with getBinContent or setBinContent, you will need to add +1 to the result of this function
629 
630  int etabin = -9999; // default invalid value
631 
632  if (depth == 1) {
633  // Depth 1 is fairly straightforward -- just shift HF-, HF+ by -/+1
634  etabin = ieta + 42;
635  if (subdet == HcalForward) {
636  ieta < 0 ? etabin-- : etabin++;
637  }
638  }
639 
640  else if (depth == 2) {
641  // Depth 2 is more complicated, given that there are no cells in the range |ieta|<15
642  if (ieta < -14) {
643  etabin = ieta + 42;
644  if (subdet == HcalForward)
645  etabin--;
646  } else if (ieta > 14) {
647  etabin = ieta + 14;
648  if (subdet == HcalForward)
649  etabin++;
650  }
651 
652  }
653  // HO is also straightforward; a simple offset to the ieta value is applied
654  else if (subdet == HcalOuter && abs(ieta) < 16)
655  etabin = ieta + 15;
656  else if (subdet == HcalEndcap) {
657  // HE depth 3 has spotty coverage; hard-code the bin response
658  if (depth == 3) {
659  if (ieta == -28)
660  etabin = 0;
661  else if (ieta == -27)
662  etabin = 1;
663  else if (ieta == -16)
664  etabin = 3;
665  else if (ieta == 16)
666  etabin = 5;
667  else if (ieta == 27)
668  etabin = 7;
669  else if (ieta == 28)
670  etabin = 8;
671  }
672  }
673  return etabin;
674  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ CalcIeta() [1/2]

int HcalObjRepresent::CalcIeta ( int  subdet,
int  eta,
int  depth 
)
inline

Definition at line 676 of file HcalObjRepresent.h.

References funct::abs(), binmapd2, binmapd3, hcalRecHitTable_cff::depth, PVValHelper::eta, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, and hcalRecHitTable_cff::ieta.

Referenced by FillUnphysicalHEHFBins(), isHB(), isHE(), isHF(), and isHO().

676  {
677  // This function returns the 'true' ieta value given subdet, eta, and depth
678  // Here 'eta' is the index from our arrays (it starts at 0);
679  // remember that histogram bins start with bin 1, so there's an offset of 1
680  // to consider if using getBinContent(eta,phi)
681 
682  // eta runs from 0...X (X depends on depth)
683  int ieta = -9999; // default value is nonsensical
684  if (subdet == HcalBarrel) {
685  if (depth == 1) {
686  ieta = eta - 42;
687  if (ieta == 0)
688  return -9999;
689  return ieta;
690  } else if (depth == 2) {
691  ieta = binmapd2[eta];
692  if (ieta == 0)
693  return -9999;
694  if (ieta == 17 || ieta == -17)
695  return -9999; // no depth 2 cells at |ieta| = 17
696  return ieta;
697  } else
698  return -9999; // non-physical value
699  } else if (subdet == HcalForward) {
700  if (depth == 1) {
701  ieta = eta - 42;
702  if (eta < 13)
703  ieta++;
704  else if (eta > 71)
705  ieta--;
706  else
707  return -9999; // if outside forward range, return dummy
708  return ieta;
709  } else if (depth == 2) {
710  ieta = binmapd2[eta]; // special map for depth 2
711  if (ieta <= -30)
712  ieta++;
713  else if (ieta >= 30)
714  ieta--;
715  else
716  return -9999;
717  return ieta;
718  } else
719  return -9999;
720  }
721 
722  else if (subdet == HcalEndcap) {
723  if (depth == 1)
724  ieta = eta - 42;
725  else if (depth == 2) {
726  ieta = binmapd2[eta];
727  if (abs(ieta) > 29 || abs(ieta) < 18)
728  return -9999; // outside HE
729  if (ieta == 0)
730  return -9999;
731  return ieta;
732  } else if (depth == 3) {
733  if (eta < 0 || eta > 8)
734  return -9999;
735  else
736  ieta = binmapd3[eta]; // special map for depth 3
737  if (ieta == 0)
738  return -9999;
739  return ieta;
740  } else
741  return -9999;
742  } // HcalEndcap
743  else if (subdet == HcalOuter) {
744  if (depth != 4)
745  return -9999;
746  else {
747  ieta = eta - 15; // bin 0 is ieta=-15, all bins increment normally from there
748  if (abs(ieta) > 15)
749  return -9999;
750  if (ieta == 0)
751  return -9999;
752  return ieta;
753  }
754  } // HcalOuter
755  if (ieta == 0)
756  return -9999;
757  return ieta;
758  }
const int binmapd3[]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int binmapd2[]

◆ CalcIeta() [2/2]

int HcalObjRepresent::CalcIeta ( int  eta,
int  depth 
)
inline

Definition at line 760 of file HcalObjRepresent.h.

References funct::abs(), binmapd2, binmapd3, hcalRecHitTable_cff::depth, PVValHelper::eta, and hcalRecHitTable_cff::ieta.

760  {
761  // This version of CalcIeta does the same as the function above,
762  // but does not require that 'subdet' be specified.
763 
764  // returns ieta value give an eta counter.
765  // eta runs from 0...X (X depends on depth)
766  int ieta = -9999;
767  if (eta < 0)
768  return ieta;
769  if (depth == 1) {
770  ieta =
771  eta -
772  42; // default shift: bin 0 corresponds to a histogram ieta of -42 (which is offset by 1 from true HF value of -41)
773  if (eta < 13)
774  ieta++;
775  else if (eta > 71)
776  ieta--;
777  if (ieta == 0)
778  ieta = -9999;
779  return ieta;
780  } else if (depth == 2) {
781  if (eta > 57)
782  return -9999;
783  else {
784  ieta = binmapd2[eta];
785  if (ieta == -9999)
786  return ieta;
787  if (ieta == 0)
788  return -9999;
789  if (ieta == 17 || ieta == -17)
790  return -9999; // no depth 2 cells at |ieta| = 17
791  else if (ieta <= -30)
792  ieta++;
793  else if (ieta >= 30)
794  ieta--;
795  return ieta;
796  }
797  } else if (depth == 3) {
798  if (eta > 8)
799  return -9999;
800  else
801  ieta = binmapd3[eta];
802  if (ieta == 0)
803  return -9999;
804  return ieta;
805  } else if (depth == 4) {
806  ieta = eta - 15; // bin 0 is ieta=-15, all bins increment normally from there
807  if (abs(ieta) > 15)
808  return -9999;
809  if (ieta == 0)
810  return -9999;
811  return ieta;
812  }
813  return ieta; // avoids compilation warning
814  }
const int binmapd3[]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int binmapd2[]

◆ drawTable()

void HcalObjRepresent::drawTable ( int  nbRows,
int  nbColumns 
)
inline

Definition at line 484 of file HcalObjRepresent.h.

References mps_fire::i, MainPageGenerator::l, and x.

484  {
485  TLine* l = new TLine;
486  l->SetLineWidth(1);
487  for (int i = 1; i < nbRows; i++) {
488  double y = (double)i;
489  l = new TLine(0., y, nbColumns, y);
490  l->Draw();
491  }
492 
493  for (int i = 1; i < nbColumns; i++) {
494  double x = (double)i;
495  double y = (double)nbRows;
496  l = new TLine(x, 0., x, y);
497  l->Draw();
498  }
499  }
float x

◆ Fill()

void HcalObjRepresent::Fill ( HcalDetId id,
double  val,
std::vector< TH2F > &  depth 
)
inline

Definition at line 1053 of file HcalObjRepresent.h.

References hcalRecHitTable_cff::depth, HcalForward, hcalRecHitTable_cff::ieta, hcalRecHitTable_cff::iphi, and heppy_batch::val.

Referenced by SiStripGainCosmicCalculator::algoAnalyze(), L1TStage2EMTF::analyze(), RPCFEDIntegrity::analyze(), L1TPUM::analyze(), PrimaryVertexMonitor::analyze(), DTVDriftSegmentCalibration::analyze(), DTOccupancyEfficiency::analyze(), L1TDEMON::analyze(), MuonTiming::analyze(), TrackingRecoMaterialAnalyser::analyze(), DTPreCalibrationTask::analyze(), MuonRecoAnalyzer::analyze(), SiPixelRecHitsValid::analyze(), DTTTrigOffsetCalibration::analyze(), SiStripMonitorDigi::analyze(), SiPixelHLTSource::analyze(), ECALpedestalPCLworker::analyze(), CTPPSPixelDQMSource::analyze(), HGCalHitCalibration::analyze(), tadqm::TrackAnalyzer::analyze(), SiStripMonitorCluster::analyze(), SiPixelTrackResidualSource::analyze(), HcalLutAnalyzer::analyze(), SiStripMonitorPedestals::analyze(), DTChamberEfficiency::analyze(), DTRunConditionVar::analyze(), HLTJetMETValidation::analyze(), APVCyclePhaseMonitor::analyze(), HcalRecHitsAnalyzer::analyze(), EventTimeDistribution::analyze(), TrackToTrackComparisonHists::analyze(), PhotonValidator::analyze(), SiStripQualityHistory::analyze(), SiPixelQualityHistory::analyze(), DQMPFCandidateAnalyzer::analyze(), CommonModeAnalyzer::analyze(), cms::Analyzer_minbias::analyze(), CTPPSDiamondDQMSource::analyze(), analyzer::SiPixelLorentzAngle::analyze(), GeneralPurposeTrackAnalyzer::analyze(), DMRChecker::analyze(), DTNoiseComputation::beginRun(), dirstructure.Directory::calcStats(), plotTTrigFromHistos::compareDiff(), plotT0FromHistos::compareDiff(), CommissioningHistograms::copyCustomInformation(), SiStripCorrelateBadStripAndNoise::correlateWithNoise(), SiStripCorrelateNoise::DoAnalysis(), SiStripPlotGain::DoAnalysis(), PPSTimingCalibrationPCLWorker::dqmAnalyze(), PPSDiamondSampicTimingCalibrationPCLWorker::dqmAnalyze(), DTResolutionAnalysisTest::dqmEndJob(), DTRunConditionVarClient::dqmEndJob(), InvRingCalib::duringLoop(), EcalEleCalibLooper::duringLoop(), ESSummaryClient::endLumiAnalyze(), DigiInvestigatorHistogramMaker::fill(), BenchmarkTree::Fill(), DigiVertexCorrHistogramMaker::fill(), DigiBXCorrHistogramMaker< EventWithHistory >::fill(), DigiLumiCorrHistogramMaker::fill(), SiPixelTrackResidualModule::fill(), SiPixelRawDataErrorModule::fill(), Histos::fill(), SiPixelClusterModule::fill(), SiPixelDigiModule::fill(), XHistogram::fill(), DD4hep_XHistogram::fill(), Book::fill(), CSCValHists::fill2DHistByEvent(), TrackToTrackComparisonHists::fill_generic_tracks_histos(), TrackToTrackComparisonHists::fill_matching_tracks_histos(), SiPixelRecHitsValid::fillBarrel(), SiStripMonitorPedestals::fillCondDBMEs(), BPhysicsValidation::FillDaughters(), SiPixelRawDataErrorModule::fillFED(), tadqm::TrackAnalyzer::fillHistosForEfficiencyFromHitPatter(), SiStripMonitorCluster::fillModuleMEs(), METAnalyzer::fillMonitorElement(), GlobalDigisAnalyzer::fillMuon(), LRHelpFunctions::fillToBackgroundHists(), edm::RootOutputTree::fillTTree(), SiStripGainCosmicCalculator::getNewObject(), overlapValidationPlot::hist(), TMultiDimFet::MakeCoefficients(), TMultiDimFet::MakeNormalized(), CosmicGenFilterHelix::monitorEnd(), CosmicGenFilterHelix::monitorStart(), DTSegmentAnalysisTest::performClientDiagnostic(), RPCMonitorDigi::performSourceOperation(), subModule::plot(), bigModule::plot(), Histogrammer.Histogrammer::process(), SiStripGainFromCalibTree::processEvent(), DTDataIntegrityTask::processuROS(), ecaldqm::MESetDet0D::reset(), ecaldqm::MESet::resetAll(), PrimaryVertexMonitor::vertexPlots(), and GeneralPurposeVertexAnalyzer::vertexPlots().

1053  {
1054  // If in HF, need to shift by 1 bin (-1 bin lower in -HF, +1 bin higher in +HF)
1055  if (id.subdet() == HcalForward)
1056  depth[id.depth() - 1].Fill(id.ieta() < 0 ? id.ieta() - 1 : id.ieta() + 1, id.iphi(), val);
1057  else
1058  depth[id.depth() - 1].Fill(id.ieta(), id.iphi(), val);
1059  }

◆ fillOneGain()

void HcalObjRepresent::fillOneGain ( std::vector< TH2F > &  graphData,
HcalGains::tAllContWithNames allContainers,
std::string  name,
int  id,
std::string  units = "" 
)
inline

Definition at line 1135 of file HcalObjRepresent.h.

References ztail::d, hcalRecHitTable_cff::depth, HcalDetId::depth(), PedestalClient_cfi::gain, HcalForward, mps_fire::i, l1ctLayer2EG_cff::id, hcalRecHitTable_cff::ieta, HcalDetId::ieta(), hcalRecHitTable_cff::iphi, HcalDetId::iphi(), Skims_PA_cff::name, setup(), HcalDetId::subdet(), and x.

1139  {
1140  setup(graphData, name);
1141 
1142  std::stringstream x;
1143  // Change the titles of each individual histogram
1144  for (unsigned int d = 0; d < graphData.size(); ++d) {
1145  graphData[d].Reset();
1146  x << "Gain " << id << " for HCAL depth " << d + 1;
1147 
1148  //BUG CAN BE HERE:
1149  //if (ChannelStatus->depth[d])
1150  graphData[d].SetTitle(
1151  x.str()
1152  .c_str()); // replace "setTitle" with "SetTitle", since you are using TH2F objects instead of MonitorElements
1153  x.str("");
1154  }
1155 
1156  HcalDetId hcal_id;
1157  int ieta, depth, iphi;
1158 
1159  //main loop
1160  // get all containers with names
1161  //HcalGains::tAllContWithNames allContainers = object().getAllContainers();
1162 
1163  //ITERATORS AND VALUES:
1164  HcalGains::tAllContWithNames::const_iterator iter;
1165  std::vector<HcalGain>::const_iterator contIter;
1166  float gain = 0.0;
1167 
1168  //Run trough given id gain:
1169  int i = id;
1170 
1171  //run trough all pair containers
1172  for (iter = allContainers.begin(); iter != allContainers.end(); ++iter) {
1173  //Run trough all values:
1174  for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter) {
1175  hcal_id = HcalDetId((uint32_t)(*contIter).rawId());
1176 
1177  depth = hcal_id.depth();
1178  if (depth < 1 || depth > 4)
1179  continue;
1180 
1181  ieta = hcal_id.ieta();
1182  iphi = hcal_id.iphi();
1183 
1184  if (hcal_id.subdet() == HcalForward)
1185  ieta > 0 ? ++ieta : --ieta;
1186 
1187  //GET VALUE:
1188  gain = (*contIter).getValue(i);
1189  //logstatus = log2(1.*channelBits)+1;
1190 
1191  //FILLING GOES HERE:
1192  graphData[depth - 1].Fill(ieta, iphi, gain);
1193 
1194  //FOR DEBUGGING:
1195  //std::cout << "ieta: " << ieta << "; iphi: " << iphi << "; logstatus: " << logstatus << "; channelBits: " << channelBits<< std::endl;
1196  }
1197  }
1198  }
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
d
Definition: ztail.py:151
float x
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164

◆ FillUnphysicalHEHFBins() [1/2]

void HcalObjRepresent::FillUnphysicalHEHFBins ( std::vector< TH2F > &  hh)
inline

Definition at line 979 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), ztail::d, PVValHelper::eta, hh, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

Referenced by HcalObjRepresent::ADataRepr::fillOneGain().

979  {
980  int ieta = 0;
981  int iphi = 0;
982  // First 2 depths have 5-10-20 degree corrections
983  for (unsigned int d = 0; d < 3; ++d) {
984  //BUG CAN BE HERE:
985  //if (hh[d] != 0) continue;
986 
987  for (int eta = 0; eta < hh[d].GetNbinsX(); ++eta) {
988  ieta = CalcIeta(eta, d + 1);
989  if (ieta == -9999 || abs(ieta) < 21)
990  continue;
991  for (int phi = 0; phi < hh[d].GetNbinsY(); ++phi) {
992  iphi = phi + 1;
993  if (iphi % 2 == 1 && abs(ieta) < 40 && iphi < 73) {
994  hh[d].SetBinContent(eta + 1, iphi + 1, hh[d].GetBinContent(eta + 1, iphi));
995  }
996  // last two eta strips span 20 degrees in phi
997  // Fill the phi cell above iphi, and the 2 below it
998  else if (abs(ieta) > 39 && iphi % 4 == 3 && iphi < 73) {
999  //ieta=40, iphi=3 covers iphi 3,4,5,6
1000  hh[d].SetBinContent(eta + 1, (iphi) % 72 + 1, hh[d].GetBinContent(eta + 1, iphi));
1001  hh[d].SetBinContent(eta + 1, (iphi + 1) % 72 + 1, hh[d].GetBinContent(eta + 1, iphi));
1002  hh[d].SetBinContent(eta + 1, (iphi + 2) % 72 + 1, hh[d].GetBinContent(eta + 1, iphi));
1003  }
1004  } // for (int phi...)
1005  } // for (int eta...)
1006  } // for (int d=0;...)
1007  // no corrections needed for HO (depth 4)
1008  return;
1009  } // FillUnphysicalHEHFBins(MonitorElement* hh)
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
d
Definition: ztail.py:151
TupleMultiplicity< TrackerTraits > const *__restrict__ TrackingRecHitSoAConstView< TrackerTraits > hh

◆ FillUnphysicalHEHFBins() [2/2]

void HcalObjRepresent::FillUnphysicalHEHFBins ( TH2F &  hh)
inline

Definition at line 1012 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), PVValHelper::eta, defaults_cfi::etabins, hh, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

1012  {
1013  // Fills unphysical HE/HF bins for Summary Histogram
1014  // Summary Histogram is binned with the same binning as the Depth 1 EtaPhiHists
1015 
1016  //CAN BE BUG HERE:
1017  //if (hh==0) return;
1018 
1019  int ieta = 0;
1020  int iphi = 0;
1021  int etabins = hh.GetNbinsX();
1022  int phibins = hh.GetNbinsY();
1023  float binval = 0;
1024  for (int eta = 0; eta < etabins; ++eta) // loop over eta bins
1025  {
1026  ieta = CalcIeta(eta, 1);
1027  if (ieta == -9999 || abs(ieta) < 21)
1028  continue; // ignore etas that don't exist, or that have 5 degree phi binning
1029 
1030  for (int phi = 0; phi < phibins; ++phi) {
1031  iphi = phi + 1;
1032  if (iphi % 2 == 1 && abs(ieta) < 40 && iphi < 73) // 10 degree phi binning condition
1033  {
1034  binval = hh.GetBinContent(eta + 1, iphi);
1035  hh.SetBinContent(eta + 1, iphi + 1, binval);
1036  } // if (iphi%2==1...)
1037  else if (abs(ieta) > 39 && iphi % 4 == 3 && iphi < 73) // 20 degree phi binning condition
1038  {
1039  // Set last two eta strips where each cell spans 20 degrees in phi
1040  // Set next phi cell above iphi, and 2 cells below the actual cell
1041  hh.SetBinContent(eta + 1, (iphi) % 72 + 1, hh.GetBinContent(eta + 1, iphi));
1042  hh.SetBinContent(eta + 1, (iphi + 1) % 72 + 1, hh.GetBinContent(eta + 1, iphi));
1043  hh.SetBinContent(eta + 1, (iphi + 2) % 72 + 1, hh.GetBinContent(eta + 1, iphi));
1044  } // else if (abs(ieta)>39 ...)
1045  } // for (int phi=0;phi<72;++phi)
1046 
1047  } // for (int eta=0; eta< (etaBins_-2);++eta)
1048 
1049  return;
1050  } // FillUnphysicalHEHFBins(std::vector<MonitorElement*> &hh)
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TupleMultiplicity< TrackerTraits > const *__restrict__ TrackingRecHitSoAConstView< TrackerTraits > hh

◆ getBitsSummary()

std::string HcalObjRepresent::getBitsSummary ( uint32_t  bits,
std::string  statusBitArray[],
short unsigned int  bitMap[] 
)
inline

Definition at line 536 of file HcalObjRepresent.h.

References gpuClustering::pixelStatus::bits, mps_fire::i, isBitSet(), and contentValuesCheck::ss.

536  {
537  std::stringstream ss;
538  for (unsigned int i = 0; i < 9; ++i) {
539  if (isBitSet(bitMap[i], bits)) {
540  ss << "[" << bitMap[i] << "]" << statusBitArray[bitMap[i]] << "; ";
541  }
542  }
543  ss << std::endl;
544  return ss.str();
545  }
constexpr uint32_t bits
Definition: gpuClustering.h:25
const bool isBitSet(unsigned int bitnumber, unsigned int status)

◆ HcalEtaPhiHistNames()

std::vector<std::string> HcalObjRepresent::HcalEtaPhiHistNames ( )
inline

Definition at line 818 of file HcalObjRepresent.h.

References Skims_PA_cff::name.

818  {
819  std::vector<std::string> name;
820  name.push_back("HB HE HF Depth 1 ");
821  name.push_back("HB HE HF Depth 2 ");
822  name.push_back("HE Depth 3 ");
823  name.push_back("HO Depth 4 ");
824  return name;
825  }

◆ IntToBinary()

std::string HcalObjRepresent::IntToBinary ( unsigned int  number)
inline

Definition at line 516 of file HcalObjRepresent.h.

References mps_fire::i, gpuClustering::pixelStatus::mask, contentValuesFiles::number, and contentValuesCheck::ss.

516  {
517  std::stringstream ss;
518  unsigned int mask = 1 << 31;
519  for (unsigned short int i = 0; i < 32; ++i) {
520  //if (!(i % 4))
521  // ss << "_";
522  if (mask & number)
523  ss << "1";
524  else
525  ss << "0";
526  mask = mask >> 1;
527  }
528  return ss.str();
529  }
constexpr uint32_t mask
Definition: gpuClustering.h:26

◆ isBitSet()

const bool HcalObjRepresent::isBitSet ( unsigned int  bitnumber,
unsigned int  status 
)
inline

Definition at line 531 of file HcalObjRepresent.h.

References mps_update::status.

Referenced by getBitsSummary().

531  {
532  unsigned int statadd = 0x1 << (bitnumber);
533  return (status & statadd) ? (true) : (false);
534  }

◆ isHB()

bool HcalObjRepresent::isHB ( int  etabin,
int  depth 
)
inline

Definition at line 827 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), hcalRecHitTable_cff::depth, and hcalRecHitTable_cff::ieta.

Referenced by HcalGeometry::alignmentTransformIndexLocal().

827  {
828  if (depth > 2)
829  return false;
830  else if (depth < 1)
831  return false;
832  else {
833  int ieta = CalcIeta(etabin, depth);
834  if (ieta == -9999)
835  return false;
836  if (depth == 1) {
837  if (abs(ieta) <= 16)
838  return true;
839  else
840  return false;
841  } else if (depth == 2) {
842  if (abs(ieta) == 15 || abs(ieta) == 16)
843  return true;
844  else
845  return false;
846  }
847  }
848  return false;
849  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isHE()

bool HcalObjRepresent::isHE ( int  etabin,
int  depth 
)
inline

Definition at line 851 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), hcalRecHitTable_cff::depth, and hcalRecHitTable_cff::ieta.

Referenced by HcalGeometry::alignmentTransformIndexLocal(), and l1t::HGCalClusterT< l1t::HGCalCluster >::hOverE().

851  {
852  if (depth > 3)
853  return false;
854  else if (depth < 1)
855  return false;
856  else {
857  int ieta = CalcIeta(etabin, depth);
858  if (ieta == -9999)
859  return false;
860  if (depth == 1) {
861  if (abs(ieta) >= 17 && abs(ieta) <= 28)
862  return true;
863  if (ieta == -29 && etabin == 13)
864  return true; // HE -29
865  if (ieta == 29 && etabin == 71)
866  return true; // HE +29
867  } else if (depth == 2) {
868  if (abs(ieta) >= 17 && abs(ieta) <= 28)
869  return true;
870  if (ieta == -29 && etabin == 13)
871  return true; // HE -29
872  if (ieta == 29 && etabin == 43)
873  return true; // HE +29
874  } else if (depth == 3)
875  return true;
876  }
877  return false;
878  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isHF()

bool HcalObjRepresent::isHF ( int  etabin,
int  depth 
)
inline

Definition at line 880 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), hcalRecHitTable_cff::depth, and hcalRecHitTable_cff::ieta.

Referenced by HcalGeometry::alignmentTransformIndexLocal(), hcaldqm::hashfunctions::hash_FED(), and reco::CentralityProducer::produce().

880  {
881  if (depth > 2)
882  return false;
883  else if (depth < 1)
884  return false;
885  else {
886  int ieta = CalcIeta(etabin, depth);
887  if (ieta == -9999)
888  return false;
889  if (depth == 1) {
890  if (ieta == -29 && etabin == 13)
891  return false; // HE -29
892  else if (ieta == 29 && etabin == 71)
893  return false; // HE +29
894  else if (abs(ieta) >= 29)
895  return true;
896  } else if (depth == 2) {
897  if (ieta == -29 && etabin == 13)
898  return false; // HE -29
899  else if (ieta == 29 && etabin == 43)
900  return false; // HE +29
901  else if (abs(ieta) >= 29)
902  return true;
903  }
904  }
905  return false;
906  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ isHO()

bool HcalObjRepresent::isHO ( int  etabin,
int  depth 
)
inline

Definition at line 908 of file HcalObjRepresent.h.

References CalcIeta(), hcalRecHitTable_cff::depth, and hcalRecHitTable_cff::ieta.

Referenced by hcaldqm::hashfunctions::hash_FED().

908  {
909  if (depth != 4)
910  return false;
911  int ieta = CalcIeta(etabin, depth);
912  if (ieta != -9999)
913  return true;
914  return false;
915  }
int CalcIeta(int eta, int depth)

◆ isSiPM()

bool HcalObjRepresent::isSiPM ( int  ieta,
int  iphi,
int  depth 
)
inline

Definition at line 919 of file HcalObjRepresent.h.

References hcalRecHitTable_cff::depth, hcalRecHitTable_cff::ieta, and hcalRecHitTable_cff::iphi.

919  {
920  if (depth != 4)
921  return false;
922  // HOP1
923  if (ieta >= 5 && ieta <= 10 && iphi >= 47 && iphi <= 58)
924  return true;
925  // HOP2
926  if (ieta >= 11 && ieta <= 15 && iphi >= 59 && iphi <= 70)
927  return true;
928  return false;
929  } // bool isSiPM

◆ Reset()

void HcalObjRepresent::Reset ( std::vector< TH2F > &  depth)
inline

Definition at line 1061 of file HcalObjRepresent.h.

References ztail::d, and hcalRecHitTable_cff::depth.

Referenced by plotTTrigFromHistos::compareDiff(), plotT0FromHistos::compareDiff(), TH2Analyzer::Eval(), and RootSig2XTReqHandler::XTReqTimer::FireAway().

1061  {
1062  for (unsigned int d = 0; d < depth.size(); d++)
1063  //BUG CAN BE HERE:
1064  //if(depth[d])
1065  depth[d].Reset();
1066  } // void Reset(void)
d
Definition: ztail.py:151
void Reset(std::vector< TH2F > &depth)

◆ SciNotatStr()

std::string HcalObjRepresent::SciNotatStr ( float  num)
inline

Definition at line 501 of file HcalObjRepresent.h.

References EgammaValidation_cff::num, and AlCaHLTBitMon_QueryRunRegistry::string.

501  {
502  // Create an output string stream
503  std::ostringstream streamObj2;
504 
505  if (num == -1)
506  return "NOT FOUND";
507 
508  //Add double to stream
509  streamObj2 << num;
510  // Get string from output string stream
511  std::string strObj2 = streamObj2.str();
512 
513  return strObj2;
514  }

◆ setBinLabels()

void HcalObjRepresent::setBinLabels ( std::vector< TH2F > &  depth)
inline

Definition at line 548 of file HcalObjRepresent.h.

References hcalRecHitTable_cff::depth, mps_fire::i, and label.

Referenced by MTVHistoProducerAlgoForTracker::bookRecoHistos(), and setup().

548  {
549  // Set labels for all depth histograms
550  for (unsigned int i = 0; i < depth.size(); ++i) {
551  depth[i].SetXTitle("i#eta");
552  depth[i].SetYTitle("i#phi");
553  }
554 
555  std::stringstream label;
556 
557  // set label on every other bin
558  for (int i = -41; i <= -29; i = i + 2) {
559  label << i;
560  depth[0].GetXaxis()->SetBinLabel(i + 42, label.str().c_str());
561  depth[1].GetXaxis()->SetBinLabel(i + 42, label.str().c_str());
562  label.str("");
563  }
564  depth[0].GetXaxis()->SetBinLabel(14, "-29HE");
565  depth[1].GetXaxis()->SetBinLabel(14, "-29HE");
566 
567  // offset by one for HE
568  for (int i = -27; i <= 27; i = i + 2) {
569  label << i;
570  depth[0].GetXaxis()->SetBinLabel(i + 43, label.str().c_str());
571  label.str("");
572  }
573  depth[0].GetXaxis()->SetBinLabel(72, "29HE");
574  for (int i = 29; i <= 41; i = i + 2) {
575  label << i;
576  depth[0].GetXaxis()->SetBinLabel(i + 44, label.str().c_str());
577  label.str("");
578  }
579  for (int i = 16; i <= 28; i = i + 2) {
580  label << i - 43;
581  depth[1].GetXaxis()->SetBinLabel(i, label.str().c_str());
582  label.str("");
583  }
584  depth[1].GetXaxis()->SetBinLabel(29, "NULL");
585  for (int i = 15; i <= 27; i = i + 2) {
586  label << i;
587  depth[1].GetXaxis()->SetBinLabel(i + 15, label.str().c_str());
588  label.str("");
589  }
590 
591  depth[1].GetXaxis()->SetBinLabel(44, "29HE");
592  for (int i = 29; i <= 41; i = i + 2) {
593  label << i;
594  depth[1].GetXaxis()->SetBinLabel(i + 16, label.str().c_str());
595  label.str("");
596  }
597 
598  // HE depth 3 labels;
599  depth[2].GetXaxis()->SetBinLabel(1, "-28");
600  depth[2].GetXaxis()->SetBinLabel(2, "-27");
601  depth[2].GetXaxis()->SetBinLabel(3, "Null");
602  depth[2].GetXaxis()->SetBinLabel(4, "-16");
603  depth[2].GetXaxis()->SetBinLabel(5, "Null");
604  depth[2].GetXaxis()->SetBinLabel(6, "16");
605  depth[2].GetXaxis()->SetBinLabel(7, "Null");
606  depth[2].GetXaxis()->SetBinLabel(8, "27");
607  depth[2].GetXaxis()->SetBinLabel(9, "28");
608  }
char const * label

◆ SetEtaPhiLabels()

void HcalObjRepresent::SetEtaPhiLabels ( TH2F &  h)
inline

Definition at line 954 of file HcalObjRepresent.h.

References h, mps_fire::i, and label.

954  {
955  std::stringstream label;
956  for (int i = -41; i <= -29; i = i + 2) {
957  label << i;
958  h.GetXaxis()->SetBinLabel(i + 42, label.str().c_str());
959  label.str("");
960  }
961  h.GetXaxis()->SetBinLabel(14, "-29HE");
962 
963  // offset by one for HE
964  for (int i = -27; i <= 27; i = i + 2) {
965  label << i;
966  h.GetXaxis()->SetBinLabel(i + 43, label.str().c_str());
967  label.str("");
968  }
969  h.GetXaxis()->SetBinLabel(72, "29HE");
970  for (int i = 29; i <= 41; i = i + 2) {
971  label << i;
972  h.GetXaxis()->SetBinLabel(i + 44, label.str().c_str());
973  label.str("");
974  }
975  return;
976  }
char const * label
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ setup()

void HcalObjRepresent::setup ( std::vector< TH2F > &  depth,
std::string  name,
std::string  units = "" 
)
inline

Definition at line 1068 of file HcalObjRepresent.h.

References hcalRecHitTable_cff::depth, mps_fire::i, Skims_PA_cff::name, setBinLabels(), AlCaHLTBitMon_QueryRunRegistry::string, units(), and fw3dlego::xbins.

Referenced by fillOneGain().

1068  {
1069  std::string unittitle, unitname;
1070  if (units.empty()) {
1071  unitname = units;
1072  unittitle = "No Units";
1073  } else {
1074  unitname = " " + units;
1075  unittitle = units;
1076  }
1077 
1078  // Push back depth plots
1080  //1. create first plot
1081  depth.push_back(TH2F(("HB HE HF Depth 1 " + name + unitname).c_str(),
1082  (name + " Depth 1 -- HB HE HF (" + unittitle + ")").c_str(),
1083  85,
1084  -42.5,
1085  42.5,
1086  72,
1087  0.5,
1088  72.5));
1089 
1090  //2.1 prepare second plot
1091  float ybins[73];
1092  for (int i = 0; i <= 72; i++)
1093  ybins[i] = (float)(i + 0.5);
1094  float xbinsd2[] = {-42.5, -41.5, -40.5, -39.5, -38.5, -37.5, -36.5, -35.5, -34.5, -33.5, -32.5, -31.5,
1095  -30.5, -29.5, -28.5, -27.5, -26.5, -25.5, -24.5, -23.5, -22.5, -21.5, -20.5, -19.5,
1096  -18.5, -17.5, -16.5, -15.5, -14.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5, 20.5,
1097  21.5, 22.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5, 29.5, 30.5, 31.5, 32.5,
1098  33.5, 34.5, 35.5, 36.5, 37.5, 38.5, 39.5, 40.5, 41.5, 42.5};
1099 
1100  //2.2 create second plot
1101  depth.push_back(TH2F(("HB HE HF Depth 2 " + name + unitname).c_str(),
1102  (name + " Depth 2 -- HB HE HF (" + unittitle + ")").c_str(),
1103  57,
1104  xbinsd2,
1105  72,
1106  ybins));
1107 
1108  //3.1 Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
1109  float xbins[] = {-28.5, -27.5, -26.5, -16.5, -15.5, 15.5, 16.5, 26.5, 27.5, 28.5};
1110  //3.2
1111  depth.push_back(TH2F(("HE Depth 3 " + name + unitname).c_str(),
1112  (name + " Depth 3 -- HE (" + unittitle + ")").c_str(),
1113  // Use variable-sized eta bins
1114  9,
1115  xbins,
1116  72,
1117  ybins));
1118 
1119  //4.1 HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
1120  depth.push_back(TH2F(("HO Depth 4 " + name + unitname).c_str(),
1121  (name + " Depth 4 -- HO (" + unittitle + ")").c_str(),
1122  31,
1123  -15.5,
1124  15.5,
1125  72,
1126  0.5,
1127  72.5));
1128 
1129  for (unsigned int i = 0; i < depth.size(); ++i)
1130  depth[i].Draw("colz");
1131 
1132  setBinLabels(depth); // set axis titles, special bins
1133  }
const double xbins[]
TString units(TString variable, Char_t axis)
void setBinLabels(std::vector< TH2F > &depth)

◆ validDetId()

bool HcalObjRepresent::validDetId ( HcalSubdetector  sd,
int  ies,
int  ip,
int  dp 
)
inline

Definition at line 933 of file HcalObjRepresent.h.

References funct::abs(), Calorimetry_cff::dp, HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

933  {
934  // inputs are (subdetector, ieta, iphi, depth)
935  // stolen from latest version of DataFormats/HcalDetId/src/HcalDetId.cc (not yet available in CMSSW_2_1_9)
936 
937  const int ie(abs(ies));
938 
939  return (
940  (ip >= 1) && (ip <= 72) && (dp >= 1) && (ie >= 1) &&
941  (((sd == HcalBarrel) && (((ie <= 14) && (dp == 1)) || (((ie == 15) || (ie == 16)) && (dp <= 2)))) ||
942  ((sd == HcalEndcap) &&
943  (((ie == 16) && (dp == 3)) || ((ie == 17) && (dp == 1)) || ((ie >= 18) && (ie <= 20) && (dp <= 2)) ||
944  ((ie >= 21) && (ie <= 26) && (dp <= 2) && (ip % 2 == 1)) ||
945  ((ie >= 27) && (ie <= 28) && (dp <= 3) && (ip % 2 == 1)) || ((ie == 29) && (dp <= 2) && (ip % 2 == 1)))) ||
946  ((sd == HcalOuter) && (ie <= 15) && (dp == 4)) ||
947  ((sd == HcalForward) && (dp <= 2) &&
948  (((ie >= 29) && (ie <= 39) && (ip % 2 == 1)) || ((ie >= 40) && (ie <= 41) && (ip % 4 == 3))))));
949 
950  } // bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Variable Documentation

◆ binmapd2

const int HcalObjRepresent::binmapd2[]
Initial value:
= {-42, -41, -40, -39, -38, -37, -36, -35, -34, -33, -32, -31, -30, -29, -28,
-27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -9999, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42}

Definition at line 612 of file HcalObjRepresent.h.

Referenced by CalcIeta().

◆ binmapd3

const int HcalObjRepresent::binmapd3[] = {-28, -27, -9999, -16, -9999, 16, -9999, 27, 28}

Definition at line 619 of file HcalObjRepresent.h.

Referenced by CalcIeta().