+ else if (calver == 2) {
+
+ // DCSv2 object
+ const AliTRDCalDCSv2 *calDCSv2 = dynamic_cast<const AliTRDCalDCSv2 *>(dcsArr->At(esor));
+ if(!calDCSv2){
+ version = "";
+ return;
+ }
+ version = calDCSv2->GetGlobalConfigVersion();
+
+ }
+ else {
+
+ AliError("NO DCS/DCSv2 OCDB entry found!");
+
+ }
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDcalibDB::GetNumberOfParsDCS(TString cname)
+{
+ // Get the number of configuration parameters from the DCS config
+
+ TString cdelim = "_";
+ TObjArray *carr = cname.Tokenize(cdelim);
+ return carr->GetEntries() - 1; // -1 for the "cf"
+
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDcalibDB::GetNumberOfOptsDCS(TString cname, Int_t cfgType)
+{
+ // Get the number of options of a given configuration parameter from DCS
+
+ TString cdelim = "_";
+ TString odelim = "-";
+
+ TObjArray *carr = cname.Tokenize(cdelim);
+ Int_t nconfig = carr->GetEntries();
+
+ // protect
+ if ((nconfig == 0) || ((nconfig-1) < cfgType)) {
+ AliError("Not enough parameters in DCS configuration name!");
+ return 0;
+ }
+
+ TString fullcfg = ((TObjString*)carr->At(cfgType))->GetString();
+ TObjArray *oarr = fullcfg.Tokenize(odelim);
+ return oarr->GetEntries() -1; // -1 for the parameter name
+
+}
+
+//_____________________________________________________________________________
+void AliTRDcalibDB::GetDCSConfigParOption(TString cname, Int_t cfgType, Int_t option, TString &cfgo)
+{
+ //
+ // Get a configuration (see enum in header file) or the options of a configuration
+ // option == 0 returns the configuration itself
+ // option > 0 returns the optional parameter Nr. (option) of the configuration (cfgType)
+ //
+
+ // define the delimiters
+ TString cdelim = "_";
+ TString odelim = "-";
+
+ TObjArray *carr = cname.Tokenize(cdelim);
+ Int_t nconfig = carr->GetEntries();
+
+ // protect
+ if (nconfig == 0) {
+ AliError("DCS configuration name empty!");
+ cfgo = "";
+ return;
+ } else if ((nconfig-1) < cfgType) {
+ AliError("Not enough parameters in DCS configuration name!");
+ cfgo = "";
+ return;
+ }
+
+ TString fullcfg = ((TObjString*)carr->At(cfgType))->GetString();
+ TObjArray *oarr = fullcfg.Tokenize(odelim);
+ Int_t noptions = oarr->GetEntries();
+
+ // protect
+ if ((noptions-1) < option) {
+ AliError("Not enough options in DCS configuration name!");
+ cfgo = "";
+ return;
+ }
+
+ cfgo = ((TObjString*)oarr->At(option))->GetString();
+ return;
+