1 //-------------------------------------------------------------------------
2 // OADB container for filling scheme information (BX ids, name ...)
3 // Author: Michele Floris, CERN
4 //-------------------------------------------------------------------------
6 #include "AliOADBFillingScheme.h"
15 ClassImp(AliOADBFillingScheme)
18 AliOADBFillingScheme::AliOADBFillingScheme() : TNamed("AliOADBFillingScheme", "OADB object storing filling scheme infos"), fFSName(""), fBXIds(0){
23 AliOADBFillingScheme::AliOADBFillingScheme(char* name) : TNamed(name, "OADB object storing filling scheme infos"), fFSName(""), fBXIds(0){
28 void AliOADBFillingScheme::Init() {
29 // initialize pointers
35 AliOADBFillingScheme::~AliOADBFillingScheme(){
38 if(fBXIds) delete fBXIds;
42 // AliOADBFillingScheme::AliOADBFillingScheme(const AliOADBFillingScheme& cont) {
44 // AliError("To be implemented");
47 // AliOADBFillingScheme& AliOADBFillingScheme::operator=(const AliOADBFillingScheme& cont) {
48 // //Assignment operator
49 // AliError("To be implemented");
54 const char * AliOADBFillingScheme::GetBXIDs(const char * beamSide) const
56 // Returns the bunch crossing numbers for the different beam classes. By default this is empty
58 if (!strcmp(beamSide, "AC")) {
60 TString &bxa = ((TObjString*)fBXIds->GetValue("A"))->String();
61 TString &bxc = ((TObjString*)fBXIds->GetValue("C"))->String();
62 if(bxa.IsNull() && bxc.IsNull()) return "";
63 if(bxc.IsNull()) return bxa.Data();
64 if(bxa.IsNull()) return bxc.Data();
65 static TString bxBoth = bxa.Data();
71 TString &bx = ((TObjString*)fBXIds->GetValue(beamSide))->String();
72 if(bx.IsNull()) return "";
77 void AliOADBFillingScheme::Browse(TBrowser *b)
79 // Browse this object.
80 // If b=0, there is no Browse call TObject::Browse(0) instead.
81 // This means TObject::Inspect() will be invoked indirectly
85 // Creates a folder for each beam type containing the list of corresponding bx ids
86 b->Add(new TObjString(Form("Filling Scheme %s",GetFillingSchemeName())));
87 TIterator * mapIter = fBXIds->MakeIterator();
89 while ((key = (TObjString*) mapIter->Next())) {
90 TFolder * folder = new TFolder(key->String().Data(), "beam side");
91 TObjString * value = (TObjString*) fBXIds->GetValue(key);
92 TObjArray * tokens = value->String().Tokenize(" ");
93 TIterator * tokIter = tokens->MakeIterator();
94 TObjString * bxNum = 0;
95 while ((bxNum = (TObjString*) tokIter->Next())){
107 void AliOADBFillingScheme::Print(Option_t* option) const {
108 // Print Class contents
109 // Option is passed to TMap::Print
110 cout << "Filling scheme Name " << fFSName.Data() << option << endl;
111 fBXIds->Print(option);