CMS 3D CMS Logo

Classes | Functions | Variables
HcalObjRepresent Namespace Reference

Classes

class  ADataRepr
 

Functions

int CalcEtaBin (int subdet, int ieta, int depth)
 
int CalcIeta (int subdet, int eta, int depth)
 
int CalcIeta (int eta, int depth)
 
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)
 
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 144 of file HcalObjRepresent.h.

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

145  {
146  // This takes the eta value from a subdetector and return an eta counter value as used by eta-phi array
147  // (ieta=-41 corresponds to bin 0, +41 to bin 85 -- there are two offsets to deal with the overlap at |ieta|=29).
148  // For HO, ieta = -15 corresponds to bin 0, and ieta=15 is bin 30
149  // For HE depth 3, things are more complicated, but feeding the ieta value will give back the corresponding counter eta value
150 
151  // The CalcEtaBin value is the value as used within our array counters, and thus starts at 0.
152  // If you are using it with getBinContent or setBinContent, you will need to add +1 to the result of this function
153 
154  int etabin=-9999; // default invalid value
155 
156  if (depth==1)
157  {
158  // Depth 1 is fairly straightforward -- just shift HF-, HF+ by -/+1
159  etabin=ieta+42;
160  if (subdet==HcalForward)
161  {
162  ieta < 0 ? etabin-- : etabin++;
163  }
164  }
165 
166  else if (depth==2)
167  {
168  // Depth 2 is more complicated, given that there are no cells in the range |ieta|<15
169  if (ieta<-14)
170  {
171  etabin=ieta+42;
172  if (subdet==HcalForward) etabin--;
173  }
174  else if (ieta>14)
175  {
176  etabin=ieta+14;
177  if (subdet==HcalForward) etabin++;
178  }
179 
180  }
181  // HO is also straightforward; a simple offset to the ieta value is applied
182  else if (subdet==HcalOuter && abs(ieta)<16)
183  etabin=ieta+15;
184  else if (subdet==HcalEndcap)
185  {
186  // HE depth 3 has spotty coverage; hard-code the bin response
187  if (depth==3)
188  {
189  if (ieta==-28) etabin=0;
190  else if (ieta==-27) etabin=1;
191  else if (ieta==-16) etabin=3;
192  else if (ieta==16) etabin=5;
193  else if (ieta==27) etabin=7;
194  else if (ieta==28) etabin=8;
195  }
196  }
197  return etabin;
198  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int HcalObjRepresent::CalcIeta ( int  subdet,
int  eta,
int  depth 
)
inline

Definition at line 200 of file HcalObjRepresent.h.

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

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

201  {
202  // This function returns the 'true' ieta value given subdet, eta, and depth
203  // Here 'eta' is the index from our arrays (it starts at 0);
204  // remember that histogram bins start with bin 1, so there's an offset of 1
205  // to consider if using getBinContent(eta,phi)
206 
207  // eta runs from 0...X (X depends on depth)
208  int ieta=-9999; // default value is nonsensical
209  if (subdet==HcalBarrel)
210  {
211  if (depth==1)
212  {
213  ieta=eta-42;
214  if (ieta==0) return -9999;
215  return ieta;
216  }
217  else if (depth==2)
218  {
219  ieta=binmapd2[eta];
220  if (ieta==0) return -9999;
221  if (ieta==17 || ieta == -17)
222  return -9999; // no depth 2 cells at |ieta| = 17
223  return ieta;
224  }
225  else
226  return -9999; // non-physical value
227  }
228  else if (subdet==HcalForward)
229  {
230  if (depth==1)
231  {
232  ieta=eta-42;
233  if (eta<13) ieta++;
234  else if (eta>71) ieta--;
235  else return -9999; // if outside forward range, return dummy
236  return ieta;
237  }
238  else if (depth==2)
239  {
240  ieta=binmapd2[eta]; // special map for depth 2
241  if (ieta<=-30) ieta++;
242  else if (ieta>=30) ieta--;
243  else return -9999;
244  return ieta;
245  }
246  else return -9999;
247  }
248 
249  else if (subdet==HcalEndcap)
250  {
251  if (depth==1)
252  ieta=eta-42;
253  else if (depth==2)
254  {
255  ieta=binmapd2[eta];
256  if (abs(ieta)>29 || abs(ieta)<18) return -9999; // outside HE
257  if (ieta==0) return -9999;
258  return ieta;
259  }
260  else if (depth==3)
261  {
262  if (eta<0 || eta>8) return -9999;
263  else
264  ieta=binmapd3[eta]; // special map for depth 3
265  if (ieta==0) return -9999;
266  return ieta;
267  }
268  else return -9999;
269  } // HcalEndcap
270  else if ( subdet==HcalOuter)
271  {
272  if (depth!=4)
273  return -9999;
274  else
275  {
276  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
277  if (abs(ieta)>15) return -9999;
278  if (ieta==0) return -9999;
279  return ieta;
280  }
281  } // HcalOuter
282  if (ieta==0) return -9999;
283  return ieta;
284  }
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 286 of file HcalObjRepresent.h.

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

287  {
288  // This version of CalcIeta does the same as the function above,
289  // but does not require that 'subdet' be specified.
290 
291  // returns ieta value give an eta counter.
292  // eta runs from 0...X (X depends on depth)
293  int ieta=-9999;
294  if (eta<0) return ieta;
295  if (depth==1)
296  {
297  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)
298  if (eta<13) ieta++;
299  else if (eta>71) ieta--;
300  if (ieta==0) ieta=-9999;
301  return ieta;
302  }
303  else if (depth==2)
304  {
305  if (eta>57) return -9999;
306  else
307  {
308  ieta=binmapd2[eta];
309  if (ieta==-9999) return ieta;
310  if (ieta==0) return -9999;
311  if (ieta==17 || ieta == -17) return -9999; // no depth 2 cells at |ieta| = 17
312  else if (ieta<=-30) ieta++;
313  else if (ieta>=30) ieta--;
314  return ieta;
315  }
316  }
317  else if (depth==3)
318  {
319  if (eta>8) return -9999;
320  else
321  ieta=binmapd3[eta];
322  if (ieta==0) return -9999;
323  return ieta;
324  }
325  else if (depth==4)
326  {
327  ieta= eta-15; // bin 0 is ieta=-15, all bins increment normally from there
328  if (abs(ieta)>15) return -9999;
329  if (ieta==0) return -9999;
330  return ieta;
331  }
332  return ieta; // avoids compilation warning
333  }
const int binmapd3[]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const int binmapd2[]
void HcalObjRepresent::Fill ( HcalDetId id,
double  val,
std::vector< TH2F > &  depth 
)

Definition at line 611 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(), RPCRecHitProbability::analyze(), L1TStage2EMTF::analyze(), ElectronMcSignalValidator::analyze(), DTVDriftSegmentCalibration::analyze(), L1TPUM::analyze(), PhotonsWithConversionsAnalyzer::analyze(), SimpleConvertedPhotonAnalyzer::analyze(), PrimaryVertexMonitor::analyze(), PUDumper::analyze(), DTTTrigOffsetCalibration::analyze(), SUSY_HLT_InclusiveHT::analyze(), CaloTowersValidation::analyze(), RPCFEDIntegrity::analyze(), SiStripMonitorDigi::analyze(), RecoTauPlotDiscriminator::analyze(), SUSY_HLT_PhotonHT::analyze(), SiPixelRecHitsValid::analyze(), MuonRecoAnalyzer::analyze(), MuonTiming::analyze(), HLTVertexPerformanceAnalyzer::analyze(), TrackingRecoMaterialAnalyser::analyze(), SUSY_HLT_DoubleMuon_Hadronic::analyze(), CTPPSPixelDQMSource::analyze(), DTPreCalibrationTask::analyze(), L1TdeGCT::analyze(), EcalPreshowerNoiseDistrib::analyze(), dEdxHitAnalyzer::analyze(), dqm::TrackAnalyzer::analyze(), VertexMonitor::analyze(), PatPhotonSimpleAnalyzer::analyze(), SiStripMonitorCluster::analyze(), PhotonIDSimpleAnalyzer::analyze(), L1TDEMON::analyze(), SUSY_HLT_DoubleEle_Hadronic::analyze(), SimplePhotonAnalyzer::analyze(), ResolutionCreator::analyze(), GsfElectronDataAnalyzer::analyze(), GsfElectronMCFakeAnalyzer::analyze(), ECALpedestalPCLworker::analyze(), CaloTowersAnalyzer::analyze(), CTPPSDiamondDQMSource::analyze(), SUSY_HLT_alphaT::analyze(), GsfElectronFakeAnalyzer::analyze(), SUSY_HLT_DiJet_MET::analyze(), SUSY_HLT_MuEle_Hadronic::analyze(), SUSY_HLT_Muon_Hadronic::analyze(), GsfElectronMCAnalyzer::analyze(), HLTBTagPerformanceAnalyzer::analyze(), EcalPreshowerRecHitsValidation::analyze(), JetTester::analyze(), EcalBarrelSimHitsValidation::analyze(), V0Monitor::analyze(), EcalBarrelRecHitsValidation::analyze(), LumiMonitor::analyze(), ElectronCalibration::analyze(), L1TRCT::analyze(), ContainmentCorrectionAnalyzer::analyze(), EcalEndcapRecHitsValidation::analyze(), ZMuMuAnalyzer_cynematics::analyze(), SiPixelHLTSource::analyze(), HGCalHitCalibration::analyze(), TagAndProbeBtagTriggerMonitor::analyze(), PhiSymmetryCalibration::analyze(), SiPixelTrackResidualSource::analyze(), DTRunConditionVar::analyze(), PhotonValidatorMiniAOD::analyze(), HcalLutAnalyzer::analyze(), DQMExample_Step1::analyze(), EcalRecHitsValidation::analyze(), TkConvValidator::analyze(), APVCyclePhaseMonitor::analyze(), SiStripFEDCheckPlugin::analyze(), SiStripMonitorPedestals::analyze(), MuonDTDigis::analyze(), HcalRecHitsAnalyzer::analyze(), ElectronCalibrationUniv::analyze(), L1TdeRCT::analyze(), GlobalDigisHistogrammer::analyze(), TopMonitor::analyze(), LogMessageMonitor::analyze(), HLTJetMETValidation::analyze(), EventTimeDistribution::analyze(), cms::Analyzer_minbias::analyze(), TriggerBxMonitor::analyze(), NoBPTXMonitor::analyze(), SiStripQualityHistory::analyze(), SiPixelQualityHistory::analyze(), TrackingMonitor::analyze(), L1TCSCTF::analyze(), PhotonValidator::analyze(), TriggerRatesMonitor::analyze(), DTChamberEfficiency::analyze(), PhotonMonitor::analyze(), CommonModeAnalyzer::analyze(), HLTMuonPlotter::analyze(), RazorMonitor::analyze(), ValidIsoTrkCalib::analyze(), IsoTrig::analyze(), MuonMonitor::analyze(), DQMPFCandidateAnalyzer::analyze(), METMonitor::analyze(), HTMonitor::analyze(), JetAnalyzer::analyze(), analyzer::SiPixelLorentzAngle::analyze(), ZToMuMuGammaAnalyzer::analyze(), PhotonAnalyzer::analyze(), PrimaryVertexAnalyzer4PUSlimmed::analyze(), BeamHaloAnalyzer::analyze(), ResidualRefitting::analyze(), DQMDaqInfo::beginLuminosityBlock(), DTNoiseComputation::beginRun(), plotTTrigFromHistos::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(), CSCValHists::fill2DHistByEvent(), SiPixelRecHitsValid::fillBarrel(), SiStripMonitorPedestals::fillCondDBMEs(), BPhysicsValidation::FillDaughters(), SiStripQualityChecker::fillDetectorStatusAtLumi(), SiStripQualityChecker::fillDummyStatus(), SiPixelRawDataErrorModule::fillFED(), GlobalHitsProdHist::fillG4MC(), GlobalHitsAnalyzer::fillG4MC(), RPCNoisyStripTest::fillGlobalME(), RPCOccupancyTest::fillGlobalME(), METDQM::fillHistograms(), HTDQM::fillHistograms(), JetDQM::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(), bigModule::plot(), subModule::plot(), SiStripGainsPCLWorker::processEvent(), SiStripGainFromCalibTree::processEvent(), PrimaryVertexMonitor::pvTracksPlots(), ecaldqm::MESetDet0D::reset(), ecaldqm::MESet::resetAll(), IsoTrig::studyTrigger(), and PrimaryVertexMonitor::vertexPlots().

612  {
613  // If in HF, need to shift by 1 bin (-1 bin lower in -HF, +1 bin higher in +HF)
614  if (id.subdet()==HcalForward)
615  depth[id.depth()-1].Fill(id.ieta()<0 ? id.ieta()-1 : id.ieta()+1, id.iphi(), val);
616  else
617  depth[id.depth()-1].Fill(id.ieta(),id.iphi(),val);
618  }
void HcalObjRepresent::fillOneGain ( std::vector< TH2F > &  graphData,
HcalGains::tAllContWithNames allContainers,
std::string  name,
int  id,
std::string  units = "" 
)

Definition at line 685 of file HcalObjRepresent.h.

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

685  {
686  setup(graphData, name);
687 
688  std::stringstream x;
689  // Change the titles of each individual histogram
690  for (unsigned int d=0;d < graphData.size();++d){
691  graphData[d].Reset();
692  x << "Gain "<< id << " for HCAL depth " << d+1;
693 
694  //BUG CAN BE HERE:
695  //if (ChannelStatus->depth[d])
696  graphData[d].SetTitle(x.str().c_str()); // replace "setTitle" with "SetTitle", since you are using TH2F objects instead of MonitorElements
697  x.str("");
698  }
699 
700  HcalDetId hcal_id;
701  int ieta, depth, iphi;
702 
703  //main loop
704  // get all containers with names
705  //HcalGains::tAllContWithNames allContainers = object().getAllContainers();
706 
707  //ITERATORS AND VALUES:
708  HcalGains::tAllContWithNames::const_iterator iter;
709  std::vector<HcalGain>::const_iterator contIter;
710  float gain = 0.0;
711 
712  //Run trough given id gain:
713  int i = id;
714 
715  //run trough all pair containers
716  for (iter = allContainers.begin(); iter != allContainers.end(); ++iter){
717  //Run trough all values:
718  for (contIter = (*iter).second.begin(); contIter != (*iter).second.end(); ++contIter){
719  hcal_id = HcalDetId((uint32_t)(*contIter).rawId());
720 
721  depth = hcal_id.depth();
722  if (depth<1 || depth>4)
723  continue;
724 
725  ieta=hcal_id.ieta();
726  iphi=hcal_id.iphi();
727 
728  if (hcal_id.subdet() == HcalForward)
729  ieta>0 ? ++ieta : --ieta;
730 
731  //GET VALUE:
732  gain = (*contIter).getValue(i);
733  //logstatus = log2(1.*channelBits)+1;
734 
735  //FILLING GOES HERE:
736  graphData[depth-1].Fill(ieta,iphi, gain);
737 
738  //FOR DEBUGGING:
739  //std::cout << "ieta: " << ieta << "; iphi: " << iphi << "; logstatus: " << logstatus << "; channelBits: " << channelBits<< std::endl;
740  }
741 
742  }
743  }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void HcalObjRepresent::FillUnphysicalHEHFBins ( std::vector< TH2F > &  hh)
inline

Definition at line 528 of file HcalObjRepresent.h.

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

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

529  {
530  int ieta=0;
531  int iphi=0;
532  // First 2 depths have 5-10-20 degree corrections
533  for (unsigned int d=0;d<3;++d)
534  {
535  //BUG CAN BE HERE:
536  //if (hh[d] != 0) continue;
537 
538  for (int eta=0;eta<hh[d].GetNbinsX();++eta)
539  {
540  ieta=CalcIeta(eta,d+1);
541  if (ieta==-9999 || abs(ieta)<21) continue;
542  for (int phi=0;phi <hh[d].GetNbinsY();++phi)
543  {
544  iphi=phi+1;
545  if (iphi%2==1 && abs(ieta)<40 && iphi<73)
546  {
547  hh[d].SetBinContent(eta+1,iphi+1,hh[d].GetBinContent(eta+1,iphi));
548  }
549  // last two eta strips span 20 degrees in phi
550  // Fill the phi cell above iphi, and the 2 below it
551  else if (abs(ieta)>39 && iphi%4==3 && iphi<73)
552  {
553  //ieta=40, iphi=3 covers iphi 3,4,5,6
554  hh[d].SetBinContent(eta+1,(iphi)%72+1, hh[d].GetBinContent(eta+1,iphi));
555  hh[d].SetBinContent(eta+1,(iphi+1)%72+1, hh[d].GetBinContent(eta+1,iphi));
556  hh[d].SetBinContent(eta+1,(iphi+2)%72+1, hh[d].GetBinContent(eta+1,iphi));
557  }
558  } // for (int phi...)
559  } // for (int eta...)
560  } // for (int d=0;...)
561  // no corrections needed for HO (depth 4)
562  return;
563  } // 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 567 of file HcalObjRepresent.h.

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

568  {
569  // Fills unphysical HE/HF bins for Summary Histogram
570  // Summary Histogram is binned with the same binning as the Depth 1 EtaPhiHists
571 
572  //CAN BE BUG HERE:
573  //if (hh==0) return;
574 
575  int ieta=0;
576  int iphi=0;
577  int etabins = hh.GetNbinsX();
578  int phibins = hh.GetNbinsY();
579  float binval=0;
580  for (int eta=0;eta<etabins;++eta) // loop over eta bins
581  {
582  ieta=CalcIeta(eta,1);
583  if (ieta==-9999 || abs(ieta)<21) continue; // ignore etas that don't exist, or that have 5 degree phi binning
584 
585  for (int phi=0;phi<phibins;++phi)
586  {
587  iphi=phi+1;
588  if (iphi%2==1 && abs(ieta)<40 && iphi<73) // 10 degree phi binning condition
589  {
590  binval=hh.GetBinContent(eta+1,iphi);
591  hh.SetBinContent(eta+1,iphi+1,binval);
592  } // if (iphi%2==1...)
593  else if (abs(ieta)>39 && iphi%4==3 && iphi<73) // 20 degree phi binning condition
594  {
595  // Set last two eta strips where each cell spans 20 degrees in phi
596  // Set next phi cell above iphi, and 2 cells below the actual cell
597  hh.SetBinContent(eta+1, (iphi)%72+1, hh.GetBinContent(eta+1,iphi));
598  hh.SetBinContent(eta+1, (iphi+1)%72+1, hh.GetBinContent(eta+1,iphi));
599  hh.SetBinContent(eta+1, (iphi+2)%72+1, hh.GetBinContent(eta+1,iphi));
600  } // else if (abs(ieta)>39 ...)
601  } // for (int phi=0;phi<72;++phi)
602 
603  } // for (int eta=0; eta< (etaBins_-2);++eta)
604 
605  return;
606  } // 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 50 of file HcalObjRepresent.h.

References mps_fire::i, and isBitSet().

50  {
51  std::stringstream ss;
52  for (unsigned int i = 0; i < 9; ++i){
53  if (isBitSet(bitMap[i], bits)){
54  ss << "[" <<bitMap[i]<< "]" << statusBitArray[bitMap[i]] << "; ";
55  }
56  }
57  ss << std::endl;
58  return ss.str();
59  }
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 338 of file HcalObjRepresent.h.

References dataset::name.

339  {
340  std::vector<std::string> name;
341  name.push_back("HB HE HF Depth 1 ");
342  name.push_back("HB HE HF Depth 2 ");
343  name.push_back("HE Depth 3 ");
344  name.push_back("HO Depth 4 ");
345  return name;
346  }
std::string HcalObjRepresent::IntToBinary ( unsigned int  number)
inline

Definition at line 27 of file HcalObjRepresent.h.

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

27  {
28  std::stringstream ss;
29  unsigned int mask = 1<<31;
30  for (unsigned short int i = 0; i < 32; ++i){
31  //if (!(i % 4))
32  // ss << "_";
33  if (mask & number)
34  ss << "1";
35  else
36  ss << "0";
37  mask = mask >> 1;
38  }
39  return ss.str();
40  }
const bool HcalObjRepresent::isBitSet ( unsigned int  bitnumber,
unsigned int  status 
)

Definition at line 43 of file HcalObjRepresent.h.

Referenced by getBitsSummary().

44  {
45  unsigned int statadd = 0x1<<(bitnumber);
46  return (status&statadd)?(true):(false);
47  }
bool HcalObjRepresent::isHB ( int  etabin,
int  depth 
)
inline

Definition at line 349 of file HcalObjRepresent.h.

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

Referenced by HcalGeometry::alignmentTransformIndexLocal().

350  {
351  if (depth>2) return false;
352  else if (depth<1) return false;
353  else
354  {
355  int ieta=CalcIeta(etabin,depth);
356  if (ieta==-9999) return false;
357  if (depth==1)
358  {
359  if (abs(ieta)<=16 ) return true;
360  else return false;
361  }
362  else if (depth==2)
363  {
364  if (abs(ieta)==15 || abs(ieta)==16) return true;
365  else return false;
366  }
367  }
368  return false;
369  }
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 371 of file HcalObjRepresent.h.

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

Referenced by HcalGeometry::alignmentTransformIndexLocal().

372  {
373  if (depth>3) return false;
374  else if (depth<1) return false;
375  else
376  {
377  int ieta=CalcIeta(etabin,depth);
378  if (ieta==-9999) return false;
379  if (depth==1)
380  {
381  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
382  if (ieta==-29 && etabin==13) return true; // HE -29
383  if (ieta==29 && etabin == 71) return true; // HE +29
384  }
385  else if (depth==2)
386  {
387  if (abs(ieta)>=17 && abs(ieta)<=28 ) return true;
388  if (ieta==-29 && etabin==13) return true; // HE -29
389  if (ieta==29 && etabin == 43) return true; // HE +29
390  }
391  else if (depth==3)
392  return true;
393  }
394  return false;
395  }
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 397 of file HcalObjRepresent.h.

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

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

398  {
399  if (depth>2) return false;
400  else if (depth<1) return false;
401  else
402  {
403  int ieta=CalcIeta(etabin,depth);
404  if (ieta==-9999) return false;
405  if (depth==1)
406  {
407  if (ieta==-29 && etabin==13) return false; // HE -29
408  else if (ieta==29 && etabin == 71) return false; // HE +29
409  else if (abs(ieta)>=29 ) return true;
410  }
411  else if (depth==2)
412  {
413  if (ieta==-29 && etabin==13) return false; // HE -29
414  else if (ieta==29 && etabin==43) return false; // HE +29
415  else if (abs(ieta)>=29 ) return true;
416  }
417  }
418  return false;
419  }
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 421 of file HcalObjRepresent.h.

References CalcIeta().

422  {
423  if (depth!=4) return false;
424  int ieta=CalcIeta(etabin,depth);
425  if (ieta!=-9999) return true;
426  return false;
427  }
int CalcIeta(int eta, int depth)
bool HcalObjRepresent::isSiPM ( int  ieta,
int  iphi,
int  depth 
)
inline

Definition at line 431 of file HcalObjRepresent.h.

432  {
433  if (depth!=4) return false;
434  // HOP1
435  if (ieta>=5 && ieta <=10 && iphi>=47 && iphi<=58) return true;
436  // HOP2
437  if (ieta>=11 && ieta<=15 && iphi>=59 && iphi<=70) return true;
438  return false;
439  } // bool isSiPM
void HcalObjRepresent::Reset ( std::vector< TH2F > &  depth)
void HcalObjRepresent::setBinLabels ( std::vector< TH2F > &  depth)

Definition at line 63 of file HcalObjRepresent.h.

References mps_fire::i, and diffTwoXMLs::label.

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

64  {
65  // Set labels for all depth histograms
66  for (unsigned int i=0;i<depth.size();++i)
67  {
68  depth[i].SetXTitle("i#eta");
69  depth[i].SetYTitle("i#phi");
70  }
71 
72  std::stringstream label;
73 
74  // set label on every other bin
75  for (int i=-41;i<=-29;i=i+2)
76  {
77  label<<i;
78  depth[0].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
79  depth[1].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
80  label.str("");
81  }
82  depth[0].GetXaxis()->SetBinLabel(14,"-29HE");
83  depth[1].GetXaxis()->SetBinLabel(14,"-29HE");
84 
85  // offset by one for HE
86  for (int i=-27;i<=27;i=i+2)
87  {
88  label<<i;
89  depth[0].GetXaxis()->SetBinLabel(i+43,label.str().c_str());
90  label.str("");
91  }
92  depth[0].GetXaxis()->SetBinLabel(72,"29HE");
93  for (int i=29;i<=41;i=i+2)
94  {
95  label<<i;
96  depth[0].GetXaxis()->SetBinLabel(i+44,label.str().c_str());
97  label.str("");
98  }
99  for (int i=16;i<=28;i=i+2)
100  {
101  label<<i-43;
102  depth[1].GetXaxis()->SetBinLabel(i,label.str().c_str());
103  label.str("");
104  }
105  depth[1].GetXaxis()->SetBinLabel(29,"NULL");
106  for (int i=15;i<=27;i=i+2)
107  {
108  label<<i;
109  depth[1].GetXaxis()->SetBinLabel(i+15,label.str().c_str());
110  label.str("");
111  }
112 
113  depth[1].GetXaxis()->SetBinLabel(44,"29HE");
114  for (int i=29;i<=41;i=i+2)
115  {
116  label<<i;
117  depth[1].GetXaxis()->SetBinLabel(i+16,label.str().c_str());
118  label.str("");
119  }
120 
121  // HE depth 3 labels;
122  depth[2].GetXaxis()->SetBinLabel(1,"-28");
123  depth[2].GetXaxis()->SetBinLabel(2,"-27");
124  depth[2].GetXaxis()->SetBinLabel(3,"Null");
125  depth[2].GetXaxis()->SetBinLabel(4,"-16");
126  depth[2].GetXaxis()->SetBinLabel(5,"Null");
127  depth[2].GetXaxis()->SetBinLabel(6,"16");
128  depth[2].GetXaxis()->SetBinLabel(7,"Null");
129  depth[2].GetXaxis()->SetBinLabel(8,"27");
130  depth[2].GetXaxis()->SetBinLabel(9,"28");
131  }
void HcalObjRepresent::SetEtaPhiLabels ( TH2F &  h)
inline

Definition at line 498 of file HcalObjRepresent.h.

References mps_fire::i, and diffTwoXMLs::label.

499  {
500  std::stringstream label;
501  for (int i=-41;i<=-29;i=i+2)
502  {
503  label<<i;
504  h.GetXaxis()->SetBinLabel(i+42,label.str().c_str());
505  label.str("");
506  }
507  h.GetXaxis()->SetBinLabel(14,"-29HE");
508 
509  // offset by one for HE
510  for (int i=-27;i<=27;i=i+2)
511  {
512  label<<i;
513  h.GetXaxis()->SetBinLabel(i+43,label.str().c_str());
514  label.str("");
515  }
516  h.GetXaxis()->SetBinLabel(72,"29HE");
517  for (int i=29;i<=41;i=i+2)
518  {
519  label<<i;
520  h.GetXaxis()->SetBinLabel(i+44,label.str().c_str());
521  label.str("");
522  }
523  return;
524  }
void HcalObjRepresent::setup ( std::vector< TH2F > &  depth,
std::string  name,
std::string  units = "" 
)

Definition at line 628 of file HcalObjRepresent.h.

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

Referenced by fillOneGain().

628  {
629  std::string unittitle, unitname;
630  if (units.empty())
631  {
632  unitname = units;
633  unittitle = "No Units";
634  }
635  else
636  {
637  unitname = " " + units;
638  unittitle = units;
639  }
640 
641  // Push back depth plots
643  //1. create first plot
644  depth.push_back(TH2F(("HB HE HF Depth 1 "+name+unitname).c_str(),
645  (name+" Depth 1 -- HB HE HF ("+unittitle+")").c_str(),
646  85,-42.5,42.5,
647  72,0.5,72.5));
648 
649  //2.1 prepare second plot
650  float ybins[73];
651  for (int i=0;i<=72;i++) ybins[i]=(float)(i+0.5);
652  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,
653  -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,
654  -15.5,-14.5,
655  14.5, 15.5,
656  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,
657  31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
658 
659  //2.2 create second plot
660  depth.push_back(TH2F(("HB HE HF Depth 2 "+name+unitname).c_str(),
661  (name+" Depth 2 -- HB HE HF ("+unittitle+")").c_str(),
662  57, xbinsd2, 72, ybins));
663 
664  //3.1 Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
665  float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
666  15.5,16.5,26.5,27.5,28.5};
667  //3.2
668  depth.push_back(TH2F(("HE Depth 3 "+name+unitname).c_str(),
669  (name+" Depth 3 -- HE ("+unittitle+")").c_str(),
670  // Use variable-sized eta bins
671  9, xbins, 72, ybins));
672 
673  //4.1 HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
674  depth.push_back(TH2F(("HO Depth 4 "+name+unitname).c_str(),
675  (name+" Depth 4 -- HO ("+unittitle+")").c_str(),
676  31,-15.5,15.5,
677  72,0.5,72.5));
678 
679  for (unsigned int i=0;i<depth.size();++i)
680  depth[i].Draw("colz");
681 
682  setBinLabels(depth); // set axis titles, special bins
683  }
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 444 of file HcalObjRepresent.h.

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

445  {
446  // inputs are (subdetector, ieta, iphi, depth)
447  // stolen from latest version of DataFormats/HcalDetId/src/HcalDetId.cc (not yet available in CMSSW_2_1_9)
448 
449  const int ie ( abs( ies ) ) ;
450 
451  return ( ( ip >= 1 ) &&
452  ( ip <= 72 ) &&
453  ( dp >= 1 ) &&
454  ( ie >= 1 ) &&
455  ( ( ( sd == HcalBarrel ) &&
456  ( ( ( ie <= 14 ) &&
457  ( dp == 1 ) ) ||
458  ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
459  ( dp <= 2 ) ) ) ) ||
460  ( ( sd == HcalEndcap ) &&
461  ( ( ( ie == 16 ) &&
462  ( dp == 3 ) ) ||
463  ( ( ie == 17 ) &&
464  ( dp == 1 ) ) ||
465  ( ( ie >= 18 ) &&
466  ( ie <= 20 ) &&
467  ( dp <= 2 ) ) ||
468  ( ( ie >= 21 ) &&
469  ( ie <= 26 ) &&
470  ( dp <= 2 ) &&
471  ( ip%2 == 1 ) ) ||
472  ( ( ie >= 27 ) &&
473  ( ie <= 28 ) &&
474  ( dp <= 3 ) &&
475  ( ip%2 == 1 ) ) ||
476  ( ( ie == 29 ) &&
477  ( dp <= 2 ) &&
478  ( ip%2 == 1 ) ) ) ) ||
479  ( ( sd == HcalOuter ) &&
480  ( ie <= 15 ) &&
481  ( dp == 4 ) ) ||
482  ( ( sd == HcalForward ) &&
483  ( dp <= 2 ) &&
484  ( ( ( ie >= 29 ) &&
485  ( ie <= 39 ) &&
486  ( ip%2 == 1 ) ) ||
487  ( ( ie >= 40 ) &&
488  ( ie <= 41 ) &&
489  ( ip%4 == 3 ) ) ) ) ) ) ;
490 
491 
492 
493  } // bool validDetId(HcalSubdetector sd, int ies, int ip, int dp)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
auto dp
Definition: deltaR.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 135 of file HcalObjRepresent.h.

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

Definition at line 142 of file HcalObjRepresent.h.