1721{
1722
1723#if 0
1724 m_clockwork->volatileSeparator->removeAllChildren();
1726 SoPickStyle *pickStyle = new SoPickStyle();
1727 pickStyle->style=SoPickStyleElement::UNPICKABLE;
1728 m_clockwork->volatileSeparator->addChild(pickStyle);
1729
1730
1731 std::ostringstream indexStream, etaBoundaryStream, phiBoundaryStream;
1732
1733
1734 {
1735 std::map < SoNode *, const EMBHVElectrode*>::const_iterator
p =
m_clockwork->EMBHVMap.find(mySelectedNode);
1737
1738 const EMBHVElectrode& electrode = *
p->second;
1740 const EMBHVManager&
manager =
module.getManager();
1741 const EMBHVManager::EMBHVData hvdata =
manager.getData(**hvCabling,
1742 attrLists);
1743 std::ostringstream outstream;
1744 outstream <<
"Side: " <<
module.getSideIndex()
1745 <<" Eta: " << module.getEtaIndex()
1746 << " Phi: " << module.getPhiIndex()
1747 << " Sector: " << module.getSectorIndex()
1748 << " Electrode " << electrode.getElectrodeIndex()
1749 << " Voltages: " << hvdata.voltage (electrode, 0)
1750 << "/" << hvdata.voltage (electrode, 1)
1751 << ";
currents:
" << hvdata.current (electrode, 0)
1752 << "/" << hvdata.current (electrode, 1);
1753 message (outstream.str().c_str());
1754 }
1755 }
1756 // EMEC HV
1757 {
1758 std::map < SoNode *, const EMECHVElectrode*>::const_iterator p = m_clockwork->EMECHVMap.find(mySelectedNode);
1759 if (p!=m_clockwork->EMECHVMap.end()) {
1760
1761 const EMECHVElectrode& electrode = *p->second;
1762 const EMECHVModule& module = electrode.getModule();
1763 const EMECHVManager& manager = module.getManager();
1764 const EMECHVManager::EMECHVData hvdata = manager.getData(**hvCabling,
1765 attrLists);
1766 std::ostringstream outstream;
1767 outstream << "Side:
" << module.getSideIndex()
1768 << " Wheel: " << module.getWheelIndex()
1769 << " Eta:
" << module.getEtaIndex()
1770 << " Phi:
" << module.getPhiIndex()
1771 << " Sector: " << module.getSectorIndex()
1772 << " Electrode: " << electrode.getElectrodeIndex()
1773 << "Voltages: " << hvdata.voltage (electrode, 0)
1774 << "/" << hvdata.voltage (electrode, 1)
1775 << ";
currents:
" << hvdata.current (electrode, 0)
1776 << "/" << hvdata.current (electrode, 1);
1777 message (outstream.str().c_str());
1778 }
1779 }
1780
1781 // HEC HV
1782 {
1783 std::map < SoNode *, const HECHVSubgap*>::const_iterator p = m_clockwork->HECHVMap.find(mySelectedNode);
1784 if (p!=m_clockwork->HECHVMap.end()) {
1785
1786 const HECHVSubgap& subgap = *p->second;
1787 const HECHVModule& module = subgap.getModule();
1788 const HECHVManager& manager = module.getManager();
1789 const HECHVManager::HECHVData hvdata = manager.getData(**hvCabling,
1790 attrLists);
1791 std::ostringstream outstream;
1792 outstream << "Side:
" << module.getSideIndex()
1793 << " Phi:
" << module.getPhiIndex()
1794 << " Sampling: " << module.getSamplingIndex()
1795 << " Subgap: " << subgap.getSubgapIndex()
1796 << "Voltage: " << hvdata.voltage (subgap)
1797 << ";
current:
" << hvdata.current (subgap);
1798 message (outstream.str().c_str());
1799 }
1800 }
1801 // FCAL HV
1802 {
1803 std::map < SoNode *, const FCALHVLine*>::const_iterator p = m_clockwork->FCALHVMap.find(mySelectedNode);
1804 if (p!=m_clockwork->FCALHVMap.end()) {
1805
1806 const FCALHVLine& line = *p->second;
1807 const FCALHVModule& module = line.getModule();
1808 const FCALHVManager& manager = module.getManager();
1809 const FCALHVManager::FCALHVData hvdata = manager.getData(**hvCabling,
1810 attrLists);
1811 std::ostringstream outstream;
1812 outstream << "Side:
" << module.getSideIndex()
1813 << " Sector: " << module.getSectorIndex()
1814 << " Sampling: " << module.getSamplingIndex()
1815 << " Line:
" << line.getLineIndex()
1816 << "Voltage: " << hvdata.voltage (line)
1817 << ";
current:
" << hvdata.current (line);
1818 message (outstream.str().c_str());
1819 }
1820 }
1821
1822 // See if it is in the FCAL
1823 {
1824 std::map < SoNode *, const FCALTile *>::const_iterator p = m_clockwork->TileMap.find(mySelectedNode);
1825 if (p!=m_clockwork->TileMap.end()) {
1826
1827 const FCALTile *element = (*p).second;
1828 indexStream << "Element selected has
identifier of
" << element->identify() << std::endl;
1829 indexStream << "I index of
" << element->getIndexI() << std::endl;
1830 indexStream << "J
index of
" << element->getIndexJ() << std::endl;
1831 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
1832 std::ostringstream highVoltageStream;
1833 highVoltageStream << "There are
" << element->getNumHVLines() << " high voltage
lines.
Status:
" << std::endl;
1834 message(highVoltageStream.str().c_str());
1835
1836 const FCALHVLine* line = nullptr;
1837 for (unsigned int i=0;i<element->getNumHVLines();i++) {
1838 line = element->getHVLine(i);
1839 if (line) break;
1840 }
1841
1842 if (line) {
1843 const FCALHVModule& module = line->getModule();
1844 const FCALHVManager& manager = module.getManager();
1845 const FCALHVManager::FCALHVData hvdata = manager.getData(**hvCabling,
1846 attrLists);
1847 for (unsigned int i=0;i<element->getNumHVLines();i++) {
1848 std::ostringstream highVoltageStream;
1849 if (element->getHVLine(i)) {
1850 highVoltageStream << i << ' ' << hvdata.voltage (*element->getHVLine(i)) << std::endl;
1851 }
1852 message(highVoltageStream.str().c_str());
1853 }
1854 }
1855 }
1856
1857
1858
1859
1860 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
1861
1862 const FCALModule *fcalMod=element->getModule();
1863
1864
1865 const HepGeom::Transform3D &xf = Amg::EigenTransformToCLHEP(fcalMod->getAbsoluteTransform());
1866 SoTransform *XF = VP1LinAlgUtils::toSoTransform(xf);
1867
1868 SoSeparator * sep = new SoSeparator();
1869 sep->addChild(XF);
1870
1871 double zf = fcalMod->getEndcapIndex()== 0 ? +fcalMod->getFullDepthZ(*element)/2.0 : -fcalMod->getFullDepthZ(*element)/2.0;
1872 double zc = 0;
1873 double zb = fcalMod->getEndcapIndex()== 0 ? -fcalMod->getFullDepthZ(*element)/2.0 : +fcalMod->getFullDepthZ(*element)/2.0;
1874
1875 double z=zf;
1876 if (m_clockwork->pos==CENTER) z=zc;
1877 if (m_clockwork->pos==BACK) z=zb;
1878
1879 SoMaterial *white = new SoMaterial();
1880 white->diffuseColor.setValue(1.00,1.00, 1.00);
1881
1882 SoDrawStyle *drawStyle = new SoDrawStyle();
1883 drawStyle->lineWidth=3;
1884 drawStyle->pointSize=3;
1885
1886 SoLightModel *lm = new SoLightModel();
1887 lm->model=SoLightModel::BASE_COLOR;
1888 sep->addChild(white);
1889 sep->addChild(drawStyle);
1890 sep->addChild(lm);
1891
1892
1893 int cc=0;
1894 SoVertexProperty *vtxProperty = new SoVertexProperty();
1895 for (FCALModule::ConstIterator f=fcalMod->beginTiles();f!=fcalMod->endTiles();f++) {
1896 if (((*f).getHVLine(0) && (*f).getHVLine(0)==element->getHVLine(0)) ||
1897 ((*f).getHVLine(1) && (*f).getHVLine(1)==element->getHVLine(1)) ||
1898 ((*f).getHVLine(2) && (*f).getHVLine(2)==element->getHVLine(2)) ||
1899 ((*f).getHVLine(3) && (*f).getHVLine(3)==element->getHVLine(3)) ) {
1900 for (unsigned int i=0;i<(*f).getNumTubes();i++) {
1901 FCALTubeConstLink myTube=(*f).getTube(i);
1902 vtxProperty->vertex.set1Value(cc++, SbVec3f(myTube->getXLocal(),myTube->getYLocal(),z));
1903 }
1904 }
1905 }
1906 SoPointSet *ps = new SoPointSet();
1907 ps->numPoints=cc;
1908 ps->vertexProperty=vtxProperty;
1909 sep->addChild(ps);
1910 m_clockwork->volatileSeparator->addChild(sep);
1911 }
1912 if (m_clockwork->ui.fcalTubesCheckBox->isChecked()) {
1913 const FCALModule *fcalMod=element->getModule();
1914 const HepGeom::Transform3D &xf = Amg::EigenTransformToCLHEP(fcalMod->getAbsoluteTransform());
1915 SoTransform *XF = VP1LinAlgUtils::toSoTransform(xf);
1916
1917 SoSeparator * sep = new SoSeparator();
1918 sep->addChild(XF);
1919
1920 double zf = fcalMod->getEndcapIndex()== 0 ? +fcalMod->getFullDepthZ(*element)/2.0 : -fcalMod->getFullDepthZ(*element)/2.0;
1921 double zc = 0;
1922 double zb = fcalMod->getEndcapIndex()== 0 ? -fcalMod->getFullDepthZ(*element)/2.0 : +fcalMod->getFullDepthZ(*element)/2.0;
1923
1924 double z=zf;
1925 if (m_clockwork->pos==CENTER) z=zc;
1926 if (m_clockwork->pos==BACK) z=zb;
1927
1928 SoMaterial *white = new SoMaterial();
1929 white->diffuseColor.setValue(1.00,1.00, 1.00);
1930
1931 SoDrawStyle *drawStyle = new SoDrawStyle();
1932 drawStyle->lineWidth=3;
1933 drawStyle->pointSize=3;
1934
1935 SoLightModel *lm = new SoLightModel();
1936 lm->model=SoLightModel::BASE_COLOR;
1937 sep->addChild(white);
1938 sep->addChild(drawStyle);
1939 sep->addChild(lm);
1940
1941
1942 int cc=0;
1943 SoVertexProperty *vtxProperty = new SoVertexProperty();
1944 for (unsigned int i=0;i<element->getNumTubes();i++) {
1945 FCALTubeConstLink myTube=element->getTube(i);
1946 vtxProperty->vertex.set1Value(cc++, SbVec3f(myTube->getXLocal(),myTube->getYLocal(),z));
1947 }
1948 SoPointSet *ps = new SoPointSet();
1949 ps->numPoints=cc;
1950 ps->vertexProperty=vtxProperty;
1951 sep->addChild(ps);
1952 m_clockwork->volatileSeparator->addChild(sep);
1953 }
1954 }
1955 }
1956
1957
1958 // See if it is in the HEC:
1959 {
1960 std::map < SoNode *, HECCellConstLink>::const_iterator p = m_clockwork->HECMap.find(mySelectedNode);
1961 if (p!=m_clockwork->HECMap.end()) {
1962
1963 HECCellConstLink element = (*p).second;
1964 indexStream << "Sampling
Region,
Eta,
Phi indices of
" << element->getSamplingIndex() << ",
" << element->getRegionIndex() << ",
" << element->getEtaIndex() << ",
" << element->getPhiIndex() << std::endl;
1965 phiBoundaryStream << "Phi min &
max (CLHEP::deg) =
" << element->getPhiLocalLower()*180/M_PI << " " << element->getPhiLocalUpper()*180/M_PI << std::endl;
1966 etaBoundaryStream << "Eta Min and Max
" << element->getEtaMinNominal() << ",
" << element->getEtaMaxNominal() << std::endl;
1967 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
1968 std::ostringstream highVoltageStream;
1969 highVoltageStream << "There are
" << element->getNumSubgaps() << " subgaps.
Status:
" << std::endl;
1970 message (highVoltageStream.str().c_str());
1971 }
1972 std::set<const HECHVModule*> modSet;
1973 if (element->getNumSubgaps() > 0) {
1974 const HECHVModule& module0 = element->getSubgap(0).getModule();
1975 const HECHVManager& manager = module0.getManager();
1976 const HECHVManager::HECHVData hvdata = manager.getData(**hvCabling,
1977 attrLists);
1978 for (unsigned int i=0;i<element->getNumSubgaps();i++) {
1979 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
1980 std::ostringstream highVoltageStream;
1981 highVoltageStream << i << " Status " << hvdata.hvOn (element->getSubgap(i))
1982 << " voltage: " << hvdata.voltage (element->getSubgap(i))
1983 << " current:
" << hvdata.current (element->getSubgap(i))
1984 << std::endl;
1985 message(highVoltageStream.str().c_str());
1986 }
1987 //
1988 // Now let's show the module, and where she is:
1989 //
1990 const HECHVModule& module = element->getSubgap(i).getModule();
1991
1992 if (!m_clockwork->ui.highVoltageCheckBox->isChecked()) continue;
1993
1994 SoSeparator * sep = new SoSeparator();
1995
1996 SoMaterial *white = new SoMaterial();
1997 white->diffuseColor.setValue(1.00,1.00, 1.00);
1998
1999 SoDrawStyle *drawStyle = new SoDrawStyle();
2000 drawStyle->lineWidth=3;
2001 drawStyle->pointSize=3;
2002
2003 SoLightModel *lm = new SoLightModel();
2004 lm->model=SoLightModel::BASE_COLOR;
2005
2006
2007 // we comment out to avoid compilation warnings, because they're not used, apparently
2008 // HECCell::CELLPOS pos=HECCell::FRONT;
2009 // if (m_clockwork->pos==BACK) pos=HECCell::BACK;
2010 // if (m_clockwork->pos==CENTER) pos=HECCell::CENTER;
2011
2012
2013 const HECDetectorManager *hecManager = VP1DetInfo::hecDetMgr();
2014 const HECDetectorRegion *region = hecManager->getDetectorRegion(element->getEndcapIndex(),element->getSamplingIndex(),element->getRegionIndex());
2015 const HepGeom::Transform3D &XF= Amg::EigenTransformToCLHEP(region->getAbsoluteTransform());
2016 double z = (XF*HepGeom::Point3D<double>(0,0,element->getZLocal(HECCell::FRONT))).z();
2017
2018 double phiMin = module.getPhiMin();
2019 double phiMax = module.getPhiMax();
2020
2021
2022 double rMax=2130;
2023 double rMin=element->getSamplingIndex()==0 ? 371 : 474;
2024
2025 sep->addChild(white);
2026 sep->addChild(drawStyle);
2027 sep->addChild(lm);
2028 if (modSet.find(&module)==modSet.end()) {
2029 modSet.insert(&module);
2030 int cc=0;
2031 SoVertexProperty *vtxProperty = new SoVertexProperty();
2032 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2033 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMax),rMin*sin(phiMax) ,z));
2034 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMax),rMax*sin(phiMax) ,z));
2035 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMin),rMax*sin(phiMin) ,z));
2036 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2037
2038
2039 SoLineSet *ls = new SoLineSet();
2040 ls->numVertices=5;
2041 ls->vertexProperty=vtxProperty;
2042 sep->addChild(ls);
2043 }
2044 m_clockwork->volatileSeparator->addChild(sep);
2045 }
2046 }
2047 }
2048 }
2049 // See if it is in the EMEC:
2050 {
2051 std::map < SoNode *, EMECCellConstLink>::const_iterator p = m_clockwork->EMECMap.find(mySelectedNode);
2052 if (p!=m_clockwork->EMECMap.end()) {
2053
2054 EMECCellConstLink element = (*p).second;
2055 indexStream<< "Sampling
Region,
Eta,
Phi indices of
" << element->getSamplingIndex() << ",
" << element->getRegionIndex() << ",
" << element->getEtaIndex() << ",
" << element->getPhiIndex() << std::endl;
2056 etaBoundaryStream << "Eta Min and Max
" << element->getEtaMin() << ",
" << element->getEtaMax() << std::endl;
2057 phiBoundaryStream << "Phi min &
max (CLHEP::deg) =
" << element->getPhiLocalLower()*180/M_PI << " " << element->getPhiLocalUpper()*180/M_PI << std::endl;
2058 //
2059
2060 if (element->getSamplingIndex()==0) {
2061
2062 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
2063 const EMECPresamplerHVModule& module = element->getPresamplerHVModule();
2064 const EMECPresamplerHVManager& manager = module.getManager();
2065 const EMECPresamplerHVManager::EMECPresamplerHVData hvdata = manager.getData(**hvCabling,
2066 attrLists);
2067 std::ostringstream highVoltageStream;
2069 message(highVoltageStream.str().c_str());
2070 highVoltageStream << "Status:
"
2071 << hvdata.hvOn (module, 0) << ' '
2072 << hvdata.hvOn (module, 1) << '\n';
2073 highVoltageStream << "Current: " << hvdata.current(module, 0) << ' ' << hvdata.current (module, 1) << '\n';
2074 highVoltageStream << "Voltage: " << hvdata.voltage (module, 0) << ' ' << hvdata.voltage (module, 1) << '\n';
2075
2076 message(highVoltageStream.str().c_str());
2077
2078
2079 SoSeparator * sep = new SoSeparator();
2080
2081 SoMaterial *white = new SoMaterial();
2082 white->diffuseColor.setValue(1.00,1.00, 1.00);
2083
2084 SoDrawStyle *drawStyle = new SoDrawStyle();
2085 drawStyle->lineWidth=3;
2086 drawStyle->pointSize=3;
2087
2088 SoLightModel *lm = new SoLightModel();
2089 lm->model=SoLightModel::BASE_COLOR;
2090
2091
2092 EMECCell::CELLPOS pos=EMECCell::FRONT;
2093 if (m_clockwork->pos==BACK) pos=EMECCell::BACK;
2094 if (m_clockwork->pos==CENTER) pos=EMECCell::CENTER;
2095
2096
2097 double z = (element->getZLocal(pos)+
2098 element->getDescriptor()->getManager()->getFocalToRef() +
2099 element->getDescriptor()->getManager()->getRefToActive())* (element->getEndcapIndex()==0 ? -1:1);
2100 double phiMin = module.getPhiMin();
2101 double phiMax = module.getPhiMax();
2102 double etaMin = module.getEtaMin();
2103 double etaMax = module.getEtaMax();
2104
2105
2106 double rMax=fabs(z/sinh(etaMin));
2107 double rMin=fabs(z/sinh(etaMax));
2108
2109 sep->addChild(white);
2110 sep->addChild(drawStyle);
2111 sep->addChild(lm);
2112 int cc=0;
2113 SoVertexProperty *vtxProperty = new SoVertexProperty();
2114 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2115 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMax),rMin*sin(phiMax) ,z));
2116 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMax),rMax*sin(phiMax) ,z));
2117 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMin),rMax*sin(phiMin) ,z));
2118 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2119
2120
2121 SoLineSet *ls = new SoLineSet();
2122 ls->numVertices=5;
2123 ls->vertexProperty=vtxProperty;
2124 sep->addChild(ls);
2125 m_clockwork->volatileSeparator->addChild(sep);
2126 }
2127 }
2128 else {
2129
2130 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
2131 std::ostringstream highVoltageStream;
2132 highVoltageStream << "There are
" << element->getNumElectrodes() << " electrodes.
Status:
" << std::endl;
2133 message(highVoltageStream.str().c_str());
2134 }
2135 std::set<const EMECHVModule*> modSet;
2136 if (element->getNumElectrodes() > 0) {
2137 for (unsigned int i=0;i<element->getNumElectrodes();i++) {
2138 const EMECHVElectrode& electrode = element->getElectrode(0);
2139 const EMECHVModule& module0 = electrode.getModule();
2140 const EMECHVManager& manager = module0.getManager();
2141 const EMECHVManager::EMECHVData hvdata = manager.getData(**hvCabling,
2142 attrLists);
2143 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
2144 {
2145 std::ostringstream highVoltageStream;
2146 highVoltageStream << i << ' '
2147 << element->getElectrode(i).getElectrodeIndex() << ") status: "
2148 << hvdata.hvOn(element->getElectrode(i),0) << ' '
2149 << hvdata.hvOn(element->getElectrode(i),1) << std::endl;
2150 message(highVoltageStream.str().c_str());
2151 }
2152 {
2153 std::ostringstream highVoltageStream;
2154 highVoltageStream << i << '('
2155 << element->getElectrode(i).getElectrodeIndex() << ") voltage: "
2156 << hvdata.voltage(element->getElectrode(i),0) << ' '
2157 << hvdata.voltage(element->getElectrode(i),1) << std::endl;
2158 message(highVoltageStream.str().c_str());
2159 }
2160 {
2161 std::ostringstream highVoltageStream;
2162 highVoltageStream << i << '(' << element->getElectrode(i).getElectrodeIndex() << ")
currents:
"
2163 << hvdata.current(element->getElectrode(i),0) << ' '
2164 << hvdata.current(element->getElectrode(i),1) << std::endl;
2165 message(highVoltageStream.str().c_str());
2166 }
2167 }
2168 //
2169 // Now let's show the module, and where she is:
2170 //
2171 const EMECHVModule& module = element->getElectrode(i).getModule();
2172
2173 if (!m_clockwork->ui.highVoltageCheckBox->isChecked()) continue;
2174
2175 SoSeparator * sep = new SoSeparator();
2176
2177 SoMaterial *white = new SoMaterial();
2178 white->diffuseColor.setValue(1.00,1.00, 1.00);
2179
2180 SoDrawStyle *drawStyle = new SoDrawStyle();
2181 drawStyle->lineWidth=3;
2182 drawStyle->pointSize=3;
2183
2184 SoLightModel *lm = new SoLightModel();
2185 lm->model=SoLightModel::BASE_COLOR;
2186
2187
2188 EMECCell::CELLPOS pos=EMECCell::FRONT;
2189 if (m_clockwork->pos==BACK) pos=EMECCell::BACK;
2190 if (m_clockwork->pos==CENTER) pos=EMECCell::CENTER;
2191
2192
2193 double z = (element->getZLocal(pos)+
2194 element->getDescriptor()->getManager()->getFocalToRef() +
2195 element->getDescriptor()->getManager()->getRefToActive())* (element->getEndcapIndex()==0 ? -1:1);
2196 double phiMin = module.getPhiMin();
2197 double phiMax = module.getPhiMax();
2198 double etaMin = module.getEtaMin();
2199 double etaMax = module.getEtaMax();
2200
2201
2202 double rMax=fabs(z/sinh(etaMin));
2203 double rMin=fabs(z/sinh(etaMax));
2204
2205 sep->addChild(white);
2206 sep->addChild(drawStyle);
2207 sep->addChild(lm);
2208 if (modSet.find(&module)==modSet.end()) {
2209 modSet.insert(&module);
2210 int cc=0;
2211 SoVertexProperty *vtxProperty = new SoVertexProperty();
2212 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2213 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMax),rMin*sin(phiMax) ,z));
2214 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMax),rMax*sin(phiMax) ,z));
2215 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(phiMin),rMax*sin(phiMin) ,z));
2216 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(phiMin),rMin*sin(phiMin) ,z));
2217
2218
2219 SoLineSet *ls = new SoLineSet();
2220 ls->numVertices=5;
2221 ls->vertexProperty=vtxProperty;
2222 sep->addChild(ls);
2223 }
2224 {
2225
2226 int cc=0;
2227 SoVertexProperty *vtxProperty = new SoVertexProperty();
2228 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMin*cos(element->getElectrode(i).getPhi()),rMin*sin(element->getElectrode(i).getPhi()) ,z));
2229 vtxProperty->vertex.set1Value(cc++, SbVec3f(rMax*cos(element->getElectrode(i).getPhi()),rMax*sin(element->getElectrode(i).getPhi()) ,z));
2230 SoLineSet *ls = new SoLineSet();
2231 ls->numVertices=2;
2232 ls->vertexProperty=vtxProperty;
2233 sep->addChild(ls);
2234 }
2235
2236 m_clockwork->volatileSeparator->addChild(sep);
2237 }
2238 }
2239 }
2240 }
2241 }
2242
2243
2244 // See if it is in the EMB:
2245 {
2246 std::map < SoNode *, EMBCellConstLink>::const_iterator p = m_clockwork->EMBMap.find(mySelectedNode);
2247 if (p!=m_clockwork->EMBMap.end()) {
2248
2249 EMBCellConstLink element = (*p).second;
2250 //element->print();
2251 indexStream<< "Sampling
Region,
Eta,
Phi indices of
" << element->getSamplingIndex() << ",
" << element->getRegionIndex() << ",
" << element->getEtaIndex() << ",
" << element->getPhiIndex() << std::endl;
2252 etaBoundaryStream<< "Eta Min and Max
" << element->getEtaMin() << ",
" << element->getEtaMax() << std::endl;
2253 phiBoundaryStream<< "Phi min &
max (CLHEP::
deg) =
" << element->getPhiLocalLower()*180/M_PI << " " << element->getPhiLocalUpper()*180/M_PI << '\n';
2254 //
2255 if (m_clockwork->ui.highVoltageCheckBox->isChecked()) {
2256 if (element->getSamplingIndex()==0) {
2257 const EMBPresamplerHVModule& module = element->getPresamplerHVModule();
2258 const EMBPresamplerHVManager& manager = module.getManager();
2259 const EMBPresamplerHVManager::EMBPresamplerHVData hvdata = manager.getData(**hvCabling,
2260 attrLists);
2261
2262 std::ostringstream highVoltageStream;
2264 message(highVoltageStream.str().c_str());
2265 highVoltageStream << "Status:
"
2266 << hvdata.hvOn (module, 0) << ' '
2267 << hvdata.hvOn (module, 1) << '\n';
2268 highVoltageStream << "Current: "
2269 << hvdata.current (module, 0) << ' '
2270 << hvdata.current (module, 1) << '\n';
2271 highVoltageStream << "Voltage: "
2272 << hvdata.voltage (module, 0) << ' '
2273 << hvdata.voltage (module, 1) << '\n';
2274
2275 message(highVoltageStream.str().c_str());
2276
2277 SoSeparator * sep = new SoSeparator();
2278
2279 SoMaterial *white = new SoMaterial();
2280 white->diffuseColor.setValue(1.00,1.00, 1.00);
2281
2282 SoDrawStyle *drawStyle = new SoDrawStyle();
2283 drawStyle->lineWidth=3;
2284 drawStyle->pointSize=3;
2285
2286 SoLightModel *lm = new SoLightModel();
2287 lm->model=SoLightModel::BASE_COLOR;
2288
2289
2290 EMBCell::CELLPOS pos=EMBCell::FRONT;
2291 if (m_clockwork->pos==BACK) pos=EMBCell::BACK;
2292 if (m_clockwork->pos==CENTER) pos=EMBCell::CENTER;
2293
2294
2295 double r = element->getRLocal(pos);
2296 double phiMin = module.getPhiMin();
2297 double phiMax = module.getPhiMax();
2298 double etaMin = module.getEtaMin();
2299 double etaMax = module.getEtaMax();
2300 sep->addChild(white);
2301 sep->addChild(drawStyle);
2302 sep->addChild(lm);
2303
2304
2305
2306 int cc=0;
2307 SoVertexProperty *vtxProperty = new SoVertexProperty();
2308 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMin)));
2309 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMax),r*sin(phiMax) ,r*sinh(etaMin)));
2310 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMax),r*sin(phiMax) ,r*sinh(etaMax)));
2311 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMax)));
2312 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMin)));
2313
2314 SoLineSet *ls = new SoLineSet();
2315 ls->numVertices=5;
2316 ls->vertexProperty=vtxProperty;
2317 sep->addChild(ls);
2318
2319 m_clockwork->volatileSeparator->addChild(sep);
2320 }
2321 else {
2322 std::ostringstream highVoltageStream;
2323 highVoltageStream << "There are
" << element->getNumElectrodes() << " electrodes.
Status:
" << '\n';
2324 message(highVoltageStream.str().c_str());
2325 std::set<const EMBHVModule*> modSet;
2326 if (element->getNumElectrodes() > 0) {
2327 const EMBHVModule& module0 = element->getElectrode(0).getModule();
2328 const EMBHVManager& manager = module0.getManager();
2329 const EMBHVManager::EMBHVData hvdata = manager.getData(**hvCabling,
2330 attrLists);
2331 for (unsigned int i=0;i<element->getNumElectrodes();i++) {
2332 highVoltageStream << i << "Status:
" << element->getElectrode(i).getElectrodeIndex() << ' '
2333 << hvdata.hvOn (element->getElectrode(i), 0) << ' '
2334 << hvdata.hvOn (element->getElectrode(i), 1) << '\n';
2335 highVoltageStream << i << "Current: "
2336 << element->getElectrode(i).getElectrodeIndex() << ' '
2337 << hvdata.current (element->getElectrode(i), 0) << ' '
2338 << hvdata.current (element->getElectrode(i), 1) << '\n';
2339 highVoltageStream << i << "Voltage: " << element->getElectrode(i).getElectrodeIndex() << ' '
2340 << hvdata.voltage (element->getElectrode(i), 0) << ' '
2341 << hvdata.voltage (element->getElectrode(i), 1) << '\n';
2342 message(highVoltageStream.str().c_str());
2343 //
2344 // Now let's show the module, and where she is:
2345 //
2346 const EMBHVModule& module = element->getElectrode(i).getModule();
2347
2348 if (!m_clockwork->ui.highVoltageCheckBox->isChecked()) continue;
2349
2350 SoSeparator * sep = new SoSeparator();
2351
2352 SoMaterial *white = new SoMaterial();
2353 white->diffuseColor.setValue(1.00,1.00, 1.00);
2354
2355 SoDrawStyle *drawStyle = new SoDrawStyle();
2356 drawStyle->lineWidth=3;
2357 drawStyle->pointSize=3;
2358
2359 SoLightModel *lm = new SoLightModel();
2360 lm->model=SoLightModel::BASE_COLOR;
2361
2362
2363 EMBCell::CELLPOS pos=EMBCell::FRONT;
2364 if (m_clockwork->pos==BACK) pos=EMBCell::BACK;
2365 if (m_clockwork->pos==CENTER) pos=EMBCell::CENTER;
2366
2367
2368 double r = element->getRLocal(pos);
2369 double phiMin = module.getPhiMin();
2370 double phiMax = module.getPhiMax();
2371 double etaMin = module.getEtaMin();
2372 double etaMax = module.getEtaMax();
2373 sep->addChild(white);
2374 sep->addChild(drawStyle);
2375 sep->addChild(lm);
2376
2377 if (modSet.find(&module)==modSet.end()) {
2378 modSet.insert(&module);
2379
2380
2381
2382 int cc=0;
2383 SoVertexProperty *vtxProperty = new SoVertexProperty();
2384 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMin)));
2385 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMax),r*sin(phiMax) ,r*sinh(etaMin)));
2386 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMax),r*sin(phiMax) ,r*sinh(etaMax)));
2387 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMax)));
2388 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(phiMin),r*sin(phiMin) ,r*sinh(etaMin)));
2389
2390 SoLineSet *ls = new SoLineSet();
2391 ls->numVertices=5;
2392 ls->vertexProperty=vtxProperty;
2393 sep->addChild(ls);
2394
2395 }
2396 {
2397 int cc=0;
2398 SoVertexProperty *vtxProperty = new SoVertexProperty();
2399 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(element->getElectrode(i).getPhi()),r*sin(element->getElectrode(i).getPhi()) ,r*sinh(etaMin)));
2400 vtxProperty->vertex.set1Value(cc++, SbVec3f(r*cos(element->getElectrode(i).getPhi()),r*sin(element->getElectrode(i).getPhi()) ,r*sinh(etaMax)));
2401
2402 SoLineSet *ls = new SoLineSet();
2403 ls->numVertices=2;
2404 ls->vertexProperty=vtxProperty;
2405
2406 sep->addChild(ls);
2407 }
2408
2409 m_clockwork->volatileSeparator->addChild(sep);
2410 }
2411 }
2412 }
2413 }
2414 }
2415 }
2416
2417 if (m_clockwork->ui.etaBoundariesCheckBox->isChecked()) {
2418 message(etaBoundaryStream.str().c_str());
2419 }
2420 if (m_clockwork->ui.phiBoundariesCheckBox->isChecked()) {
2421 message(phiBoundaryStream.str().c_str());
2422 }
2423 if (m_clockwork->ui.indicesCheckBox->isChecked()) {
2424 message(indexStream.str().c_str());
2425 }
2426#endif
2427}
Status
Athena specific StatusCode values.
std::pair< long int, long int > indices