//////////////////////////////////////////////////////////////////////////// // Detector // // Detector defines Detector_t which is an enumeration of the // legal detector configurations // //////////////////////////////////////////////////////////////////////////// // try the input file #include "db_detector_def.h" // or the default one ... #ifndef DETECTOR_H #define DETECTOR_H #ifndef ROOT_Rtypes #if !defined(__CINT__) || defined(__MAKECINT__) #include "Rtypes.h" #endif #endif #include "TString.h" class Detector { public: typedef enum EDetector { kUnknown = 0x00, kCal = 0x01, kCalCrystal = 0x02, kDch = 0x04, kGfi = 0x08, kLand = 0x10, kMtof = 0x12, kTof = 0x14, kTracker = 0x16, } Detector_t; static Int_t FullMask() { return kCal|kCalCrystal|kDch|kGfi|kLand|kMtof|kTof|kTracker; } // Translation enum to/from character strings static const Char_t* 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; } } static Detector::Detector_t 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; } } static Char_t* 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