|
ATLAS Offline Software
|
Go to the documentation of this file.
14 #include <TGraphErrors.h>
33 return StatusCode::SUCCESS;
39 S <<
"<Channel coolid='0x" << std::hex <<
cool
40 << std::dec <<
"' slope='" << slope
42 <<
"' chi2='" << chi <<
"/>\n";
48 S <<
"0x" << std::hex <<
cool;
49 return std::string(
S.str());
70 std::ofstream xmlFile(
"rampdata.xml");
71 xmlFile <<
"<?xml version='1.0' encoding='utf-8'?>\n"
72 <<
"<TriggerTowerDecoratorData>\n"
73 <<
"<default name='slope' />\n";
75 std::unique_ptr<TGraphErrors> graph_temp = make_unique<TGraphErrors>();
76 std::unique_ptr<TF1> func = make_unique<TF1>(
"func",
"pol1", 0., 255.);
77 for(
auto rampDataIt : *rampDataContainer) {
78 auto coolId = rampDataIt.first;
80 ATH_MSG_DEBUG(
"Processing RampData for 0x" << std::hex << coolId << std::dec);
83 graph_temp->SetNameTitle(
getName(coolId).c_str(), getTitle(coolId).c_str());
88 for(
unsigned int iStep = 0; iStep <
nSteps; ++iStep) {
89 auto dataPoint = rampData.
getStep(iStep);
92 <<
" and coolId 0x" << std::hex << coolId << std::dec);
98 auto* prevStep = rampData.
getStep(iStep - 1);
99 if(prevStep && prevStep->second.mean() > dataPoint->second.mean())
continue;
102 graph->SetPoint(iStep, dataPoint->second.mean(), dataPoint->first.mean());
103 graph->SetPointError(iStep, dataPoint->second.rms(), dataPoint->first.rms());
108 if(attrListIt != energyScanResults->
end()) {
109 const auto& attrList = attrListIt->second;
110 double slope = attrList[
"Slope"].data<
double>();
111 double offset = attrList[
"Offset"].data<
double>();
112 double chi2 = attrList[
"Chi2"].data<
double>();
114 func->SetParameters(
offset, slope);
115 graph->GetListOfFunctions()->Add(func->Clone((
"func" +
getName(coolId)).c_str()));
120 << coolId << std::dec);
124 xmlFile <<
"</TriggerTowerDecoratorData>\n";
126 return StatusCode::SUCCESS;
131 return StatusCode::SUCCESS;
def retrieve(aClass, aKey=None)
const_iterator end() const
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
L1CaloDumpRampData(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode finalize()
TGraph * graph(const std::string &graphName, const std::string &tDir="", const std::string &stream="")
Simplify the retrieval of registered TGraphs.
This class is a collection of AttributeLists where each one is associated with a channel number....
virtual StatusCode initialize()
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
const L1CaloRampDataPoint * getStep(unsigned int step) const
::StatusCode StatusCode
StatusCode definition for legacy code.
double chi2(TH1 *h0, TH1 *h1)
unsigned int getNSteps() const
Container of L1CaloRampData objects.
const_iterator chanAttrListPair(ChanNum chanNum) const
Access to Chan/AttributeList pairs via channel number: returns map iterator.
#define ATH_MSG_WARNING(x)
virtual StatusCode execute()
#define CHECK_RECOVERABLE(EXP)
Evaluate an expression and check for errors.
void writeChannel(const CCIovVectorMap_t &data, const Folder &destination, const std::string &tag)
virtual ~L1CaloDumpRampData()
Transient class to store the RampData calculated from calibration runs.
TH1 * bookGetPointer(const TH1 &hist, const std::string &tDir="", const std::string &stream="")
Simplify the booking and registering (into THistSvc) of histograms.