36 if (hist->GetXaxis()->GetNbins() !=
nFEBs(part))
return false;
42 for (
int i = 0; i < nTicks; i++)
88 for (
unsigned int c = 0; c < 10; c++)
127 if (layer == 1)
return 2;
128 if (layer == 2)
return 2;
133 if (layer == 1)
return 6;
134 if (layer == 2)
return 2;
164 for (
short region = 0; region <
nRegions(calo, layer); region++) total +=
nEta(calo, layer, region);
171 if (region >=
nRegions(calo, layer))
return 0;
173 if (layer == 0)
return 61;
175 if (region == 0)
return 447;
176 if (region == 1)
return 3;
179 if (region == 0)
return 56;
180 if (region == 1)
return 1;
182 if (layer == 3)
return 27;
186 if (layer == 0)
return 12;
188 if (region == 0)
return 1;
189 if (region == 1)
return 3;
190 if (region == 2)
return 96;
191 if (region == 3)
return 48;
192 if (region == 4)
return 64;
193 if (region == 5)
return 4;
196 if (region == 0)
return 1;
197 if (region == 1)
return 43;
199 if (layer == 3)
return 20;
203 if (layer == 0)
return 0;
204 if (layer == 1)
return 7;
205 if (layer == 2)
return 7;
206 if (layer == 3)
return 0;
210 if (layer >= 4)
return 0;
211 if (region == 0) {
short n[4] = { 10, 10, 9, 8 };
return n[layer]; }
212 if (region == 1) {
short n[4] = { 4, 3, 3, 4 };
return n[layer]; }
216 if (layer > 3)
return 0;
217 if (layer == 1)
return 63;
219 short n[16] = { 30, 32, 32, 31, 31, 32, 32, 30, 30, 32, 32, 31, 31, 32, 32, 30 };
222 if (layer == 3)
return (iPhi == 5 || iPhi == 13 ? 15 : 16);
231 if (layer > 3)
return 0;
232 if (region == 1)
return (layer == 1 || layer == 2 ? 256 : 0);
233 short n[4] = { 64, 64, 256, 256 };
237 if (layer > 3)
return 0;
238 short n[4] = { 64, 64, 256, 256 };
242 if (layer > 2 || layer == 0)
return 0;
243 short n[3] = { 0, 64, 64 };
250 if (layer > 3)
return 0;
251 if (region == 0)
return 64;
252 if (region == 1)
return 32;
256 if (layer > 3)
return 0;
257 short n[4] = { 0, 16, 16, 16 };
267 if (layer > 3)
return 0;
268 double w[4] = { 0.025, 0.0249724/8, 0.025, 0.050 };
269 double nominal = w[layer];
270 if (iEta == -1)
return nominal;
276 if (layer == 0)
return nominal;
277 if (calo ==
EMB_A && layer == 1 && region == 0 && iEta == 0)
return nominal*1.5;
278 if (calo ==
EMB_C && layer == 1 && region == 0 && iEta ==
nEta(calo, layer, region))
return nominal*1.5;
279 if (layer == 1 && region == 0)
return nominal;
280 if (layer == 1 && region == 1)
return 8*nominal;
281 if (layer == 2 && region == 0)
return nominal;
282 if (layer == 2 && region == 1)
return 3*nominal;
283 if (layer == 3)
return nominal;
288 if (layer > 3)
return 0;
289 double w[4] = { 0.025, 0.025/8, 0.025, 0.050 };
290 double nominal = w[layer];
291 if (iEta == -1)
return nominal;
300 if (layer == 0)
return nominal;
301 if (layer == 1 && region == 0)
return 16*nominal;
302 if (layer == 1 && region == 1)
return 8*nominal;
303 if (layer == 1 && region == 2)
return nominal;
304 if (layer == 1 && region == 3)
return 4/3.*nominal;
305 if (layer == 1 && region == 4)
return 2*nominal;
306 if (layer == 1 && region == 5)
return 8*nominal;
307 if (layer == 2 && region == 0)
return 2*nominal;
308 if (layer == 2 && region == 1)
return nominal;
309 if (layer == 3)
return nominal;
314 if (layer > 3)
return 0;
315 double nominal = 0.1;
316 if (iEta == -1)
return nominal;
319 if (layer == 1)
return nominal;
320 if (layer == 2)
return nominal;
321 if (layer == 3)
return nominal;
326 if (layer > 3)
return 0;
327 if (region == 0)
return 0.1;
328 if (region == 1)
return 0.2;
333 double nominal = 1.8/64;
334 if (layer == 1)
return nominal;
335 if (layer == 2)
return 2*nominal;
336 if (layer == 3)
return 4*nominal;
346 if (layer > 3)
return 0;
348 short nphi=
nPhi(calo, layer);
350 if (nphi!=0) nominal=TMath::TwoPi()/nphi;
366 if (layer == 1 && region == 0)
return 0;
367 if (region == 1)
return 1.40;
371 if (layer == 0)
return 1.5;
373 if (region == 0)
return 1.385;
374 if (region == 1)
return 1.435;
375 if (region == 2)
return 1.51;
376 if (region == 3)
return 1.81;
377 if (region == 4)
return 2.01;
378 if (region == 5)
return 2.41;
381 if (region == 0)
return 1.385;
382 if (region == 1)
return 1.435;
384 if (layer == 3)
return 1.5;
387 if (layer == 1 || layer == 2)
return 2.51;
389 if (region == 0)
return 1.5;
390 if (region == 1)
return 2.5;
392 if (calo ==
FCAL_A)
return 3.1;
408 if (layer == 0)
return 1.52;
409 if (layer == 1 || layer == 2) {
410 if (region == 0)
return 1.40;
411 if (region == 1)
return 1.475;
413 if (layer == 3)
return 1.35;
416 if (layer == 0)
return 1.8;
418 if (region == 0)
return 1.435;
419 if (region == 1)
return 1.51;
420 if (region == 2)
return 1.81;
421 if (region == 3)
return 2.01;
422 if (region == 4)
return 2.41;
423 if (region == 5)
return 2.51;
426 if (region == 0)
return 1.435;
427 if (region == 1)
return 2.51;
429 if (layer == 3)
return 2.5;
432 if (layer == 1 || layer == 2)
return 3.21;
434 if (region == 0)
return 2.5;
435 if (region == 1)
return 3.3;
437 if (calo ==
FCAL_A)
return 4.9;
444 double pos =
etaMin(calo, layer, region);
445 for (
short i = 0; i < iEta; i++) pos +=
etaSize(calo, layer, region, i);
459 double pos =
phiMin(calo, layer, region);
460 for (
short i = 0; i < iPhi; i++) pos +=
phiSize(calo, layer, region, i);
468 if (layer == 1 && region == 1) iEta +=
nEta(calo, layer, 0);
469 if (layer == 2 && region == 1) iEta +=
nEta(calo, layer, 0);
473 for (
short r = 0;
r < region;
r++) iEta +=
nEta(calo, layer,
r);
474 if (layer == 2 && region >= 1) iEta += 1;
477 if (region == 1) iEta += 10;
489 std::vector<TArrayD*> v; v.push_back(&binsC); v.push_back(&binsA);
495 std::vector<TArrayD*> v; v.push_back(&binsO); v.push_back(&binsI);
502 binsBA =
remove(binsBA, -1);
503 binsBA =
remove(binsBA, -1);
504 binsOA =
remove(binsOA, 0);
505 }
else if (layer == 2) {
506 binsBA =
remove(binsBA, -1);
509 TArrayD binsBC =
mirror(binsBA);
510 TArrayD binsOC =
mirror(binsOA);
511 std::vector<TArrayD*> v;
512 v.push_back(&binsOC); v.push_back(&binsBC);
513 v.push_back(&binsBA); v.push_back(&binsOA);
520 std::vector<TArrayD*> v;
521 v.push_back(&binsIC); v.push_back(&binsPE); v.push_back(&binsIA);
528 TArrayD trans(2); trans[0] = -1.5; trans[1] = 1.5;
529 std::vector<TArrayD*> v;
530 v.push_back(&binsHC); v.push_back(&trans); v.push_back(&binsHA);
534 if (
nEta(calo, layer) == 0)
return TArrayD();
536 TArrayD
bins(
nEta(calo, layer) + 1);
537 short nRegs =
nRegions(calo, layer);
540 for (
short k = 0; k < nRegs; k++) {
541 for (
short ii = 0; ii <
nEta(calo, layer, k); ii++, i++)
542 bins[i] =
eta(calo, layer, k, ii);
544 bins[i] =
etaHigh(calo, layer, nRegs - 1,
nEta(calo, layer, nRegs - 1) - 1);
551 TArrayD etaBinArray =
etaBins(calo, layer);
552 short nPhiBins =
nPhi(calo, layer);
555 TH2D*
h =
new TH2D(name, title, etaBinArray.GetSize() - 1, etaBinArray.GetArray(),
556 nPhiBins, -TMath::Pi() + eps +
phiMin(calo, layer), TMath::Pi() + eps +
phiMin(calo, layer));
557 h->GetXaxis()->SetTitle(
"#eta");
558 h->GetYaxis()->SetTitle(
"#phi");
565 return eta(calo, layer, region, iEta) +
Id::sign(calo)*
etaSize(calo, layer, region, iEta)/2;
571 return phi(calo, layer, region, iPhi) +
phiSize(calo, layer, region, iPhi)/2;
577 return eta(calo, layer, region, iEta) +
Id::sign(calo)*
etaSize(calo, layer, region, iEta);
583 return phi(calo, layer, region, iPhi) +
phiSize(calo, layer, region, iPhi);
630 static const char*
const ftBarrelA[] = {
631 " 0-01L",
" 1-02R",
" 2-02L",
" 3-03R",
632 " 4-03L",
" 5-04R",
" 6-04L",
" 7-05R",
633 " 8-05L",
" 9-06R",
"10-06L",
"11-07R",
634 "12-07L",
"13-08R",
"14-08L",
"15-09R",
635 "16-09L",
"17-10R",
"18-10L",
"19-11R",
636 "20-11L",
"21-12R",
"22-12L",
"23-13R",
637 "24-13L",
"25-14R",
"26-14L",
"27-15R",
638 "28-15L",
"29-16R",
"30-16L",
"31-01R",
640 if (feedThrough >= 0 && feedThrough <
static_cast<int>(std::size(ftBarrelA))) {
641 return ftBarrelA[feedThrough];
646 static const char*
const ftBarrelC[] = {
647 " 0-09L",
" 1-08R",
" 2-08L",
" 3-07R",
648 " 4-07L",
" 5-06R",
" 6-06L",
" 7-05R",
649 " 8-05L",
" 9-04R",
"10-04L",
"11-03R",
650 "12-03L",
"13-02R",
"14-02L",
"15-01R",
651 "16-01L",
"17-16R",
"18-16L",
"19-15R",
652 "20-15L",
"21-14R",
"22-14L",
"23-13R",
653 "24-13L",
"25-12R",
"26-12L",
"27-11R",
654 "28-11L",
"29-10R",
"30-10L",
"31-09R",
656 if (feedThrough >= 0 && feedThrough <
static_cast<int>(std::size(ftBarrelC))) {
657 return ftBarrelC[feedThrough];
662 static const char*
const ftEndcapA[] = {
663 " 0-01R",
" 1-01L",
" 2-02R",
" 3-02L",
" 4-03R",
664 " 5-03L",
" 6-04R",
" 7-05R",
" 8-05L",
" 9-06R",
665 "10-06L",
"11-07R",
"12-07L",
"13-08R",
"14-08L",
666 "15-09R",
"16-09L",
"17-10R",
"18-10L",
"19-11R",
667 "20-11L",
"21-12R",
"22-12L",
"23-13R",
"24-13L",
669 if (feedThrough >= 0 && feedThrough <
static_cast<int>(std::size(ftEndcapA))) {
670 return ftEndcapA[feedThrough];
675 static const char*
const ftEndcapC[] = {
676 " 0-07R",
" 1-07L",
" 2-06R",
" 3-06L",
" 4-05R",
677 " 5-05L",
" 6-04L",
" 7-03R",
" 8-03L",
" 9-02R",
678 "10-02L",
"11-01R",
"12-01L",
"13-13R",
"14-13L",
679 "15-12R",
"16-12L",
"17-11R",
"18-11L",
"19-10R",
680 "20-10L",
"21-09R",
"22-09L",
"23-08R",
"24-08L",
682 if (feedThrough >= 0 && feedThrough <
static_cast<int>(std::size(ftEndcapC))) {
683 return ftEndcapC[feedThrough];
692 std::vector<TArrayD*> nonEmptyArrays;
694 for (
unsigned int k = 0; k < arrays.size(); k++) {
695 if (arrays[k]->GetSize() == 0)
continue;
696 n += arrays[k]->GetSize();
697 nonEmptyArrays.push_back(arrays[k]);
700 TArrayD
bins(n - nonEmptyArrays.size() + 1);
702 for (
unsigned int k = 0; k < nonEmptyArrays.size(); k++)
703 for (
int ii = 0; ii < nonEmptyArrays[k]->GetSize() - 1; ii++, i++)
704 bins[i] = (*nonEmptyArrays[k])[ii];
705 bins[i] = (*nonEmptyArrays[nonEmptyArrays.size() - 1])[nonEmptyArrays[nonEmptyArrays.size() - 1]->GetSize() - 1];
712 int n =
bins.GetSize();
713 TArrayD mirrorBins(n);
714 for (
int k = 0; k < n; k++)
715 mirrorBins[k] = -
bins[n - k - 1];
721 int n =
bins.GetSize();
725 TArrayD newBins(n - 1);
727 for (
int kk = 0; kk < n; kk++) {
728 if (kk ==
index)
continue;
729 newBins[k] =
bins[kk];
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
static const std::vector< std::string > bins
static short firstEta(CaloId calo, short layer, short region=0)
static short nFEBs(PartitionId part)
static bool setBinLabels(TH2 *hist, PartitionId part)
static short firstLayer(CaloId calo)
static double phiCenter(CaloId calo, short layer, short region, short iPhi)
static short nEta(CaloId calo, short layer, short region, short iPhi=1)
static double phiMin(CaloId calo, short layer, short region=-1)
static double etaCenter(CaloId calo, short layer, short region, short iEta)
static double etaHigh(CaloId calo, short layer, short region, short iEta)
static TArrayD merge(const std::vector< TArrayD * > &arrays)
static TH2D * etaPhiHist(CaloId calo, short layer, const TString &name, const TString &title)
static double phiSize(CaloId calo, short layer, short region, short iPhi=-1)
static short nLayers(CaloId calo)
static int nChannels(CaloId calo, short layer, short region)
static short nRegions(CaloId calo, short layer)
static TProfile2D * partitionProfileHist(PartitionId part, const TString &name, const TString &title)
static short nSlots(PartitionId part)
static double etaSize(CaloId calo, short layer, short region, short iEta=-1)
static double etaMax(CaloId calo, short layer, short region=-1)
static TArrayD mirror(const TArrayD &bins)
static short nPartitionChannels(PartitionId part)
static TArrayD etaBins(CaloId calo, short layer)
static const char * feedThroughName(PartitionId part, short feedThrough)
static short etaIndex(CaloId calo, short layer, short region, short iEta)
static TArrayD remove(const TArrayD &bins, int index)
static double etaMin(CaloId calo, short layer, short region=-1)
static short nFeedThroughs(PartitionId part)
static double phi(CaloId calo, short layer, short region, short iPhi)
static TH2D * partitionHist(PartitionId part, const TString &name, const TString &title)
static short nPhi(CaloId calo, short layer, short region=0)
static double phiHigh(CaloId calo, short layer, short region, short iPhi)
static double eta(CaloId calo, short layer, short region, short iEta)
static CaloId mirror(CaloId id)
static CaloId summary(CaloId id)
static bool matchCalo(CaloId id, CaloId idSpec)
static short sign(CaloId id)