35 EcalIntercalibConstantsMCEBMap() :
cond::payloadInspector::Histogram2D<
EcalIntercalibConstantsMC>(
"ECAL Barrel Intercalib Constants MC- 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;
58 if (value_ptr == payload->end())
89 EcalIntercalibConstantsMCEEMap() :
cond::payloadInspector::Histogram2D<
EcalIntercalibConstantsMC>(
"ECAL Endcap Intercalib Constants MC- map ",
92 Base::setSingleIov(
true );
95 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
97 for (
auto const & iov: iovs) {
98 std::shared_ptr<EcalIntercalibConstantsMC> payload = Base::fetchPayload( std::get<1>(iov) );
100 if (payload->endcapItems().empty())
return false;
105 fillWithValue(ix, iy, -1);
111 if (value_ptr == payload->end())
114 float weight = (
float)(*value_ptr);
116 if(myEEId.zside() == -1)
117 fillWithValue(myEEId.ix(), myEEId.iy(),
weight);
119 fillWithValue(myEEId.ix() +
IX_MAX + EEhistSplit, myEEId.iy(),
weight);
138 setSingleIov(
true );
141 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
146 auto iov = iovs.front();
147 std::shared_ptr<EcalIntercalibConstantsMC> payload = fetchPayload( std::get<1>(iov) );
148 unsigned int run = std::get<0>(iov);
152 if (payload->barrelItems().empty())
155 fillEBMap_SingleIOV<EcalIntercalibConstantsMC>(
payload,
barrel);
158 if (payload->endcapItems().empty())
161 fillEEMap_SingleIOV<EcalIntercalibConstantsMC>(
payload, endc_m, endc_p);
165 gStyle->SetPalette(1);
166 gStyle->SetOptStat(0);
167 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
171 t1.SetTextSize(0.04);
172 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants MC, IOV %i", run));
174 float xmi[3] = {0.0 , 0.24, 0.76};
175 float xma[3] = {0.24, 0.76, 1.00};
176 TPad** pad =
new TPad*;
178 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
193 canvas.SaveAs(ImageName.c_str());
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) {
222 std::shared_ptr<EcalIntercalibConstantsMC> payload = fetchPayload( std::get<1>(iov) );
223 run[irun] = std::get<0>(iov);
227 if (payload->barrelItems().empty())
230 fillEBMap_DiffIOV<EcalIntercalibConstantsMC>(
payload,
barrel, irun, pEB, pEBmin, pEBmax);
232 if (payload->endcapItems().empty())
235 fillEEMap_DiffIOV<EcalIntercalibConstantsMC>(
payload, endc_m, endc_p, irun, pEE, pEEmin, pEEmax);
242 gStyle->SetPalette(1);
243 gStyle->SetOptStat(0);
244 TCanvas
canvas(
"CC map",
"CC map", 1600, 450);
248 t1.SetTextSize(0.04);
249 t1.DrawLatex(0.5, 0.96, Form(
"Ecal IntercalibConstants MC Diff, IOV %i - %i", run[1], run[0]));
251 float xmi[3] = {0.0 , 0.24, 0.76};
252 float xma[3] = {0.24, 0.76, 1.00};
253 TPad** pad =
new TPad*;
256 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), xmi[
obj], 0.0, xma[obj], 0.94);
261 DrawEE(endc_m, pEEmin, pEEmax);
263 DrawEB(barrel, pEBmin, pEBmax);
265 DrawEE(endc_p, pEEmin, pEEmax);
268 canvas.SaveAs(ImageName.c_str());
278 EcalIntercalibConstantsMCSummaryPlot():
283 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
284 auto iov=iovs.front();
285 std::shared_ptr <EcalIntercalibConstantsMC> payload = fetchPayload(std::get<1> (iov));
286 unsigned int run=std::get<0> (iov);
292 align=
new TH2F(
"",
"", 0, 0, 0, 0, 0, 0);
295 float mean_x_EB=0.0f;
296 float mean_x_EE=0.0f;
305 payload->summary(mean_x_EB, rms_EB, num_x_EB, mean_x_EE, rms_EE, num_x_EE);
306 fillTableWithSummary(align,
"Ecal Intercalib Constants MC", 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 Intercalib Constants MC 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)