00001
00017 #ifndef QMLFTOOL_H
00018 #define QMLFTOOL_H 1
00019
00020 #include "ReconAlg/IReconTool.h"
00021 #include "GaudiAlg/GaudiTool.h"
00022 #include "Event/CalibReadoutPmtCrate.h"
00023 #include "Conventions/Electronics.h"
00024 #include <map>
00025
00026 namespace DayaBay{
00027 class CalibReadout;
00028 class RecTrigger;
00029
00030 class CalibReadoutPmtCrate;
00031 }
00032
00033 class IPmtGeomInfoSvc;
00034 class ICableSvc;
00035 class ICalibDataSvc;
00036
00037 class OpPara;
00038 class GeomPara;
00039
00040 class QMLFTool : public GaudiTool , virtual public IReconTool
00041 {
00042 public:
00043
00044 QMLFTool(const std::string& type,
00045 const std::string& name,
00046 const IInterface* parent);
00047
00048 virtual ~QMLFTool();
00049
00050 virtual StatusCode reconstruct(const DayaBay::CalibReadout&,
00051 DayaBay::RecTrigger&);
00052 virtual StatusCode initialize();
00053 virtual StatusCode finalize();
00054
00055 private:
00056
00057 static void NCLL_fcn(int& npar, double* grad, double& fval, double* xval, int iflag);
00058
00059 StatusCode getOpPara(std::string &data_src);
00060 StatusCode getGeomPara(std::string &data_src);
00061 StatusCode printPara();
00062
00063 StatusCode setUsedChannels(const DayaBay::CalibReadoutPmtCrate*,
00064 DayaBay::RecTrigger*);
00065
00066 typedef std::map<DayaBay::FeeChannelId, bool> UsedFeeChannelMap;
00067 typedef std::map<DayaBay::FeeChannelId, double> ExpChgMap;
00068
00069 public:
00070
00071
00072 std::string m_cableSvcName;
00073
00074
00075 static ICableSvc* m_cableSvc;
00076
00077
00078 std::string m_pmtGeomSvcName;
00079
00080
00081 static IPmtGeomInfoSvc* m_pmtGeomSvc;
00082
00083
00084 std::string m_pmtCalibDataSvcName;
00085
00086
00087 static ICalibDataSvc* m_pmtCalibDataSvc;
00088
00089 static DayaBay::CalibReadoutPmtCrate* m_calibCrate;
00090
00091
00092 static ExpChgMap m_expChgMap;
00093
00094
00095
00096
00097 static int m_LLFMode;
00098
00099
00100
00101 static bool m_addTimeLLF;
00102
00103
00104
00105 static double m_pmtChgCut;
00106
00107
00108
00109 static bool m_recExtInfo;
00110
00111
00112 static OpPara *m_opPara;
00113 std::string m_opLocation;
00114
00115
00116 static GeomPara *m_geomPara;
00117 std::string m_geomLocation;
00118
00119 double m_ATTL;
00120 double m_TopRef;
00121 double m_BotRef;
00122 double m_LightYield;
00123 double m_PhotoCathodeArea;
00124
00125
00126 double m_TopRefZpos;
00127 double m_BotRefZpos;
00128
00129
00130 static UsedFeeChannelMap m_timeLLFUsedChannels;
00131 static UsedFeeChannelMap m_chgLLFUsedChannels;
00132 };
00133
00134 #endif // QMLFTOOL_H