+//____________________________________________________________________
+void
+AliFMDInput::SetLoads(UInt_t mask)
+{
+ for (UInt_t i = 0; i < sizeof(mask); i++) {
+ if (!(mask & (1 << i))) continue;
+ const ETrees *ptype = fgkAllLoads;
+ do {
+ ETrees type = *ptype;
+ if (i != UInt_t(type)) continue;
+ AddLoad(type);
+ break;
+ } while (*ptype++ != kUser);
+ }
+}
+
+//____________________________________________________________________
+void
+AliFMDInput::SetLoads(const char* what)
+{
+ TString l(what);
+ TObjArray* ll = l.Tokenize(", ");
+ TIter next(ll);
+ TObject* os = 0;
+ while ((os = next())) {
+ ETrees type = ParseLoad(os->GetName());
+ AddLoad(type);
+ }
+}
+
+
+//____________________________________________________________________
+AliFMDInput::ETrees
+AliFMDInput::ParseLoad(const char* what)
+{
+ TString opt(what);
+ opt.ToLower();
+ const ETrees* ptype = fgkAllLoads;
+ do {
+ ETrees type = *ptype;
+ if (opt.Contains(TreeName(type,true), TString::kIgnoreCase))
+ return type;
+ } while (*ptype++ != kUser);
+ return kUser;
+}
+//____________________________________________________________________
+const char*
+AliFMDInput::LoadedString(Bool_t dataOnly) const
+{
+ static TString ret;
+ if (!ret.IsNull()) return ret.Data();
+
+ const ETrees* ptype = fgkAllLoads;
+ do {
+ ETrees type = *ptype;
+ if (dataOnly &&
+ (type == kKinematics ||
+ type == kHeader ||
+ type == kGeometry ||
+ type == kTrackRefs)) continue;
+ if (!IsLoaded(*ptype)) continue;
+
+ if (!ret.IsNull()) ret.Append(",");
+ ret.Append(TreeName(type));
+ } while (*ptype++ != kUser);
+ return ret.Data();
+}
+
+//____________________________________________________________________
+const char*
+AliFMDInput::TreeName(ETrees tree, Bool_t shortest)
+{
+ if (shortest) {
+ switch (tree) {
+ case kHits: return "hit";
+ case kKinematics: return "kin";
+ case kDigits: return "dig";
+ case kSDigits: return "sdig";
+ case kHeader: return "hea";
+ case kRecPoints: return "recp";
+ case kESD: return "esd";
+ case kRaw: return "raw";
+ case kGeometry: return "geo";
+ case kTrackRefs: return "trackr";
+ case kRawCalib: return "rawc";
+ case kUser: return "user";
+ }
+ return 0;
+ }
+ switch (tree) {
+ case kHits: return "Hits";
+ case kKinematics: return "Kinematics";
+ case kDigits: return "Digits";
+ case kSDigits: return "SDigits";
+ case kHeader: return "Header";
+ case kRecPoints: return "RecPoints";
+ case kESD: return "ESD";
+ case kRaw: return "Raw";
+ case kGeometry: return "Geometry";
+ case kTrackRefs: return "TrackRefs";
+ case kRawCalib: return "RawCalib";
+ case kUser: return "User";
+ }
+ return 0;
+}
+