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 625 of file HcalObjRepresent.h.

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

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

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

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

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

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

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

◆ Fill()

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

Definition at line 1057 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(), tadqm::TrackAnalyzer::analyze(), HGCalHitCalibration::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(), SiStripLorentzAnglePCLMonitor::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(), DigiLumiCorrHistogramMaker::fill(), DigiBXCorrHistogramMaker< EventWithHistory >::fill(), SiPixelTrackResidualModule::fill(), SiPixelRawDataErrorModule::fill(), Histos::fill(), SiPixelClusterModule::fill(), SiPixelDigiModule::fill(), XHistogram::fill(), DD4hep_XHistogram::fill(), output.OutputTree::fill(), Book::fill(), output.FullOutput::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().

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

◆ fillOneGain()

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

Definition at line 1139 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.

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

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

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

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

◆ FillUnphysicalHEHFBins() [2/2]

void HcalObjRepresent::FillUnphysicalHEHFBins ( TH2F &  hh)
inline

Definition at line 1016 of file HcalObjRepresent.h.

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

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

◆ getBitsSummary()

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

Definition at line 540 of file HcalObjRepresent.h.

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

540  {
541  std::stringstream ss;
542  for (unsigned int i = 0; i < 9; ++i) {
543  if (isBitSet(bitMap[i], bits)) {
544  ss << "[" << bitMap[i] << "]" << statusBitArray[bitMap[i]] << "; ";
545  }
546  }
547  ss << std::endl;
548  return ss.str();
549  }
const bool isBitSet(unsigned int bitnumber, unsigned int status)

◆ HcalEtaPhiHistNames()

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

Definition at line 822 of file HcalObjRepresent.h.

References Skims_PA_cff::name.

822  {
823  std::vector<std::string> name;
824  name.push_back("HB HE HF Depth 1 ");
825  name.push_back("HB HE HF Depth 2 ");
826  name.push_back("HE Depth 3 ");
827  name.push_back("HO Depth 4 ");
828  return name;
829  }

◆ IntToBinary()

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

Definition at line 520 of file HcalObjRepresent.h.

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

520  {
521  std::stringstream ss;
522  unsigned int mask = 1 << 31;
523  for (unsigned short int i = 0; i < 32; ++i) {
524  //if (!(i % 4))
525  // ss << "_";
526  if (mask & number)
527  ss << "1";
528  else
529  ss << "0";
530  mask = mask >> 1;
531  }
532  return ss.str();
533  }

◆ isBitSet()

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

Definition at line 535 of file HcalObjRepresent.h.

References mps_update::status.

Referenced by getBitsSummary().

535  {
536  unsigned int statadd = 0x1 << (bitnumber);
537  return (status & statadd) ? (true) : (false);
538  }

◆ isHB()

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

Definition at line 831 of file HcalObjRepresent.h.

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

Referenced by HcalGeometry::alignmentTransformIndexLocal().

831  {
832  if (depth > 2)
833  return false;
834  else if (depth < 1)
835  return false;
836  else {
837  int ieta = CalcIeta(etabin, depth);
838  if (ieta == -9999)
839  return false;
840  if (depth == 1) {
841  if (abs(ieta) <= 16)
842  return true;
843  else
844  return false;
845  } else if (depth == 2) {
846  if (abs(ieta) == 15 || abs(ieta) == 16)
847  return true;
848  else
849  return false;
850  }
851  }
852  return false;
853  }
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 855 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().

855  {
856  if (depth > 3)
857  return false;
858  else if (depth < 1)
859  return false;
860  else {
861  int ieta = CalcIeta(etabin, depth);
862  if (ieta == -9999)
863  return false;
864  if (depth == 1) {
865  if (abs(ieta) >= 17 && abs(ieta) <= 28)
866  return true;
867  if (ieta == -29 && etabin == 13)
868  return true; // HE -29
869  if (ieta == 29 && etabin == 71)
870  return true; // HE +29
871  } else if (depth == 2) {
872  if (abs(ieta) >= 17 && abs(ieta) <= 28)
873  return true;
874  if (ieta == -29 && etabin == 13)
875  return true; // HE -29
876  if (ieta == 29 && etabin == 43)
877  return true; // HE +29
878  } else if (depth == 3)
879  return true;
880  }
881  return false;
882  }
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 884 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().

884  {
885  if (depth > 2)
886  return false;
887  else if (depth < 1)
888  return false;
889  else {
890  int ieta = CalcIeta(etabin, depth);
891  if (ieta == -9999)
892  return false;
893  if (depth == 1) {
894  if (ieta == -29 && etabin == 13)
895  return false; // HE -29
896  else if (ieta == 29 && etabin == 71)
897  return false; // HE +29
898  else if (abs(ieta) >= 29)
899  return true;
900  } else if (depth == 2) {
901  if (ieta == -29 && etabin == 13)
902  return false; // HE -29
903  else if (ieta == 29 && etabin == 43)
904  return false; // HE +29
905  else if (abs(ieta) >= 29)
906  return true;
907  }
908  }
909  return false;
910  }
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 912 of file HcalObjRepresent.h.

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

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

912  {
913  if (depth != 4)
914  return false;
915  int ieta = CalcIeta(etabin, depth);
916  if (ieta != -9999)
917  return true;
918  return false;
919  }
int CalcIeta(int eta, int depth)

◆ isSiPM()

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

Definition at line 923 of file HcalObjRepresent.h.

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

Referenced by HGCalMappingModuleIndexer::convertTypeCode(), ALPAKA_ACCELERATOR_NAMESPACE::hgcal::HGCalMappingModuleESProducer::produce(), and ALPAKA_ACCELERATOR_NAMESPACE::hgcal::HGCalMappingCellESProducer::produce().

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

◆ Reset()

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

Definition at line 1065 of file HcalObjRepresent.h.

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

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

1065  {
1066  for (unsigned int d = 0; d < depth.size(); d++)
1067  //BUG CAN BE HERE:
1068  //if(depth[d])
1069  depth[d].Reset();
1070  } // 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 505 of file HcalObjRepresent.h.

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

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

◆ setBinLabels()

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

Definition at line 552 of file HcalObjRepresent.h.

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

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

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

◆ SetEtaPhiLabels()

void HcalObjRepresent::SetEtaPhiLabels ( TH2F &  h)
inline

Definition at line 958 of file HcalObjRepresent.h.

References h, mps_fire::i, and label.

958  {
959  std::stringstream label;
960  for (int i = -41; i <= -29; i = i + 2) {
961  label << i;
962  h.GetXaxis()->SetBinLabel(i + 42, label.str().c_str());
963  label.str("");
964  }
965  h.GetXaxis()->SetBinLabel(14, "-29HE");
966 
967  // offset by one for HE
968  for (int i = -27; i <= 27; i = i + 2) {
969  label << i;
970  h.GetXaxis()->SetBinLabel(i + 43, label.str().c_str());
971  label.str("");
972  }
973  h.GetXaxis()->SetBinLabel(72, "29HE");
974  for (int i = 29; i <= 41; i = i + 2) {
975  label << i;
976  h.GetXaxis()->SetBinLabel(i + 44, label.str().c_str());
977  label.str("");
978  }
979  return;
980  }
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 1072 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().

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

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

937  {
938  // inputs are (subdetector, ieta, iphi, depth)
939  // stolen from latest version of DataFormats/HcalDetId/src/HcalDetId.cc (not yet available in CMSSW_2_1_9)
940 
941  const int ie(abs(ies));
942 
943  return (
944  (ip >= 1) && (ip <= 72) && (dp >= 1) && (ie >= 1) &&
945  (((sd == HcalBarrel) && (((ie <= 14) && (dp == 1)) || (((ie == 15) || (ie == 16)) && (dp <= 2)))) ||
946  ((sd == HcalEndcap) &&
947  (((ie == 16) && (dp == 3)) || ((ie == 17) && (dp == 1)) || ((ie >= 18) && (ie <= 20) && (dp <= 2)) ||
948  ((ie >= 21) && (ie <= 26) && (dp <= 2) && (ip % 2 == 1)) ||
949  ((ie >= 27) && (ie <= 28) && (dp <= 3) && (ip % 2 == 1)) || ((ie == 29) && (dp <= 2) && (ip % 2 == 1)))) ||
950  ((sd == HcalOuter) && (ie <= 15) && (dp == 4)) ||
951  ((sd == HcalForward) && (dp <= 2) &&
952  (((ie >= 29) && (ie <= 39) && (ip % 2 == 1)) || ((ie >= 40) && (ie <= 41) && (ip % 4 == 3))))));
953 
954  } // 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 616 of file HcalObjRepresent.h.

Referenced by CalcIeta().

◆ binmapd3

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

Definition at line 623 of file HcalObjRepresent.h.

Referenced by CalcIeta().