35 EcalPFRecHitThresholdsEBMap() :
cond::payloadInspector::Histogram2D<
EcalPFRecHitThresholds>(
"ECAL Barrel PFRec Hit Thresholds- 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())
85 EcalPFRecHitThresholdsEEMap() :
cond::payloadInspector::Histogram2D<
EcalPFRecHitThresholds>(
"ECAL Endcap PFRec Hit Thresholds- map ",
88 Base::setSingleIov(
true );
91 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
93 for (
auto const & iov: iovs) {
94 std::shared_ptr<EcalPFRecHitThresholds> payload = Base::fetchPayload( std::get<1>(iov) );
96 if (payload->endcapItems().empty())
return false;
101 fillWithValue(ix, iy, -1);
107 if (value_ptr == payload->end())
110 float weight = (
float)(*value_ptr);
112 if(myEEId.zside() == -1)
113 fillWithValue(myEEId.ix(), myEEId.iy(),
weight);
115 fillWithValue(myEEId.ix() +
IX_MAX + EEhistSplit, myEEId.iy(),
weight);
133 EcalPFRecHitThresholdsPlot() :
cond::payloadInspector::PlotImage<
EcalPFRecHitThresholds>(
"Ecal PFRec Hit Thresholds - map ") {
134 setSingleIov(
true );
137 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
142 auto iov = iovs.front();
143 std::shared_ptr<EcalPFRecHitThresholds> payload = fetchPayload( std::get<1>(iov) );
144 unsigned int run = std::get<0>(iov);
148 if (payload->barrelItems().empty())
151 fillEBMap_SingleIOV<EcalPFRecHitThresholds>(
payload,
barrel);
154 if (payload->endcapItems().empty())
157 fillEEMap_SingleIOV<EcalPFRecHitThresholds>(
payload, endc_m, endc_p);
161 gStyle->SetPalette(1);
162 gStyle->SetOptStat(0);
163 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
167 t1.SetTextSize(0.05);
168 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PFRec Hit Thresholds, IOV %i", run));
170 float xmi[3] = {0.0 , 0.24, 0.76};
171 float xma[3] = {0.24, 0.76, 1.00};
172 TPad** pad =
new TPad*;
174 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
189 canvas.SaveAs(ImageName.c_str());
200 EcalPFRecHitThresholdsDiff() :
cond::payloadInspector::PlotImage<
EcalPFRecHitThresholds>(
"Ecal PFRec Hit Thresholds difference ") {
204 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
208 float pEBmin, pEEmin, pEBmax, pEEmax;
214 unsigned int run[2], irun = 0;
216 for (
auto const & iov: iovs) {
217 std::shared_ptr<EcalPFRecHitThresholds> payload = fetchPayload( std::get<1>(iov) );
218 run[irun] = std::get<0>(iov);
222 if (payload->barrelItems().empty())
225 fillEBMap_DiffIOV<EcalPFRecHitThresholds>(
payload,
barrel, irun, pEB, pEBmin, pEBmax);
227 if (payload->endcapItems().empty())
230 fillEEMap_DiffIOV<EcalPFRecHitThresholds>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax);
237 gStyle->SetPalette(1);
238 gStyle->SetOptStat(0);
239 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
243 t1.SetTextSize(0.05);
244 t1.DrawLatex(0.5, 0.96, Form(
"Ecal PFRec Hit Thresholds Diff, IOV %i - %i", run[1], run[0]));
246 float xmi[3] = {0.0 , 0.24, 0.76};
247 float xma[3] = {0.24, 0.76, 1.00};
248 TPad** pad =
new TPad*;
251 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
256 DrawEE(endc_m, pEEmin, pEEmax);
258 DrawEB(barrel, pEBmin, pEBmax);
260 DrawEE(endc_p, pEEmin, pEEmax);
263 canvas.SaveAs(ImageName.c_str());
274 EcalPFRecHitThresholdsSummaryPlot():
279 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
280 auto iov=iovs.front();
281 std::shared_ptr <EcalPFRecHitThresholds> payload = fetchPayload(std::get<1> (iov));
282 unsigned int run=std::get<0> (iov);
288 align=
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
291 float mean_x_EB=0.0f;
292 float mean_x_EE=0.0f;
301 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
302 fillTableWithSummary(align,
"Ecal PFRec Hit Thresholds", mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
306 gStyle->SetPalette(1);
307 gStyle->SetOptStat(0);
308 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
312 t1.SetTextSize(0.04);
314 t1.DrawLatex(0.5, 0.96,Form(
"Ecal PFRec Hit Thresholds Summary, IOV %i", run));
317 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
325 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)