ATLAS Offline Software
Loading...
Searching...
No Matches
LArSamples::Geo Class Reference

#include <Geometry.h>

Collaboration diagram for LArSamples::Geo:

Static Public Member Functions

static const char * feedThroughName (PartitionId part, short feedThrough)
static TH2D * partitionHist (PartitionId part, const TString &name, const TString &title)
static TProfile2D * partitionProfileHist (PartitionId part, const TString &name, const TString &title)
static bool setBinLabels (TH2 *hist, PartitionId part)
static short nFeedThroughs (PartitionId part)
static short nSlots (PartitionId part)
static short nPartitionChannels (PartitionId part)
static short nFEBs (PartitionId part)
static short nFEBs ()
static short nPhiRings ()
static short firstLayer (CaloId calo)
static short nLayers (CaloId calo)
static short nRegions (CaloId calo, short layer)
static short firstEta (CaloId calo, short layer, short region=0)
static short nEta (CaloId calo, short layer, short region, short iPhi=1)
static short nEta (CaloId calo, short layer)
static short nPhi (CaloId calo, short layer, short region=0)
static double etaSize (CaloId calo, short layer, short region, short iEta=-1)
static double phiSize (CaloId calo, short layer, short region, short iPhi=-1)
static double etaMin (CaloId calo, short layer, short region=-1)
static double etaMax (CaloId calo, short layer, short region=-1)
static double phiMin (CaloId calo, short layer, short region=-1)
static double eta (CaloId calo, short layer, short region, short iEta)
static double phi (CaloId calo, short layer, short region, short iPhi)
static double etaCenter (CaloId calo, short layer, short region, short iEta)
static double phiCenter (CaloId calo, short layer, short region, short iPhi)
static double etaHigh (CaloId calo, short layer, short region, short iEta)
static double phiHigh (CaloId calo, short layer, short region, short iPhi)
static short etaIndex (CaloId calo, short layer, short region, short iEta)
static TArrayD etaBins (CaloId calo, short layer)
static TH2D * etaPhiHist (CaloId calo, short layer, const TString &name, const TString &title)
static int nChannels (CaloId calo, short layer, short region)
static int nChannels (CaloId calo, short layer)
static int nChannels (CaloId calo)
static TArrayD merge (const std::vector< TArrayD * > &arrays)
static TArrayD mirror (const TArrayD &bins)
static TArrayD remove (const TArrayD &bins, int index)

Detailed Description

Definition at line 24 of file Geometry.h.

Member Function Documentation

◆ eta()

double Geo::eta ( CaloId calo,
short layer,
short region,
short iEta )
static

Definition at line 442 of file Geometry.cxx.

443{
444 double pos = etaMin(calo, layer, region);
445 for (short i = 0; i < iEta; i++) pos += etaSize(calo, layer, region, i);
446 return Id::sign(calo)*pos;
447}
static double etaSize(CaloId calo, short layer, short region, short iEta=-1)
Definition Geometry.cxx:264
static double etaMin(CaloId calo, short layer, short region=-1)
Definition Geometry.cxx:355
static short sign(CaloId id)
Definition CaloId.cxx:206
setScale setgFexType iEta

◆ etaBins()

TArrayD Geo::etaBins ( CaloId calo,
short layer )
static

Definition at line 482 of file Geometry.cxx.

483{
484 if (Id::sign(calo) < 0) return mirror(etaBins(Id::mirror(calo), layer));
485
486 if (calo == EMB) {
487 TArrayD binsA = etaBins(EMB_A, layer);
488 TArrayD binsC = etaBins(EMB_C, layer);
489 std::vector<TArrayD*> v; v.push_back(&binsC); v.push_back(&binsA);
490 return merge(v);
491 }
492 if (calo == EMEC_A) {
493 TArrayD binsO = etaBins(EMEC_OUTER_A, layer);
494 TArrayD binsI = etaBins(EMEC_INNER_A, layer);
495 std::vector<TArrayD*> v; v.push_back(&binsO); v.push_back(&binsI);
496 return merge(v);
497 }
498 if (calo == PRECISION_EM) {
499 TArrayD binsBA = etaBins(EMB_A, layer);
500 TArrayD binsOA = etaBins(EMEC_OUTER_A, layer);
501 if (layer == 1) {
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);
507 binsOA[0] = 1.40;
508 }
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);
514 return merge(v);
515 }
516 if (calo == EM) {
517 TArrayD binsIA = etaBins(EMEC_INNER_A, layer);
518 TArrayD binsIC = etaBins(EMEC_INNER_C, layer);
519 TArrayD binsPE = etaBins(PRECISION_EM, layer);
520 std::vector<TArrayD*> v;
521 v.push_back(&binsIC); v.push_back(&binsPE); v.push_back(&binsIA);
522 return merge(v);
523 }
524
525 if (calo == HEC) {
526 TArrayD binsHA = etaBins(HEC_A, layer);
527 TArrayD binsHC = etaBins(HEC_C, layer);
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);
531 return merge(v);
532 }
533
534 if (nEta(calo, layer) == 0) return TArrayD();
535
536 TArrayD bins(nEta(calo, layer) + 1);
537 short nRegs = nRegions(calo, layer);
538
539 int i = 0;
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);
543 }
544 bins[i] = etaHigh(calo, layer, nRegs - 1, nEta(calo, layer, nRegs - 1) - 1);
545 return bins;
546}
Scalar eta() const
pseudorapidity method
static const std::vector< std::string > bins
static short nEta(CaloId calo, short layer, short region, short iPhi=1)
Definition Geometry.cxx:169
static double etaHigh(CaloId calo, short layer, short region, short iEta)
Definition Geometry.cxx:575
static TArrayD merge(const std::vector< TArrayD * > &arrays)
Definition Geometry.cxx:690
static short nRegions(CaloId calo, short layer)
Definition Geometry.cxx:124
static TArrayD mirror(const TArrayD &bins)
Definition Geometry.cxx:710
static TArrayD etaBins(CaloId calo, short layer)
Definition Geometry.cxx:482
static TArrayD remove(const TArrayD &bins, int index)
Definition Geometry.cxx:719
static CaloId mirror(CaloId id)
Definition CaloId.cxx:236
@ EMEC_INNER_C
Definition CaloId.h:22
@ PRECISION_EM
Definition CaloId.h:26
@ EMEC_INNER_A
Definition CaloId.h:24
@ EMEC_OUTER_A
Definition CaloId.h:24

◆ etaCenter()

double Geo::etaCenter ( CaloId calo,
short layer,
short region,
short iEta )
static

Definition at line 563 of file Geometry.cxx.

564{
565 return eta(calo, layer, region, iEta) + Id::sign(calo)*etaSize(calo, layer, region, iEta)/2;
566}

◆ etaHigh()

double Geo::etaHigh ( CaloId calo,
short layer,
short region,
short iEta )
static

Definition at line 575 of file Geometry.cxx.

576{
577 return eta(calo, layer, region, iEta) + Id::sign(calo)*etaSize(calo, layer, region, iEta);
578}

◆ etaIndex()

short Geo::etaIndex ( CaloId calo,
short layer,
short region,
short iEta )
static

Definition at line 465 of file Geometry.cxx.

466{
467 if (Id::matchCalo(calo, EMB)) {
468 if (layer == 1 && region == 1) iEta += nEta(calo, layer, 0);
469 if (layer == 2 && region == 1) iEta += nEta(calo, layer, 0);
470 }
471 if (Id::matchCalo(calo, EMEC_OUTER)) {
472 if (layer == 1)
473 for (short r = 0; r < region; r++) iEta += nEta(calo, layer, r);
474 if (layer == 2 && region >= 1) iEta += 1;
475 }
476 if (Id::matchCalo(calo, HEC))
477 if (region == 1) iEta += 10;
478 return iEta;
479}
static bool matchCalo(CaloId id, CaloId idSpec)
Definition CaloId.cxx:188
int r
Definition globals.cxx:22
@ EMEC_OUTER
Definition CaloId.h:25

◆ etaMax()

double Geo::etaMax ( CaloId calo,
short layer,
short region = -1 )
static

Definition at line 397 of file Geometry.cxx.

398{
399 if (Id::sign(calo) < 0) return -etaMin(Id::mirror(calo), layer, region);
400
401 if (region < 0) {
402 if (calo == EMB) return etaMax(EMB_A, layer);
403 if (calo == EMEC_A) return etaMax(EMEC_INNER_A, layer);
404 region = nRegions(calo, layer) - 1;
405 }
406
407 if (calo == EMB_A) {
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;
412 }
413 if (layer == 3) return 1.35;
414 }
415 if (calo == EMEC_OUTER_A) {
416 if (layer == 0) return 1.8;
417 if (layer == 1) {
418 if (region == 0) return 1.435; // njpb
419 if (region == 1) return 1.51; // njpb
420 if (region == 2) return 1.81; // njpb
421 if (region == 3) return 2.01; // njpb
422 if (region == 4) return 2.41; // njpb
423 if (region == 5) return 2.51; // njpb
424 }
425 if (layer == 2) {
426 if (region == 0) return 1.435; // njpb
427 if (region == 1) return 2.51; // njpb
428 }
429 if (layer == 3) return 2.5;
430 }
431 if (calo == EMEC_INNER_A)
432 if (layer == 1 || layer == 2) return 3.21;
433 if (calo == HEC_A) {
434 if (region == 0) return 2.5;
435 if (region == 1) return 3.3;
436 }
437 if (calo == FCAL_A) return 4.9;
438 return -999;
439}
static double etaMax(CaloId calo, short layer, short region=-1)
Definition Geometry.cxx:397

◆ etaMin()

double Geo::etaMin ( CaloId calo,
short layer,
short region = -1 )
static

Definition at line 355 of file Geometry.cxx.

356{
357 if (Id::sign(calo) < 0) return -etaMax(Id::mirror(calo), layer, region);
358
359 if (region < 0) {
360 if (calo == EMB) return -etaMax(EMB_A, layer);
361 if (calo == EMEC_A) return etaMin(EMEC_OUTER_A, layer);
362 region = 0;
363 }
364
365 if (calo == EMB_A) {
366 if (layer == 1 && region == 0) return 0;
367 if (region == 1) return 1.40; // where applicable, i.e. layers 1,2
368 return 0;
369 }
370 if (calo == EMEC_OUTER_A) {
371 if (layer == 0) return 1.5;
372 if (layer == 1) {
373 if (region == 0) return 1.385; // njpb
374 if (region == 1) return 1.435; // njpb
375 if (region == 2) return 1.51; // njpb
376 if (region == 3) return 1.81; // njpb
377 if (region == 4) return 2.01; // njpb
378 if (region == 5) return 2.41; // njpb
379 }
380 if (layer == 2) {
381 if (region == 0) return 1.385; // njpb
382 if (region == 1) return 1.435; // njpb
383 }
384 if (layer == 3) return 1.5;
385 }
386 if (calo == EMEC_INNER_A)
387 if (layer == 1 || layer == 2) return 2.51;
388 if (calo == HEC_A) {
389 if (region == 0) return 1.5;
390 if (region == 1) return 2.5;
391 }
392 if (calo == FCAL_A) return 3.1;
393 return -999;
394}

◆ etaPhiHist()

TH2D * Geo::etaPhiHist ( CaloId calo,
short layer,
const TString & name,
const TString & title )
static

Definition at line 549 of file Geometry.cxx.

550{
551 TArrayD etaBinArray = etaBins(calo, layer);
552 short nPhiBins = nPhi(calo, layer);
553 double eps = 1E-6; // This is needed for changes in granularity: e.g. in the HEC, at larger eta the phi granularity is twice less => the center of
554 // the coarse phi bins fall on a histogram boundary, and floating-point uncertainties mean that some bins fall on one side and some on the other...
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");
559 return h;
560}
static double phiMin(CaloId calo, short layer, short region=-1)
Definition Geometry.cxx:450
static short nPhi(CaloId calo, short layer, short region=0)
Definition Geometry.cxx:228
constexpr std::size_t nPhiBins

◆ etaSize()

double Geo::etaSize ( CaloId calo,
short layer,
short region,
short iEta = -1 )
static

Definition at line 264 of file Geometry.cxx.

265{
266 if (Id::matchCalo(calo, EMB)) {
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;
271 // iEta == 0 strip is not there! (well, strip is there, but not connected...)
272/* if (layer == 1 && iEta >= 1 && iEta <= 447) return nominal;
273 if (layer == 1 && iEta >= 448) return 8*nominal;
274 if (layer == 2 && iEta >= 0 && iEta <= 56) return nominal;
275 if (layer == 2 && iEta == 57) return 3*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;
284 return 0;
285 }
286
287 if (Id::matchCalo(calo, EMEC_OUTER)) {
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;
292/* if (layer == 1 && iEta == 0) return 16*nominal;
293 if (layer == 1 && iEta >= 1 && iEta <= 3) return 8*nominal;
294 if (layer == 1 && iEta >= 4 && iEta <= 99) return nominal;
295 if (layer == 1 && iEta >= 100 && iEta <= 147) return 4/3.*nominal;
296 if (layer == 1 && iEta >= 148 && iEta <= 211) return 2*nominal;
297 if (layer == 1 && iEta >= 212 && iEta <= 215) return 8*nominal;
298 if (layer == 2 && iEta == 1) return 2*nominal;
299 if (layer == 2 && iEta >= 2 && iEta <= 44) 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;
310 return 0;
311 }
312
313 if (Id::matchCalo(calo, EMEC_INNER)) {
314 if (layer > 3) return 0;
315 double nominal = 0.1;
316 if (iEta == -1) return nominal;
317/* if (layer == 1 && iEta >= 216 && iEta <= 222) return 32*nominal;
318 if (layer == 2 && iEta >= 45 && iEta <= 51) return 4*nominal;*/
319 if (layer == 1) return nominal;
320 if (layer == 2) return nominal;
321 if (layer == 3) return nominal;
322 return 0;
323 }
324
325 if (Id::matchCalo(calo, HEC)) {
326 if (layer > 3) return 0;
327 if (region == 0) return 0.1;
328 if (region == 1) return 0.2;
329 return 0;
330 }
331
332 if (Id::matchCalo(calo, FCAL)) {
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;
337 return 0;
338 }
339
340 return 0;
341}
@ EMEC_INNER
Definition CaloId.h:25
@ layer
Definition HitInfo.h:79

◆ feedThroughName()

const char * Geo::feedThroughName ( PartitionId part,
short feedThrough )
static

Definition at line 622 of file Geometry.cxx.

623{
624// feedthrough experts names (based on baseplane numbers) vector
625// From ATL-AP-IN-0003, Numberings for the Barrel Feedthroughs
626
627// Feedthrough experts names indexed by feedthrough number (which starts at 0)
628
629 if (part == EMB_A_PARTITION) {
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",
639 };
640 if (feedThrough >= 0 && feedThrough < static_cast<int>(std::size(ftBarrelA))) {
641 return ftBarrelA[feedThrough];
642 }
643 }
644
645 if (part == EMB_C_PARTITION) {
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",
655 };
656 if (feedThrough >= 0 && feedThrough < static_cast<int>(std::size(ftBarrelC))) {
657 return ftBarrelC[feedThrough];
658 }
659 }
660
661 if (part == EMEC_A_PARTITION) {
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",
668 };
669 if (feedThrough >= 0 && feedThrough < static_cast<int>(std::size(ftEndcapA))) {
670 return ftEndcapA[feedThrough];
671 }
672 }
673
674 if (part == EMEC_C_PARTITION) {
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",
681 };
682 if (feedThrough >= 0 && feedThrough < static_cast<int>(std::size(ftEndcapC))) {
683 return ftEndcapC[feedThrough];
684 }
685 }
686 return "UNKNOWN";
687}
@ EMEC_A_PARTITION
Definition CaloId.h:30
@ EMB_A_PARTITION
Definition CaloId.h:30
@ EMB_C_PARTITION
Definition CaloId.h:30
@ EMEC_C_PARTITION
Definition CaloId.h:30

◆ firstEta()

short Geo::firstEta ( CaloId calo,
short layer,
short region = 0 )
static

Definition at line 146 of file Geometry.cxx.

147{
148 if (Id::matchCalo(calo, EMB) && layer == 1 && region == 0) return 1;
149 if (Id::matchCalo(calo, HEC) && layer == 2 && region == 0) return 1;
150 if (Id::matchCalo(calo, HEC) && layer == 3 && region == 0) return 1;
151 return 0;
152}

◆ firstLayer()

short Geo::firstLayer ( CaloId calo)
static

Definition at line 104 of file Geometry.cxx.

105{
106 if (Id::matchCalo(calo, EMB)) return 0;
107 if (Id::matchCalo(calo, EMEC)) return 0;
108 if (Id::matchCalo(calo, HEC)) return 0;
109 if (Id::matchCalo(calo, FCAL)) return 1;
110 return -1;
111}

◆ merge()

TArrayD Geo::merge ( const std::vector< TArrayD * > & arrays)
static

Definition at line 690 of file Geometry.cxx.

691{
692 std::vector<TArrayD*> nonEmptyArrays;
693 unsigned int n = 0;
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]);
698 }
699
700 TArrayD bins(n - nonEmptyArrays.size() + 1); // remove final bins, except the last one
701 int i = 0;
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];
706 return bins;
707}

◆ mirror()

TArrayD Geo::mirror ( const TArrayD & bins)
static

Definition at line 710 of file Geometry.cxx.

711{
712 int n = bins.GetSize();
713 TArrayD mirrorBins(n);
714 for (int k = 0; k < n; k++)
715 mirrorBins[k] = -bins[n - k - 1];
716 return mirrorBins;
717}

◆ nChannels() [1/3]

int Geo::nChannels ( CaloId calo)
static

Definition at line 613 of file Geometry.cxx.

614{
615 int n = 0;
616 for (unsigned short l = Geo::firstLayer(calo); l < Geo::firstLayer(calo) + Geo::nLayers(calo); l++)
617 n += Geo::nChannels(calo, l);
618 return n;
619}
static short firstLayer(CaloId calo)
Definition Geometry.cxx:104
static short nLayers(CaloId calo)
Definition Geometry.cxx:114
static int nChannels(CaloId calo, short layer, short region)
Definition Geometry.cxx:587
l
Printing final latex table to .tex output file.

◆ nChannels() [2/3]

int Geo::nChannels ( CaloId calo,
short layer )
static

Definition at line 597 of file Geometry.cxx.

598{
599 if (calo == EMB) return nChannels(EMB_A, layer) + nChannels(EMB_C, layer);
600 if (calo == EMEC_A) return nChannels(EMEC_OUTER_A, layer) + nChannels(EMEC_INNER_A, layer);
601 if (calo == EMEC_C) return nChannels(EMEC_OUTER_C, layer) + nChannels(EMEC_INNER_C, layer);
602 if (calo == EMEC) return nChannels(EMEC_A, layer) + nChannels(EMEC_C, layer);
603 if (calo == HEC) return nChannels(HEC_A, layer) + nChannels(HEC_C, layer);
604 if (calo == FCAL) return nChannels(FCAL_A, layer) + nChannels(FCAL_C, layer);
605
606 int n = 0;
607 for (unsigned short r = 0; r < Geo::nRegions(calo, layer); r++)
608 n += Geo::nChannels(calo, layer, r);
609 return n;
610}
@ EMEC_OUTER_C
Definition CaloId.h:22

◆ nChannels() [3/3]

int Geo::nChannels ( CaloId calo,
short layer,
short region )
static

Definition at line 587 of file Geometry.cxx.

588{
589 if (region >= Geo::nRegions(calo, layer)) return 0;
590 int n = Geo::nEta(calo, layer, region)*Geo::nPhi(calo, layer, region);
591 if (Id::matchCalo(calo, FCAL) && layer == 2) n -= 12; // account for non-phi-symmetric disconnected channels
592 if (Id::matchCalo(calo, FCAL) && layer == 3) n -= 2; // account for non-phi-symmetric disconnected channels
593 return n;
594}

◆ nEta() [1/2]

short Geo::nEta ( CaloId calo,
short layer )
static

Definition at line 155 of file Geometry.cxx.

156{
157 if (calo == EMB) return 2*nEta(EMB_A, layer);
158 if (calo == EMEC) return 2*nEta(EMEC_A, layer);
159 if (calo == EMEC_A || calo == EMEC_C) return nEta(EMEC_OUTER_A, layer) + nEta(EMEC_INNER_A, layer);
160 if (calo == HEC) return 2*nEta(HEC_A, layer);
161 if (calo == FCAL) return 2*nEta(FCAL_A, layer);
162
163 short total = 0;
164 for (short region = 0; region < nRegions(calo, layer); region++) total += nEta(calo, layer, region);
165 return total;
166}

◆ nEta() [2/2]

short Geo::nEta ( CaloId calo,
short layer,
short region,
short iPhi = 1 )
static

Definition at line 169 of file Geometry.cxx.

170{
171 if (region >= nRegions(calo, layer)) return 0;
172 if (Id::matchCalo(calo, EMB)) {
173 if (layer == 0) return 61;
174 if (layer == 1) {
175 if (region == 0) return 447; // should be 448, but first strip in each 1/2 barrel is missing
176 if (region == 1) return 3;
177 }
178 if (layer == 2) {
179 if (region == 0) return 56;
180 if (region == 1) return 1;
181 }
182 if (layer == 3) return 27;
183 return 0;
184 }
185 if (Id::matchCalo(calo, EMEC_OUTER)) {
186 if (layer == 0) return 12;
187 if (layer == 1) {
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;
194 }
195 if (layer == 2) {
196 if (region == 0) return 1;
197 if (region == 1) return 43;
198 }
199 if (layer == 3) return 20;
200 return 0;
201 }
202 if (Id::matchCalo(calo, EMEC_INNER)) {
203 if (layer == 0) return 0;
204 if (layer == 1) return 7;
205 if (layer == 2) return 7;
206 if (layer == 3) return 0;
207 return 0;
208 }
209 if (Id::matchCalo(calo, HEC)) {
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]; }
213 return 0;
214 }
215 if (Id::matchCalo(calo, FCAL)) {
216 if (layer > 3) return 0;
217 if (layer == 1) return 63;
218 if (layer == 2) {
219 short n[16] = { 30, 32, 32, 31, 31, 32, 32, 30, 30, 32, 32, 31, 31, 32, 32, 30 };
220 return n[iPhi];
221 }
222 if (layer == 3) return (iPhi == 5 || iPhi == 13 ? 15 : 16);
223 }
224 return 0;
225}
@ iPhi
Definition ParamDefs.h:47

◆ nFEBs() [1/2]

short Geo::nFEBs ( )
static

Definition at line 69 of file Geometry.cxx.

70{
71 short n = 0;
80 return n;
81}
static short nFEBs()
Definition Geometry.cxx:69
@ FCAL_C_PARTITION
Definition CaloId.h:31
@ HEC_C_PARTITION
Definition CaloId.h:31
@ FCAL_A_PARTITION
Definition CaloId.h:31
@ HEC_A_PARTITION
Definition CaloId.h:31

◆ nFEBs() [2/2]

short LArSamples::Geo::nFEBs ( PartitionId part)
inlinestatic

Definition at line 35 of file Geometry.h.

35{ return nFeedThroughs(part)*nSlots(part); }
static short nSlots(PartitionId part)
Definition Geometry.cxx:59
static short nFeedThroughs(PartitionId part)
Definition Geometry.cxx:49

◆ nFeedThroughs()

short Geo::nFeedThroughs ( PartitionId part)
static

Definition at line 49 of file Geometry.cxx.

50{
51 if (Id::summary(part) == EMB) return 32;
52 if (Id::summary(part) == EMEC) return 25;
53 if (Id::summary(part) == HEC) return 25;
54 if (Id::summary(part) == FCAL) return 25;
55 return 0;
56}
static CaloId summary(CaloId id)
Definition CaloId.cxx:74

◆ nLayers()

short Geo::nLayers ( CaloId calo)
static

Definition at line 114 of file Geometry.cxx.

115{
116 if (Id::matchCalo(calo, EMB)) return 4;
117 if (Id::matchCalo(calo, EMEC)) return 4;
118 if (Id::matchCalo(calo, HEC)) return 4;
119 if (Id::matchCalo(calo, FCAL)) return 3;
120 return -1;
121}

◆ nPartitionChannels()

short Geo::nPartitionChannels ( PartitionId part)
static

Definition at line 98 of file Geometry.cxx.

99{
100 return 128;
101}

◆ nPhi()

short Geo::nPhi ( CaloId calo,
short layer,
short region = 0 )
static

Definition at line 228 of file Geometry.cxx.

229{
230 if (Id::matchCalo(calo, EMB)) {
231 if (layer > 3) return 0;
232 if (region == 1) return (layer == 1 || layer == 2 ? 256 : 0); // barrel-end region
233 short n[4] = { 64, 64, 256, 256 };
234 return n[layer];
235 }
236 if (Id::matchCalo(calo, EMEC_OUTER)) {
237 if (layer > 3) return 0;
238 short n[4] = { 64, 64, 256, 256 };
239 return n[layer];
240 }
241 if (Id::matchCalo(calo, EMEC_INNER)) {
242 if (layer > 2 || layer == 0) return 0;
243 short n[3] = { 0, 64, 64 };
244 return n[layer];
245 }
246 if (Id::matchCalo(calo, EMEC)) return nPhi(EMEC_OUTER, layer);
247 if (Id::matchCalo(calo, PRECISION_EM)) return nPhi(EMB, layer);
248 if (Id::matchCalo(calo, EM)) return nPhi(EMB, layer);
249 if (Id::matchCalo(calo, HEC)) {
250 if (layer > 3) return 0;
251 if (region == 0) return 64;
252 if (region == 1) return 32;
253 return 0;
254 }
255 if (Id::matchCalo(calo, FCAL)) {
256 if (layer > 3) return 0;
257 short n[4] = { 0, 16, 16, 16 };
258 return n[layer];
259 }
260 return 0;
261}

◆ nPhiRings()

short Geo::nPhiRings ( )
static

Definition at line 84 of file Geometry.cxx.

85{
86 short n = 0;
88 for (unsigned int c = 0; c < 10; c++)
89 for (unsigned short l = Geo::firstLayer(cal[c]); l < Geo::firstLayer(cal[c]) + Geo::nLayers(cal[c]); l++)
90 for (unsigned short r = 0; r < Geo::nRegions(cal[c], l); r++) {
91 n += Geo::nEta(cal[c], l);
92 }
93
94 return n;
95}

◆ nRegions()

short Geo::nRegions ( CaloId calo,
short layer )
static

Definition at line 124 of file Geometry.cxx.

125{
126 if (Id::matchCalo(calo, EMB)) {
127 if (layer == 1) return 2;
128 if (layer == 2) return 2;
129 return 1;
130 }
131
132 if (Id::matchCalo(calo, EMEC_OUTER)) {
133 if (layer == 1) return 6;
134 if (layer == 2) return 2;
135 return 1;
136 }
137
138 if (Id::matchCalo(calo, EMEC_INNER)) return 1;
139 if (Id::matchCalo(calo, HEC)) return 2;
140 if (Id::matchCalo(calo, FCAL)) return 1;
141
142 return 0;
143}

◆ nSlots()

short Geo::nSlots ( PartitionId part)
static

Definition at line 59 of file Geometry.cxx.

60{
61 if (Id::summary(part) == EMB) return 14;
62 if (Id::summary(part) == EMEC) return 15;
63 if (Id::summary(part) == HEC) return 15;
64 if (Id::summary(part) == FCAL) return 15;
65 return 0;
66}

◆ partitionHist()

TH2D * Geo::partitionHist ( PartitionId part,
const TString & name,
const TString & title )
static

Definition at line 18 of file Geometry.cxx.

19{
20 TH2D* h = new TH2D(name, title, nFEBs(part), -0.5, nFEBs(part) - 0.5, nPartitionChannels(part), -0.5, nPartitionChannels(part) - 0.5);
21 setBinLabels(h, part);
22 return h;
23}
static bool setBinLabels(TH2 *hist, PartitionId part)
Definition Geometry.cxx:34
static short nPartitionChannels(PartitionId part)
Definition Geometry.cxx:98

◆ partitionProfileHist()

TProfile2D * Geo::partitionProfileHist ( PartitionId part,
const TString & name,
const TString & title )
static

Definition at line 26 of file Geometry.cxx.

27{
28 TProfile2D* h = new TProfile2D(name, title, nFEBs(part), -0.5, nFEBs(part) - 0.5, nPartitionChannels(part), -0.5, nPartitionChannels(part) - 0.5);
29 setBinLabels(h, part);
30 return h;
31}

◆ phi()

double Geo::phi ( CaloId calo,
short layer,
short region,
short iPhi )
static

Definition at line 457 of file Geometry.cxx.

458{
459 double pos = phiMin(calo, layer, region);
460 for (short i = 0; i < iPhi; i++) pos += phiSize(calo, layer, region, i);
461 return pos;
462}
static double phiSize(CaloId calo, short layer, short region, short iPhi=-1)
Definition Geometry.cxx:344

◆ phiCenter()

double Geo::phiCenter ( CaloId calo,
short layer,
short region,
short iPhi )
static

Definition at line 569 of file Geometry.cxx.

570{
571 return phi(calo, layer, region, iPhi) + phiSize(calo, layer, region, iPhi)/2;
572}
Scalar phi() const
phi method

◆ phiHigh()

double Geo::phiHigh ( CaloId calo,
short layer,
short region,
short iPhi )
static

Definition at line 581 of file Geometry.cxx.

582{
583 return phi(calo, layer, region, iPhi) + phiSize(calo, layer, region, iPhi);
584}

◆ phiMin()

double Geo::phiMin ( CaloId calo,
short layer,
short region = -1 )
static

Definition at line 450 of file Geometry.cxx.

451{
452 if (Id::matchCalo(calo, EMEC_OUTER) && layer == 2) return phiSize(calo, layer, region)/2;
453 return 0;
454}

◆ phiSize()

double Geo::phiSize ( CaloId calo,
short layer,
short region,
short iPhi = -1 )
static

Definition at line 344 of file Geometry.cxx.

345{
346 if (layer > 3) return 0;
347 if (Id::matchCalo(calo, FCAL) && layer == 0) return 0;
348 short nphi=nPhi(calo, layer);
349 double nominal = 0;
350 if (nphi!=0) nominal=TMath::TwoPi()/nphi;//nPhi(calo, layer);
351 return nominal;
352}

◆ remove()

TArrayD Geo::remove ( const TArrayD & bins,
int index )
static

Definition at line 719 of file Geometry.cxx.

720{
721 int n = bins.GetSize();
722 if (index < 0) index = n + index;
723 if (index >= n) return bins;
724
725 TArrayD newBins(n - 1);
726 int k = 0;
727 for (int kk = 0; kk < n; kk++) {
728 if (kk == index) continue;
729 newBins[k] = bins[kk];
730 k++;
731 }
732 return newBins;
733}
str index
Definition DeMoScan.py:362

◆ setBinLabels()

bool Geo::setBinLabels ( TH2 * hist,
PartitionId part )
static

Definition at line 34 of file Geometry.cxx.

35{
36 if (hist->GetXaxis()->GetNbins() != nFEBs(part)) return false;
37 for (short i = 0; i < nFeedThroughs(part); i++)
38 hist->GetXaxis()->SetBinLabel(1 + i*static_cast<int>(nSlots(part)), feedThroughName(part, i));
39
40 short nTicks = 16;
41 if (hist->GetYaxis()->GetNbins() != nPartitionChannels(part)) return false;
42 for (int i = 0; i < nTicks; i++)
43 hist->GetYaxis()->SetBinLabel(1 + nPartitionChannels(part)/nTicks*i, Form("%d", nPartitionChannels(part)/nTicks*i));
44
45 return true;
46}
static short nFEBs(PartitionId part)
Definition Geometry.h:35
static const char * feedThroughName(PartitionId part, short feedThrough)
Definition Geometry.cxx:622

The documentation for this class was generated from the following files: