#include "Detector.h" #include "TString.h" Int_t Detector::FullMask() { return kCal|kCalCrystal|kDch|kGfi|kLand|kMtof|kTof|kTracker; } const Char_t* Detector::AsString(Detector_t detector) { switch (detector) { case kUnknown: return "Unknown"; break; case kCal: return "Califa"; break; case kCalCrystal: return "CrystalBall"; break; case kDch: return "Dch"; break; case kGfi: return "Gfi"; break; case kLand: return "Land"; break; case kMtof: return "Mtof"; break; case kTof: return "Tof"; break; case kTracker: return "Tracker"; break; default: return "?Unknown?"; break; } } Detector::Detector_t Detector::CharToEnum(Char_t c) { switch(c) { case 'C': case '1': case 0x01: return kCal; case 'c': case '2': case 0x02: return kCalCrystal; case 'D': case 'd': case '4': case 0x04: return kDch; case 'G': case 'g': case '8': case 0x08: return kGfi; case 'L': case 'l': case 0x10: return kLand; case 'M': case 'm': case 0x12: return kMtof; case 't': case 0x14: return kTof; case 'T': case 0x16: return kTracker; default: return kUnknown; } } Char_t* Detector::MaskToString(Int_t mask) { // Return a mask of Detector as a string // // Result is a pointer to a statically allocated string. // User should copy this into their own buffer before calling // this method again. static Char_t newstring[255] = ""; Char_t* ptr = newstring; // start at the beginning *ptr = 0; // start with nothing Int_t fullmask = Detector::FullMask(); for (Int_t i=0; i<32; i++) { Detector::Detector_t adet = (Detector::Detector_t)(1<0 && maxChar