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

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

Definition at line 646 of file HcalObjRepresent.h.

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

647  {
648  // This takes the eta value from a subdetector and return an eta counter value as used by eta-phi array
649  // (ieta=-41 corresponds to bin 0, +41 to bin 85 -- there are two offsets to deal with the overlap at |ieta|=29).
650  // For HO, ieta = -15 corresponds to bin 0, and ieta=15 is bin 30
651  // For HE depth 3, things are more complicated, but feeding the ieta value will give back the corresponding counter eta value
652 
653  // The CalcEtaBin value is the value as used within our array counters, and thus starts at 0.
654  // If you are using it with getBinContent or setBinContent, you will need to add +1 to the result of this function
655 
656  int etabin=-9999; // default invalid value
657 
658  if (depth==1)
659  {
660  // Depth 1 is fairly straightforward -- just shift HF-, HF+ by -/+1
661  etabin=ieta+42;
662  if (subdet==HcalForward)
663  {
664  ieta < 0 ? etabin-- : etabin++;
665  }
666  }
667 
668  else if (depth==2)
669  {
670  // Depth 2 is more complicated, given that there are no cells in the range |ieta|<15
671  if (ieta<-14)
672  {
673  etabin=ieta+42;
674  if (subdet==HcalForward) etabin--;
675  }
676  else if (ieta>14)
677  {
678  etabin=ieta+14;
679  if (subdet==HcalForward) etabin++;
680  }
681 
682  }
683  // HO is also straightforward; a simple offset to the ieta value is applied
684  else if (subdet==HcalOuter && abs(ieta)<16)
685  etabin=ieta+15;
686  else if (subdet==HcalEndcap)
687  {
688  // HE depth 3 has spotty coverage; hard-code the bin response
689  if (depth==3)
690  {
691  if (ieta==-28) etabin=0;
692  else if (ieta==-27) etabin=1;
693  else if (ieta==-16) etabin=3;
694  else if (ieta==16) etabin=5;
695  else if (ieta==27) etabin=7;
696  else if (ieta==28) etabin=8;
697  }
698  }
699  return etabin;
700  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int HcalObjRepresent::CalcIeta ( int  subdet,
int  eta,
int  depth 
)
inline

Definition at line 702 of file HcalObjRepresent.h.

References funct::abs(), PVValHelper::eta, HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

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

703  {
704  // This function returns the 'true' ieta value given subdet, eta, and depth
705  // Here 'eta' is the index from our arrays (it starts at 0);
706  // remember that histogram bins start with bin 1, so there's an offset of 1
707  // to consider if using getBinContent(eta,phi)
708 
709  // eta runs from 0...X (X depends on depth)
710  int ieta=-9999; // default value is nonsensical
711  if (subdet==HcalBarrel)
712  {
713  if (depth==1)
714  {
715  ieta=eta-42;
716  if (ieta==0) return -9999;
717  return ieta;
718  }
719  else if (depth==2)
720  {
721  ieta=binmapd2[eta];
722  if (ieta==0) return -9999;
723  if (ieta==17 || ieta == -17)
724  return -9999; // no depth 2 cells at |ieta| = 17
725  return ieta;
726  }
727  else
728  return -9999; // non-physical value
729  }
730  else if (subdet==HcalForward)
731  {
732  if (depth==1)
733  {
734  ieta=eta-42;
735  if (eta<13) ieta++;
736  else if (eta>71) ieta--;
737  else return -9999; // if outside forward range, return dummy
738  return ieta;
739  }
740  else if (depth==2)
741  {
742  ieta=binmapd2[eta]; // special map for depth 2
743  if (ieta<=-30) ieta++;
744  else if (ieta>=30) ieta--;
745  else return -9999;
746  return ieta;
747  }
748  else return -9999;
749  }
750 
751  else if (subdet==HcalEndcap)
752  {
753  if (depth==1)
754  ieta=eta-42;
755  else if (depth==2)
756  {
757  ieta=binmapd2[eta];
758  if (abs(ieta)>29 || abs(ieta)<18) return -9999; // outside HE
759  if (ieta==0) return -9999;
760  return ieta;
761  }
762  else if (depth==3)
763  {
764  if (eta<0 || eta>8) return -9999;
765  else
766  ieta=binmapd3[eta]; // special map for depth 3
767  if (ieta==0) return -9999;
768  return ieta;
769  }
770  else return -9999;
771  } // HcalEndcap
772  else if ( subdet==HcalOuter)
773  {
774  if (depth!=4)
775  return -9999;
776  else
777  {
778  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
779  if (abs(ieta)>15) return -9999;
780  if (ieta==0) return -9999;
781  return ieta;
782  }
783  } // HcalOuter
784  if (ieta==0) return -9999;
785  return ieta;
786  }
const int binmapd3[]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int binmapd2[]
int HcalObjRepresent::CalcIeta ( int  eta,
int  depth 
)
inline

Definition at line 788 of file HcalObjRepresent.h.

References funct::abs(), and PVValHelper::eta.

789  {
790  // This version of CalcIeta does the same as the function above,
791  // but does not require that 'subdet' be specified.
792 
793  // returns ieta value give an eta counter.
794  // eta runs from 0...X (X depends on depth)
795  int ieta=-9999;
796  if (eta<0) return ieta;
797  if (depth==1)
798  {
799  ieta=eta-42; // default shift: bin 0 corresponds to a histogram ieta of -42 (which is offset by 1 from true HF value of -41)
800  if (eta<13) ieta++;
801  else if (eta>71) ieta--;
802  if (ieta==0) ieta=-9999;
803  return ieta;
804  }
805  else if (depth==2)
806  {
807  if (eta>57) return -9999;
808  else
809  {
810  ieta=binmapd2[eta];
811  if (ieta==-9999) return ieta;
812  if (ieta==0) return -9999;
813  if (ieta==17 || ieta == -17) return -9999; // no depth 2 cells at |ieta| = 17
814  else if (ieta<=-30) ieta++;
815  else if (ieta>=30) ieta--;
816  return ieta;
817  }
818  }
819  else if (depth==3)
820  {
821  if (eta>8) return -9999;
822  else
823  ieta=binmapd3[eta];
824  if (ieta==0) return -9999;
825  return ieta;
826  }
827  else if (depth==4)
828  {
829  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
830  if (abs(ieta)>15) return -9999;
831  if (ieta==0) return -9999;
832  return ieta;
833  }
834  return ieta; // avoids compilation warning
835  }
const int binmapd3[]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int binmapd2[]
void HcalObjRepresent::drawTable ( int  nbRows,
int  nbColumns 
)

Definition at line 491 of file HcalObjRepresent.h.

References mps_fire::i, and checklumidiff::l.

491  {
492  TLine* l = new TLine;
493  l->SetLineWidth(1);
494  for (int i = 1; i < nbRows; i++) {
495  double y = (double) i;
496  l = new TLine(0., y, nbColumns, y);
497  l->Draw();
498  }
499 
500  for (int i = 1; i < nbColumns; i++) {
501  double x = (double) i;
502  double y = (double) nbRows;
503  l = new TLine(x, 0., x, y);
504  l->Draw();
505  }
506  }
void HcalObjRepresent::Fill ( HcalDetId id,
double  val,
std::vector< TH2F > &  depth 
)

Definition at line 1113 of file HcalObjRepresent.h.

References HcalForward.

Referenced by SiStripGainCosmicCalculator::algoAnalyze(), zPdfUnc::analyze(), EWKSystUnc::analyze(), ZLONLOHistogrammer::analyze(), ZMuPtScaleAnalyzer::analyze(), ESRecoSummary::analyze(), PatZjetsElectronAnalyzer::analyze(), SiStripDigiValid::analyze(), EcalTBValidation::analyze(), L1TStage2EMTF::analyze(), RPCRecHitProbability::analyze(), ElectronMcSignalValidator::analyze(), L1TPUM::analyze(), DTVDriftSegmentCalibration::analyze(), SimpleConvertedPhotonAnalyzer::analyze(), PhotonsWithConversionsAnalyzer::analyze(), PrimaryVertexMonitor::analyze(), PUDumper::analyze(), DTTTrigOffsetCalibration::analyze(), RecoTauPlotDiscriminator::analyze(), SUSY_HLT_InclusiveHT::analyze(), CaloTowersValidation::analyze(), RPCFEDIntegrity::analyze(), SiStripMonitorDigi::analyze(), SUSY_HLT_PhotonHT::analyze(), SiPixelRecHitsValid::analyze(), MuonTiming::analyze(), HLTVertexPerformanceAnalyzer::analyze(), TrackingRecoMaterialAnalyser::analyze(), L1TdeGCT::analyze(), SUSY_HLT_DoubleMuon_Hadronic::analyze(), DTPreCalibrationTask::analyze(), dqm::TrackAnalyzer::analyze(), VertexMonitor::analyze(), EcalPreshowerNoiseDistrib::analyze(), dEdxHitAnalyzer::analyze(), L1TDEMON::analyze(), PatPhotonSimpleAnalyzer::analyze(), PhotonIDSimpleAnalyzer::analyze(), L1TdeStage2uGT::analyze(), SUSY_HLT_DoubleEle_Hadronic::analyze(), SimplePhotonAnalyzer::analyze(), MuonRecoAnalyzer::analyze(), SiStripMonitorCluster::analyze(), ResolutionCreator::analyze(), GsfElectronDataAnalyzer::analyze(), GsfElectronMCFakeAnalyzer::analyze(), CaloTowersAnalyzer::analyze(), ECALpedestalPCLworker::analyze(), SUSY_HLT_alphaT::analyze(), GsfElectronFakeAnalyzer::analyze(), SUSY_HLT_DiJet_MET::analyze(), SUSY_HLT_MuEle_Hadronic::analyze(), SUSY_HLT_Muon_Hadronic::analyze(), GsfElectronMCAnalyzer::analyze(), EcalPreshowerRecHitsValidation::analyze(), JetTester::analyze(), HLTBTagPerformanceAnalyzer::analyze(), EcalBarrelSimHitsValidation::analyze(), V0Monitor::analyze(), EcalBarrelRecHitsValidation::analyze(), ElectronCalibration::analyze(), L1TRCT::analyze(), ContainmentCorrectionAnalyzer::analyze(), EcalEndcapRecHitsValidation::analyze(), HGCalHitCalibration::analyze(), ZMuMuAnalyzer_cynematics::analyze(), SiPixelHLTSource::analyze(), TagAndProbeBtagTriggerMonitor::analyze(), PhiSymmetryCalibration::analyze(), SiPixelTrackResidualSource::analyze(), DTRunConditionVar::analyze(), PhotonValidatorMiniAOD::analyze(), DiJetMonitor::analyze(), HcalLutAnalyzer::analyze(), DQMExample_Step1::analyze(), EcalRecHitsValidation::analyze(), SiStripMonitorPedestals::analyze(), TkConvValidator::analyze(), APVCyclePhaseMonitor::analyze(), SiStripFEDCheckPlugin::analyze(), MuonDTDigis::analyze(), HcalRecHitsAnalyzer::analyze(), ElectronCalibrationUniv::analyze(), LogMessageMonitor::analyze(), GlobalDigisHistogrammer::analyze(), EventTimeDistribution::analyze(), HLTJetMETValidation::analyze(), cms::Analyzer_minbias::analyze(), L1TdeRCT::analyze(), NoBPTXMonitor::analyze(), TopMonitor::analyze(), SiStripQualityHistory::analyze(), SiPixelQualityHistory::analyze(), DTChamberEfficiency::analyze(), PhotonValidator::analyze(), L1TCSCTF::analyze(), TrackingMonitor::analyze(), PhotonMonitor::analyze(), CommonModeAnalyzer::analyze(), HLTMuonPlotter::analyze(), CTPPSDiamondDQMSource::analyze(), ValidIsoTrkCalib::analyze(), MuonMonitor::analyze(), RazorMonitor::analyze(), DQMPFCandidateAnalyzer::analyze(), METMonitor::analyze(), HTMonitor::analyze(), JetAnalyzer::analyze(), analyzer::SiPixelLorentzAngle::analyze(), ZToMuMuGammaAnalyzer::analyze(), IsoTrig::analyze(), PhotonAnalyzer::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), BeamHaloAnalyzer::analyze(), ResidualRefitting::analyze(), ZCounting::analyzeElectrons(), DTNoiseComputation::beginRun(), plotTTrigFromHistos::compareDiff(), plotT0FromHistos::compareDiff(), EffPurFromHistos::compute(), CommissioningHistograms::copyCustomInformation(), SiStripCorrelateBadStripAndNoise::correlateWithNoise(), popcon::EcalChannelStatusHandler::cosmicsAnalysis(), SiStripPlotGain::DoAnalysis(), SiStripCorrelateNoise::DoAnalysis(), DTResolutionAnalysisTest::dqmEndJob(), DTChamberEfficiencyClient::dqmEndJob(), DTRunConditionVarClient::dqmEndJob(), InvRingCalib::duringLoop(), EcalEleCalibLooper::duringLoop(), ZeeCalibration::duringLoop(), ESSummaryClient::endLumiAnalyze(), ZeeCalibration::endOfLoop(), DigiInvestigatorHistogramMaker::fill(), DigiVertexCorrHistogramMaker::fill(), DigiBXCorrHistogramMaker< T >::fill(), DigiLumiCorrHistogramMaker::fill(), SiPixelTrackResidualModule::fill(), BenchmarkTree::Fill(), SiPixelRawDataErrorModule::fill(), Histos::fill(), SiPixelClusterModule::fill(), MELaserPrim::fill(), SiPixelDigiModule::fill(), XHistogram::fill(), Book::fill(), MonitorElement::Fill(), HParticle::Fill(), HDelta::Fill(), HPartVSEta::Fill(), HPartVSPhi::Fill(), HPartVSPt::Fill(), HMassVSPart::Fill(), HMassVSPartProfile::Fill(), HLikelihoodVSPart::Fill(), HMassResolutionVSPart::Fill(), CSCValHists::fill2DHistByEvent(), SiPixelRecHitsValid::fillBarrel(), SiStripMonitorPedestals::fillCondDBMEs(), BPhysicsValidation::FillDaughters(), SiStripQualityChecker::fillDetectorStatusAtLumi(), SiStripQualityChecker::fillDummyStatus(), SiPixelRawDataErrorModule::fillFED(), GlobalHitsAnalyzer::fillG4MC(), GlobalHitsProdHist::fillG4MC(), RPCNoisyStripTest::fillGlobalME(), RPCOccupancyTest::fillGlobalME(), METDQM::fillHistograms(), HTDQM::fillHistograms(), JetDQM::fillHistograms(), HMesonGammaDQM::fillHistograms(), dqm::TrackAnalyzer::fillHistosForEfficiencyFromHitPatter(), dqm::TrackAnalyzer::fillHistosForTrackerSpecific(), LRHelpFunctions::fillLRBackgroundHist(), LRHelpFunctions::fillLRSignalHist(), SiStripMonitorCluster::fillModuleMEs(), METAnalyzer::fillMonitorElement(), GlobalDigisAnalyzer::fillMuon(), LRHelpFunctions::fillToBackgroundHists(), LRHelpFunctions::fillToSignalCorrelation(), LRHelpFunctions::fillToSignalHists(), edm::RootOutputTree::fillTTree(), SiStripGainCosmicCalculator::getNewObject(), MuTriggerAnalyzer::IsMuMatchedToHLTMu(), HSCPValidator::makeSimDigiPlotsRPC(), CosmicGenFilterHelix::monitorEnd(), CosmicGenFilterHelix::monitorStart(), DTSegmentAnalysisTest::performClientDiagnostic(), RPCChamberQuality::performeClientOperation(), RPCMonitorDigi::performSourceOperation(), subModule::plot(), bigModule::plot(), SiStripGainFromCalibTree::processEvent(), DTDataIntegrityTask::processuROS(), PrimaryVertexMonitor::pvTracksPlots(), ecaldqm::MESetDet0D::reset(), ecaldqm::MESet::resetAll(), IsoTrig::studyTrigger(), and PrimaryVertexMonitor::vertexPlots().

1114  {
1115  // If in HF, need to shift by 1 bin (-1 bin lower in -HF, +1 bin higher in +HF)
1116  if (id.subdet()==HcalForward)
1117  depth[id.depth()-1].Fill(id.ieta()<0 ? id.ieta()-1 : id.ieta()+1, id.iphi(), val);
1118  else
1119  depth[id.depth()-1].Fill(id.ieta(),id.iphi(),val);
1120  }
void HcalObjRepresent::fillOneGain ( std::vector< TH2F > &  graphData,
HcalGains::tAllContWithNames allContainers,
std::string  name,
int  id,
std::string  units = "" 
)

Definition at line 1187 of file HcalObjRepresent.h.

References edmIntegrityCheck::d, egammaForCoreTracking_cff::depth, HcalDetId::depth(), muonCSCDigis_cfi::gain, HcalForward, mps_fire::i, triggerObjects_cff::id, HcalDetId::ieta(), HcalDetId::iphi(), setup(), and HcalDetId::subdet().

1187  {
1188  setup(graphData, name);
1189 
1190  std::stringstream x;
1191  // Change the titles of each individual histogram
1192  for (unsigned int d=0;d < graphData.size();++d){
1193  graphData[d].Reset();
1194  x << "Gain "<< id << " for HCAL depth " << d+1;
1195 
1196  //BUG CAN BE HERE:
1197  //if (ChannelStatus->depth[d])
1198  graphData[d].SetTitle(x.str().c_str()); // replace "setTitle" with "SetTitle", since you are using TH2F objects instead of MonitorElements
1199  x.str("");
1200  }
1201 
1202  HcalDetId hcal_id;
1203  int ieta, depth, iphi;
1204 
1205  //main loop
1206  // get all containers with names
1207  //HcalGains::tAllContWithNames allContainers = object().getAllContainers();
1208 
1209  //ITERATORS AND VALUES:
1210  HcalGains::tAllContWithNames::const_iterator iter;
1211  std::vector<HcalGain>::const_iterator contIter;
1212  float gain = 0.0;
1213 
1214  //Run trough given id gain:
1215  int i = id;
1216 
1217  //run trough all pair containers
1218  for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
1219  //Run trough all values:
1220  for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
1221  hcal_id = HcalDetId((uint32_t)(*contIter).rawId());
1222 
1223  depth = hcal_id.depth();
1224  if (depth<1 || depth>4)
1225  continue;
1226 
1227  ieta=hcal_id.ieta();
1228  iphi=hcal_id.iphi();
1229 
1230  if (hcal_id.subdet() == HcalForward)
1231  ieta>0 ? ++ieta : --ieta;
1232 
1233  //GET VALUE:
1234  gain = (*contIter).getValue(i);
1235  //logstatus = log2(1.*channelBits)+1;
1236 
1237  //FILLING GOES HERE:
1238  graphData[depth-1].Fill(ieta,iphi, gain);
1239 
1240  //FOR DEBUGGING:
1241  //std::cout << "ieta: " << ieta << "; iphi: " << iphi << "; logstatus: " << logstatus << "; channelBits: " << channelBits<< std::endl;
1242  }
1243 
1244  }
1245  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:146
int depth() const
get the tower depth
Definition: HcalDetId.h:166
int ieta() const
get the cell ieta
Definition: HcalDetId.h:159
int iphi() const
get the cell iphi
Definition: HcalDetId.h:161
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void HcalObjRepresent::FillUnphysicalHEHFBins ( std::vector< TH2F > &  hh)
inline

Definition at line 1030 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), edmIntegrityCheck::d, and PVValHelper::eta.

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

1031  {
1032  int ieta=0;
1033  int iphi=0;
1034  // First 2 depths have 5-10-20 degree corrections
1035  for (unsigned int d=0;d<3;++d)
1036  {
1037  //BUG CAN BE HERE:
1038  //if (hh[d] != 0) continue;
1039 
1040  for (int eta=0;eta<hh[d].GetNbinsX();++eta)
1041  {
1042  ieta=CalcIeta(eta,d+1);
1043  if (ieta==-9999 || abs(ieta)<21) continue;
1044  for (int phi=0;phi <hh[d].GetNbinsY();++phi)
1045  {
1046  iphi=phi+1;
1047  if (iphi%2==1 && abs(ieta)<40 && iphi<73)
1048  {
1049  hh[d].SetBinContent(eta+1,iphi+1,hh[d].GetBinContent(eta+1,iphi));
1050  }
1051  // last two eta strips span 20 degrees in phi
1052  // Fill the phi cell above iphi, and the 2 below it
1053  else if (abs(ieta)>39 && iphi%4==3 && iphi<73)
1054  {
1055  //ieta=40, iphi=3 covers iphi 3,4,5,6
1056  hh[d].SetBinContent(eta+1,(iphi)%72+1, hh[d].GetBinContent(eta+1,iphi));
1057  hh[d].SetBinContent(eta+1,(iphi+1)%72+1, hh[d].GetBinContent(eta+1,iphi));
1058  hh[d].SetBinContent(eta+1,(iphi+2)%72+1, hh[d].GetBinContent(eta+1,iphi));
1059  }
1060  } // for (int phi...)
1061  } // for (int eta...)
1062  } // for (int d=0;...)
1063  // no corrections needed for HO (depth 4)
1064  return;
1065  } // FillUnphysicalHEHFBins(MonitorElement* hh)
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
void HcalObjRepresent::FillUnphysicalHEHFBins ( TH2F &  hh)
inline

Definition at line 1069 of file HcalObjRepresent.h.

References funct::abs(), CalcIeta(), and PVValHelper::eta.

1070  {
1071  // Fills unphysical HE/HF bins for Summary Histogram
1072  // Summary Histogram is binned with the same binning as the Depth 1 EtaPhiHists
1073 
1074  //CAN BE BUG HERE:
1075  //if (hh==0) return;
1076 
1077  int ieta=0;
1078  int iphi=0;
1079  int etabins = hh.GetNbinsX();
1080  int phibins = hh.GetNbinsY();
1081  float binval=0;
1082  for (int eta=0;eta<etabins;++eta) // loop over eta bins
1083  {
1084  ieta=CalcIeta(eta,1);
1085  if (ieta==-9999 || abs(ieta)<21) continue; // ignore etas that don't exist, or that have 5 degree phi binning
1086 
1087  for (int phi=0;phi<phibins;++phi)
1088  {
1089  iphi=phi+1;
1090  if (iphi%2==1 && abs(ieta)<40 && iphi<73) // 10 degree phi binning condition
1091  {
1092  binval=hh.GetBinContent(eta+1,iphi);
1093  hh.SetBinContent(eta+1,iphi+1,binval);
1094  } // if (iphi%2==1...)
1095  else if (abs(ieta)>39 && iphi%4==3 && iphi<73) // 20 degree phi binning condition
1096  {
1097  // Set last two eta strips where each cell spans 20 degrees in phi
1098  // Set next phi cell above iphi, and 2 cells below the actual cell
1099  hh.SetBinContent(eta+1, (iphi)%72+1, hh.GetBinContent(eta+1,iphi));
1100  hh.SetBinContent(eta+1, (iphi+1)%72+1, hh.GetBinContent(eta+1,iphi));
1101  hh.SetBinContent(eta+1, (iphi+2)%72+1, hh.GetBinContent(eta+1,iphi));
1102  } // else if (abs(ieta)>39 ...)
1103  } // for (int phi=0;phi<72;++phi)
1104 
1105  } // for (int eta=0; eta< (etaBins_-2);++eta)
1106 
1107  return;
1108  } // FillUnphysicalHEHFBins(std::vector<MonitorElement*> &hh)
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::string HcalObjRepresent::getBitsSummary ( uint32_t  bits,
std::string  statusBitArray[],
short unsigned int  bitMap[] 
)

Definition at line 552 of file HcalObjRepresent.h.

References mps_fire::i, and isBitSet().

552  {
553  std::stringstream ss;
554  for (unsigned int i = 0; i < 9; ++i){
555  if (isBitSet(bitMap[i], bits)){
556  ss << "[" <<bitMap[i]<< "]" << statusBitArray[bitMap[i]] << "; ";
557  }
558  }
559  ss << std::endl;
560  return ss.str();
561  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision bits
const bool isBitSet(unsigned int bitnumber, unsigned int status)
std::vector<std::string> HcalObjRepresent::HcalEtaPhiHistNames ( )
inline

Definition at line 840 of file HcalObjRepresent.h.

References dataset::name.

841  {
842  std::vector<std::string> name;
843  name.push_back("HB HE HF Depth 1 ");
844  name.push_back("HB HE HF Depth 2 ");
845  name.push_back("HE Depth 3 ");
846  name.push_back("HO Depth 4 ");
847  return name;
848  }
std::string HcalObjRepresent::IntToBinary ( unsigned int  number)
inline

Definition at line 529 of file HcalObjRepresent.h.

References mps_fire::i, and RecoTauDiscriminantConfiguration::mask.

529  {
530  std::stringstream ss;
531  unsigned int mask = 1<<31;
532  for (unsigned short int i = 0; i < 32; ++i){
533  //if (!(i % 4))
534  // ss << "_";
535  if (mask & number)
536  ss << "1";
537  else
538  ss << "0";
539  mask = mask >> 1;
540  }
541  return ss.str();
542  }
const bool HcalObjRepresent::isBitSet ( unsigned int  bitnumber,
unsigned int  status 
)

Definition at line 545 of file HcalObjRepresent.h.

Referenced by getBitsSummary().

546  {
547  unsigned int statadd = 0x1<<(bitnumber);
548  return (status&statadd)?(true):(false);
549  }
bool HcalObjRepresent::isHB ( int  etabin,
int  depth 
)
inline

Definition at line 851 of file HcalObjRepresent.h.

References funct::abs(), and CalcIeta().

Referenced by HcalGeometry::alignmentTransformIndexLocal().

852  {
853  if (depth>2) return false;
854  else if (depth<1) return false;
855  else
856  {
857  int ieta=CalcIeta(etabin,depth);
858  if (ieta==-9999) return false;
859  if (depth==1)
860  {
861  if (abs(ieta)<=16 ) return true;
862  else return false;
863  }
864  else if (depth==2)
865  {
866  if (abs(ieta)==15 || abs(ieta)==16) return true;
867  else return false;
868  }
869  }
870  return false;
871  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool HcalObjRepresent::isHE ( int  etabin,
int  depth 
)
inline

Definition at line 873 of file HcalObjRepresent.h.

References funct::abs(), and CalcIeta().

Referenced by HcalGeometry::alignmentTransformIndexLocal().

874  {
875  if (depth>3) return false;
876  else if (depth<1) return false;
877  else
878  {
879  int ieta=CalcIeta(etabin,depth);
880  if (ieta==-9999) return false;
881  if (depth==1)
882  {
883  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
884  if (ieta==-29 && etabin==13) return true; // HE -29
885  if (ieta==29 && etabin == 71) return true; // HE +29
886  }
887  else if (depth==2)
888  {
889  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
890  if (ieta==-29 && etabin==13) return true; // HE -29
891  if (ieta==29 && etabin == 43) return true; // HE +29
892  }
893  else if (depth==3)
894  return true;
895  }
896  return false;
897  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool HcalObjRepresent::isHF ( int  etabin,
int  depth 
)
inline

Definition at line 899 of file HcalObjRepresent.h.

References funct::abs(), and CalcIeta().

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

900  {
901  if (depth>2) return false;
902  else if (depth<1) return false;
903  else
904  {
905  int ieta=CalcIeta(etabin,depth);
906  if (ieta==-9999) return false;
907  if (depth==1)
908  {
909  if (ieta==-29 && etabin==13) return false; // HE -29
910  else if (ieta==29 && etabin == 71) return false; // HE +29
911  else if (abs(ieta)>=29 ) return true;
912  }
913  else if (depth==2)
914  {
915  if (ieta==-29 && etabin==13) return false; // HE -29
916  else if (ieta==29 && etabin==43) return false; // HE +29
917  else if (abs(ieta)>=29 ) return true;
918  }
919  }
920  return false;
921  }
int CalcIeta(int eta, int depth)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool HcalObjRepresent::isHO ( int  etabin,
int  depth 
)
inline

Definition at line 923 of file HcalObjRepresent.h.

References CalcIeta().

924  {
925  if (depth!=4) return false;
926  int ieta=CalcIeta(etabin,depth);
927  if (ieta!=-9999) return true;
928  return false;
929  }
int CalcIeta(int eta, int depth)
bool HcalObjRepresent::isSiPM ( int  ieta,
int  iphi,
int  depth 
)
inline

Definition at line 933 of file HcalObjRepresent.h.

934  {
935  if (depth!=4) return false;
936  // HOP1
937  if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58) return true;
938  // HOP2
939  if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70) return true;
940  return false;
941  } // bool isSiPM
void HcalObjRepresent::Reset ( std::vector< TH2F > &  depth)
std::string HcalObjRepresent::SciNotatStr ( float  num)

Definition at line 511 of file HcalObjRepresent.h.

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

511  {
512 
513  // Create an output string stream
514  std::ostringstream streamObj2;
515 
516  if(num==-1) return "NOT FOUND";
517 
518  //Add double to stream
519  streamObj2 << num;
520  // Get string from output string stream
521  std::string strObj2 = streamObj2.str();
522 
523  return strObj2;
524  }
void HcalObjRepresent::setBinLabels ( std::vector< TH2F > &  depth)

Definition at line 565 of file HcalObjRepresent.h.

References mps_fire::i, and label.

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

566  {
567  // Set labels for all depth histograms
568  for (unsigned int i=0;i<depth.size();++i)
569  {
570  depth[i].SetXTitle("i#eta");
571  depth[i].SetYTitle("i#phi");
572  }
573 
574  std::stringstream label;
575 
576  // set label on every other bin
577  for (int i=-41;i<=-29;i=i+2)
578  {
579  label<<i;
580  depth[0].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
581  depth[1].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
582  label.str("");
583  }
584  depth[0].GetXaxis()->SetBinLabel(14,"-29HE");
585  depth[1].GetXaxis()->SetBinLabel(14,"-29HE");
586 
587  // offset by one for HE
588  for (int i=-27;i<=27;i=i+2)
589  {
590  label<<i;
591  depth[0].GetXaxis()->SetBinLabel(i+43,label.str().c_str());
592  label.str("");
593  }
594  depth[0].GetXaxis()->SetBinLabel(72,"29HE");
595  for (int i=29;i<=41;i=i+2)
596  {
597  label<<i;
598  depth[0].GetXaxis()->SetBinLabel(i+44,label.str().c_str());
599  label.str("");
600  }
601  for (int i=16;i<=28;i=i+2)
602  {
603  label<<i-43;
604  depth[1].GetXaxis()->SetBinLabel(i,label.str().c_str());
605  label.str("");
606  }
607  depth[1].GetXaxis()->SetBinLabel(29,"NULL");
608  for (int i=15;i<=27;i=i+2)
609  {
610  label<<i;
611  depth[1].GetXaxis()->SetBinLabel(i+15,label.str().c_str());
612  label.str("");
613  }
614 
615  depth[1].GetXaxis()->SetBinLabel(44,"29HE");
616  for (int i=29;i<=41;i=i+2)
617  {
618  label<<i;
619  depth[1].GetXaxis()->SetBinLabel(i+16,label.str().c_str());
620  label.str("");
621  }
622 
623  // HE depth 3 labels;
624  depth[2].GetXaxis()->SetBinLabel(1,"-28");
625  depth[2].GetXaxis()->SetBinLabel(2,"-27");
626  depth[2].GetXaxis()->SetBinLabel(3,"Null");
627  depth[2].GetXaxis()->SetBinLabel(4,"-16");
628  depth[2].GetXaxis()->SetBinLabel(5,"Null");
629  depth[2].GetXaxis()->SetBinLabel(6,"16");
630  depth[2].GetXaxis()->SetBinLabel(7,"Null");
631  depth[2].GetXaxis()->SetBinLabel(8,"27");
632  depth[2].GetXaxis()->SetBinLabel(9,"28");
633  }
char const * label
void HcalObjRepresent::SetEtaPhiLabels ( TH2F &  h)
inline

Definition at line 1000 of file HcalObjRepresent.h.

References mps_fire::i, and label.

1001  {
1002  std::stringstream label;
1003  for (int i=-41;i<=-29;i=i+2)
1004  {
1005  label<<i;
1006  h.GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1007  label.str("");
1008  }
1009  h.GetXaxis()->SetBinLabel(14,"-29HE");
1010 
1011  // offset by one for HE
1012  for (int i=-27;i<=27;i=i+2)
1013  {
1014  label<<i;
1015  h.GetXaxis()->SetBinLabel(i+43,label.str().c_str());
1016  label.str("");
1017  }
1018  h.GetXaxis()->SetBinLabel(72,"29HE");
1019  for (int i=29;i<=41;i=i+2)
1020  {
1021  label<<i;
1022  h.GetXaxis()->SetBinLabel(i+44,label.str().c_str());
1023  label.str("");
1024  }
1025  return;
1026  }
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
char const * label
void HcalObjRepresent::setup ( std::vector< TH2F > &  depth,
std::string  name,
std::string  units = "" 
)

Definition at line 1130 of file HcalObjRepresent.h.

References mps_fire::i, setBinLabels(), AlCaHLTBitMon_QueryRunRegistry::string, units(), and fw3dlego::xbins.

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

1130  {
1131  std::string unittitle, unitname;
1132  if (units.empty())
1133  {
1134  unitname = units;
1135  unittitle = "No Units";
1136  }
1137  else
1138  {
1139  unitname = " " + units;
1140  unittitle = units;
1141  }
1142 
1143  // Push back depth plots
1145  //1. create first plot
1146  depth.push_back(TH2F(("HB HE HF Depth 1 "+name+unitname).c_str(),
1147  (name+" Depth 1 -- HB HE HF ("+unittitle+")").c_str(),
1148  85,-42.5,42.5,
1149  72,0.5,72.5));
1150 
1151  //2.1 prepare second plot
1152  float ybins[73];
1153  for (int i=0;i<=72;i++) ybins[i]=(float)(i+0.5);
1154  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,-30.5,-29.5,
1155  -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
1156  -15.5,-14.5,
1157  14.5, 15.5,
1158  16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
1159  31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
1160 
1161  //2.2 create second plot
1162  depth.push_back(TH2F(("HB HE HF Depth 2 "+name+unitname).c_str(),
1163  (name+" Depth 2 -- HB HE HF ("+unittitle+")").c_str(),
1164  57, xbinsd2, 72, ybins));
1165 
1166  //3.1 Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
1167  float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
1168  15.5,16.5,26.5,27.5,28.5};
1169  //3.2
1170  depth.push_back(TH2F(("HE Depth 3 "+name+unitname).c_str(),
1171  (name+" Depth 3 -- HE ("+unittitle+")").c_str(),
1172  // Use variable-sized eta bins
1173  9, xbins, 72, ybins));
1174 
1175  //4.1 HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
1176  depth.push_back(TH2F(("HO Depth 4 "+name+unitname).c_str(),
1177  (name+" Depth 4 -- HO ("+unittitle+")").c_str(),
1178  31,-15.5,15.5,
1179  72,0.5,72.5));
1180 
1181  for (unsigned int i=0;i<depth.size();++i)
1182  depth[i].Draw("colz");
1183 
1184  setBinLabels(depth); // set axis titles, special bins
1185  }
const double xbins[]
TString units(TString variable, Char_t axis)
void setBinLabels(std::vector< TH2F > &depth)
bool HcalObjRepresent::validDetId ( HcalSubdetector  sd,
int  ies,
int  ip,
int  dp 
)
inline

Definition at line 946 of file HcalObjRepresent.h.

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

947  {
948  // inputs are (subdetector, ieta, iphi, depth)
949  // stolen from latest version of DataFormats/HcalDetId/src/HcalDetId.cc (not yet available in CMSSW_2_1_9)
950 
951  const int ie ( abs( ies ) ) ;
952 
953  return ( ( ip >= 1 ) &&
954  ( ip <= 72 ) &&
955  ( dp >= 1 ) &&
956  ( ie >= 1 ) &&
957  ( ( ( sd == HcalBarrel ) &&
958  ( ( ( ie <= 14 ) &&
959  ( dp == 1 ) ) ||
960  ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
961  ( dp <= 2 ) ) ) ) ||
962  ( ( sd == HcalEndcap ) &&
963  ( ( ( ie == 16 ) &&
964  ( dp == 3 ) ) ||
965  ( ( ie == 17 ) &&
966  ( dp == 1 ) ) ||
967  ( ( ie >= 18 ) &&
968  ( ie <= 20 ) &&
969  ( dp <= 2 ) ) ||
970  ( ( ie >= 21 ) &&
971  ( ie <= 26 ) &&
972  ( dp <= 2 ) &&
973  ( ip%2 == 1 ) ) ||
974  ( ( ie >= 27 ) &&
975  ( ie <= 28 ) &&
976  ( dp <= 3 ) &&
977  ( ip%2 == 1 ) ) ||
978  ( ( ie == 29 ) &&
979  ( dp <= 2 ) &&
980  ( ip%2 == 1 ) ) ) ) ||
981  ( ( sd == HcalOuter ) &&
982  ( ie <= 15 ) &&
983  ( dp == 4 ) ) ||
984  ( ( sd == HcalForward ) &&
985  ( dp <= 2 ) &&
986  ( ( ( ie >= 29 ) &&
987  ( ie <= 39 ) &&
988  ( ip%2 == 1 ) ) ||
989  ( ( ie >= 40 ) &&
990  ( ie <= 41 ) &&
991  ( ip%4 == 3 ) ) ) ) ) ) ;
992 
993 
994 
995  } // bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double sd

Variable Documentation

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

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

Definition at line 644 of file HcalObjRepresent.h.