HighLAND
Public Types | Static Public Member Functions | List of all members
SubDetId Class Reference

Public Types

enum  SubDetEnum {
  kFGD1 = 0, kFGD2, kTPC1, kTPC2,
  kTPC3, kP0D, kDSECAL, kTopTECAL,
  kBottomTECAL, kLeftTECAL, kRightTECAL, kTopPECAL,
  kBottomPECAL, kLeftPECAL, kRightPECAL, kTopSMRD,
  kBottomSMRD, kLeftSMRD, kRightSMRD, kInvalidSubdetector,
  kTPC, kFGD, kECAL, kTECAL,
  kPECAL, kSMRD, kTRACKER, kInvalid
}
 Enumeration of all detector systems and subdetectors.
 

Static Public Member Functions

static void SetDetectorUsed (unsigned long &BitField, SubDetId::SubDetEnum det)
 Method to set a certain subdetector or subdetector system to used used.
 
static bool GetDetectorUsed (unsigned long BitField, SubDetId::SubDetEnum det)
 Method to see if a certain subdetector or subdetector system is used.
 
static bool GetDetectorArrayUsed (unsigned long BitField, SubDetId::SubDetEnum dets[], int nDet)
 
static bool GetDetectorUsed (unsigned long BitField, SubDetId_h det)
 
static bool GetDetectorArrayUsed (unsigned long BitField, SubDetId_h dets[], int nDet)
 
static int GetTPC (unsigned long BitField)
 
static void SetDetectorSystemFields (unsigned long &BitField)
 
static int GetNSegmentsInDet (unsigned long BitFIeld, SubDetId::SubDetEnum det)
 
static bool TrackUsesOnlyDet (unsigned long BitFIeld, SubDetId::SubDetEnum det)
 Check whether a track only uses a specified subdetector or detector system.
 
static bool IsTPCDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a TPC or not.
 
static bool IsFGDDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a FGD or not.
 
static bool IsSMRDDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a SMRD or not.
 
static bool IsP0DDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a SMRDP0D or not.
 
static bool IsECALDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a ECAL or not.
 
static bool IsTECALDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a Tracker ECAL or not.
 
static bool IsPECALDetector (SubDetId::SubDetEnum det)
 Check if a detector enumeration refers to a P0D ECAL or not.
 
static bool HasTECALDetector (unsigned long BitField)
 Check if a detector bit field has a Tracker ECAL or not.
 
static bool HasPECALDetector (unsigned long BitField)
 Check if a detector bit field has a P0D ECAL or not.
 
static bool HasSMRDDetector (unsigned long BitField)
 Check if a detector bit field has a SMRD or not.
 
static SubDetId::SubDetEnum GetSubdetectorEnum (unsigned long BitField)
 Get the single subdetector that this track is from.
 

Detailed Description

Definition at line 6 of file SubDetId.hxx.

Member Function Documentation

§ GetNSegmentsInDet()

int SubDetId::GetNSegmentsInDet ( unsigned long  BitFIeld,
SubDetId::SubDetEnum  det 
)
static

Method to count the number of Segments a given track has in a detector system The DetMask bitfield masks are used to select the specified detector system

Definition at line 113 of file SubDetId.cxx.

113  {
114  return NumberOfSetBits(BitField & DetMask[det]);
115 }

§ GetTPC()

int SubDetId::GetTPC ( unsigned long  BitField)
static

Returns the TPC number (TPC1 = 1, TPC2 = 2 etc.) of the track Does not check whether track passed through more than one TPC, just returns the first TPC it finds (checking TPC2, TPC3 then TPC1)

Definition at line 74 of file SubDetId.cxx.

74  {
75  if (BitField & DetMask[SubDetId::kTPC2]) return 2;
76  else if (BitField & DetMask[SubDetId::kTPC3]) return 3;
77  else if (BitField & DetMask[SubDetId::kTPC1]) return 1;
78  else return -1;
79 }

§ SetDetectorSystemFields()

void SubDetId::SetDetectorSystemFields ( unsigned long &  BitField)
static

Method to set the detector system bits using the individual subdetector bits. e.g. If SetDetectorUsed(BitField, SubDetId::kTPC1) had been called, this function would call SetDetectorUsed(BitField, SubDetId::kTPC)

Definition at line 81 of file SubDetId.cxx.

81  {
82  for(int i = SubDetId::kFGD1; i < SubDetId::kInvalidSubdetector; ++i){ //loop through sub-detectors list
83  if (GetDetectorUsed(BitField, static_cast<SubDetId::SubDetEnum>(i))){
84  // FGD
85  if (i == SubDetId::kFGD1 || i == SubDetId::kFGD2)
86  SetDetectorUsed(BitField, SubDetId::kFGD);
87  // TPC
88  else if (i == SubDetId::kTPC1 || i == SubDetId::kTPC2 || i == SubDetId::kTPC3)
89  SetDetectorUsed(BitField, SubDetId::kTPC);
90  // P0D (for consistency)
91  else if (i == SubDetId::kP0D) continue;
92  //ECal
93  else if (i >= SubDetId::kDSECAL && i <= SubDetId::kRightPECAL){
94  SetDetectorUsed(BitField, SubDetId::kECAL);
95  //TECal
96  if (i >= SubDetId::kTopTECAL && i <= SubDetId::kRightTECAL) SetDetectorUsed(BitField, SubDetId::kTECAL);
97  //PECal
98  else if(i >= SubDetId::kTopPECAL && i <= SubDetId::kRightPECAL) SetDetectorUsed(BitField, SubDetId::kPECAL);
99  }
100  //SMRD
101  else if (i >= SubDetId::kTopSMRD && i <= SubDetId::kRightSMRD) SetDetectorUsed(BitField, SubDetId::kSMRD);
102  }
103  }
104 }
static bool GetDetectorUsed(unsigned long BitField, SubDetId::SubDetEnum det)
Method to see if a certain subdetector or subdetector system is used.
Definition: SubDetId.cxx:40
static void SetDetectorUsed(unsigned long &BitField, SubDetId::SubDetEnum det)
Method to set a certain subdetector or subdetector system to used used.
Definition: SubDetId.cxx:36

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