+int AliHLTMUONMansoTrackerFSMComponent::Reconfigure(
+ const char* cdbEntry, const char* componentId
+ )
+{
+ /// Inherited from AliHLTComponent. This method will reload CDB configuration
+ /// entries for this component from the CDB.
+ /// \param cdbEntry If this is NULL or equals "HLT/ConfigMUON/MansoTrackerFSM"
+ /// then new configuration parameters are loaded, otherwise nothing is done.
+ /// \param componentId The name of the component in the current chain.
+
+ bool givenConfigPath = strcmp(cdbEntry, AliHLTMUONConstants::MansoTrackerFSMCDBPath()) == 0;
+
+ if (cdbEntry == NULL or givenConfigPath)
+ {
+ HLTInfo("Reading new configuration entries from CDB for component '%s'.", componentId);
+ ResetCanLoadFlags(); // Make sure to allow reading all values from CDB.
+ int result = ReadConfigFromCDB();
+ if (result != 0) return result;
+ }
+
+ return 0;
+}
+
+
+int AliHLTMUONMansoTrackerFSMComponent::ReadPreprocessorValues(const char* modules)
+{
+ /// Inherited from AliHLTComponent.
+ /// Updates the configuration of this component if HLT or ALL has been
+ /// specified in the 'modules' list.
+
+ TString mods = modules;
+ if (mods.Contains("ALL"))
+ {
+ return Reconfigure(NULL, GetComponentID());
+ }
+ if (mods.Contains("HLT"))
+ {
+ return Reconfigure(AliHLTMUONConstants::MansoTrackerFSMCDBPath(), GetComponentID());
+ }
+ return 0;
+}
+
+
+int AliHLTMUONMansoTrackerFSMComponent::ReadConfigFromCDB()
+{
+ /// Reads this component's configuration parameters from the CDB.
+ /// These include the middle of the dipole Z coordinate (zmiddle), the
+ /// integrated magnetic field of the dipole, Z coordinates of the chambers
+ /// and the region of interest parameters used during the tracking.
+ /// \param setZmiddle Indicates if the zmiddle parameter should be set
+ /// (default true).
+ /// \param setBL Indicates if the integrated magnetic field parameter should
+ /// be set (default true).
+ /// \return 0 if no errors occured and negative error code compatible with
+ /// the HLT framework on errors.
+
+ const char* pathToEntry = AliHLTMUONConstants::MansoTrackerFSMCDBPath();
+
+ TMap* map = NULL;
+ int result = FetchTMapFromCDB(pathToEntry, map);
+ if (result != 0) return result;
+
+ Double_t value = 0;
+ if (fCanLoadZmiddle)
+ {
+ result = GetFloatFromTMap(map, "zmiddle", value, pathToEntry, "dipole middle Z coordinate");
+ if (result != 0) return result;
+ AliHLTMUONCalculations::Zf(value);
+ }
+
+ if (fCanLoadBL)
+ {
+ result = GetFloatFromTMap(map, "bfieldintegral", value, pathToEntry, "integrated magnetic field");
+ if (result != 0) return result;
+ AliHLTMUONCalculations::QBL(value);
+ }
+
+ if (fCanLoadA[0])
+ {
+ result = GetFloatFromTMap(map, "roi_paramA_chamber7", value, pathToEntry, "chamber 7 region of interest 'A'");
+ if (result != 0) return result;
+ fTracker->SetA7(value);
+ }
+ if (fCanLoadA[1])
+ {
+ result = GetFloatFromTMap(map, "roi_paramA_chamber8", value, pathToEntry, "chamber 8 region of interest 'A'");
+ if (result != 0) return result;
+ fTracker->SetA8(value);
+ }
+ if (fCanLoadA[2])
+ {
+ result = GetFloatFromTMap(map, "roi_paramA_chamber9", value, pathToEntry, "chamber 9 region of interest 'A'");
+ if (result != 0) return result;
+ fTracker->SetA9(value);
+ }
+ if (fCanLoadA[3])
+ {
+ result = GetFloatFromTMap(map, "roi_paramA_chamber10", value, pathToEntry, "chamber 10 region of interest 'A'");
+ if (result != 0) return result;
+ fTracker->SetA10(value);
+ }
+
+ if (fCanLoadB[0])
+ {
+ result = GetFloatFromTMap(map, "roi_paramB_chamber7", value, pathToEntry, "chamber 7 region of interest 'B'");
+ if (result != 0) return result;
+ fTracker->SetB7(value);
+ }
+ if (fCanLoadB[1])
+ {
+ result = GetFloatFromTMap(map, "roi_paramB_chamber8", value, pathToEntry, "chamber 8 region of interest 'B'");
+ if (result != 0) return result;
+ fTracker->SetB8(value);
+ }
+ if (fCanLoadB[2])
+ {
+ result = GetFloatFromTMap(map, "roi_paramB_chamber9", value, pathToEntry, "chamber 9 region of interest 'B'");
+ if (result != 0) return result;
+ fTracker->SetB9(value);
+ }
+ if (fCanLoadB[3])
+ {
+ result = GetFloatFromTMap(map, "roi_paramB_chamber10", value, pathToEntry, "chamber 10 region of interest 'B'");
+ if (result != 0) return result;
+ fTracker->SetB10(value);
+ }
+
+ if (fCanLoadZ[0])
+ {
+ result = GetFloatFromTMap(map, "chamber7postion", value, pathToEntry, "nominal chamber 7 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ7(value);
+ }
+ if (fCanLoadZ[1])
+ {
+ result = GetFloatFromTMap(map, "chamber8postion", value, pathToEntry, "nominal chamber 8 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ8(value);
+ }
+ if (fCanLoadZ[2])
+ {
+ result = GetFloatFromTMap(map, "chamber9postion", value, pathToEntry, "nominal chamber 9 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ9(value);
+ }
+ if (fCanLoadZ[3])
+ {
+ result = GetFloatFromTMap(map, "chamber10postion", value, pathToEntry, "nominal chamber 10 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ10(value);
+ }
+ if (fCanLoadZ[4])
+ {
+ result = GetFloatFromTMap(map, "chamber11postion", value, pathToEntry, "nominal chamber 11 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ11(value);
+ }
+ if (fCanLoadZ[5])
+ {
+ result = GetFloatFromTMap(map, "chamber13postion", value, pathToEntry, "nominal chamber 13 Z coordinate");
+ if (result != 0) return result;
+ fTracker->SetZ13(value);
+ }
+
+ HLTDebug("Using the following configuration parameters:");
+ HLTDebug(" Middle of dipole Z coordinate = %f cm", AliHLTMUONCalculations::Zf());
+ HLTDebug(" Magnetic field integral = %f T.m", AliHLTMUONCalculations::QBL());
+ HLTDebug(" Region of interest parameter 'A' for chamber 7 = %f", fTracker->GetA7());
+ HLTDebug(" Region of interest parameter 'B' for chamber 7 = %f cm", fTracker->GetB7());
+ HLTDebug(" Region of interest parameter 'A' for chamber 8 = %f", fTracker->GetA8());
+ HLTDebug(" Region of interest parameter 'B' for chamber 8 = %f cm", fTracker->GetB8());
+ HLTDebug(" Region of interest parameter 'A' for chamber 9 = %f", fTracker->GetA9());
+ HLTDebug(" Region of interest parameter 'B' for chamber 9 = %f cm", fTracker->GetB9());
+ HLTDebug(" Region of interest parameter 'A' for chamber 10 = %f", fTracker->GetA10());
+ HLTDebug(" Region of interest parameter 'B' for chamber 10 = %f cm", fTracker->GetB10());
+ HLTDebug(" Nominal Z coordinate for chamber 7 = %f cm", fTracker->GetZ7());
+ HLTDebug(" Nominal Z coordinate for chamber 8 = %f cm", fTracker->GetZ8());
+ HLTDebug(" Nominal Z coordinate for chamber 9 = %f cm", fTracker->GetZ9());
+ HLTDebug(" Nominal Z coordinate for chamber 10 = %f cm", fTracker->GetZ10());
+ HLTDebug(" Nominal Z coordinate for chamber 11 = %f cm", fTracker->GetZ11());
+ HLTDebug(" Nominal Z coordinate for chamber 13 = %f cm", fTracker->GetZ13());
+
+ return 0;
+}
+
+