21 enum {kEBTotalTowers = 2448, kEETotalTowers = 1584};
22 enum {MIN_IETA = 1, MIN_IPHI = 1, MAX_IETA = 17, MAX_IPHI = 72};
30 EcalTPGTowerStatusPlot() :
cond::payloadInspector::PlotImage<
EcalTPGTowerStatus>(
"ECAL TPGTowerStatus - map ") {
34 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
35 TH2F*
barrel =
new TH2F(
"EB",
"EB TPG Tower Status", MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA);
36 int EBstat = 0, EEstat = 0;
38 auto iov = iovs.front();
40 unsigned int run = std::get<0>(iov);
45 for(it = towerMap.begin(); it != towerMap.end(); ++it) {
46 if((*it).second > 0) {
48 int ieta =
ttId.ieta();
50 int iphi =
ttId.iphi() - 1;
54 if(
ttId.subDet() == 1) {
55 barrel->Fill(iphi, ieta, (*it).second);
63 gStyle->SetPalette(1);
64 gStyle->SetOptStat(0);
68 TCanvas
canvas(
"c",
"c", w, h);
75 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGTowerStatus, IOV %i", run));
77 TPad** pad =
new TPad*;
79 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), 0.0, 0.04, 1.0, 0.94);
83 t1.DrawLatex(0.2, 0.88, Form(
"%i towers", EBstat));
84 t1.DrawLatex(0.5, 0.02, Form(
"EE : %i tower(s)", EEstat));
89 TLine*
l =
new TLine(0., 0., 0., 0.);
91 for(
int i = 0;
i < MAX_IETA;
i++) {
92 Double_t
x = 4.+ (
i * 4);
93 l =
new TLine(x, -MAX_IETA, x, MAX_IETA);
96 l =
new TLine(0., 0., 72., 0.);
100 canvas.SaveAs(ImageName.c_str());
111 EcalTPGTowerStatusDiff() :
cond::payloadInspector::PlotImage<
EcalTPGTowerStatus>(
"ECAL TPGTowerStatus difference") {
115 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
116 TH2F* barrel =
new TH2F(
"EB",
"EB difference", MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA);
118 int EBstat = 0, EEstat = 0;
120 unsigned int run[2] = {0, 0}, irun = 0, vEB[kEBTotalTowers];
122 for (
auto const & iov: iovs) {
123 std::shared_ptr<EcalTPGTowerStatus> payload = fetchPayload( std::get<1>(iov) );
124 run[irun] = std::get<0>(iov);
129 for(it = towerMap.begin(); it != towerMap.end(); ++it) {
131 int ieta =
ttId.ieta();
133 int iphi =
ttId.iphi() - 1;
135 int stat = (*it).second;
137 if(
ttId.subDet() == 1) {
140 if(towerId >= kEBTotalTowers)
std::cout <<
" strange tower Id " << towerId << std::endl;
153 if(
ttId.subDet() == 1) {
155 if(towerId >= kEBTotalTowers)
std::cout <<
" strange tower Id " << towerId << std::endl;
161 if(diff != 0) barrel->Fill(iphi, ieta, diff);
189 gStyle->SetPalette(1);
190 gStyle->SetOptStat(0);
193 TCanvas
canvas(
"c",
"c", w, h);
199 t1.SetTextSize(0.05);
200 t1.DrawLatex(0.5, 0.96, Form(
"Ecal TPGTowerStatus, IOV %i - %i", run[1], run[0]));
202 TPad** pad =
new TPad*;
204 pad[
obj] =
new TPad(Form(
"p_%i",
obj),Form(
"p_%i",
obj), 0.0, 0.04, 1.0, 0.94);
207 t1.SetTextSize(0.03);
208 t1.DrawLatex(0.2, 0.88, Form(
"%i tower(s)", EBstat));
209 t1.DrawLatex(0.5, 0.02, Form(
"EE : %i tower(s)", EEstat));
214 TLine* l =
new TLine(0., 0., 0., 0.);
216 for(
int i = 0;
i < MAX_IETA;
i++) {
217 Double_t x = 4.+ (
i * 4);
218 l =
new TLine(x, -MAX_IETA, x, MAX_IETA);
221 l =
new TLine(0., 0., 72., 0.);
225 canvas.SaveAs(ImageName.c_str());
std::map< uint32_t, uint16_t >::const_iterator EcalTPGTowerStatusMapIterator
std::map< uint32_t, uint16_t > EcalTPGTowerStatusMap
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
unsigned ttId(DetId const &)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
unsigned towerId(DetId const &)
void setSingleIov(bool flag)