HighLAND
Functions
ND::GeomId::TPC Namespace Reference

Define the TPC specific identifiers. More...

Functions

bool IsTPC (TGeometryId id)
 Check to see if the id is for a TPC.
 
TGeometryId Module (int mod)
 
int GetModule (TGeometryId id)
 
TGeometryId TPC1 ()
 The geometry identifier for TPC1.
 
TGeometryId TPC2 ()
 The geometry identifier for TPC2.
 
TGeometryId TPC3 ()
 The geometry identifier for TPC3.
 
TGeometryId MicroMega (int tpc, int half, int mm)
 
bool IsMicroMega (TGeometryId id)
 Check if a TGeometryId is a MicroMega. More...
 
TGeometryId Pad (int tpc, int half, int mm, int pad)
 
bool IsPad (TGeometryId id)
 Check if a TGeometryId is a PAD. More...
 
bool IsTPC1 (TGeometryId id)
 Check to see if the id is for a TPCn.
 
bool IsTPC2 (TGeometryId id)
 
bool IsTPC3 (TGeometryId id)
 
int GetMicroMegaTPC (TGeometryId id)
 
int GetMicroMegaHalf (TGeometryId id)
 
int GetMicroMegaNumber (TGeometryId id)
 
int GetPadTPC (TGeometryId id)
 
int GetPadHalf (TGeometryId id)
 
int GetPadMicroMega (TGeometryId id)
 
int GetPadNumber (TGeometryId id)
 

Detailed Description

Define the TPC specific identifiers.

Function Documentation

§ GetMicroMegaTPC()

int ND::GeomId::TPC::GetMicroMegaTPC ( TGeometryId  id)

Get the micromega TPC, half, or number. This returns -1 if the id is invalid.

Definition at line 481 of file ND280GeomId.cxx.

481  {
482  return ND::GeomId::TPC::GetPadTPC(i);
483 }
int GetPadTPC(TGeometryId id)

§ GetModule()

int ND::GeomId::TPC::GetModule ( TGeometryId  id)

Get the TPC module number (0 to 2). This returns -1 if the id is invalid.

Definition at line 355 of file ND280GeomId.cxx.

355  {
356  TSettableGeometryId id(i);
357  if (ND::GeomId::Def::kTPC
358  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
361  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
362  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
363  if (ND::GeomId::Def::TPC::Global::kTPC
364  != id.GetField(ND::GeomId::Def::TPC::Global::kSeqIdMSB,
365  ND::GeomId::Def::TPC::Global::kSeqIdLSB)) return -1;
366  return id.GetField(ND::GeomId::Def::TPC::Global::kFieldMSB,
367  ND::GeomId::Def::TPC::Global::kFieldLSB);
368 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB

§ GetPadTPC()

int ND::GeomId::TPC::GetPadTPC ( TGeometryId  id)

Get the pad TPC, half, micro-mega or number. This returns -1 if the id is invalid.

Definition at line 485 of file ND280GeomId.cxx.

485  {
486  TSettableGeometryId id(i);
487  if (ND::GeomId::Def::kTPC
488  != id.GetField(ND::GeomId::Def::kDetectorIdMSB,
491  != id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
492  ND::GeomId::Def::TPC::kSeqIdLSB)) return -1;
493  return id.GetField(ND::GeomId::Def::TPC::Pad::kTPCMSB,
494  ND::GeomId::Def::TPC::Pad::kTPCLSB);
495 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB
const GeomIdBit kTPCMSB
The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3.

§ IsMicroMega()

bool ND::GeomId::TPC::IsMicroMega ( ND::TGeometryId  i)

Check if a TGeometryId is a MicroMega.

This may be a pad.

Definition at line 424 of file ND280GeomId.cxx.

424  {
425  TSettableGeometryId id(i);
426  int detector = id.GetField(ND::GeomId::Def::kDetectorIdMSB,
428  if (detector != ND::GeomId::Def::kTPC) return false;
429  /// This may be a pad.
430  int seqId = id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
431  ND::GeomId::Def::TPC::kSeqIdLSB);
432  if (seqId != ND::GeomId::Def::TPC::kPad) return false;
433  int padFlag = id.GetField(ND::GeomId::Def::TPC::Pad::kPadFlagMSB,
434  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
435  if (padFlag) return false;
436  return true;
437 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB

§ IsPad()

bool ND::GeomId::TPC::IsPad ( ND::TGeometryId  i)

Check if a TGeometryId is a PAD.

This may be a pad.

Definition at line 543 of file ND280GeomId.cxx.

543  {
544  TSettableGeometryId id(i);
545  int detector = id.GetField(ND::GeomId::Def::kDetectorIdMSB,
547  if (detector != ND::GeomId::Def::kTPC) return false;
548  /// This may be a pad.
549  int seqId = id.GetField(ND::GeomId::Def::TPC::kSeqIdMSB,
550  ND::GeomId::Def::TPC::kSeqIdLSB);
551  if (seqId != ND::GeomId::Def::TPC::kPad) return false;
552  int padFlag = id.GetField(ND::GeomId::Def::TPC::Pad::kPadFlagMSB,
553  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
554  if (!padFlag) return false;
555  return true;
556 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB

§ MicroMega()

ND::TGeometryId ND::GeomId::TPC::MicroMega ( int  tpc,
int  half,
int  mm 
)

The geometry identifier for the micromegas. The TPCs are numbered 0 to 2 from upstream to downstream. The half is 0 for -x, and 1 for +x. The micromegas run from 0 to 15;

Definition at line 386 of file ND280GeomId.cxx.

386  {
387  TSettableGeometryId id;
388  if (tpc<0 || tpc>2) {
389  ND280Warn("TPC module out of range [0,2]: " << tpc);
390  return id;
391  }
392  if (half<0 || half>1) {
393  ND280Warn("TPC half out of range [0,1]: " << half);
394  return id;
395  }
396  if (mm<0 || mm>11) {
397  ND280Warn("TPC micromega out of range [0,11]: " << mm);
398  return id;
399  }
400  id.SetField(ND::GeomId::Def::kTPC,
403  id.SetField(ND::GeomId::Def::TPC::kPad,
405  ND::GeomId::Def::TPC::kSeqIdLSB);
406  id.SetField(tpc,
408  ND::GeomId::Def::TPC::Pad::kTPCLSB);
409  id.SetField(half,
411  ND::GeomId::Def::TPC::Pad::kHalfLSB);
412  id.SetField(mm,
414  ND::GeomId::Def::TPC::Pad::kMMegaLSB);
415  id.SetField(0,
417  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
418  id.SetField(0,
420  ND::GeomId::Def::TPC::Pad::kPadLSB);
421  return id;
422 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kHalfMSB
The half of the drift volume.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB
const GeomIdBit kTPCMSB
The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3.

§ Module()

ND::TGeometryId ND::GeomId::TPC::Module ( int  mod)

The geometry identifier for the TPC modules. This count starts from zero and runs from upstream to downstream.

Definition at line 334 of file ND280GeomId.cxx.

334  {
335  TSettableGeometryId id;
336  if (tpc<0 || tpc>2) {
337  ND280Warn("TPC module out of range [0,2]: " << tpc);
338  return id;
339  }
340  id.SetField(ND::GeomId::Def::kTPC,
343  id.SetField(ND::GeomId::Def::TPC::kGlobal,
345  ND::GeomId::Def::TPC::kSeqIdLSB);
346  id.SetField(ND::GeomId::Def::TPC::Global::kTPC,
347  ND::GeomId::Def::TPC::Global::kSeqIdMSB,
348  ND::GeomId::Def::TPC::Global::kSeqIdLSB);
349  id.SetField(tpc,
350  ND::GeomId::Def::TPC::Global::kFieldMSB,
351  ND::GeomId::Def::TPC::Global::kFieldLSB);
352  return id;
353 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB

§ Pad()

ND::TGeometryId ND::GeomId::TPC::Pad ( int  tpc,
int  half,
int  mm,
int  pad 
)

The geometry identifier for the micromega pads. The TPCs are numbered 0 to 2 from upstream to downstream. The half is 0 for -x, and 1 for +x. The micromegas run from 0 to 15; The pad runs from 0 to 1727.

Definition at line 439 of file ND280GeomId.cxx.

439  {
440  TSettableGeometryId id;
441  if (tpc<0 || tpc>2) {
442  ND280Warn("TPC module out of range [0,2]: " << tpc);
443  return id;
444  }
445  if (half<0 || half>1) {
446  ND280Warn("TPC half out of range [0,1]: " << half);
447  return id;
448  }
449  if (mm<0 || mm>11) {
450  ND280Warn("TPC micromega out of range [0,11]: " << mm);
451  return id;
452  }
453  if (pad<0 || pad>1727) {
454  ND280Warn("TPC pad out of range [0,1727]: " << pad);
455  return id;
456  }
457  id.SetField(ND::GeomId::Def::kTPC,
460  id.SetField(ND::GeomId::Def::TPC::kPad,
462  ND::GeomId::Def::TPC::kSeqIdLSB);
463  id.SetField(tpc,
465  ND::GeomId::Def::TPC::Pad::kTPCLSB);
466  id.SetField(half,
468  ND::GeomId::Def::TPC::Pad::kHalfLSB);
469  id.SetField(mm,
471  ND::GeomId::Def::TPC::Pad::kMMegaLSB);
472  id.SetField(1,
474  ND::GeomId::Def::TPC::Pad::kPadFlagLSB);
475  id.SetField(pad,
477  ND::GeomId::Def::TPC::Pad::kPadLSB);
478  return id;
479 }
const GeomIdBit kDetectorIdLSB
The least significant bit of the detector identifier.
const GeomIdBit kHalfMSB
The half of the drift volume.
const GeomIdBit kDetectorIdMSB
const GeomIdBit kSeqIdMSB
const GeomIdBit kTPCMSB
The TPC withing the tracker. 0) TPC1 1) TPC2 2) TPC3.