37 EcalTimeCalibConstantsEBMap() :
cond::payloadInspector::Histogram2D<
EcalTimeCalibConstants>(
"ECAL Barrel Time Calib Constants - map ",
44 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
46 for (
auto const & iov: iovs) {
50 if (payload->barrelItems().empty())
return false;
59 if (value_ptr == payload->end())
88 EcalTimeCalibConstantsEEMap() :
cond::payloadInspector::Histogram2D<
EcalTimeCalibConstants>(
"ECAL Endcap Time Calib Constants - map ",
91 Base::setSingleIov(
true );
94 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
96 for (
auto const & iov: iovs) {
97 std::shared_ptr<EcalTimeCalibConstants> payload = Base::fetchPayload( std::get<1>(iov) );
99 if (payload->endcapItems().empty())
return false;
104 fillWithValue(ix, iy, -1);
110 if (value_ptr == payload->end())
113 float weight = (
float)(*value_ptr);
115 if(myEEId.zside() == -1)
116 fillWithValue(myEEId.ix(), myEEId.iy(),
weight);
118 fillWithValue(myEEId.ix() +
IX_MAX + EEhistSplit, myEEId.iy(),
weight);
137 setSingleIov(
true );
140 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
145 auto iov = iovs.front();
146 std::shared_ptr<EcalTimeCalibConstants> payload = fetchPayload( std::get<1>(iov) );
147 unsigned int run = std::get<0>(iov);
151 if (payload->barrelItems().empty())
154 fillEBMap_SingleIOV<EcalTimeCalibConstants>(
payload,
barrel);
157 if (payload->endcapItems().empty())
160 fillEEMap_SingleIOV<EcalTimeCalibConstants>(
payload, endc_m, endc_p);
164 gStyle->SetPalette(1);
165 gStyle->SetOptStat(0);
166 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
170 t1.SetTextSize(0.05);
171 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Time Calib Constants, IOV %i", run));
173 float xmi[3] = {0.0 , 0.24, 0.76};
174 float xma[3] = {0.24, 0.76, 1.00};
175 TPad** pad =
new TPad*;
177 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
183 DrawEE(endc_m, -2.5, 2.5);
186 DrawEB(barrel, -2.5, 2.5);
189 DrawEE(endc_p, -2.5, 2.5);
192 canvas.SaveAs(ImageName.c_str());
204 EcalTimeCalibConstantsDiff() :
cond::payloadInspector::PlotImage<
EcalTimeCalibConstants>(
"Ecal Time Calib Constants difference ") {
208 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
212 float pEBmin, pEEmin, pEBmax, pEEmax;
218 unsigned int run[2], irun = 0;
220 for (
auto const & iov: iovs) {
221 std::shared_ptr<EcalTimeCalibConstants> payload = fetchPayload( std::get<1>(iov) );
222 run[irun] = std::get<0>(iov);
226 if (payload->barrelItems().empty())
229 fillEBMap_DiffIOV<EcalTimeCalibConstants>(
payload,
barrel, irun, pEB, pEBmin, pEBmax);
231 if (payload->endcapItems().empty())
234 fillEEMap_DiffIOV<EcalTimeCalibConstants>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax);
241 gStyle->SetPalette(1);
242 gStyle->SetOptStat(0);
243 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
247 t1.SetTextSize(0.05);
248 t1.DrawLatex(0.5, 0.96, Form(
"Ecal Time Calib Constants Diff, IOV %i - %i", run[1], run[0]));
250 float xmi[3] = {0.0 , 0.24, 0.76};
251 float xma[3] = {0.24, 0.76, 1.00};
252 TPad** pad =
new TPad*;
255 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
260 DrawEE(endc_m, pEEmin, pEEmax);
262 DrawEB(barrel, pEBmin, pEBmax);
264 DrawEE(endc_p, pEEmin, pEEmax);
267 canvas.SaveAs(ImageName.c_str());
279 EcalTimeCalibConstantsSummaryPlot():
284 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
285 auto iov=iovs.front();
286 std::shared_ptr <EcalTimeCalibConstants> payload = fetchPayload(std::get<1> (iov));
287 unsigned int run=std::get<0> (iov);
293 align=
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
296 float mean_x_EB=0.0f;
297 float mean_x_EE=0.0f;
306 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
307 fillTableWithSummary(align,
"Ecal Time Calib Constants", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
311 gStyle->SetPalette(1);
312 gStyle->SetOptStat(0);
313 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
317 t1.SetTextSize(0.04);
319 t1.DrawLatex(0.5, 0.96,Form(
"Ecal Time Calib Constants Summary, IOV %i", run));
322 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
330 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)