CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions
HcalObjRepresent::ADataRepr Class Referenceabstract

#include <HcalObjRepresent.h>

Public Member Functions

 ADataRepr (unsigned int d)
 
void fillOneGain (std::vector< TH2F > &graphData, std::string units="")
 
virtual ~ADataRepr ()
 

Public Attributes

std::stringstream filename
 
unsigned int id
 
unsigned int nr
 
std::stringstream plotname
 
std::stringstream rootname
 

Protected Member Functions

virtual void doFillIn (std::vector< TH2F > &graphData)=0
 

Protected Attributes

int depth
 
HcalDetId hcal_id
 
int ieta
 
int iphi
 
unsigned int m_total
 

Private Member Functions

void draw (std::vector< TH2F > &graphData, std::string filename)
 
void setBinLabels (std::vector< TH2F > &depth)
 
void setup (std::vector< TH2F > &depth, std::string name, std::string units="")
 

Detailed Description

Definition at line 1251 of file HcalObjRepresent.h.

Constructor & Destructor Documentation

HcalObjRepresent::ADataRepr::ADataRepr ( unsigned int  d)
inline

Definition at line 1254 of file HcalObjRepresent.h.

virtual HcalObjRepresent::ADataRepr::~ADataRepr ( )
inlinevirtual

Definition at line 1255 of file HcalObjRepresent.h.

References triggerObjects_cff::id.

1255 {};

Member Function Documentation

virtual void HcalObjRepresent::ADataRepr::doFillIn ( std::vector< TH2F > &  graphData)
protectedpure virtual
void HcalObjRepresent::ADataRepr::draw ( std::vector< TH2F > &  graphData,
std::string  filename 
)
inlineprivate

Definition at line 1310 of file HcalObjRepresent.h.

References svgfig::canvas().

Referenced by Vispa.Gui.PortConnection.PointToPointConnection::paintEvent().

1310  {
1311  //Drawing...
1312  // use David's palette
1313  gStyle->SetPalette(1);
1314  const Int_t NCont = 999;
1315  gStyle->SetNumberContours(NCont);
1316  TCanvas canvas("CC map","CC map",840,369*4);
1317 
1318  TPad pad1("pad1","pad1", 0.0, 0.75, 1.0, 1.0);
1319  pad1.Draw();
1320  TPad pad2("pad2","pad2", 0.0, 0.5, 1.0, 0.75);
1321  pad2.Draw();
1322  TPad pad3("pad3","pad3", 0.0, 0.25, 1.0, 0.5);
1323  pad3.Draw();
1324  TPad pad4("pad4","pad4", 0.0, 0.0, 1.0, 0.25);
1325  pad4.Draw();
1326 
1327 
1328  pad1.cd();
1329  graphData[0].SetStats(false);
1330  graphData[0].Draw("colz");
1331 
1332  pad2.cd();
1333  graphData[1].SetStats(false);
1334  graphData[1].Draw("colz");
1335 
1336  pad3.cd();
1337  graphData[2].SetStats(false);
1338  graphData[2].Draw("colz");
1339 
1340  pad4.cd();
1341  graphData[3].SetStats(false);
1342  graphData[3].Draw("colz");
1343 
1344  canvas.SaveAs(filename.c_str());
1345  }
def canvas(sub, attr)
Definition: svgfig.py:482
void HcalObjRepresent::ADataRepr::fillOneGain ( std::vector< TH2F > &  graphData,
std::string  units = "" 
)
inline

Definition at line 1259 of file HcalObjRepresent.h.

References edmIntegrityCheck::d, ntuplePlotting::draw(), HcalObjRepresent::FillUnphysicalHEHFBins(), and HcalObjRepresent::setup().

1259  {
1260  std::stringstream ss("");
1261 
1262  if (m_total == 1)
1263  ss << rootname.str() << " for HCAL depth ";
1264  else
1265  ss << rootname.str() << nr << " for HCAL depth ";
1266 
1267  setup(graphData, ss.str());
1268 
1269  // Change the titles of each individual histogram
1270  for (unsigned int d=0;d < graphData.size();++d){
1271  graphData[d].Reset();
1272 
1273  ss.str("");
1274  if (m_total == 1)
1275  ss << plotname.str() << " for HCAL depth " << d+1;
1276  else
1277  ss << plotname.str() << nr << " for HCAL depth " << d+1;
1278 
1279 
1280  //BUG CAN BE HERE:
1281  //if (ChannelStatus->depth[d])
1282  graphData[d].SetTitle(ss.str().c_str()); // replace "setTitle" with "SetTitle", since you are using TH2F objects instead of MonitorElements
1283  ss.str("");
1284  }
1285  //overload this function:
1286  doFillIn(graphData);
1287 
1288  FillUnphysicalHEHFBins(graphData);
1289 
1290  ss.str("");
1291  if (m_total == 1)
1292  ss << filename.str() << ".png";
1293  else
1294  ss << filename.str() << nr << ".png";
1295  draw(graphData, ss.str());
1296  //FOR DEBUGGING:
1297  //std::cout << "ieta: " << ieta << "; iphi: " << iphi << "; logstatus: " << logstatus << "; channelBits: " << channelBits<< std::endl;
1298  }
virtual void doFillIn(std::vector< TH2F > &graphData)=0
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void draw(std::vector< TH2F > &graphData, std::string filename)
void FillUnphysicalHEHFBins(std::vector< TH2F > &hh)
void HcalObjRepresent::ADataRepr::setBinLabels ( std::vector< TH2F > &  depth)
inlineprivate

Definition at line 1405 of file HcalObjRepresent.h.

References mps_fire::i, and label.

1406  {
1407  // Set labels for all depth histograms
1408  for (unsigned int i=0;i<depth.size();++i)
1409  {
1410  depth[i].SetXTitle("i#eta");
1411  depth[i].SetYTitle("i#phi");
1412  }
1413 
1414  std::stringstream label;
1415 
1416  // set label on every other bin
1417  for (int i=-41;i<=-29;i=i+2)
1418  {
1419  label<<i;
1420  depth[0].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1421  depth[1].GetXaxis()->SetBinLabel(i+42,label.str().c_str());
1422  label.str("");
1423  }
1424  depth[0].GetXaxis()->SetBinLabel(14,"-29HE");
1425  depth[1].GetXaxis()->SetBinLabel(14,"-29HE");
1426 
1427  // offset by one for HE
1428  for (int i=-27;i<=27;i=i+2)
1429  {
1430  label<<i;
1431  depth[0].GetXaxis()->SetBinLabel(i+43,label.str().c_str());
1432  label.str("");
1433  }
1434  depth[0].GetXaxis()->SetBinLabel(72,"29HE");
1435  for (int i=29;i<=41;i=i+2)
1436  {
1437  label<<i;
1438  depth[0].GetXaxis()->SetBinLabel(i+44,label.str().c_str());
1439  label.str("");
1440  }
1441  for (int i=16;i<=28;i=i+2)
1442  {
1443  label<<i-43;
1444  depth[1].GetXaxis()->SetBinLabel(i,label.str().c_str());
1445  label.str("");
1446  }
1447  depth[1].GetXaxis()->SetBinLabel(29,"NULL");
1448  for (int i=15;i<=27;i=i+2)
1449  {
1450  label<<i;
1451  depth[1].GetXaxis()->SetBinLabel(i+15,label.str().c_str());
1452  label.str("");
1453  }
1454 
1455  depth[1].GetXaxis()->SetBinLabel(44,"29HE");
1456  for (int i=29;i<=41;i=i+2)
1457  {
1458  label<<i;
1459  depth[1].GetXaxis()->SetBinLabel(i+16,label.str().c_str());
1460  label.str("");
1461  }
1462 
1463  // HE depth 3 labels;
1464  depth[2].GetXaxis()->SetBinLabel(1,"-28");
1465  depth[2].GetXaxis()->SetBinLabel(2,"-27");
1466  depth[2].GetXaxis()->SetBinLabel(3,"Null");
1467  depth[2].GetXaxis()->SetBinLabel(4,"-16");
1468  depth[2].GetXaxis()->SetBinLabel(5,"Null");
1469  depth[2].GetXaxis()->SetBinLabel(6,"16");
1470  depth[2].GetXaxis()->SetBinLabel(7,"Null");
1471  depth[2].GetXaxis()->SetBinLabel(8,"27");
1472  depth[2].GetXaxis()->SetBinLabel(9,"28");
1473  }
char const * label
void HcalObjRepresent::ADataRepr::setup ( std::vector< TH2F > &  depth,
std::string  name,
std::string  units = "" 
)
inlineprivate

Definition at line 1347 of file HcalObjRepresent.h.

References mps_fire::i, HcalObjRepresent::setBinLabels(), AlCaHLTBitMon_QueryRunRegistry::string, units(), and fw3dlego::xbins.

Referenced by o2olib.O2OTool::execute().

1347  {
1348  std::string unittitle, unitname;
1349  if (units.empty())
1350  {
1351  unitname = units;
1352  unittitle = "No Units";
1353  }
1354  else
1355  {
1356  unitname = " " + units;
1357  unittitle = units;
1358  }
1359 
1360  // Push back depth plots
1362  //1. create first plot
1363  depth.push_back(TH2F(("HB HE HF Depth 1 "+name+unitname).c_str(),
1364  (name+" Depth 1 -- HB HE HF ("+unittitle+")").c_str(),
1365  85,-42.5,42.5,
1366  72,0.5,72.5));
1367 
1368  //2.1 prepare second plot
1369  float ybins[73];
1370  for (int i=0;i<=72;i++) ybins[i]=(float)(i+0.5);
1371  float xbinsd2[]={-42.5,-41.5,-40.5,-39.5,-38.5,-37.5,-36.5,-35.5,-34.5,-33.5,-32.5,-31.5,-30.5,-29.5,
1372  -28.5,-27.5,-26.5,-25.5,-24.5,-23.5,-22.5,-21.5,-20.5,-19.5,-18.5,-17.5,-16.5,
1373  -15.5,-14.5,
1374  14.5, 15.5,
1375  16.5,17.5,18.5,19.5,20.5,21.5,22.5,23.5,24.5,25.5,26.5,27.5,28.5,29.5,30.5,
1376  31.5,32.5,33.5,34.5,35.5,36.5,37.5,38.5,39.5,40.5,41.5,42.5};
1377 
1378  //2.2 create second plot
1379  depth.push_back(TH2F(("HB HE HF Depth 2 "+name+unitname).c_str(),
1380  (name+" Depth 2 -- HB HE HF ("+unittitle+")").c_str(),
1381  57, xbinsd2, 72, ybins));
1382 
1383  //3.1 Set up variable-sized bins for HE depth 3 (MonitorElement also requires phi bins to be entered in array format)
1384  float xbins[]={-28.5,-27.5,-26.5,-16.5,-15.5,
1385  15.5,16.5,26.5,27.5,28.5};
1386  //3.2
1387  depth.push_back(TH2F(("HE Depth 3 "+name+unitname).c_str(),
1388  (name+" Depth 3 -- HE ("+unittitle+")").c_str(),
1389  // Use variable-sized eta bins
1390  9, xbins, 72, ybins));
1391 
1392  //4.1 HO bins are fixed width, but cover a smaller eta range (-15 -> 15)
1393  depth.push_back(TH2F(("HO Depth 4 "+name+unitname).c_str(),
1394  (name+" Depth 4 -- HO ("+unittitle+")").c_str(),
1395  31,-15.5,15.5,
1396  72,0.5,72.5));
1397 
1398  for (unsigned int i=0;i<depth.size();++i)
1399  depth[i].Draw("colz");
1400 
1401  setBinLabels(depth); // set axis titles, special bins
1402  }
const double xbins[]
void setBinLabels(std::vector< TH2F > &depth)
TString units(TString variable, Char_t axis)

Member Data Documentation

int HcalObjRepresent::ADataRepr::depth
protected
std::stringstream HcalObjRepresent::ADataRepr::filename
HcalDetId HcalObjRepresent::ADataRepr::hcal_id
protected

Definition at line 1302 of file HcalObjRepresent.h.

unsigned int HcalObjRepresent::ADataRepr::id

Definition at line 1255 of file HcalObjRepresent.h.

int HcalObjRepresent::ADataRepr::ieta
protected

Definition at line 1303 of file HcalObjRepresent.h.

int HcalObjRepresent::ADataRepr::iphi
protected

Definition at line 1303 of file HcalObjRepresent.h.

unsigned int HcalObjRepresent::ADataRepr::m_total
protected

Definition at line 1301 of file HcalObjRepresent.h.

unsigned int HcalObjRepresent::ADataRepr::nr

Definition at line 1255 of file HcalObjRepresent.h.

std::stringstream HcalObjRepresent::ADataRepr::plotname

Definition at line 1257 of file HcalObjRepresent.h.

std::stringstream HcalObjRepresent::ADataRepr::rootname

Definition at line 1257 of file HcalObjRepresent.h.