#include <TObjArray.h>\r
#include "AliTRDSaxHandler.h"\r
#include "AliTRDgeometry.h"\r
+#include "AliTRDcalibDB.h"\r
#include "Cal/AliTRDCalDCSv2.h"\r
#include "Cal/AliTRDCalDCSFEEv2.h"\r
#include "Cal/AliTRDCalDCSGTU.h"\r
AliTRDCalDCSv2* AliTRDSaxHandler::GetCalDCSObj()\r
{\r
// put the arrays in the global calibration object and return this\r
+\r
fCalDCSObj->SetFEEArr(fFEEArr);\r
fCalDCSObj->SetPTRArr(fPTRArr);\r
fCalDCSObj->SetGTUObj(fDCSGTUObj);\r
return fCalDCSObj;\r
}\r
\r
+//_____________________________________________________________________________\r
+void AliTRDSaxHandler::ParseConfigName(TString cfgname) const\r
+{\r
+ // Evaluate the config name and set the individual parameters\r
+\r
+ // protect\r
+ if (!AliTRDcalibDB::Instance()) {\r
+ AliError("Could not create an instance of AliTRDcalibDB!");\r
+ return;\r
+ }\r
+\r
+ TString cfg = "", par = "", pars = "";\r
+ Int_t nPar = AliTRDcalibDB::Instance()->GetNumberOfParsDCS(cfgname);\r
+ if (nPar == 0) return;\r
+\r
+ for (Int_t i=1; i<=nPar; i++) {\r
+ // Get the configuration parameter\r
+ AliTRDcalibDB::Instance()->GetDCSConfigParOption(cfgname, i, 0, cfg);\r
+\r
+ // Set Parameters accordingly\r
+ if (i == AliTRDcalibDB::kFltrSet) fDCSFEEObj->SetFilterType(cfg);\r
+ if (i == AliTRDcalibDB::kTrigSet) fDCSFEEObj->SetTriggerSetup(cfg);\r
+ if (i == AliTRDcalibDB::kAddOpti) fDCSFEEObj->SetAddOptions(cfg);\r
+ if (i == AliTRDcalibDB::kTimebin) fDCSFEEObj->SetNumberOfTimeBins(AliTRDcalibDB::Instance()->ExtractTimeBinsFromString(cfg));\r
+ if (i == AliTRDcalibDB::kReadout) fDCSFEEObj->SetReadoutParam(cfg);\r
+ if (i == AliTRDcalibDB::kTrkMode) fDCSFEEObj->SetTrackletMode(cfg);\r
+\r
+ // Set options of parameters accordingly\r
+ Int_t nOpt = AliTRDcalibDB::Instance()->GetNumberOfOptsDCS(cfgname, i);\r
+ if (nOpt == 0) continue;\r
+\r
+ for (Int_t j=1; j<=nOpt; j++) {\r
+ // Get the parameter option\r
+ AliTRDcalibDB::Instance()->GetDCSConfigParOption(cfgname, i, j, par);\r
+\r
+ if (i == AliTRDcalibDB::kReadout) {\r
+ if (par.EqualTo("stat")) fDCSFEEObj->SetFastStatNoise(1);\r
+ }\r
+ if (i == AliTRDcalibDB::kTrkMode) {\r
+ if ((j > 1) && (par.Length() != 0)) pars += "-";\r
+ pars += par;\r
+ }\r
+ // SetTCFilterWeight, SetTCFilterShortDecPar, SetTCFilterLongDecPar might be filled here, too\r
+ // SetSingleHitThres, SetThreePadClustThres, SetSelectiveNoZS, SetTestPattern might be filled here, too\r
+ }\r
+\r
+ fDCSFEEObj->SetTrackletDef(pars);\r
+ }\r
+}\r
+\r
//_____________________________________________________________________________\r
void AliTRDSaxHandler::OnStartDocument() const\r
{\r
// store informations of the FEE DCS-Board\r
if (fSystem == kInsideFEE) {\r
if (CompareString(tagName, "DNR")) fDCSFEEObj->SetStatusBit(fContent.Atoi());\r
- if (CompareString(tagName, "CFGNME")) fDCSFEEObj->SetConfigName(fContent);\r
if (CompareString(tagName, "CFGTAG")) fDCSFEEObj->SetConfigTag(fContent.Atoi());\r
if (CompareString(tagName, "CFGVRSN")) fDCSFEEObj->SetConfigVersion(fContent);\r
- if (CompareString(tagName, "NTB")) fDCSFEEObj->SetNumberOfTimeBins(fContent.Atoi());\r
if (CompareString(tagName, "SM-ID")) fDCSFEEObj->SetSM(fContent.Atoi());\r
if (CompareString(tagName, "STACK-ID")) fDCSFEEObj->SetStack(fContent.Atoi());\r
if (CompareString(tagName, "LAYER-ID")) fDCSFEEObj->SetLayer(fContent.Atoi());\r
- if (CompareString(tagName, "SINGLEHITTHRES")) fDCSFEEObj->SetSingleHitThres(fContent.Atoi());\r
- if (CompareString(tagName, "THRPADCLSTHRS")) fDCSFEEObj->SetThreePadClustThres(fContent.Atoi());\r
- if (CompareString(tagName, "SELNOZS")) fDCSFEEObj->SetSelectiveNoZS(fContent.Atoi());\r
- if (CompareString(tagName, "FASTSTATNOISE")) fDCSFEEObj->SetFastStatNoise(fContent.Atoi());\r
- if (CompareString(tagName, "FILTWEIGHT")) fDCSFEEObj->SetTCFilterWeight(fContent.Atoi());\r
- if (CompareString(tagName, "FILTSHRTDCYPRM")) fDCSFEEObj->SetTCFilterShortDecPar(fContent.Atoi());\r
- if (CompareString(tagName, "FILTLNGDCYPRM")) fDCSFEEObj->SetTCFilterLongDecPar(fContent.Atoi());\r
- if (CompareString(tagName, "FLTR")) fDCSFEEObj->SetFilterType(fContent);\r
- if (CompareString(tagName, "READOUTPAR")) fDCSFEEObj->SetReadoutParam(fContent);\r
- if (CompareString(tagName, "TESTPATTERN")) fDCSFEEObj->SetTestPattern(fContent);\r
- if (CompareString(tagName, "TRCKLTMODE")) fDCSFEEObj->SetTrackletMode(fContent);\r
- if (CompareString(tagName, "TRCKLTDEF")) fDCSFEEObj->SetTrackletDef(fContent);\r
- if (CompareString(tagName, "TRIGGERSETUP")) fDCSFEEObj->SetTriggerSetup(fContent);\r
- if (CompareString(tagName, "ADDOPTIONS")) fDCSFEEObj->SetAddOptions(fContent);\r
+ if (CompareString(tagName, "CFGNME")) {\r
+ fDCSFEEObj->SetConfigName(fContent);\r
+ ParseConfigName(fContent);\r
+ }\r
if (CompareString(tagName, "gaintbl")) {\r
fLevel1Tag = kInsideNone;\r
fCurrentROB = -1;\r
////////////////////////////////////////////////////////////////////////////
-#include "TObject.h"
+#include <TObject.h>
#include "Cal/AliTRDCalDCSGTUCtpOpc.h"
#include "Cal/AliTRDCalDCSGTUBoardInfo.h"
#include "Cal/AliTRDCalDCSGTUSegment.h"
TObjArray* GetDCSFEEDataArray() const { return fFEEArr; }
TObjArray* GetDCSPTRDataArray() const { return fPTRArr; }
AliTRDCalDCSv2* GetCalDCSObj(); // to be called by the preprocessor
+ void ParseConfigName(TString cfgname) const;
+
Int_t GetHandlerStatus() const { return fHandlerStatus; }
}
//_____________________________________________________________________________
-Int_t AliTRDcalibDB::GetNumberOfTimeBinsDCS()
+Int_t AliTRDcalibDB::ExtractTimeBinsFromString(TString tbstr)
{
- //
- // Returns number of time bins from the DCS
- //
-
// default value - has not been set
Int_t nUndef = -1;
- // Get the corresponding parameter
- TString tbstr = "";
- GetDCSConfigParOption(kTimebin, 0, tbstr);
-
// Check if there is any content in the string first
if (tbstr.Length() == 0) {
AliError("Parameter for number of timebins is empty!");
return nUndef;
}
- Int_t ntb = tbstr.Atoi();
- AliInfo(Form("Number of timebins from CDB: %d", ntb));
+ return tbstr.Atoi();
- return ntb;
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDcalibDB::GetNumberOfTimeBinsDCS()
+{
+ //
+ // Returns number of time bins from the DCS
+ //
+
+ // Get the corresponding parameter
+ TString cfgstr = "", cfgname = "";
+ GetGlobalConfiguration(cfgname);
+ GetDCSConfigParOption(cfgname, kTimebin, 0, cfgstr);
+
+ return ExtractTimeBinsFromString(cfgstr);
}
// Returns the filter type
//
- GetDCSConfigParOption(kFltrSet, 0, filterType);
+ TString cfgname = "";
+ GetGlobalConfiguration(cfgname);
+ GetDCSConfigParOption(cfgname, kFltrSet, 0, filterType);
}
}
//_____________________________________________________________________________
-void AliTRDcalibDB::GetDCSConfigParOption(Int_t cfgType, Int_t option, TString &cfgo)
+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
TString cdelim = "_";
TString odelim = "-";
- // get the full configuration name
- TString cname;
- GetGlobalConfiguration(cname);
TObjArray *carr = cname.Tokenize(cdelim);
Int_t nconfig = carr->GetEntries();
// protect
if (nconfig == 0) {
- AliError("Bad DCS configuration name!");
+ AliError("DCS configuration name empty!");
cfgo = "";
return;
} else if ((nconfig-1) < cfgType) {
- AliError("Not enough DCS configuration parameters!");
+ 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();
- if (fullcfg.Contains(odelim)) {
-
- TObjArray *oarr = fullcfg.Tokenize(odelim);
- Int_t noptions = oarr->GetEntries();
-
- // protect
- if ((noptions-1) < option) {
- AliError("Not enough DCS configuration options defined!");
- cfgo = "";
- return;
- }
-
- cfgo = ((TObjString*)oarr->At(option))->GetString();
+ // protect
+ if ((noptions-1) < option) {
+ AliError("Not enough options in DCS configuration name!");
+ cfgo = "";
return;
-
}
- else {
- if (option != 0) {
- AliError("Not enough DCS configuration options defined!");
- cfgo = "";
- return;
- }
- cfgo = fullcfg;
- return;
-
- }
+ cfgo = ((TObjString*)oarr->At(option))->GetString();
+ return;
}
Float_t GetPRFlo() const { return fPRFlo; };
Float_t GetPRFhi() const { return fPRFhi; };
+ Int_t ExtractTimeBinsFromString(TString tbstr);
Int_t GetNumberOfTimeBinsDCS();
void GetFilterType(TString &filterType);
void GetGlobalConfiguration(TString &config);
void GetGlobalConfigurationVersion(TString &version);
- void GetDCSConfigParOption(Int_t cfgType, Int_t option, TString &cfgo);
+ Int_t GetNumberOfParsDCS(TString cname);
+ Int_t GetNumberOfOptsDCS(TString cname, Int_t cfgType);
+ void GetDCSConfigParOption(TString cname, Int_t cfgType, Int_t option, TString &cfgo);
Int_t GetOnlineGainTableID();
return;\r
}\r
\r
+ Bool_t hasSOR = (objArrayCDB->At(0));\r
+ Bool_t hasEOR = (objArrayCDB->At(1));\r
+ printf("SOR entry: %d, EOR entry: %d\n", hasSOR, hasEOR);\r
+\r
if (!strcmp(objArrayCDB->At(iesor)->ClassName(),"AliTRDCalDCS")) calVer = 1;\r
else if (!strcmp(objArrayCDB->At(iesor)->ClassName(),"AliTRDCalDCSv2")) calVer = 2;\r
else { \r
if (gsz != -1) cout<<"Global selective ZS (every i'th event).............: "<< gsz << endl;\r
if (gfw != -1) cout<<"Global tail cancellation filter weight.............: "<< gfs << endl;\r
if (gfs != -1) cout<<"Global tail cancellat. filter short decay parameter: "<< gfs << endl;\r
- if (gfl != -1) cout<<"Global tail cancellation filt. long decay parameter: "<< gsn << endl;\r
+ if (gfl != -1) cout<<"Global tail cancellation filt. long decay parameter: "<< gfl << endl;\r
if (gsn != -1) cout<<"Global fast statistics mode?.......................: "<< gsn << endl;\r
if (gcv != "") cout<<"Global configuration tag version...................: "<< gcv << endl;\r
if (gcn != "") cout<<"Global configuration tag name......................: "<< gcn << endl;\r