35 EcalIntercalibConstantsEBMap() :
cond::payloadInspector::Histogram2D<
EcalIntercalibConstants>(
"ECAL Barrel Intercalib Constants - map ",
42 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
44 for (
auto const & iov: iovs) {
48 if (payload->barrelItems().empty())
return false;
57 if (value_ptr == payload->end())
continue;
76 EcalIntercalibConstantsEEMap() :
cond::payloadInspector::Histogram2D<
EcalIntercalibConstants>(
"ECAL Endcap Intercalib Constants - map ",
79 Base::setSingleIov(
true );
82 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
84 for (
auto const & iov: iovs) {
85 std::shared_ptr<EcalIntercalibConstants> payload = Base::fetchPayload( std::get<1>(iov) );
87 if (payload->endcapItems().empty())
return false;
92 fillWithValue(ix, iy, -1);
98 if (value_ptr == payload->end())
continue;
99 float weight = (
float)(*value_ptr);
101 if(myEEId.zside() == -1)
102 fillWithValue(myEEId.ix(), myEEId.iy(),
weight);
104 fillWithValue(myEEId.ix() +
IX_MAX + EEhistSplit, myEEId.iy(),
weight);
120 setSingleIov(
true );
123 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
128 auto iov = iovs.front();
129 std::shared_ptr<EcalIntercalibConstants> payload = fetchPayload( std::get<1>(iov) );
130 unsigned int run = std::get<0>(iov);
134 if (payload->barrelItems().empty())
137 fillEBMap_SingleIOV<EcalIntercalibConstants>(
payload,
barrel);
140 if (payload->endcapItems().empty())
143 fillEEMap_SingleIOV<EcalIntercalibConstants>(
payload, endc_m, endc_p);
147 gStyle->SetPalette(1);
148 gStyle->SetOptStat(0);
149 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
153 t1.SetTextSize(0.05);
154 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants, IOV %i", run));
156 float xmi[3] = {0.0 , 0.24, 0.76};
157 float xma[3] = {0.24, 0.76, 1.00};
158 TPad** pad =
new TPad*;
160 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
175 canvas.SaveAs(ImageName.c_str());
186 EcalIntercalibConstantsDiff() :
cond::payloadInspector::PlotImage<
EcalIntercalibConstants>(
"ECAL Intercalib Constants difference ") {
190 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
194 float pEBmin, pEEmin, pEBmax, pEEmax;
200 unsigned int run[2], irun = 0;
202 for (
auto const & iov: iovs) {
203 std::shared_ptr<EcalIntercalibConstants> payload = fetchPayload( std::get<1>(iov) );
204 run[irun] = std::get<0>(iov);
208 if (payload->barrelItems().empty())
211 fillEBMap_DiffIOV<EcalIntercalibConstants>(
payload,
barrel, irun, pEB, pEBmin, pEBmax);
213 if (payload->endcapItems().empty())
216 fillEEMap_DiffIOV<EcalIntercalibConstants>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax);
223 gStyle->SetPalette(1);
224 gStyle->SetOptStat(0);
225 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
229 t1.SetTextSize(0.05);
230 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants, IOV %i - %i", run[1], run[0]));
232 float xmi[3] = {0.0 , 0.24, 0.76};
233 float xma[3] = {0.24, 0.76, 1.00};
234 TPad** pad =
new TPad*;
236 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
240 DrawEE(endc_m, pEEmin, pEEmax);
242 DrawEB(barrel, pEBmin, pEBmax);
244 DrawEE(endc_p, pEEmin, pEEmax);
247 canvas.SaveAs(ImageName.c_str());
258 EcalIntercalibConstantsSummaryPlot():
263 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
264 auto iov=iovs.front();
265 std::shared_ptr <EcalIntercalibConstants> payload = fetchPayload(std::get<1> (iov));
266 unsigned int run=std::get<0> (iov);
272 align=
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
275 float mean_x_EB=0.0f;
276 float mean_x_EE=0.0f;
285 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
286 fillTableWithSummary(align,
"Ecal Intercalib Constants", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
290 gStyle->SetPalette(1);
291 gStyle->SetOptStat(0);
292 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
296 t1.SetTextSize(0.04);
298 t1.DrawLatex(0.5, 0.96,Form(
"Ecal Intercalib Constants Summary, IOV %i", run));
301 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
305 TLine*
l =
new TLine;
311 canvas.SaveAs(ImageName.c_str());
void fillTableWithSummary(TH2F *&align, std::string title, const float &mean_x_EB, const float &rms_EB, const int &num_x_EB, const float &mean_x_EE, const float &rms_EE, const int &num_x_EE)
void fillWithValue(float xvalue, float yvalue, float weight=1)
static EEDetId unhashIndex(int hi)
static bool validHashIndex(int i)
void DrawEE(TH2F *endc, float min, float max)
void DrawEB(TH2F *ebmap, float min, float max)
bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs) override
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
void setSingleIov(bool flag)
std::vector< Item >::const_iterator const_iterator
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
void drawTable(int nbRows, int nbColumns)