ATLAS Offline Software
Loading...
Searching...
No Matches
VP1GeometrySystem Class Reference

#include <VP1GeometrySystem.h>

Inheritance diagram for VP1GeometrySystem:
Collaboration diagram for VP1GeometrySystem:

Classes

class  Imp

Public Types

typedef std::set< SoCamera * > CamList
typedef CamList::iterator CamListItr
enum  State { CONSTRUCTED =0 , REFRESHED , ERASED , UNCREATED }
enum  ActiveState { ON =0 , OFF }

Public Slots

void reiconizeToShowSpecificMuonChambers (const std::set< GeoPVConstLink > &)
void orientViewToMuonChamber (const GeoPVConstLink &chamberPV)
void setCurvedSurfaceRealism (int)
void muonChamberT0sChanged (const std::map< GeoPVConstLink, float > &, int)
 The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.

Signals

void appropriateMDTProjectionsChanged (int)
void plotSpectrum (QStack< QString > &, int copyNumber=-1)
void itemFromSystemSelected ()
void sysmessage (QString) const
void inactiveSystemTurnedActive ()
void needErase ()

Public Member Functions

 VP1GeometrySystem (const VP1GeoFlags::SubSystemFlags &SubSystemsTurnedOn=VP1GeoFlags::None, const QString &name="Geo")
virtual ~VP1GeometrySystem ()
void setGeometrySelectable (bool)
void setZoomToVolumeOnClick (bool)
void setOrientViewToMuonChambersOnClick (bool)
void setAutoAdaptMuonChambersToEventData (bool)
QWidget * buildController ()
void systemcreate (StoreGateSvc *detstore)
void buildPermanentSceneGraph (StoreGateSvc *detstore, SoSeparator *root)
void buildEventSceneGraph (StoreGateSvc *, SoSeparator *)
void userPickedNode (SoNode *pickedNode, SoPath *pickedPath)
void systemuncreate ()
QByteArray saveState ()
void restoreFromState (QByteArray)
void enableMuonChamberLabels (bool, bool)
 first is t0s, 2nd is hits
void ensureBuildController ()
void updateGUI ()
virtual void systemerase ()
void warnOnDisabledNotifications () const
void registerCamera (SoCamera *camera)
void registerViewer (SoQtViewer *viewer)
void registerSelectionNode (SoCooperativeSelection *)
void unregisterSelectionNode (SoCooperativeSelection *)
void setUserSelectionNotificationsEnabled (SoCooperativeSelection *sel, bool enabled)
virtual void userSelectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
virtual void userDeselectedSingleNode (SoCooperativeSelection *, SoNode *, SoPath *)
virtual void userChangedSelection (SoCooperativeSelection *, const QSet< SoNode * > &, QSet< SoPath * >)
virtual void userClickedOnBgd ()
virtual void deselectAll (SoCooperativeSelection *exception_sel=0)
CamList getCameraList ()
virtual QWidget * buildExtraDisplayWidget ()
const QString & name () const
const QString & information () const
const QString & contact_info () const
QWidget * controllerWidget ()
void message (const QString &) const
void message (const QStringList &, const QString &addtoend="") const
void message (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &) const
void messageDebug (const QStringList &, const QString &addtoend="") const
void messageDebug (const QString &addtostart, const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &) const
void messageVerbose (const QStringList &, const QString &addtoend="") const
void messageVerbose (const QString &addtostart, const QStringList &, const QString &addtoend="") const
StoreGateSvcstoreGate () const
StoreGateSvceventStore () const
StoreGateSvcdetectorStore () const
ISvcLocator * serviceLocator () const
IToolSvc * toolSvc () const
State state () const
ActiveState activeState () const

Static Public Member Functions

static bool verbose ()
static QString str (const QString &s)
static QString str (const char *c)
static QString str (const bool b)
static QString str (const QColor &)
static QString str (const SbColor &)
static QString str (const VP1Interval &)
static QString str (const SbVec2d &)
static QString str (const SbVec2f &)
static QString str (const SbVec2s &)
static QString str (const SbVec3d &)
static QString str (const SbVec3f &)
static QString str (const SbVec3s &)
static QString str (const SbVec4d &)
static QString str (const SbVec4f &)
static QString str (short int n)
static QString str (unsigned short int n)
static QString str (long n)
static QString str (ulong n)
static QString str (int n)
static QString str (uint n)
static QString str (qlonglong n)
static QString str (qulonglong n)
static QString str (const double &d)
static QString str (const float &f)
static QString str (const void *)
template<class T>
static QString str (const T *t)
template<class T>
static QString str (const QFlags< T > &f)
template<class T>
static QString str (const HepGeom::BasicVector3D< T > &t)
static QString str (const Amg::Vector3D &t)
template<class T>
static QString str (const QList< T > &t)

Protected Slots

void checkboxChanged ()
void updateTransparency ()
void adaptMuonChambersToEventData ()
void adaptMuonChambersStyleChanged ()
void emit_appropriateMDTProjectionsChanged ()
void autoAdaptPixelsOrSCT (bool, bool, bool, bool, bool, bool)
void autoAdaptMuonNSW (bool reset, bool stgc, bool mm, bool passiveSpacer, bool passiveStructure, bool passiveAPlate)
void autoAdaptHGTD (bool reset, bool flex, bool hybrid, bool glue, bool sensors, bool inactive, bool asic, bool supportPlate, bool frontCover, bool backCover, bool moderatorIn, bool moderatorOut, bool outerRCover, bool coolingLines)
void resetSubSystems (VP1GeoFlags::SubSystemFlags)
void autoExpandByVolumeOrMaterialName (bool, const QString &)
void autoIconifyByVolumeOrMaterialName (bool, const QString &)
void actionOnAllNonStandardVolumes (bool)
void volumeStateChangeRequested (VolumeHandle *, VP1GeoFlags::VOLSTATE)
void volumeResetRequested (VolumeHandle *)
void setShowVolumeOutLines (bool)
void saveMaterialsToFile (const QString &, bool)
void loadMaterialsFromFile (const QString &)
void setLabels (int)
void setLabelPosOffsets (const QList< int > &)

Protected Member Functions

void registerController (QWidget *)

Protected Attributes

Impm_d

Private Slots

void activateClickedOutside ()

Private Member Functions

SoSeparator * getSceneGraph () const
void create (StoreGateSvc *detstore)
void refresh (StoreGateSvc *storegate)
void erase ()
void uncreate ()
void disallowUpdateGUI ()
void allowUpdateGUI ()
void setChannel (IVP1ChannelWidget *)
IVP1ChannelWidgetchannel () const
void deleteController ()
void setState (const State &)
void setActiveState (const ActiveState &, const bool &donttriggererase=true)
bool isRefreshing ()
void setRefreshing (const bool &)
void setCanRegisterController (const bool &)

Static Private Attributes

static const bool s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")

Detailed Description

Definition at line 33 of file VP1GeometrySystem.h.

Member Typedef Documentation

◆ CamList

typedef std::set<SoCamera*> IVP13DSystem::CamList
inherited

Definition at line 90 of file IVP13DSystem.h.

◆ CamListItr

typedef CamList::iterator IVP13DSystem::CamListItr
inherited

Definition at line 91 of file IVP13DSystem.h.

Member Enumeration Documentation

◆ ActiveState

enum IVP1System::ActiveState
inherited
Enumerator
ON 
OFF 

Definition at line 144 of file IVP1System.h.

144{ ON=0, OFF };//Whether it is part of the erase/refresh cycle.

◆ State

enum IVP1System::State
inherited
Enumerator
CONSTRUCTED 
REFRESHED 
ERASED 
UNCREATED 

Definition at line 143 of file IVP1System.h.

Constructor & Destructor Documentation

◆ VP1GeometrySystem()

VP1GeometrySystem::VP1GeometrySystem ( const VP1GeoFlags::SubSystemFlags & SubSystemsTurnedOn = VP1GeoFlags::None,
const QString & name = "Geo" )

Definition at line 304 of file VP1GeometrySystem.cxx.

306 "This system displays the geometry as defined in the GeoModel tree.",
307 "Riccardo.Maria.Bianchi@cern.ch"),
308 m_d(new Imp(this,SubSystemsTurnedOn))
309{
310}
IVP13DSystemSimple(const QString &name, const QString &information, const QString &contact_info)
const QString & name() const

◆ ~VP1GeometrySystem()

VP1GeometrySystem::~VP1GeometrySystem ( )
virtual

Definition at line 329 of file VP1GeometrySystem.cxx.

330{
331 delete m_d;
332 m_d = 0;
333}

Member Function Documentation

◆ actionOnAllNonStandardVolumes

void VP1GeometrySystem::actionOnAllNonStandardVolumes ( bool zap)
protectedslot

Definition at line 2038 of file VP1GeometrySystem.cxx.

2039{
2041 messageVerbose("Action on volumes with non-standard VRML representations. Target state is "+VP1GeoFlags::toString(target));
2042
2043 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2044 m_d->volumetreemodel->getRootHandles(roothandles);
2046
2047 bool save = m_d->sceneroot->enableNotify(false);
2048 m_d->phisectormanager->largeChangesBegin();
2049
2050 deselectAll();
2051
2052 for (unsigned i = 0; i<roothandles.size();++i) {
2053 it = roothandles.at(i).first;
2054 itE = roothandles.at(i).second;
2055 for(;it!=itE;++it) {
2056 m_d->changeStateOfVisibleNonStandardVolumesRecursively(*it,target);
2057 }
2058 }
2059
2060 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2061 m_d->phisectormanager->largeChangesEnd();
2062 if (save) {
2063 m_d->sceneroot->enableNotify(true);
2064 m_d->sceneroot->touch();
2065 }
2066}
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
void messageVerbose(const QString &) const
static QString toString(const VOLSTATE &)
VolumeHandleList::iterator VolumeHandleListItr
save(self, fileName="./columbo.out")
Definition checkTP.py:176

◆ activateClickedOutside

void IVP13DSystem::activateClickedOutside ( )
privateslotinherited

Definition at line 85 of file IVP13DSystem.cxx.

86{
87 if (!m_d->clickedoutsideScheduled)
88 return;
89 m_d->clickedoutsideScheduled = false;
91}
virtual void userClickedOnBgd()

◆ activeState()

IVP1System::ActiveState IVP1System::activeState ( ) const
inherited

Definition at line 135 of file IVP1System.cxx.

136{
137 return m_d->activeState;
138}

◆ adaptMuonChambersStyleChanged

void VP1GeometrySystem::adaptMuonChambersStyleChanged ( )
protectedslot

Definition at line 1588 of file VP1GeometrySystem.cxx.

1589{
1590 //Make all chamber representations dirty:
1591 std::map<PVConstLink,VolumeHandle*>::iterator it, itE=m_d->muonchambers_pv2handles.end();
1592 for (it=m_d->muonchambers_pv2handles.begin();it!=itE;++it)
1593 it->second->setMuonChamberDirty(true);
1594
1595 //Adapt immediately if necessary:
1596 if (m_d->controller->autoAdaptMuonChambersToEventData())
1599}
void emit_appropriateMDTProjectionsChanged()

◆ adaptMuonChambersToEventData

void VP1GeometrySystem::adaptMuonChambersToEventData ( )
protectedslot

Definition at line 1550 of file VP1GeometrySystem.cxx.

1551{
1552 if (m_d->muonchambers_pv2handles.empty())
1553 return;
1554
1555 std::set<GeoPVConstLink> allchambers;
1556 if (!m_d->sender2ChamberList.empty()) {
1557 allchambers = (m_d->sender2ChamberList.begin())->second;
1558 std::map<QObject*,std::set<GeoPVConstLink> >::iterator itLists,itListsE(m_d->sender2ChamberList.end());
1559 for (itLists = m_d->sender2ChamberList.begin(),++itLists;itLists != itListsE;++itLists) {
1560 allchambers.insert(itLists->second.begin(),itLists->second.end());
1561 }
1562 }
1563
1564 //Idea: Maybe just iconise them all and then selectively deiconise the few? Then we can avoid most searches!
1565 bool save = m_d->sceneroot->enableNotify(false);
1566 m_d->phisectormanager->largeChangesBegin();
1567
1568 deselectAll();
1569 std::map<PVConstLink,VolumeHandle*>::iterator it, itE=m_d->muonchambers_pv2handles.end();
1570 std::set<GeoPVConstLink>::iterator itchambersE = allchambers.end();
1571 for (it=m_d->muonchambers_pv2handles.begin();it!=itE;++it) {
1572 if (allchambers.find(it->first)==itchambersE)
1573 it->second->setState(VP1GeoFlags::ZAPPED);
1574 else {
1575 if (it->second->muonChamberDirty())
1576 m_d->updateTouchedMuonChamber(it->second);
1577 }
1578 }
1579 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
1580 m_d->phisectormanager->largeChangesEnd();
1581 if (save) {
1582 m_d->sceneroot->enableNotify(true);
1583 m_d->sceneroot->touch();
1584 }
1585}

◆ allowUpdateGUI()

void IVP1System::allowUpdateGUI ( )
privateinherited

Definition at line 256 of file IVP1System.cxx.

257{
258 m_d->allowupdategui=true;
259}

◆ appropriateMDTProjectionsChanged

void VP1GeometrySystem::appropriateMDTProjectionsChanged ( int )
signal

◆ autoAdaptHGTD

void VP1GeometrySystem::autoAdaptHGTD ( bool reset,
bool flex,
bool hybrid,
bool glue,
bool sensors,
bool inactive,
bool asic,
bool supportPlate,
bool frontCover,
bool backCover,
bool moderatorIn,
bool moderatorOut,
bool outerRCover,
bool coolingLines )
protectedslot

Definition at line 2453 of file VP1GeometrySystem.cxx.

2454{
2455 VP1Msg::messageDebug("VP1GeometrySystem::autoAdaptHGTD()");
2456
2457 #ifndef BUILDVP1LIGHT
2459 return;
2460 #endif
2461
2462 if( reset )
2463 VP1Msg::messageDebug("resetting to full HGTD...");
2464
2466
2468 //Find subsystem:
2469 Imp::SubSystemInfo* subsys(0);
2470 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
2471 if (si->flag == subSysFlag) {
2472 subsys = si;
2473 break;
2474 }
2475 }
2476 if (!subsys) {
2477 message("autoAdaptHGTD Error: Could not find subsystem");
2478 return;
2479 }
2480
2482 //Abort if corresponding subsystem is not built:
2483 if (!subsys->isbuilt) {
2484 VP1Msg::messageDebug("autoAdaptHGTD: Aborting since subsystem geometry not built yet");
2485 return;
2486 }
2487
2488 bool save = m_d->sceneroot->enableNotify(false);
2489 m_d->phisectormanager->largeChangesBegin();
2490
2491 for (VolumeHandle* volume : subsys->vollist) {
2492 if (reset) {
2493 volume->reset();
2495 } else {
2497 handles.push_back(volume);
2498
2499 for (unsigned i = 0; i < handles.size(); ++i) {
2500 handles.at(i)->initialiseChildren();
2501 for (VolumeHandle* child : std::ranges::subrange(
2502 handles.at(i)->childrenBegin(), handles.at(i)->childrenEnd()))
2503 handles.push_back(child);
2504 }
2505
2506 for (VolumeHandle* handle : handles)
2507 handle->setState(VP1GeoFlags::ZAPPED);
2508
2509 bool unzap(false);
2510 for (VolumeHandle* handle : handles) {
2511 const QString name = handle->getName();
2512 bool selected(false);
2513 if (flex && (name=="HGTDFlexPackage" || name.startsWith("HGTDFlexTube"))) {
2514 selected = true;
2515 } else if (hybrid && name=="HGTDHybrid") {
2516 selected = true;
2517 } else if (glue && (name=="HGTDGlueSensor" || name=="HGTDGlueAsic")) {
2518 selected = true;
2519 } else if (sensors && name.startsWith("HGTDSiSensor")) {
2520 selected = true;
2521 } else if (inactive && name=="HGTDLGADInactive") {
2522 selected = true;
2523 } else if (asic && name=="HGTDASIC") {
2524 selected = true;
2525 } else if (supportPlate && name=="HGTDSupportPlate") {
2526 selected = true;
2527 } else if (frontCover && name=="HGTDFrontCover") {
2528 selected = true;
2529 } else if (backCover && name=="HGTDBackCover") {
2530 selected = true;
2531 } else if (moderatorIn && name=="HGTDModeratorIn") {
2532 selected = true;
2533 } else if (moderatorOut && name=="HGTDModeratorOut") {
2534 selected = true;
2535 } else if (outerRCover && name=="HGTDOuterRCover") {
2536 selected = true;
2537 } else if (coolingLines && name=="HGTDPeripheralCoolingLines") {
2538 selected = true;
2539 }
2540
2541 if (selected) {
2542 unzap = true;
2544 VolumeHandle* parent = handle->parent();
2545 while (parent) {
2546 parent->setState(VP1GeoFlags::EXPANDED);
2547 parent = parent->parent();
2548 }
2549 }
2550 }
2551 if (!unzap)
2553 }
2554 }
2555
2556 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2557 m_d->phisectormanager->largeChangesEnd();
2558
2559 if (save) {
2560 m_d->sceneroot->enableNotify(true);
2561 m_d->sceneroot->touch();
2562 }
2563}
void message(const QString &) const
static bool hasHGTDGeometry()
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
void setState(const VP1GeoFlags::VOLSTATE &state)
std::vector< VolumeHandle * > VolumeHandleList
virtual void handle(const Incident &inc)
Handle end of run incidents to save the metadata at that point.

◆ autoAdaptMuonNSW

void VP1GeometrySystem::autoAdaptMuonNSW ( bool reset,
bool stgc,
bool mm,
bool passiveSpacer,
bool passiveStructure,
bool passiveAPlate )
protectedslot

Definition at line 2366 of file VP1GeometrySystem.cxx.

2367{
2368 VP1Msg::messageDebug("VP1GeometrySystem::autoAdaptMuonNSW()");
2369
2370 #ifndef BUILDVP1LIGHT
2371 // return if Muon and MuonNSW are not configured/present/ON
2373 return;
2374 #endif
2375
2376 if( reset )
2377 VP1Msg::messageDebug("resetting to full NSW...");
2378
2380
2382 //Find subsystem:
2383 Imp::SubSystemInfo* subsys(0);
2384 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
2385 if (si->flag == subSysFlag) {
2386 subsys = si;
2387 break;
2388 }
2389 }
2390 if (!subsys) {
2391 message("autoAdaptMuonNSW Error: Could not find subsystem");
2392 return;
2393 }
2394
2395
2397 //Abort if corresponding subsystem is not built:
2398 if (!subsys->isbuilt) {
2399 VP1Msg::messageDebug("autoAdaptMuonNSW: Aborting since subsystem geometry not built yet");
2400 return;//Disabling now due to phi-sector problems if "click some phi sectors"->"adapt pixel"->"turn on pixel"
2401 }
2402 bool save = m_d->sceneroot->enableNotify(false);
2403 m_d->phisectormanager->largeChangesBegin();
2404
2405 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
2406
2407 // loop over first level children (i.e., 'NewSmallWheel')
2408 for (;it!=itE;++it) {
2409
2410 (*it)->initialiseChildren();
2411 (*it)->setState(VP1GeoFlags::CONTRACTED);
2412 VolumeHandle::VolumeHandleListItr itChl((*it)->childrenBegin()),itChlE((*it)->childrenEnd());
2413
2414 // loop over second level children (i.e., 'NSW_sTGC', 'NSW_MM')
2415 for (;itChl!=itChlE;++itChl) {
2416
2417 bool unzap( reset? true : false );
2418
2419 if ( !reset ) {
2420 (*itChl)->setState(VP1GeoFlags::ZAPPED);
2421 if ( (stgc) && (*itChl)->hasName("NSW_sTGC") ) {
2422 unzap = true;
2423 //m_d->showPixelModules(*itChl);
2424 } else if ( (mm) && (*itChl)->hasName("NSW_MM") ) {
2425 unzap = true;
2426 //m_d->showPixelModules(*itChl);
2427 } else if ( (passiveSpacer) && (*itChl)->hasName("NSW_Spacer") ) {
2428 unzap = true;
2429 } else if ( (passiveStructure) && (*itChl)->hasName("NSW_Aluminum_Structure_and_HUB") ) {
2430 unzap = true;
2431 } else if ( (passiveAPlate) && (*itChl)->hasName("A_Plate") ) {
2432 unzap = true;
2433 }
2434 }
2435 if (unzap) {
2436 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2437 }
2438 }
2439 (*it)->setState(VP1GeoFlags::EXPANDED);
2440 }
2441
2442 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2443 m_d->phisectormanager->largeChangesEnd();
2444
2445 if (save) {
2446 m_d->sceneroot->enableNotify(true);
2447 m_d->sceneroot->touch();
2448 }
2449}
@ MuonEndcapStationNSW
Definition VP1GeoFlags.h:65
static bool hasMuonNSWGeometry()
static bool hasMuonGeometry()

◆ autoAdaptPixelsOrSCT

void VP1GeometrySystem::autoAdaptPixelsOrSCT ( bool pixel,
bool brl,
bool ecA,
bool ecC,
bool bcmA,
bool bcmC )
protectedslot

Definition at line 2258 of file VP1GeometrySystem.cxx.

2259{
2260 #ifndef BUILDVP1LIGHT
2262 return;
2263 #endif
2264 //VP1GeoFlags::SubSystemFlag subSysFlag( pixel ? VP1GeoFlags::Pixel : VP1GeoFlags::SCT );
2266
2267 bool bcm(bcmA||bcmC);
2268 bool ec(ecA||ecC);
2269
2271 //Find subsystem:
2272 Imp::SubSystemInfo* subsys(0);
2273 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
2274 if (si->flag == subSysFlag) {
2275 subsys = si;
2276 break;
2277 }
2278 }
2279 if (!subsys) {
2280 message("AutoAdaptPixelsOrSCT Error: Could not find subsystem");
2281 return;
2282 }
2283
2284
2286 //Abort if corresponding subsystem is not built:
2287 if (!subsys->isbuilt) {
2288 VP1Msg::messageDebug("AutoAdaptPixelsOrSCT: Aborting since subsystem geometry not built yet");
2289 return;//Disabling now due to phi-sector problems if "click some phi sectors"->"adapt pixel"->"turn on pixel"
2290 }
2291 bool save = m_d->sceneroot->enableNotify(false);
2292 m_d->phisectormanager->largeChangesBegin();
2293 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
2294
2295 if (pixel) {
2296 // --> Pixel
2297 for (;it!=itE;++it) {
2298 (*it)->initialiseChildren();
2299 (*it)->setState(VP1GeoFlags::CONTRACTED);
2300 VolumeHandle::VolumeHandleListItr itChl((*it)->childrenBegin()),itChlE((*it)->childrenEnd());
2301 for (;itChl!=itChlE;++itChl) {
2302 bool unzap(false);
2303 (*itChl)->setState(VP1GeoFlags::ZAPPED);
2305 if (brl&&(*itChl)->hasName("barrelLog")) {
2306 unzap = true;
2307 m_d->showPixelModules(*itChl);
2308 } else if ((ec)&&(*itChl)->hasName("EndCapLog")) {
2309 if (((*itChl)->isPositiveZ()?ecA:ecC)) {
2310 m_d->showPixelModules(*itChl);
2311 unzap = true;
2312 }
2313 } else if (bcm&&(*itChl)->hasName("bcmModLog")) {
2314 if (((*itChl)->isPositiveZ()?bcmA:bcmC)) {
2315 (*itChl)->reset();
2316 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2317 }
2318 }
2319 } else {
2320 if ((*itChl)->hasName("ITkPixelDetector")) {
2321 m_d->showITkPixelModules(*itChl, brl, ecA, ecC);
2322 unzap = true;
2323 }
2324 }
2325 if (unzap)
2326 (*itChl)->setState(VP1GeoFlags::EXPANDED);
2327 }
2328 (*it)->setState(VP1GeoFlags::EXPANDED);
2329 }
2330 } else {
2331 // --> SCT
2332 for (;it!=itE;++it) {
2333 (*it)->initialiseChildren();
2334 (*it)->setState(VP1GeoFlags::CONTRACTED);
2335 bool unzap(false);
2336 (*it)->setState(VP1GeoFlags::ZAPPED);
2338 if (brl&&(*it)->hasName("SCT_Barrel")) {
2339 unzap = true;
2340 m_d->showSCTBarrelModules(*it);
2341 } else if (ecA&&(*it)->hasName("SCT_ForwardA")) {
2342 unzap = true;
2343 m_d->showSCTEndcapModules(*it);
2344 } else if (ecC&&(*it)->hasName("SCT_ForwardC")) {
2345 unzap = true;
2346 m_d->showSCTEndcapModules(*it);
2347 }
2348 } else {
2349 m_d->showITkStripModules(*it, brl, ecA, ecC);
2350 unzap=true;
2351 }
2352 if (unzap)
2353 (*it)->setState(VP1GeoFlags::EXPANDED);
2354 }
2355 }
2356 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2357 m_d->phisectormanager->largeChangesEnd();
2358 if (save) {
2359 m_d->sceneroot->enableNotify(true);
2360 m_d->sceneroot->touch();
2361 }
2362}
static bool hasPixelGeometry()
static bool hasSCTGeometry()
static bool hasITkGeometry()

◆ autoExpandByVolumeOrMaterialName

void VP1GeometrySystem::autoExpandByVolumeOrMaterialName ( bool bymatname,
const QString & targetname )
protectedslot

Definition at line 2069 of file VP1GeometrySystem.cxx.

2070{
2071 if (targetname.isEmpty()) {
2072 VP1Msg::messageDebug("targetname is empty.");
2073 return;
2074 }
2075
2076 messageVerbose("Auto expansions of visible volumes requested. Target all volumes with "
2077 +str(bymatname?"material name":"name")+" matching "+targetname);
2078
2079 QRegExp selregexp(targetname,Qt::CaseSensitive,QRegExp::Wildcard);
2080
2081 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2082 m_d->volumetreemodel->getRootHandles(roothandles);
2084
2085 bool save = m_d->sceneroot->enableNotify(false);
2086 m_d->phisectormanager->largeChangesBegin();
2087
2088 deselectAll();
2089
2090 for (unsigned i = 0; i<roothandles.size();++i) {
2091 it = roothandles.at(i).first;
2092 itE = roothandles.at(i).second;
2093 for(;it!=itE;++it)
2094 m_d->expandVisibleVolumesRecursively(*it,selregexp,bymatname);
2095 }
2096
2097 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2098 m_d->phisectormanager->largeChangesEnd();
2099 if (save) {
2100 m_d->sceneroot->enableNotify(true);
2101 m_d->sceneroot->touch();
2102 }
2103}
static QString str(const QString &s)
Definition VP1String.h:49

◆ autoIconifyByVolumeOrMaterialName

void VP1GeometrySystem::autoIconifyByVolumeOrMaterialName ( bool bymatname,
const QString & targetname )
protectedslot

Definition at line 2149 of file VP1GeometrySystem.cxx.

2150{
2151 if (targetname.isEmpty()) {
2152 VP1Msg::messageDebug("targetname is empty.");
2153 return;
2154 }
2155
2156 messageVerbose("Auto iconification/zapping of visible volumes requested. Target all volumes with "
2157 +str(bymatname?"material name":"name")+" matching "+targetname);
2158
2159 QRegExp selregexp(targetname,Qt::CaseSensitive,QRegExp::Wildcard);
2160
2161 std::vector<std::pair<VolumeHandle::VolumeHandleListItr,VolumeHandle::VolumeHandleListItr> > roothandles;
2162 m_d->volumetreemodel->getRootHandles(roothandles);
2164
2165 bool save = m_d->sceneroot->enableNotify(false);
2166 m_d->phisectormanager->largeChangesBegin();
2167
2168 deselectAll();
2169
2170 for (unsigned i = 0; i<roothandles.size();++i) {
2171 it = roothandles.at(i).first;
2172 itE = roothandles.at(i).second;
2173 for(;it!=itE;++it)
2174 m_d->iconifyVisibleVolumesRecursively(*it,selregexp,bymatname);
2175 }
2176
2177 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2178 m_d->phisectormanager->largeChangesEnd();
2179 if (save) {
2180 m_d->sceneroot->enableNotify(true);
2181 m_d->sceneroot->touch();
2182 }
2183}

◆ buildController()

QWidget * VP1GeometrySystem::buildController ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 385 of file VP1GeometrySystem.cxx.

386{
387 message("VP1GeometrySystem::buildController");
388
389 m_d->controller = new GeoSysController(this);
390
391 m_d->phisectormanager = new PhiSectorManager(m_d->controller->phiSectionWidget(),this,this);
392
393
394 connect(m_d->controller,SIGNAL(showVolumeOutLinesChanged(bool)),this,SLOT(setShowVolumeOutLines(bool)));
395 setShowVolumeOutLines(m_d->controller->showVolumeOutLines());
396 connect(m_d->controller,SIGNAL(saveMaterialsToFile(QString,bool)),this,SLOT(saveMaterialsToFile(QString,bool)));
397 connect(m_d->controller,SIGNAL(loadMaterialsFromFile(QString)),this,SLOT(loadMaterialsFromFile(QString)));
398
399 connect(m_d->controller,SIGNAL(transparencyChanged(float)),this,SLOT(updateTransparency()));
400 connect (m_d->controller,SIGNAL(volumeStateChangeRequested(VolumeHandle*,VP1GeoFlags::VOLSTATE)),
401 this,SLOT(volumeStateChangeRequested(VolumeHandle*,VP1GeoFlags::VOLSTATE)));
402 connect (m_d->controller,SIGNAL(volumeResetRequested(VolumeHandle*)),
403 this,SLOT(volumeResetRequested(VolumeHandle*)));
404 connect(m_d->controller,SIGNAL(adaptMuonChambersToEventData()),this,SLOT(adaptMuonChambersToEventData()));
405 connect(m_d->controller,SIGNAL(muonChamberAdaptionStyleChanged(VP1GeoFlags::MuonChamberAdaptionStyleFlags)),
406 this,SLOT(adaptMuonChambersStyleChanged()));
407 connect(m_d->controller,SIGNAL(autoExpandByVolumeOrMaterialName(bool,QString)),this,SLOT(autoExpandByVolumeOrMaterialName(bool,QString)));
408 connect(m_d->controller,SIGNAL(autoIconifyByVolumeOrMaterialName(bool,QString)),this,SLOT(autoIconifyByVolumeOrMaterialName(bool,QString)));
409 connect(m_d->controller,SIGNAL(actionOnAllNonStandardVolumes(bool)),this,SLOT(actionOnAllNonStandardVolumes(bool)));
410 connect(m_d->controller,SIGNAL(autoAdaptPixelsOrSCT(bool,bool,bool,bool,bool,bool)),this,SLOT(autoAdaptPixelsOrSCT(bool,bool,bool,bool,bool,bool)));
411 connect(m_d->controller,SIGNAL(autoAdaptMuonNSW(bool,bool,bool,bool,bool,bool)),this,SLOT(autoAdaptMuonNSW(bool, bool,bool,bool,bool,bool)));
412 connect(m_d->controller,SIGNAL(autoAdaptHGTD(bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool)),this,SLOT(autoAdaptHGTD(bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool)));
413 connect(m_d->controller,SIGNAL(resetSubSystems(VP1GeoFlags::SubSystemFlags)),this,SLOT(resetSubSystems(VP1GeoFlags::SubSystemFlags)));
414
415 connect(m_d->controller,SIGNAL(labelsChanged(int)),this,SLOT(setLabels(int)));
416 connect(m_d->controller,SIGNAL(labelPosOffsetChanged(QList<int>)),this,SLOT(setLabelPosOffsets(QList<int>)));
417 setLabels(m_d->controller->labels());
418
419
420 /* This is where we define the available different subsystems and their location in the geomodel tree.
421 *
422 * if the reg expr does not match any volume, the corresponding subsystem checkbox in the Geo GUI gets disabled.
423 *
424 * syntax: addSubSystem(VP1GeoFlags::SubSystemFlag&, // the associated system flag
425 QString& treetopregexp, // the regular expr for the top/root name of the main sub-detector system
426 QString& childrenregexp="", // the reg expr for the children of the main sub-detector
427 std::string& matname="", // a name we choose for displaying in VP1
428 bool negatetreetopregexp = false, // if we want to negate the top reg expr
429 bool negatechildrenregexp = false); // if we want to negate the children reg expr
430 const QString& grandchildrenregexp="", // the regex for granchildren of the main sub-detector
431 bool negategrandchildrenregexp = false // wheter we want to negate teh granchildren regex
432 */
433
435 m_d->addSubSystem( VP1GeoFlags::ITkPixel,"ITkPixel", "", "ITkPixel");
436 m_d->addSubSystem( VP1GeoFlags::ITkStrip,"ITkStrip", "", "ITkStrip");
437 } else {
438 m_d->addSubSystem( VP1GeoFlags::Pixel,"Pixel");
439 m_d->addSubSystem( VP1GeoFlags::SCT,"SCT");
440 m_d->addSubSystem( VP1GeoFlags::TRT,"TRT");
441 }
443 m_d->addSubSystem(VP1GeoFlags::HGTD, "HGTD", "", "HGTD");
444 }
445 m_d->addSubSystem( VP1GeoFlags::InDetServMat,"InDetServMat");
446 m_d->addSubSystem( VP1GeoFlags::LAr, ".*LAr.*");
447 m_d->addSubSystem( VP1GeoFlags::Tile,"Tile");
448 m_d->addSubSystem( VP1GeoFlags::CavernInfra,"CavernInfra");
449 m_d->addSubSystem( VP1GeoFlags::BeamPipe,"BeamPipe");
450 m_d->addSubSystem( VP1GeoFlags::LUCID,".*Lucid.*");
451 m_d->addSubSystem( VP1GeoFlags::ZDC,".*ZDC.*");
452 m_d->addSubSystem( VP1GeoFlags::ALFA,".*ALFA.*");
453 m_d->addSubSystem( VP1GeoFlags::AFP,".*AFP.*");
454 m_d->addSubSystem( VP1GeoFlags::ForwardRegion,".*ForwardRegion.*");
455
456 //The muon systems require special treatment, since we want to
457 //cherrypick below the treetop (this is the main reason for a lot
458 //of the ugly stuff in this class):
459 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationCSC,"Muon","CS.*","CSC");
460 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationTGC,"Muon","T(1|2|3|4).*","TGC");
461 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationMDT,"Muon","(EI|EM|EO|EE).*","EndcapMdt");
462 m_d->addSubSystem( VP1GeoFlags::MuonEndcapStationNSW,"Muon",".*ANON.*","MuonNSW",false, false, "NewSmallWheel.*");
463
464 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationInner,"Muon","(BI|BEE).*","BarrelInner");
465 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationMiddle,"Muon","BM.*","BarrelMiddle");
466 m_d->addSubSystem( VP1GeoFlags::MuonBarrelStationOuter,"Muon","BO.*","BarrelOuter");
467
468 //This last one is even more horrible. We want everything from the Muon treetop that is NOT included elsewhere:
469// m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","Muon",false,true);
470
471 // Toroid
472 m_d->addSubSystem( VP1GeoFlags::BarrelToroid,"Muon",".*ANON.*","BarrelToroid", false, false, "BAR_Toroid.*");
473 m_d->addSubSystem( VP1GeoFlags::ToroidECA,"Muon",".*ANON.*","ToroidECA", false, false, "ECT_Toroids.*");
474// m_d->addSubSystem( VP1GeoFlags::ToroidECC,"Muon",".*ANON.*","ToroidECC", false, false, "ECT_Toroids");
475
476 // Muon Feet
477 m_d->addSubSystem( VP1GeoFlags::MuonFeet,"Muon",".*ANON.*","MuonFeet", false, false, "Feet.*");
478
479 // Muon shielding
480 m_d->addSubSystem( VP1GeoFlags::MuonShielding,"Muon",".*ANON.*","Shielding", false, false, "(JDSH|JTSH|JFSH).*");
481
482
483 // All muon stuff --> this will be linked to the "Services" checkbox in the GUI
484 // m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","MuonEtc",false,true);
485 m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon",".*(CS|T1|T2|T3|T4|EI|EM|EO|EE|BI|BEE|BM|BO).*","MuonEtc",false,true,"(ECT_Toroids|BAR_Toroid|Feet|NewSmallWheel|JDSH|JTSH|JFSH).*",true);
486
487 // m_d->addSubSystem( VP1GeoFlags::MuonToroidsEtc,"Muon","*.Feet.*","MuonEtc");
488
489 //This one MUST be added last. It will get slightly special treatment in various places!
490 m_d->addSubSystem( VP1GeoFlags::AllUnrecognisedVolumes,".*");
491
492
493 //Setup models/views for volume tree browser and zapped volumes list:
494 m_d->volumetreemodel = new VolumeTreeModel(m_d->controller->volumeTreeBrowser());
495 m_d->controller->volumeTreeBrowser()->header()->hide();
496 m_d->controller->volumeTreeBrowser()->uniformRowHeights();
497 m_d->controller->volumeTreeBrowser()->setModel(m_d->volumetreemodel);
498
499 return m_d->controller;
500}
@ MuonEndcapStationTGC
Definition VP1GeoFlags.h:47
@ AllUnrecognisedVolumes
Definition VP1GeoFlags.h:73
@ MuonBarrelStationInner
Definition VP1GeoFlags.h:42
@ MuonBarrelStationMiddle
Definition VP1GeoFlags.h:44
@ MuonBarrelStationOuter
Definition VP1GeoFlags.h:45
@ MuonEndcapStationCSC
Definition VP1GeoFlags.h:46
@ MuonEndcapStationMDT
Definition VP1GeoFlags.h:49
void loadMaterialsFromFile(const QString &)
void autoAdaptMuonNSW(bool reset, bool stgc, bool mm, bool passiveSpacer, bool passiveStructure, bool passiveAPlate)
void resetSubSystems(VP1GeoFlags::SubSystemFlags)
void autoIconifyByVolumeOrMaterialName(bool, const QString &)
void volumeResetRequested(VolumeHandle *)
void autoAdaptPixelsOrSCT(bool, bool, bool, bool, bool, bool)
void autoAdaptHGTD(bool reset, bool flex, bool hybrid, bool glue, bool sensors, bool inactive, bool asic, bool supportPlate, bool frontCover, bool backCover, bool moderatorIn, bool moderatorOut, bool outerRCover, bool coolingLines)
void volumeStateChangeRequested(VolumeHandle *, VP1GeoFlags::VOLSTATE)
void setLabelPosOffsets(const QList< int > &)
void autoExpandByVolumeOrMaterialName(bool, const QString &)
void actionOnAllNonStandardVolumes(bool)
void saveMaterialsToFile(const QString &, bool)

◆ buildEventSceneGraph()

void VP1GeometrySystem::buildEventSceneGraph ( StoreGateSvc * ,
SoSeparator *  )
inlinevirtual

Implements IVP13DSystemSimple.

Definition at line 55 of file VP1GeometrySystem.h.

55{}

◆ buildExtraDisplayWidget()

virtual QWidget * IVP13DSystem::buildExtraDisplayWidget ( )
inlinevirtualinherited

Definition at line 106 of file IVP13DSystem.h.

106{ return 0; }

◆ buildPermanentSceneGraph()

void VP1GeometrySystem::buildPermanentSceneGraph ( StoreGateSvc * detstore,
SoSeparator * root )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 517 of file VP1GeometrySystem.cxx.

518{
519 m_d->sceneroot = root;
520
521 #ifndef BUILDVP1LIGHT
523 message("Error: GeoModel not configured properly in job.");
524 return;
525 }
526
527 //Get the world volume:
528 const GeoModelExperiment * theExpt;
529 if (!VP1SGAccessHelper(this,true).retrieve(theExpt,"ATLAS")) {
530 message("Error: Could not retrieve the ATLAS GeoModelExperiment from detector store");
531 return;
532 }
533 #endif
534
535 #ifdef BUILDVP1LIGHT
536 GeoModelExperiment* theExpt = m_d->getGeometry();
537 #endif
538 PVConstLink world(theExpt->getPhysVol());
539
540 if (!m_d->m_textSep) {
541 // FIXME!
542 // std::cout<<"Making new Text sep"<<std::endl;
543 m_d->m_textSep = new SoSeparator;
544 m_d->m_textSep->setName("TextSep");
545 m_d->m_textSep->ref();
546 }
547 m_d->sceneroot->addChild(m_d->m_textSep);
548
549 // FIXME - what if font is missing?
550 SoFont *myFont = new SoFont;
551 myFont->name.setValue("Arial");
552 myFont->size.setValue(12.0);
553 m_d->m_textSep->addChild(myFont);
554
555 bool save = root->enableNotify(false);
556
557 //Catch keyboard events:
558 SoEventCallback *catchEvents = new SoEventCallback();
559 catchEvents->addEventCallback(SoKeyboardEvent::getClassTypeId(),Imp::catchKbdState, m_d);
560 root->addChild(catchEvents);
561
562 root->addChild(m_d->controller->drawOptions());
563 root->addChild(m_d->controller->pickStyle());
564
565 if(VP1Msg::debug()){
566 qDebug() << "Configuring the default systems... - subsysInfoList len:" << (m_d->subsysInfoList).length();
567 }
568 // we switch on the systems flagged to be turned on at start
569 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList)
570 {
571 VP1Msg::messageDebug("Switching on this system: " + QString::fromStdString(subsys->matname) + " - " + subsys->flag);
572 bool on(m_d->initialSubSystemsTurnedOn & subsys->flag);
573 subsys->checkbox->setChecked( on );
574 subsys->checkbox->setEnabled(false);
575 subsys->checkbox->setToolTip("This sub-system is not available");
576 connect(subsys->checkbox,SIGNAL(toggled(bool)),this,SLOT(checkboxChanged()));
577 }
578
579 //Locate geometry info for the various subsystems, and add the info as appropriate:
580
581 QCheckBox * checkBoxOther = m_d->controller->subSystemCheckBox(VP1GeoFlags::AllUnrecognisedVolumes);
582
583 if(VP1Msg::debug()){
584 qDebug() << "Looping on volumes from the input GeoModel...";
585 }
586 GeoVolumeCursor av(world);
587 while (!av.atEnd()) {
588
589 std::string name = av.getName();
590 if(VP1Msg::debug()){
591 qDebug() << "volume name:" << QString::fromStdString(name);
592 }
593
594 // DEBUG
595 VP1Msg::messageDebug("DEBUG: Found GeoModel treetop: "+QString(name.c_str()));
596
597 //Let us see if we recognize this volume:
598 bool found = false;
599 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
600 if (subsys->negatetreetopregexp!=subsys->geomodeltreetopregexp.exactMatch(name.c_str()))
601 {
602 if (subsys->checkbox==checkBoxOther&&found) {
603 continue;//The "other" subsystem has a wildcard which matches everything - but we only want stuff that is nowhere else.
604 }
605
606 if(VP1Msg::debug()){
607 qDebug() << (subsys->geomodeltreetopregexp).pattern() << subsys->geomodeltreetopregexp.exactMatch(name.c_str()) << subsys->negatetreetopregexp;
608 qDebug() << "setting 'found' to TRUE for pattern:" << (subsys->geomodeltreetopregexp).pattern();
609 }
610 found = true;
611 //We did... now, time to extract info:
612 subsys->treetopinfo.resize(subsys->treetopinfo.size()+1);
613 subsys->treetopinfo.back().pV = av.getVolume();
614 subsys->treetopinfo.back().xf = Amg::EigenTransformToCLHEP(av.getTransform());
615 subsys->treetopinfo.back().volname = av.getName();
616
617 //Add a switch for this system (turned off for now):
618 SoSwitch * sw = new SoSwitch();
619 //But add a separator on top of it (for caching):
620 subsys->soswitch = sw;
621 if (sw->whichChild.getValue() != SO_SWITCH_NONE)
622 sw->whichChild = SO_SWITCH_NONE;
623 SoSeparator * sep = new SoSeparator;
624 sep->addChild(sw);
625 root->addChild(sep);
626 //Enable the corresponding checkbox:
627 subsys->checkbox->setEnabled(true);
628 subsys->checkbox->setToolTip("Toggle the display of the "+subsys->checkbox->text()+" sub system");
629 //NB: Dont break here - several systems might share same treetop!
630 // break;
631 }
632 }
633 if (!found) {
634 message("Warning: Found unexpected GeoModel treetop: "+QString(name.c_str()));
635 }
636
637 av.next(); // increment volume cursor.
638 }
639
640 //Hide other cb if not needed:
641 if (!checkBoxOther->isEnabled())
642 checkBoxOther->setVisible(false);
643
644 //Build the geometry for those (available) subsystems that starts out being turned on:
645 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
646 if (!subsys->soswitch||!subsys->checkbox->isChecked())
647 continue;
648 m_d->buildSystem(subsys);
649 //Enable in 3D view:
650 if (subsys->soswitch->whichChild.getValue() != SO_SWITCH_ALL)
651 subsys->soswitch->whichChild = SO_SWITCH_ALL;
652 //Enable in tree browser:
653 m_d->volumetreemodel->enableSubSystem(subsys->flag);
654 // new ModelTest(m_d->volumetreemodel, m_d->treeView_volumebrowser);
655 }
656 if (!m_d->restoredTopvolstates.isEmpty()) {
657 m_d->applyTopVolStates(m_d->restoredTopvolstates,false);
658 m_d->restoredTopvolstates.clear();
659 }
660 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
661 root->enableNotify(save);
662 if (save)
663 root->touch();
664
665
666 if (m_d->controller->autoAdaptMuonChambersToEventData())
668
669 //To ensure we emit it once upon startup:
670 QTimer::singleShot(0, this, SLOT(emit_appropriateMDTProjectionsChanged()));
671}
double length(const pvec &v)
GeoPhysVol * getPhysVol()
Destructor.
static void catchKbdState(void *userData, SoEventCallback *CB)
static bool hasGeoModelExperiment()
static bool debug()
Definition VP1Msg.h:32
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.

◆ channel()

IVP1ChannelWidget * IVP1System::channel ( ) const
privateinherited

Definition at line 275 of file IVP1System.cxx.

276{
277 if (VP1Msg::verbose()&&!m_d->channel){
278 messageVerbose("WARNING channel() returning NULL");
279 }
280 assert(m_d->channel);
281 return m_d->channel;
282}
static bool verbose()
Definition VP1Msg.h:31

◆ checkboxChanged

void VP1GeometrySystem::checkboxChanged ( )
protectedslot

Definition at line 779 of file VP1GeometrySystem.cxx.

780{
781 QCheckBox * cb = static_cast<QCheckBox*>(sender());
782 Imp::SubSystemInfo * subsys(0);
783 for (Imp::SubSystemInfo * ss : m_d->subsysInfoList) {
784 if (cb==ss->checkbox) {
785 subsys=ss;
786 break;
787 }
788 }
789 if (!subsys) {
790 message("ERROR: Unknown checkbox");
791 return;
792 }
793
794 SoSwitch * sw = subsys->soswitch;
795 assert(sw);
796 if (cb->isChecked()) {
797 SbBool save = sw->enableNotify(false);
798 if (sw->getNumChildren()==0) {
799 m_d->buildSystem(subsys);
800 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();//
801 }
802 if (sw->whichChild.getValue() != SO_SWITCH_ALL)
803 sw->whichChild = SO_SWITCH_ALL;
804 sw->enableNotify(save);
805 //Enable in tree browser:
806 m_d->volumetreemodel->enableSubSystem(subsys->flag);
807 // new ModelTest(m_d->volumetreemodel, m_d->treeView_volumebrowser);
808 if (save)
809 sw->touch();
810 } else {
811 if (sw->whichChild.getValue() != SO_SWITCH_NONE)
812 sw->whichChild = SO_SWITCH_NONE;
813 m_d->volumetreemodel->disableSubSystem(subsys->flag);
814 }
815}
static Double_t ss

◆ contact_info()

const QString & IVP1System::contact_info ( ) const
inherited

Definition at line 62 of file IVP1System.cxx.

63{
64 return m_d->contact_info;
65}

◆ controllerWidget()

QWidget * IVP1System::controllerWidget ( )
inherited

Definition at line 202 of file IVP1System.cxx.

202 {
203 if (VP1Msg::verbose()) {
204 messageVerbose("controllerWidget()");
205 messageVerbose("registerController m_d->state==ERASED = "+QString(m_d->state==ERASED?"true":"false"));
206 messageVerbose("registerController m_d->state==REFRESHED = "+QString(m_d->state==REFRESHED?"true":"false"));
207 }
208 assert(m_d->state==REFRESHED||m_d->state==ERASED);
209 return m_d->controller;
210 }

◆ create()

void IVP13DSystemSimple::create ( StoreGateSvc * detstore)
privatevirtualinherited

Implements IVP1System.

Definition at line 133 of file IVP13DSystemSimple.cxx.

134{
135 if(VP1Msg::verbose()){
136 messageVerbose("IVP13DSystemSimple create");
137 }
138 assert(!m_d->wasrefreshed);
139 assert(!m_d->wascreated);
140 ensureBuildController();//TODO: Move to refresh.
141 m_d->wascreated=true;
142 m_d->wasrefreshed=false;
143}

◆ deleteController()

void IVP1System::deleteController ( )
privateinherited

Definition at line 213 of file IVP1System.cxx.

214{
215 if (VP1Msg::verbose()){
216 messageVerbose("deleteController()");
217 }
218 if (m_d->controller)
219 m_d->controller->deleteLater();
220 m_d->controller = 0;
221}

◆ deselectAll()

void IVP13DSystem::deselectAll ( SoCooperativeSelection * exception_sel = 0)
virtualinherited

Reimplemented in VP1PrepRawDataSystem.

Definition at line 331 of file IVP13DSystem.cxx.

332{
333 static std::map<SoCooperativeSelection*,IVP13DSystem*>::iterator it, itE = Imp::selection2system.end();
334 for (it = Imp::selection2system.begin(); it!=itE;++it) {
335 if (it->second!=this)
336 continue;
337 if (it->first!=exception_sel) {
338 if (it->first->policy.getValue()!=SoCooperativeSelection::SINGLE) {
339 Imp::start_changeselection(this, it->first);
340 it->first->deselectAll();
341 Imp::finished_changeselection(this, it->first);
342 } else {
343 if (it->first->getList()->getLength()==1) {
344 Imp::start_changeselection(this, it->first);
345 SoPath * path = static_cast<SoPath*>(it->first->getList()->get(0));
346 Imp::made_deselection(it->first,path);
347 it->first->deselectAll();
348 Imp::finished_changeselection(this, it->first);
349 }
350 }
351 }
352 }
353}
static void start_changeselection(void *userdata, SoSelection *sel)
static void finished_changeselection(void *userdata, SoSelection *sel)
static std::map< SoCooperativeSelection *, IVP13DSystem * > selection2system
static void made_deselection(void *userdata, SoPath *path)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
path
python interpreter configuration --------------------------------------—
Definition athena.py:130

◆ detectorStore()

StoreGateSvc * IVP1System::detectorStore ( ) const
inherited

Definition at line 318 of file IVP1System.cxx.

319{
321}
static StoreGateSvc * detectorStore()

◆ disallowUpdateGUI()

void IVP1System::disallowUpdateGUI ( )
privateinherited

Definition at line 250 of file IVP1System.cxx.

251{
252 m_d->allowupdategui=false;
253}

◆ emit_appropriateMDTProjectionsChanged

void VP1GeometrySystem::emit_appropriateMDTProjectionsChanged ( )
protectedslot

Definition at line 1602 of file VP1GeometrySystem.cxx.

1603{
1604 if (!m_d->controller) {
1605 message("emit_appropriateMDTProjectionsChanged called before controller built.");
1606 return;
1607 }
1608 VP1GeoFlags::MuonChamberAdaptionStyleFlags f(m_d->controller->muonChamberAdaptionStyle());
1609 bool option_openmdtchambers = f & VP1GeoFlags::OpenMDTChambers;
1610 bool option_hidetubes = f & VP1GeoFlags::HideMDTTubes;
1611 int i (option_openmdtchambers?(option_hidetubes?0:1):2);
1612 if ( m_d->last_appropriatemdtprojections != i ) {
1613 m_d->last_appropriatemdtprojections = i;
1615 }
1616}
void appropriateMDTProjectionsChanged(int)

◆ enableMuonChamberLabels()

void VP1GeometrySystem::enableMuonChamberLabels ( bool t0s,
bool hits )

first is t0s, 2nd is hits

Definition at line 3008 of file VP1GeometrySystem.cxx.

3008 {
3009 m_d->controller->setLabelsEnabled(t0s,hits);
3010}

◆ ensureBuildController()

void IVP13DSystemSimple::ensureBuildController ( )
inherited

Definition at line 90 of file IVP13DSystemSimple.cxx.

91{
92 if (m_d->controllerBuilt)
93 return;
94 m_d->controllerBuilt=true;
95 if(VP1Msg::verbose()){
96 messageVerbose("IVP13DSystemSimple build controller");
97 }
98 QWidget * controller = buildController();
99 if (controller)
100 registerController(controller);
101 if(VP1Msg::verbose()){
102 messageVerbose("IVP13DSystemSimple controller was = "+str(controller));
103 }
104}
virtual QWidget * buildController()
void registerController(QWidget *)

◆ erase()

void IVP13DSystemSimple::erase ( )
privatevirtualinherited

Implements IVP1System.

Definition at line 173 of file IVP13DSystemSimple.cxx.

174{
175 if(VP1Msg::verbose()){
176 messageVerbose("IVP13DSystemSimple::erase() start");
177 }
178 assert(m_d->wascreated);
179 assert(m_d->wasrefreshed);
180
181 bool saveE = m_d->rootE->enableNotify(false);
182
183 systemerase();
184 if(VP1Msg::verbose()){
185 messageVerbose("IVP13DSystemSimple::erase() Removing all event objects from scene");
187 }
188 m_d->rootE->removeAllChildren();
189
190 if (saveE) {
191 m_d->rootE->enableNotify(true);
192 m_d->rootE->touch();
193 }
194
195 m_d->wasrefreshed=false;
196 if(VP1Msg::verbose()){
197 messageVerbose("IVP13DSystemSimple::erase() end");
198 }
199}
void warnOnDisabledNotifications() const

◆ eventStore()

StoreGateSvc * IVP1System::eventStore ( ) const
inherited

Definition at line 312 of file IVP1System.cxx.

313{
315}
static StoreGateSvc * eventStore()

◆ getCameraList()

std::set< SoCamera * > IVP13DSystem::getCameraList ( )
inherited

Definition at line 395 of file IVP13DSystem.cxx.

396{
397 std::set<SoCamera*> cameralist = m_d->staticcameras;
398 std::set<SoQtViewer*>::const_iterator it, itE=m_d->viewers.end();
399 for (it=m_d->viewers.begin();it!=itE;++it) {
400 SoCamera*cam = (*it)->getCamera();
401 if (cam)
402 cameralist.insert(cam);
403 }
404
405 //m_d->camerasfromviewer
406 return cameralist;
407}

◆ getSceneGraph()

SoSeparator * IVP13DSystemSimple::getSceneGraph ( ) const
privatevirtualinherited

Implements IVP13DSystem.

Definition at line 127 of file IVP13DSystemSimple.cxx.

128{
129 return static_cast<SoSeparator*>(m_d->root);
130}

◆ inactiveSystemTurnedActive

void IVP1System::inactiveSystemTurnedActive ( )
signalinherited

◆ information()

const QString & IVP1System::information ( ) const
inherited

Definition at line 56 of file IVP1System.cxx.

57{
58 return m_d->information;
59}

◆ isRefreshing()

bool IVP1System::isRefreshing ( )
privateinherited

Definition at line 108 of file IVP1System.cxx.

109{
110 return m_d->refreshing;
111}

◆ itemFromSystemSelected

void IVP13DSystem::itemFromSystemSelected ( )
signalinherited

◆ loadMaterialsFromFile

void VP1GeometrySystem::loadMaterialsFromFile ( const QString & filename)
protectedslot

Definition at line 2934 of file VP1GeometrySystem.cxx.

2935{
2936 if (filename.isEmpty())
2937 return;
2938 QFileInfo fi(filename);
2939 if (!fi.exists()) {
2940 QMessageBox::critical(0, "Error - file does not exists: "+filename,
2941 "File does not exists: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2942 return;
2943 }
2944 if (!fi.isReadable()) {
2945 QMessageBox::critical(0, "Error - file is not readable: "+filename,
2946 "File is not readable: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2947 return;
2948 }
2949 //open file
2950 QFile file(filename);
2951 if (!file.open(QIODevice::ReadOnly)) {
2952 QMessageBox::critical(0, "Error - problems opening file "+filename,
2953 "Problems opening file: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2954 return;
2955 }
2956 QByteArray byteArray64;
2957 QDataStream infile(&file);
2958 infile >> byteArray64;
2959 QByteArray byteArray = qUncompress(QByteArray::fromBase64(byteArray64));
2960
2961 VP1Deserialise s(byteArray,this);
2962 if (s.version()!=0) {
2963 QMessageBox::critical(0, "Error - File in wrong format "+filename,
2964 "File in wrong format: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2965 return;
2966 }
2967 QString txtbegin, txtend;
2968 QByteArray baDet, baMat, baVol;
2969 txtbegin = s.restoreString();
2970 baDet = s.restoreByteArray();
2971 baMat = s.restoreByteArray();
2972 baVol = s.restoreByteArray();
2973 txtend = s.restoreString();
2974 s.disableUnrestoredChecks();
2975 if (txtbegin!="VP1GeoMaterialsBegin"||txtend!="VP1GeoMaterialsEnd") {
2976 QMessageBox::critical(0, "Error - File in wrong format "+filename,
2977 "File in wrong format: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2978 return;
2979 }
2980
2981 m_d->ensureInitVisAttributes();
2982 m_d->detVisAttributes->applyState(baDet);
2983 m_d->matVisAttributes->applyState(baMat);
2984 m_d->volVisAttributes->applyState(baVol);
2985
2986 VolumeHandle* lastsel = m_d->controller->lastSelectedVolume();
2987 m_d->controller->setLastSelectedVolume(0);
2988 m_d->controller->setLastSelectedVolume(lastsel);
2989}
TFile * file

◆ message() [1/3]

void IVP1System::message ( const QString & str) const
inherited

Definition at line 336 of file IVP1System.cxx.

337{
338 if (receivers(SIGNAL(sysmessage(QString))) > 0){
340 }
341 else{
342 std::cout<<VP1Msg::prefix_msg()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
343 }
344}
void sysmessage(QString) const
static const char * prefix_msg()
Definition VP1Msg.h:56

◆ message() [2/3]

void IVP1System::message ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 400 of file IVP1System.cxx.

401{
402 if (addtostart.isEmpty()) {
403 message(l,addtoend);
404 return;
405 }
406 if (addtoend.isEmpty()) {
407 for (const QString& s : l)
408 message(addtostart+s);
409 } else {
410 for (const QString& s : l)
411 message(addtostart+s+addtoend);
412 }
413}

◆ message() [3/3]

void IVP1System::message ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 362 of file IVP1System.cxx.

363{
364 if (addtoend.isEmpty()) {
365 for (const QString& s : l)
366 message(s);
367 } else {
368 for (const QString& s : l)
369 message(s+addtoend);
370 }
371}

◆ messageDebug() [1/3]

void IVP1System::messageDebug ( const QString & str) const
inherited

Definition at line 347 of file IVP1System.cxx.

348{
349 if (VP1Msg::debug())
350 std::cout<<VP1Msg::prefix_debug()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
351}
static const char * prefix_debug()
Definition VP1Msg.h:57

◆ messageDebug() [2/3]

void IVP1System::messageDebug ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 416 of file IVP1System.cxx.

417{
418 if (addtostart.isEmpty()) {
419 messageDebug(l,addtoend);
420 return;
421 }
422 if (addtoend.isEmpty()) {
423 for (const QString& s : l)
424 messageDebug(addtostart+s);
425 } else {
426 for (const QString& s : l)
427 messageDebug(addtostart+s+addtoend);
428 }
429}
void messageDebug(const QString &) const

◆ messageDebug() [3/3]

void IVP1System::messageDebug ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 374 of file IVP1System.cxx.

375{
376 if (addtoend.isEmpty()) {
377 for (const QString& s : l)
378 messageDebug(s);
379 } else {
380 for (const QString& s : l)
381 messageDebug(s+addtoend);
382 }
383}

◆ messageVerbose() [1/3]

void IVP1System::messageVerbose ( const QString & str) const
inherited

Definition at line 354 of file IVP1System.cxx.

355{
356 if (VP1Msg::verbose())
357 std::cout<<VP1Msg::prefix_verbose()<<" ["<<m_d->name.toStdString()<<"]: "<<str.toStdString()<<std::endl;
358}
static const char * prefix_verbose()
Definition VP1Msg.h:59

◆ messageVerbose() [2/3]

void IVP1System::messageVerbose ( const QString & addtostart,
const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 432 of file IVP1System.cxx.

433{
434 if (!VP1Msg::verbose())
435 return;
436 if (addtostart.isEmpty()) {
437 messageVerbose(l,addtoend);
438 return;
439 }
440 if (addtoend.isEmpty()) {
441 for (const QString& s : l)
442 messageVerbose(addtostart+s);
443 } else {
444 for (const QString& s : l)
445 messageVerbose(addtostart+s+addtoend);
446 }
447}

◆ messageVerbose() [3/3]

void IVP1System::messageVerbose ( const QStringList & l,
const QString & addtoend = "" ) const
inherited

Definition at line 386 of file IVP1System.cxx.

387{
388 if (!VP1Msg::verbose())
389 return;
390 if (addtoend.isEmpty()) {
391 for (const QString& s : l)
393 } else {
394 for (const QString& s : l)
395 messageVerbose(s+addtoend);
396 }
397}

◆ muonChamberT0sChanged

void VP1GeometrySystem::muonChamberT0sChanged ( const std::map< GeoPVConstLink, float > & t0s,
int index )
slot

The map is the dt0 per chamber, plus a label identifier, which by convention (!) is 0=Moore, 1=Muonboy.

Definition at line 3012 of file VP1GeometrySystem.cxx.

3012 {
3013 messageVerbose("muonChamberT0sChanged for this many chambers:"+str(t0s.size()));
3014 if (index>=m_d->chamberT0s.size())
3015 message("ERROR: chamber t0 index out of bounds!");
3016 else
3017 m_d->chamberT0s[index]=&t0s;
3018}
str index
Definition DeMoScan.py:362

◆ name()

const QString & IVP1System::name ( ) const
inherited

Definition at line 50 of file IVP1System.cxx.

51{
52 return m_d->name;
53}

◆ needErase

void IVP1System::needErase ( )
signalinherited

◆ orientViewToMuonChamber

void VP1GeometrySystem::orientViewToMuonChamber ( const GeoPVConstLink & chamberPV)
slot

Definition at line 1778 of file VP1GeometrySystem.cxx.

1779{
1780 if (!m_d->sceneroot)
1781 return;
1782
1783 //Find relevant muon subsystem info:
1784 Imp::SubSystemInfo * subsys = m_d->chamberPVToMuonSubSystemInfo(chamberPV);
1785 if (!subsys) {
1786 message("Error: Asked to orient view to chamber volume '"
1787 +QString(chamberPV->getLogVol()->getName().c_str())
1788 +"', which doesn't fit the known format of any chamber!");
1789 return;
1790 }
1791
1792 //Subsystem must be available:
1793 if (!subsys->soswitch) {//NB: Could as well look at checkbox enabled state instead of whether sw pointer is null.
1794 message("Warning: Asked to orient view to muon chamber volume which is not available. Perhaps muon geometry was not built?");
1795 return;
1796 }
1797
1798 //Find handle for the muon chamber (possibly ensure that relevant muon subsystem is build):
1799 std::map<PVConstLink,VolumeHandle*>::iterator itChamber = m_d->muonchambers_pv2handles.find(chamberPV);
1800 if (itChamber==m_d->muonchambers_pv2handles.end()) {
1801 //Probably the muon relevant muon system was not initialised. Build and try again:
1802 m_d->buildSystem(subsys);
1803 itChamber = m_d->muonchambers_pv2handles.find(chamberPV);
1804 if (itChamber==m_d->muonchambers_pv2handles.end()) {
1805 message("Error: Asked to orient view to chamber volume '"
1806 +QString(chamberPV->getLogVol()->getName().c_str())
1807 +"', but could not find chamber handle!");
1808 return;
1809 }
1810 }
1811 VolumeHandle * chamberHandle = itChamber->second;
1812
1813 //Figure out if we are MDT, CSC or TGC (if not we print warning and abort);
1814
1815 std::string name = chamberHandle->getNameStdString();
1816
1817 bool isCSCOrTGC = name.size()>=2 && ( (name[0]=='C' && name[1]=='S') || (name[0]=='T') );
1818 if (!isCSCOrTGC&&!(name.size()>=1&&(name[0]=='E'||name[0]=='B'))) {
1819 //Neither CSC, TGC or MDT:
1820 message("orientViewToMuonChamber Warning: Not CSC, TGC or MDT station!");
1821 return;
1822 }
1823
1824 bool save = subsys->soswitch->enableNotify(false);//Disable notifications to avoid chamber flickering in for a moment.
1825
1826 //If subsystem soswitch is turned off, we turn it on temporarily
1827 int32_t soswitch_val = subsys->soswitch->whichChild.getValue();
1828 if (soswitch_val!=SO_SWITCH_ALL)
1829 subsys->soswitch->whichChild = SO_SWITCH_ALL;
1830
1831 VP1GeoFlags::VOLSTATE oldChamberState = chamberHandle->state();
1832 chamberHandle->setState(VP1GeoFlags::CONTRACTED);
1833
1834 SoSeparator * chambersep = chamberHandle->nodeSoSeparator();
1835 if (chambersep) {
1836 std::set<SoCamera*> cameras = getCameraList();
1837 std::set<SoCamera*>::iterator it,itE = cameras.end();
1838 for (it=cameras.begin();it!=itE;++it) {
1839 //Find desired camera orientation (must be parallel to tubes - and
1840 //we choose the one of the possible orientations which is closest to
1841 //current camera orientation - i.e. loop over tubes and try both
1842 //positive and negative directions of each tube.
1843
1844 SbRotation camrot = (*it)->orientation.getValue();
1845 SbVec3f cameraDir(0, 0, -1); // init to default view direction vector
1846 camrot.multVec(cameraDir, cameraDir);
1847 SbVec3f cameraUpVec(0, 1, 0); // init to default up vector
1848 camrot.multVec(cameraUpVec, cameraUpVec);
1849
1850 std::pair<SbVec3f,SbVec3f> chamberdirections;
1851 if (isCSCOrTGC) {
1852 //CSC/TGC chamber - look at top TRD shape for directions
1853 chamberdirections = m_d->getClosestCSCOrTGCEdgeDirections(cameraDir,chamberHandle);
1854 } else {
1855 //MDT chamber - look at tubes for direction
1856 chamberdirections = m_d->getClosestMuonDriftTubeDirections(cameraDir,cameraUpVec,chamberHandle);
1857 }
1858 SbVec3f newdirection = - chamberdirections.first;
1859 SbVec3f newup(cameraUpVec);
1860 const float epsilon(0.00001f);
1861 if (m_d->previousAlignedChamberHandle==chamberHandle&&cameraDir.equals(newdirection,epsilon)) {
1862 //If we already zoomed in the direction of the chamber,
1863 //subsequent requests aligns the upvector along the other chamber
1864 //axes.
1865 SbRotation rot(cameraDir,0.5*M_PI);
1866 SbVec3f chambdir1 = chamberdirections.second;
1867 SbVec3f chambdir2,chambdir3,chambdir4;
1868 rot.multVec(chambdir1,chambdir2);
1869 rot.multVec(chambdir2,chambdir3);
1870 rot.multVec(chambdir3,chambdir4);
1871 if (cameraUpVec.equals(chambdir1,epsilon)) {
1872 newup = chambdir2;
1873 } else if (cameraUpVec.equals(chambdir2,epsilon)) {
1874 newup = chambdir3;
1875 } else if (cameraUpVec.equals(chambdir3,epsilon)) {
1876 newup = chambdir4;
1877 } else if (cameraUpVec.equals(chambdir4,epsilon)) {
1878 newup = chambdir1;
1879 } else {
1880 //Take the closest one...
1881 float cos1 = chambdir1.dot(cameraUpVec);
1882 float cos2 = chambdir2.dot(cameraUpVec);
1883 float cos3 = chambdir3.dot(cameraUpVec);
1884 float cos4 = chambdir4.dot(cameraUpVec);
1885 float maxcos = std::max(std::max(cos1,cos2),std::max(cos3,cos4));
1886 if (cos1==maxcos)
1887 newup = chambdir1;
1888 else if (cos2==maxcos)
1889 newup = chambdir2;
1890 else if (cos3==maxcos)
1891 newup = chambdir3;
1892 else
1893 newup = chambdir4;
1894 }
1895 }
1896
1897 //Zoom to chamber with given orientation - and we make sure the
1898 //chamber is attached while we initiate the zoom (so the camera
1899 //helper can use a boundaryboxaction to find the bounding box):
1900 VP1CameraHelper::animatedZoomToSubTree(*it,m_d->sceneroot,chambersep,1.0, 100.0, 100.0, 1.0,newdirection,newup);
1901 }
1902 }
1903
1904 chamberHandle->setState(oldChamberState);
1905 if (soswitch_val!=SO_SWITCH_ALL)
1906 subsys->soswitch->whichChild.setValue(soswitch_val);
1907 if (save) {
1908 subsys->soswitch->enableNotify(true);
1909 subsys->soswitch->touch();
1910 }
1911 m_d->previousAlignedChamberHandle=chamberHandle;
1912
1913}
#define M_PI
CamList getCameraList()
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
std::string getNameStdString() const
VP1GeoFlags::VOLSTATE state() const
SoSeparator * nodeSoSeparator() const

◆ plotSpectrum

void VP1GeometrySystem::plotSpectrum ( QStack< QString > & ,
int copyNumber = -1 )
signal

◆ refresh()

void IVP13DSystemSimple::refresh ( StoreGateSvc * storegate)
privatevirtualinherited

Implements IVP1System.

Definition at line 146 of file IVP13DSystemSimple.cxx.

147{
148 assert(m_d->wascreated);
149 assert(!m_d->wasrefreshed);
150
151 if (m_d->first) {
152 if(VP1Msg::verbose()){
153 messageVerbose("IVP13DSystemSimple first refresh - so calling create methods (i.e. delayed create).");
154 }
156 m_d->first = false;
157 m_d->root->removeChild(m_d->rootR);
159 m_d->root->addChild(m_d->rootR);
160 }
161
162 m_d->root->removeChild(m_d->rootE);
163 updateGUI();
164 buildEventSceneGraph(sg, m_d->rootE);
165 updateGUI();
166 m_d->root->addChild(m_d->rootE);
167
168 m_d->wasrefreshed=true;
169
170}
virtual void systemcreate(StoreGateSvc *detstore)
virtual void buildPermanentSceneGraph(StoreGateSvc *detstore, SoSeparator *root)
virtual void buildEventSceneGraph(StoreGateSvc *sg, SoSeparator *root)=0
StoreGateSvc * detectorStore() const

◆ registerCamera()

void IVP13DSystem::registerCamera ( SoCamera * camera)
inherited

Definition at line 410 of file IVP13DSystem.cxx.

410 {
411 if (!cam)
412 return;
413 m_d->staticcameras.insert(cam);
414 cam->ref();
415}

◆ registerController()

void IVP1System::registerController ( QWidget * w)
protectedinherited

Definition at line 224 of file IVP1System.cxx.

225{
226 if (VP1Msg::verbose()) {
227 messageVerbose("registerController ");
228 messageVerbose("registerController m_d->canregistercontroller = "+QString(m_d->canregistercontroller?"true":"false"));
229 messageVerbose("registerController m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
230 messageVerbose("registerController m_d->controller==0 = "+QString(m_d->controller==0?"true":"false"));
231 messageVerbose("registerController w!=0 = "+QString(w!=0?"true":"false"));
232 }
233 if (!m_d->canregistercontroller)
234 message("ERROR: Please don't register controllers after create().");
235 if (m_d->state!=CONSTRUCTED)
236 message("ERROR: Please only register controllers in CONSTRUCTED state.");
237 if (!w) {
238 message("ERROR: Attempt to register null controller.");
239 return;
240 }
241 if (m_d->controller) {
242 message("ERROR: Attempt to register controller twice.");
243 return;
244 }
245 m_d->controller = w;
246 w->setParent(0);
247}

◆ registerSelectionNode()

void IVP13DSystem::registerSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 257 of file IVP13DSystem.cxx.

258{
259 if (!selection) {
260 message("registerSelectionNode Error: NULL selection pointer!");
261 return;
262 }
264 message("registerSelectionNode Error: Trying to register selection node more than once!");
265 return;
266 }
267
268 selection->addSelectionCallback( Imp::made_selection, selection );
269 selection->addDeselectionCallback( Imp::made_deselection, selection );
270 selection->addStartCallback( Imp::start_changeselection, this );
271 selection->addFinishCallback( Imp::finished_changeselection, this );
272 selection->addClickOutsideCallback( Imp::clickedoutside, this );
273
275 selection->ref();
276
277 messageVerbose("selection node registered");
278}
static void clickedoutside(void *userdata, SoCooperativeSelection *sel)
static void made_selection(void *userdata, SoPath *path)
const std::string selection
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140

◆ registerViewer()

void IVP13DSystem::registerViewer ( SoQtViewer * viewer)
inherited

Definition at line 418 of file IVP13DSystem.cxx.

419{
420 if (!viewer)
421 return;
422 m_d->viewers.insert(viewer);
423}

◆ reiconizeToShowSpecificMuonChambers

void VP1GeometrySystem::reiconizeToShowSpecificMuonChambers ( const std::set< GeoPVConstLink > & chambers)
slot

Definition at line 1619 of file VP1GeometrySystem.cxx.

1620{
1621 //Update map of touched chamber lists:
1622 bool listChanged(m_d->sender2ChamberList.find(sender())!=m_d->sender2ChamberList.end()?
1623 (chambers != m_d->sender2ChamberList[sender()]):true);
1624 m_d->sender2ChamberList[sender()] = chambers;
1625
1626 //Trigger update if list changed and in auto mode:
1627 if ( listChanged && m_d->controller->autoAdaptMuonChambersToEventData() )
1629}

◆ resetSubSystems

void VP1GeometrySystem::resetSubSystems ( VP1GeoFlags::SubSystemFlags f)
protectedslot

Definition at line 1528 of file VP1GeometrySystem.cxx.

1529{
1530 if (!f) {
1531 return;
1532 }
1533
1534 deselectAll();
1535 for (Imp::SubSystemInfo*si : m_d->subsysInfoList) {
1536 if (si->flag & f) {
1537 if (!si->isbuilt) {
1538 continue;
1539 }
1540 VolumeHandle::VolumeHandleListItr it(si->vollist.begin()),itE(si->vollist.end());
1541 for (;it!=itE;++it) {
1542 messageDebug("resetting volume --> " + (*it)->getName() );
1543 (*it)->reset();
1544 }
1545 }
1546 }
1547}

◆ restoreFromState()

void VP1GeometrySystem::restoreFromState ( QByteArray ba)
virtual

Reimplemented from IVP1System.

Definition at line 1341 of file VP1GeometrySystem.cxx.

1341 {
1342 VP1Deserialise state(ba,this);
1343 if (state.version()<0||state.version()>7) {
1344 message("Warning: State data in .vp1 file is in wrong format - ignoring!");
1345 return;
1346 }
1347 if (state.version()<=5) {
1348 message("Warning: State data in .vp1 file is in obsolete format - ignoring!");
1349 return;
1350 }
1351
1353 IVP13DSystemSimple::restoreFromState(state.restoreByteArray());
1354
1355 //Controller:
1356 m_d->controller->restoreSettings(state.restoreByteArray());
1357
1358 //Subsystem checkboxes:
1359 VP1GeoFlags::SubSystemFlags flags;
1360 QMap<QString,bool> subsysstate = state.restore<QMap<QString,bool> >();
1361 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1362 state.widgetHandled(subsys->checkbox);
1363 if (subsysstate.contains(subsys->checkbox->text())&&subsysstate[subsys->checkbox->text()])
1364 flags |= subsys->flag;
1365 }
1366 m_d->initialSubSystemsTurnedOn = flags;
1367
1368 //Volume states:
1369 QMap<quint32,QByteArray> topvolstates;
1370 topvolstates = state.restore<QMap<quint32,QByteArray> >();
1371 if (m_d->sceneroot)//(for some reason) we already have been in buildPermanentScenegraph
1372 m_d->applyTopVolStates(topvolstates,true);
1373 else
1374 m_d->restoredTopvolstates = topvolstates;//save until buildPermanentScenegraph
1375
1376 if (state.version()>=7) {
1377 m_d->ensureInitVisAttributes();
1378 m_d->detVisAttributes->applyState(state.restoreByteArray());
1379 m_d->matVisAttributes->applyState(state.restoreByteArray());
1380 m_d->volVisAttributes->applyState(state.restoreByteArray());
1381 }
1382
1383 state.disableUnrestoredChecks();//We do the testing in the controller
1384
1385 //Special:
1386 if (m_d->controller->autoAdaptMuonChambersToEventData())
1388}
virtual void restoreFromState(QByteArray)
State state() const

◆ saveMaterialsToFile

void VP1GeometrySystem::saveMaterialsToFile ( const QString & filename,
bool onlyChangedMaterials )
protectedslot

Definition at line 2895 of file VP1GeometrySystem.cxx.

2896{
2897 if (filename.isEmpty())
2898 return;
2899
2900 //If file exists, ask to overwrite.
2901 QFileInfo fi(filename);
2902 if (fi.exists()) {
2903 if (!fi.isWritable()) {
2904 QMessageBox::critical(0, "Error - could not save to file "+filename,
2905 "Could not save to file: <i>"+filename+"</i>"
2906 +"<br/><br/>Reason: File exists already and is write protected",QMessageBox::Ok,QMessageBox::Ok);
2907 return;
2908 }
2909 }
2910
2911 QFile file(filename);
2912 if (!file.open(QIODevice::WriteOnly)) {
2913 QMessageBox::critical(0, "Error - problems writing to file "+filename,
2914 "Problems writing to file: <i>"+filename+"</i>",QMessageBox::Ok,QMessageBox::Ok);
2915 return;
2916 }
2917
2918 m_d->ensureInitVisAttributes();
2919 VP1Serialise s(0/*version*/,this);
2920 //Save some file ID info!!
2921 s.save(QString("VP1GeoMaterialsBegin"));
2922 s.save(m_d->detVisAttributes->getState(onlyChangedMaterials));
2923 s.save(m_d->matVisAttributes->getState(onlyChangedMaterials));
2924 s.save(m_d->volVisAttributes->getState(onlyChangedMaterials));
2925 s.save(QString("VP1GeoMaterialsEnd"));
2926 s.disableUnsavedChecks();
2927
2928 QDataStream outfile(&file);
2929 outfile<<qCompress(s.result()).toBase64();
2930
2931}

◆ saveState()

QByteArray VP1GeometrySystem::saveState ( )
virtual

Reimplemented from IVP1System.

Definition at line 1302 of file VP1GeometrySystem.cxx.

1302 {
1303
1305
1306 VP1Serialise serialise(7/*version*/,this);
1308
1309 //Controller:
1310 serialise.save(m_d->controller->saveSettings());
1311
1312 //Subsystem checkboxes:
1313 QMap<QString,bool> subsysstate;
1314 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1315 serialise.widgetHandled(subsys->checkbox);
1316 subsysstate.insert(subsys->checkbox->text(),subsys->checkbox->isChecked());
1317 }
1318 serialise.save(subsysstate);
1319
1320 //Volume states:
1321 QMap<quint32,QByteArray> topvolstates;
1322 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList) {
1323 if (m_d->controller->autoAdaptMuonChambersToEventData()&&subsys->hasMuonChambers())
1324 continue;//No need to store muon chamber data which will anyway be auto-adapted away.
1325 VolumeHandle::VolumeHandleListItr it(subsys->vollist.begin()),itE(subsys->vollist.end());
1326 for (;it!=itE;++it)
1327 topvolstates.insert((*it)->hashID(),(*it)->getPersistifiableState());
1328 }
1329 serialise.save(topvolstates);
1330
1331 m_d->ensureInitVisAttributes();
1332 serialise.save(m_d->detVisAttributes->getState());//version 7+
1333 serialise.save(m_d->matVisAttributes->getState());//version 7+
1334 serialise.save(m_d->volVisAttributes->getState());//version 7+
1335
1336 serialise.disableUnsavedChecks();//We do the testing in the controller
1337 return serialise.result();
1338}
virtual QByteArray saveState()
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors

◆ serviceLocator()

ISvcLocator * IVP1System::serviceLocator ( ) const
inherited

Definition at line 324 of file IVP1System.cxx.

325{
327}
static ISvcLocator * serviceLocator()

◆ setActiveState()

void IVP1System::setActiveState ( const ActiveState & s,
const bool & donttriggererase = true )
privateinherited

Definition at line 162 of file IVP1System.cxx.

163{
164 //First handle case where we dont actually change state. Only
165 //special consideration is OFF->OFF where we have to do something if
166 //we need to erase:
167 if (m_d->activeState==OFF&&s==OFF&&(m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
168 needErase();
169 m_d->channel->emitRefreshInfoChanged();
170 return;
171 } else if (m_d->activeState==s) {
172 m_d->channel->emitRefreshInfoChanged();
173 return;
174 }
175
176 //Ok, we know that we are either ON->OFF or OFF->ON.
177 m_d->activeState = s;
178
179 if (s==ON) {
180 //OFF->ON: We might need a refresh, so send out a signal for the scheduler:
182 } else {
183 //ON->OFF: We might need an erase signal:
184 if ((m_d->state==REFRESHED||m_d->refreshing)&&!donttriggererase) {
185 needErase();
186 }
187 }
188 m_d->channel->emitRefreshInfoChanged();
189}
void inactiveSystemTurnedActive()
void needErase()

◆ setAutoAdaptMuonChambersToEventData()

void VP1GeometrySystem::setAutoAdaptMuonChambersToEventData ( bool b)

Definition at line 355 of file VP1GeometrySystem.cxx.

356{
358 if (m_d->controller->autoAdaptMuonChambersToEventData()!=b) {
359 m_d->controller->setAutoAdaptMuonChambersToEventData(b);
360 if (b)
362 }
363}

◆ setCanRegisterController()

void IVP1System::setCanRegisterController ( const bool & c)
privateinherited

Definition at line 285 of file IVP1System.cxx.

286{
287 if (VP1Msg::verbose()){
288 messageVerbose("setCanRegisterController called with"+QString(c?"true":"false"));
289 }
290 m_d->canregistercontroller=c;
291}

◆ setChannel()

void IVP1System::setChannel ( IVP1ChannelWidget * cw)
privateinherited

Definition at line 94 of file IVP1System.cxx.

95{
96 if (VP1Msg::verbose()) {
97 messageVerbose("setChannel ");
98 messageVerbose("setChannel m_d->state==CONSTRUCTED = "+QString(m_d->state==CONSTRUCTED?"true":"false"));
99 messageVerbose("setChannel cw!=0 = "+QString(cw!=0?"true":"false"));
100 }
101 assert(!m_d->channel);
102 assert(cw);
103 assert(m_d->state==CONSTRUCTED);
104 m_d->channel = cw;
105}

◆ setCurvedSurfaceRealism

void VP1GeometrySystem::setCurvedSurfaceRealism ( int val)
slot

Definition at line 1499 of file VP1GeometrySystem.cxx.

1500{
1502 if (val<0||val>100) {
1503 message("setCurvedSurfaceRealism Error: Value "+str(val)+"out of range!");
1504 return;
1505 }
1506 m_d->controller->setComplexity(val==100?1.0:(val==0?0.0:val/100.0));
1507}

◆ setGeometrySelectable()

void VP1GeometrySystem::setGeometrySelectable ( bool b)

Definition at line 336 of file VP1GeometrySystem.cxx.

336 {
338 m_d->controller->setGeometrySelectable(b);
339}

◆ setLabelPosOffsets

void VP1GeometrySystem::setLabelPosOffsets ( const QList< int > & )
protectedslot

Definition at line 2992 of file VP1GeometrySystem.cxx.

2993{
2994 messageVerbose("setLabelPosOffsets called");
2995 setLabels(m_d->controller->labels());
2996}

◆ setLabels

void VP1GeometrySystem::setLabels ( int i)
protectedslot

Definition at line 2998 of file VP1GeometrySystem.cxx.

2998 {
2999 messageVerbose("setLabels "+str(i)+" for this many chambers:"+str(m_d->muonchambers_pv2handles.size()));
3000 // loop over all contained volumes (all visible volumes?) and update labels.
3001 // Just muons to start with
3002 std::map<PVConstLink,VolumeHandle*>::const_iterator it = m_d->muonchambers_pv2handles.begin(), itEnd = m_d->muonchambers_pv2handles.end();
3003 for (; it!=itEnd ; ++it){
3004 if (it->second->isInMuonChamber()) it->second->updateLabels(); // currently only do labels for Muon volumes
3005 }
3006}

◆ setOrientViewToMuonChambersOnClick()

void VP1GeometrySystem::setOrientViewToMuonChambersOnClick ( bool b)

Definition at line 348 of file VP1GeometrySystem.cxx.

349{
351 m_d->controller->setOrientViewToMuonChambersOnClick(b);
352}

◆ setRefreshing()

void IVP1System::setRefreshing ( const bool & b)
privateinherited

Definition at line 114 of file IVP1System.cxx.

115{
116 if (VP1Msg::verbose()){
117 messageVerbose("setRefreshing() called with b="+QString(b?"true":"false"));
118 }
119 if (b) {
120 assert(m_d->state==ERASED);
121 } else {
122 assert(m_d->state==REFRESHED);
123 }
124 m_d->refreshing = b;
125}

◆ setShowVolumeOutLines

void VP1GeometrySystem::setShowVolumeOutLines ( bool b)
protectedslot

Definition at line 2886 of file VP1GeometrySystem.cxx.

2887{
2888 std::map<SoSeparator*,VolumeHandle*>::iterator it,itE(m_d->sonodesep2volhandle.end());
2889 for (it =m_d->sonodesep2volhandle.begin();it!=itE;++it)
2891}
static void setShowVolumeOutlines(SoGroup *nodesep, bool showvol)

◆ setState()

void IVP1System::setState ( const State & s)
privateinherited

Definition at line 141 of file IVP1System.cxx.

142{
143#ifndef NDEBUG
144 assert (m_d->state != s);
145 assert(s!=CONSTRUCTED);
146 if (s==REFRESHED) {
147 assert(m_d->state==ERASED);
148 }
149 if (s==ERASED) {
150 assert(m_d->state==REFRESHED||m_d->state==CONSTRUCTED);
151 }
152 if (s==UNCREATED) {
153 assert(m_d->state==ERASED);
154 }
155#endif
156 m_d->state = s;
157 if (s==REFRESHED||s==ERASED)
158 m_d->channel->emitRefreshInfoChanged();
159}

◆ setUserSelectionNotificationsEnabled()

void IVP13DSystem::setUserSelectionNotificationsEnabled ( SoCooperativeSelection * sel,
bool enabled )
inherited

Definition at line 310 of file IVP13DSystem.cxx.

311{
312 if (!selection) {
313 message("setUserSelectionNotificationsEnabled Error: NULL selection pointer!");
314 return;
315 }
317 message("setUserSelectionNotificationsEnabled Error: Called for selection which was never registered!");
318 return;
319 }
320 if (enabled != m_d->selectionsWithDisabledNotifications.contains(selection))
321 return;
322
323 if (enabled)
324 m_d->selectionsWithDisabledNotifications.remove(selection);
325 else
326 m_d->selectionsWithDisabledNotifications << selection;
327
328}

◆ setZoomToVolumeOnClick()

void VP1GeometrySystem::setZoomToVolumeOnClick ( bool b)

Definition at line 342 of file VP1GeometrySystem.cxx.

342 {
344 m_d->controller->setZoomToVolumeOnClick(b);
345}

◆ state()

IVP1System::State IVP1System::state ( ) const
inherited

Definition at line 129 of file IVP1System.cxx.

130{
131 return m_d->state;
132}

◆ storeGate()

StoreGateSvc * IVP1System::storeGate ( ) const
inlineinherited

Definition at line 119 of file IVP1System.h.

119{ return eventStore(); }//OBSOLETE NAME. Use eventStore() instead.
StoreGateSvc * eventStore() const

◆ str() [1/30]

QString VP1String::str ( const Amg::Vector3D & t)
inlinestaticinherited

Definition at line 98 of file VP1String.h.

98{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [2/30]

QString VP1String::str ( const bool b)
inlinestaticinherited

Definition at line 53 of file VP1String.h.

53{ return b?"True":"False"; }

◆ str() [3/30]

QString VP1String::str ( const char * c)
inlinestaticinherited

Definition at line 50 of file VP1String.h.

50{ return c; }

◆ str() [4/30]

QString VP1String::str ( const double & d)
inlinestaticinherited

Definition at line 81 of file VP1String.h.

81{ return QString::number(d); }

◆ str() [5/30]

QString VP1String::str ( const float & f)
inlinestaticinherited

Definition at line 82 of file VP1String.h.

82{ return QString::number(f); }

◆ str() [6/30]

template<class T>
QString VP1String::str ( const HepGeom::BasicVector3D< T > & t)
inlinestaticinherited

Definition at line 95 of file VP1String.h.

95{ return "("+str(t.x())+", "+str(t.y())+", "+str(t.z())+")"; }

◆ str() [7/30]

QString VP1String::str ( const QColor & c)
staticinherited

Definition at line 30 of file VP1String.cxx.

31{
32 return c.isValid() ? c.name() : "Invalid";
33}

◆ str() [8/30]

template<class T>
QString VP1String::str ( const QFlags< T > & f)
inlinestaticinherited

Definition at line 91 of file VP1String.h.

91{ return "0x"+QString::number(f, 16).toUpper().rightJustified(8,'0'); }

◆ str() [9/30]

template<class T>
QString VP1String::str ( const QList< T > & t)
inlinestaticinherited

Definition at line 102 of file VP1String.h.

102{ return "QList of size"+QString::number(t.size()); }

◆ str() [10/30]

QString VP1String::str ( const QString & s)
inlinestaticinherited

Definition at line 49 of file VP1String.h.

49{ return s; }

◆ str() [11/30]

QString VP1String::str ( const SbColor & c)
staticinherited

Definition at line 36 of file VP1String.cxx.

37{
39}
static QColor sbcol2qcol(const SbColor &)

◆ str() [12/30]

QString VP1String::str ( const SbVec2d & v)
staticinherited

Definition at line 61 of file VP1String.cxx.

61{ double x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }
#define y
#define x

◆ str() [13/30]

QString VP1String::str ( const SbVec2f & v)
staticinherited

Definition at line 62 of file VP1String.cxx.

62{ float x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [14/30]

QString VP1String::str ( const SbVec2s & v)
staticinherited

Definition at line 63 of file VP1String.cxx.

63{ short x,y; v.getValue(x,y); return "("+str(x)+", "+str(y)+")"; }

◆ str() [15/30]

QString VP1String::str ( const SbVec3d & v)
staticinherited

Definition at line 64 of file VP1String.cxx.

64{ double x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }
#define z

◆ str() [16/30]

QString VP1String::str ( const SbVec3f & v)
staticinherited

Definition at line 65 of file VP1String.cxx.

65{ float x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [17/30]

QString VP1String::str ( const SbVec3s & v)
staticinherited

Definition at line 66 of file VP1String.cxx.

66{ short x,y,z; v.getValue(x,y,z); return "("+str(x)+", "+str(y)+", "+str(z)+")"; }

◆ str() [18/30]

QString VP1String::str ( const SbVec4d & v)
staticinherited

Definition at line 67 of file VP1String.cxx.

67{ double x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [19/30]

QString VP1String::str ( const SbVec4f & v)
staticinherited

Definition at line 68 of file VP1String.cxx.

68{ float x,y,z,t; v.getValue(x,y,z,t); return "("+str(x)+", "+str(y)+", "+str(z)+", "+str(t)+")"; }

◆ str() [20/30]

template<class T>
QString VP1String::str ( const T * t)
inlinestaticinherited

Definition at line 87 of file VP1String.h.

87{ return str(static_cast<const void* >(t)); }

◆ str() [21/30]

QString VP1String::str ( const void * p)
staticinherited

Definition at line 48 of file VP1String.cxx.

49{
50 if (p) {
51 std::ostringstream s;
52 s << p;
53 // Explicitly naming QString here avoids a cppcheck warning.
54 return QString (s.str().c_str());
55 } else {
56 return "NULL";
57 }
58}

◆ str() [22/30]

QString VP1String::str ( const VP1Interval & i)
staticinherited

Definition at line 42 of file VP1String.cxx.

43{
44 return i.toString();
45}

◆ str() [23/30]

QString VP1String::str ( int n)
inlinestaticinherited

Definition at line 77 of file VP1String.h.

77{ return QString::number(n); }

◆ str() [24/30]

QString VP1String::str ( long n)
inlinestaticinherited

Definition at line 75 of file VP1String.h.

75{ return QString::number(n); }

◆ str() [25/30]

QString VP1String::str ( qlonglong n)
inlinestaticinherited

Definition at line 79 of file VP1String.h.

79{ return QString::number(n); }

◆ str() [26/30]

QString VP1String::str ( qulonglong n)
inlinestaticinherited

Definition at line 80 of file VP1String.h.

80{ return QString::number(n); }

◆ str() [27/30]

QString VP1String::str ( short int n)
inlinestaticinherited

Definition at line 73 of file VP1String.h.

73{ return QString::number(n); }

◆ str() [28/30]

QString VP1String::str ( uint n)
inlinestaticinherited

Definition at line 78 of file VP1String.h.

78{ return QString::number(n); }

◆ str() [29/30]

QString VP1String::str ( ulong n)
inlinestaticinherited

Definition at line 76 of file VP1String.h.

76{ return QString::number(n); }

◆ str() [30/30]

QString VP1String::str ( unsigned short int n)
inlinestaticinherited

Definition at line 74 of file VP1String.h.

74{ return QString::number(n); }

◆ sysmessage

void IVP1System::sysmessage ( QString ) const
signalinherited

◆ systemcreate()

void VP1GeometrySystem::systemcreate ( StoreGateSvc * detstore)
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 504 of file VP1GeometrySystem.cxx.

505{
506 m_d->ensureInitVisAttributes();
507}

◆ systemerase()

void IVP13DSystemSimple::systemerase ( )
virtualinherited

Reimplemented in VP1AODSystem, VP1CaloCellSystem, VP1CaloClusterSystem, VP1CaloHitLegoSystem, VP1CaloLegoSystem, VP1MissingEtSystem, VP1PrepRawDataSystem, VP1RawDataSystem, VP1TrackSystem, and VP1VertexSystem.

Definition at line 28 of file IVP13DSystemSimple.cxx.

29{
30 // messageVerbose("WARNING: Did not reimplement systemerase!");
31}

◆ systemuncreate()

void VP1GeometrySystem::systemuncreate ( )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 314 of file VP1GeometrySystem.cxx.

315{
316
317 m_d->volumetreemodel->cleanup();
318 delete m_d->matVisAttributes; m_d->matVisAttributes = 0;
319 delete m_d->detVisAttributes; m_d->detVisAttributes = 0;
320 delete m_d->volVisAttributes; m_d->volVisAttributes = 0;
321
322 for (Imp::SubSystemInfo * subsys : m_d->subsysInfoList)
323 delete subsys;
324 m_d->subsysInfoList.clear();
325
326}

◆ toolSvc()

IToolSvc * IVP1System::toolSvc ( ) const
inherited

Definition at line 330 of file IVP1System.cxx.

331{
332 return VP1AthenaPtrs::toolSvc();
333}
static IToolSvc * toolSvc()

◆ uncreate()

void IVP13DSystemSimple::uncreate ( )
privatevirtualinherited

Reimplemented from IVP1System.

Definition at line 202 of file IVP13DSystemSimple.cxx.

203{
204
205 if(VP1Msg::verbose()){
206 messageDebug("uncreate()...");
207 }
208
209 assert(m_d->wascreated);
210 assert(!m_d->wasrefreshed);
211 m_d->rootE->enableNotify(false);
212 m_d->rootR->enableNotify(false);
214 m_d->root->removeAllChildren();
215 m_d->rootE->removeAllChildren();
216 m_d->rootR->removeAllChildren();
217 m_d->wascreated=false;
218}
virtual void systemuncreate()

◆ unregisterSelectionNode()

void IVP13DSystem::unregisterSelectionNode ( SoCooperativeSelection * selection)
inherited

Definition at line 281 of file IVP13DSystem.cxx.

282{
283 if (!selection) {
284 message("unregisterSelectionNode Error: NULL selection pointer!");
285 return;
286 }
288 message("registerSelectionNode Error: Trying to unregister unknown selection node!");
289 return;
290 }
291
292 selection->removeSelectionCallback( Imp::made_selection, selection );
293 selection->removeDeselectionCallback( Imp::made_deselection, selection );
294 selection->removeStartCallback( Imp::start_changeselection, this );
295 selection->removeFinishCallback( Imp::finished_changeselection, this );
296 selection->removeClickOutsideCallback( Imp::clickedoutside, this );
297
299 if (m_d->selectionsWithDisabledNotifications.contains(selection))
300 m_d->selectionsWithDisabledNotifications.remove(selection);
301 selection->unref();
302
303 messageVerbose("selection node unregistered");
304
305}

◆ updateGUI()

void IVP13DSystemSimple::updateGUI ( )
inlineinherited

Definition at line 89 of file IVP13DSystemSimple.h.

◆ updateTransparency

void VP1GeometrySystem::updateTransparency ( )
protectedslot

Definition at line 1512 of file VP1GeometrySystem.cxx.

1513{
1515
1516 float transparency = m_d->controller->transparency();
1517
1518 VolumeHandle* lastSelVol = m_d->controller->lastSelectedVolume();
1519 m_d->controller->setLastSelectedVolume(0);
1520 m_d->ensureInitVisAttributes();
1521 m_d->detVisAttributes->overrideTransparencies(transparency);
1522 m_d->matVisAttributes->overrideTransparencies(transparency);
1523 m_d->volVisAttributes->overrideTransparencies(transparency);
1524 m_d->controller->setLastSelectedVolume(lastSelVol);
1525}

◆ userChangedSelection()

void IVP13DSystem::userChangedSelection ( SoCooperativeSelection * ,
const QSet< SoNode * > & ,
QSet< SoPath * >  )
virtualinherited

◆ userClickedOnBgd()

void IVP13DSystem::userClickedOnBgd ( )
virtualinherited

Reimplemented in VP1AODSystem, VP1CaloReadoutSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 62 of file IVP13DSystem.cxx.

62{}

◆ userDeselectedSingleNode()

void IVP13DSystem::userDeselectedSingleNode ( SoCooperativeSelection * ,
SoNode * ,
SoPath *  )
virtualinherited

Reimplemented in VP1AODSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 60 of file IVP13DSystem.cxx.

60{}

◆ userPickedNode()

void VP1GeometrySystem::userPickedNode ( SoNode * pickedNode,
SoPath * pickedPath )
virtual

Reimplemented from IVP13DSystemSimple.

Definition at line 818 of file VP1GeometrySystem.cxx.

819{
820
822 // We want to find the volumehandle for the volume. To do so, we look //
823 // for the SoSeparator identifying the actual picked shape node, and //
824 // use it to look up the handle: //
826
827 //Looking for the identifying "nodesep", there are three scenarios
828 //for the type signatures of the final part of the path:
829 //
830 // 1) Most shapes:
831 // nodesep -> pickedNode (but we must pop to a group node in case of SoCylinders)
832 //
833 // 2) Volumes Around Z (all phi sectors enabled):
834 // nodesep -> switch -> pickedNode
835 //
836 // 3) Volumes Around Z (only some phi sectors enabled):
837 // nodesep -> switch -> sep -> pickedNode
838 //
839 // In the third scenario we also have to pop the path, in order for
840 // all phi-slices of the part gets highlighted (since more than one
841 // soshape node represents the volume).
842
843
844 VP1Msg::messageDebug("VP1GeometrySystem::userPickedNode()");
845
846 if (pickedPath->getNodeFromTail(0)->getTypeId()==SoCylinder::getClassTypeId())
847 pickedPath->pop();
848
849 if (pickedPath->getLength()<5) {
850 message("Path too short");
851 return;
852 }
853
854 SoSeparator * nodesep(0);
855
856 if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSeparator::getClassTypeId()
857 && pickedPath->getNodeFromTail(2)->getTypeId()==SoSwitch::getClassTypeId()
858 && pickedPath->getNodeFromTail(3)->getTypeId()==SoSeparator::getClassTypeId())
859 {
860 //Scenario 3:
861 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(3));
862 pickedPath->pop();//To get highlighting of siblings also.
863 }
864 else if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSwitch::getClassTypeId()
865 && pickedPath->getNodeFromTail(2)->getTypeId()==SoSeparator::getClassTypeId())
866 {
867 //Scenario 2:
868 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(2));
869 }
870 else if (pickedPath->getNodeFromTail(1)->getTypeId()==SoSeparator::getClassTypeId()) {
871 //Scenario 1 (normal):
872 nodesep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(1));
873 }
874 if (!nodesep) {
875 message("Unexpected picked path");
876 return;
877 }
878 if ( (!(nodesep)) || (m_d->sonodesep2volhandle.find(nodesep) == m_d->sonodesep2volhandle.end()) ) {
879 message("Problems finding volume handle");
880 return;
881 }
882 VolumeHandle * volhandle = m_d->sonodesep2volhandle[nodesep];
883 if (!volhandle) {
884 message("Found NULL volume handle");
885 return;
886 }
887
889 // Next thing to do is to check whether volume was clicked on with a //
890 // modifier of SHIFT/CTRL/Z. If so, we have to change the state on //
891 // the volume handle. Otherwise, we need to print some information: //
893
894 //For focus reason, and since Qt doesn't allow standard keys such as
895 //'z' as modifiers, we check for keypress states using a combination
896 //of the inventor and Qt way
897
898 bool shift_isdown = (Qt::ShiftModifier & QApplication::keyboardModifiers());
899// || ( m_d->kbEvent && (SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::LEFT_SHIFT)||
900// SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::RIGHT_SHIFT)) ) );
901
902 if (shift_isdown) {
903 //Parent of volume should be put in CONTRACTED state.
904 deselectAll();
905 if (volhandle->parent())
907 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
908 return;
909 }
910
911 bool ctrl_isdown = (Qt::ControlModifier & QApplication::keyboardModifiers());
912// || ( m_d->kbEvent && (SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::LEFT_CONTROL)||
913// SO_KEY_PRESS_EVENT(m_d->kbEvent, SoKeyboardEvent::RIGHT_CONTROL)) ) );
914
915 if (ctrl_isdown) {
916 //Volume should be put in EXPANDED state if it has children.
917 deselectAll();
918 if (volhandle->nChildren()>0) {
920 }
921 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
922 return;
923 }
924
925 bool z_isdown = m_d->kbEvent && SO_KEY_PRESS_EVENT(m_d->kbEvent,SoKeyboardEvent::Z);
926 if (z_isdown) {
927 //Volume should be put in ZAPPED state.
928 deselectAll();
929 volhandle->setState(VP1GeoFlags::ZAPPED);
930 message("===> Zapping Node: "+volhandle->getName());
931 // std::cout<<"Zapped VH="<<volhandle<<std::endl;
932 return;
933 }
934
936 // Depending on settings, we are to realign the camera if the //
937 // clicked volume is (daughter of) a muon chamber //
939
940 bool orientedView(false);
941 if (m_d->controller->orientViewToMuonChambersOnClick() && volhandle->isInMuonChamber()) {
942 //Volume is an, or is daughter of an, MDT, CSC or TGC chamber
944 orientedView = true;
945 //Now we must fix the tail of the pickedPath to ensure we
946 //select the correct node corresponding to the clicked volume
947 //again (it might have become attached/detached by the call to
948 //orientViewToMuonChamber):
949 if (!VP1QtInventorUtils::changePathTail(pickedPath,m_d->sceneroot,volhandle->nodeSoSeparator())) {
950 message("Warning: Failed to relocate picked node.");
951 deselectAll();
952 }
953 }
954
956 // Zoom to volume //
958
959 //Nb: We don't do this if we already oriented to the muon chamber above.
960 if (!orientedView&&m_d->controller->zoomToVolumeOnClick()) {
961 if (m_d->sceneroot&&volhandle->nodeSoSeparator()) {
962 std::set<SoCamera*> cameras = getCameraList();
963 std::set<SoCamera*>::iterator it,itE = cameras.end();
964 for (it=cameras.begin();it!=itE;++it) {
965 VP1CameraHelper::animatedZoomToSubTree(*it,m_d->sceneroot,volhandle->nodeSoSeparator(),2.0,1.0);
966 }
967 }
968 }
969
970
972 // Update last-select controls //
974
975 m_d->controller->setLastSelectedVolume(volhandle);
976
978 // OK, time to print some information for the volume //
980
981 message("===> Selected Node: "+volhandle->getName());
982 // std::cout<<"VolHandle = "<<volhandle<<std::endl;
983 if (m_d->controller->printInfoOnClick_Shape()) {
984 for (const QString& str : DumpShape::shapeToStringList(volhandle->geoPVConstLink()->getLogVol()->getShape()))
985 message(str);
986 }
987
988 if (m_d->controller->printInfoOnClick_Material()) {
989 message("===> Material:");
990 for (const QString& line : VP1GeomUtils::geoMaterialToStringList(volhandle->geoMaterial()))
991 message(" "+line);
992 }
993
994 if ( m_d->controller->printInfoOnClick_CopyNumber() ) {
995 int cn = volhandle->copyNumber();
996 message("===> CopyNo : "+(cn>=0?QString::number(cn):QString(cn==-1?"Invalid":"Error reconstructing copynumber")));
997 }
998
999 if ( m_d->controller->printInfoOnClick_Transform() ) {
1000
1001 float translation_x, translation_y, translation_z, rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians;
1003 translation_x, translation_y, translation_z,
1004 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
1005 message("===> Local Translation:");
1006 message(" x = "+QString::number(translation_x/CLHEP::mm)+" mm");
1007 message(" y = "+QString::number(translation_y/CLHEP::mm)+" mm");
1008 message(" z = "+QString::number(translation_z/CLHEP::mm)+" mm");
1009 message("===> Local Rotation:");
1010 message(" axis x = "+QString::number(rotaxis_x));
1011 message(" axis y = "+QString::number(rotaxis_y));
1012 message(" axis z = "+QString::number(rotaxis_z));
1013 message(" angle = "+QString::number(rotangle_radians*180.0/M_PI)+" deg");
1015 translation_x, translation_y, translation_z,
1016 rotaxis_x, rotaxis_y, rotaxis_z, rotangle_radians );
1017 message("===> Global Translation:");
1018 message(" x = "+QString::number(translation_x/CLHEP::mm)+" mm");
1019 message(" y = "+QString::number(translation_y/CLHEP::mm)+" mm");
1020 message(" z = "+QString::number(translation_z/CLHEP::mm)+" mm");
1021 message("===> Global Rotation:");
1022 message(" axis x = "+QString::number(rotaxis_x));
1023 message(" axis y = "+QString::number(rotaxis_y));
1024 message(" axis z = "+QString::number(rotaxis_z));
1025 message(" angle = "+QString::number(rotangle_radians*180.0/M_PI)+" deg");
1026 }
1027
1028 if (m_d->controller->printInfoOnClick_Tree()) {
1029 std::ostringstream str;
1030 GeoPrintGraphAction pg(str);
1031 volhandle->geoPVConstLink()->exec(&pg);
1032 message("===> Tree:");
1033 for (const QString& line : QString(str.str().c_str()).split("\n"))
1034 message(" "+line);
1035 }
1036
1037 if (m_d->controller->printInfoOnClick_Mass()) {
1038 //FIXME: Move the mass calculations to the volume handles, and let
1039 //the common data cache some of the volume information by
1040 //logVolume).
1041 message("===> Total Mass &lt;===");
1042 message("Inclusive "+QString::number(Imp::inclusiveMass(volhandle->geoPVConstLink())/CLHEP::kilogram)+" kg");
1043 message("Exclusive "+QString::number(Imp::exclusiveMass(volhandle->geoPVConstLink())/CLHEP::kilogram)+" kg");
1044 }
1045
1046 if (m_d->controller->printInfoOnClick_MuonStationInfo()&&volhandle->isInMuonChamber()) {
1047 PVConstLink pvlink = volhandle->topLevelParent()->geoPVConstLink();
1048 std::map<PVConstLink,VolumeHandle*>::const_iterator itChamber = m_d->muonchambers_pv2handles.find(pvlink);
1049 #ifndef BUILDVP1LIGHT
1050 if (itChamber!=m_d->muonchambers_pv2handles.end()) {
1051 m_d->ensureInitPV2MuonStationMap();
1052 std::map<GeoPVConstLink,const MuonGM::MuonStation*>::const_iterator itStation(m_d->pv2MuonStation.find(pvlink));
1053 if (itStation!=m_d->pv2MuonStation.end()) {
1054 message("===> Muon station &lt;===");
1055 message(" ",m_d->stationInfo(itStation->second));
1056 }
1057 }
1058 #endif
1059 }
1060
1062 // Emit a signal for the VP1UtilitySystems::PartSpect system //
1064 QStack<QString> partspectPath, extras;
1065 QString detFactoryName;
1066
1067 VolumeHandle *parentVH(volhandle), *childVH(volhandle);
1068 m_d->createPathExtras(volhandle,detFactoryName,extras);
1069
1070 do {
1071 parentVH = parentVH->parent();
1072 PVConstLink parentPVLink = parentVH ? parentVH->geoPVConstLink() : childVH->geoPVConstLink()->getParent();
1073 if (parentPVLink) {
1074 int indexOfChild = parentVH ? childVH->childNumber() : parentPVLink->indexOf(childVH->geoPVConstLink()).value();
1075
1076 std::string childPVName = parentPVLink->getNameOfChildVol(indexOfChild);
1077 QString pathEntry = childPVName=="ANON" ? detFactoryName+childVH->getName() : QString(childPVName.c_str());
1078
1079 std::optional<int> childCopyNo = parentPVLink->getIdOfChildVol(indexOfChild);
1080 if(childCopyNo) {
1081 QString strCopyNo;
1082 strCopyNo.setNum(*childCopyNo);
1083 pathEntry += ("::"+strCopyNo);
1084 }
1085 partspectPath.push(pathEntry);
1086 childVH = parentVH;
1087 }
1088 }while(parentVH);
1089
1090 while(!extras.isEmpty())
1091 partspectPath.push(extras.pop());
1092
1093 partspectPath.push("Atlas::Atlas");
1094
1095 // Emit the signal
1096 //volhandle cannot be NULL here (coverity 16287)
1097 //int cn=(!volhandle) ? -1 : volhandle->copyNumber();
1098 int cn=volhandle->copyNumber();
1099 plotSpectrum(partspectPath,cn);
1100}
static QStringList shapeToStringList(const GeoShape *shape)
Definition DumpShape.cxx:34
static QStringList geoMaterialToStringList(const GeoMaterial *)
static double inclusiveMass(const PVConstLink &pv)
static double exclusiveMass(const PVConstLink &pv)
void orientViewToMuonChamber(const GeoPVConstLink &chamberPV)
void plotSpectrum(QStack< QString > &, int copyNumber=-1)
static void decodeTransformation(const SbMatrix &, float &translation_x, float &translation_y, float &translation_z, float &rotaxis_x, float &rotaxis_y, float &rotaxis_z, float &rotangle_radians)
static bool changePathTail(SoPath *path, SoNode *commonBranchPoint, SoNode *newtail)
const SbMatrix & getGlobalTransformToVolume() const
const GeoMaterial * geoMaterial() const
QString getName() const
SbMatrix getLocalTransformToVolume() const
VolumeHandle * topLevelParent()
GeoPVConstLink geoPVConstLink() const
int copyNumber() const
bool isInMuonChamber() const
VolumeHandle * parent()
unsigned nChildren() const

◆ userSelectedSingleNode()

void IVP13DSystem::userSelectedSingleNode ( SoCooperativeSelection * ,
SoNode * ,
SoPath *  )
virtualinherited

Reimplemented in VP1AODSystem, VP1PrepRawDataSystem, and VP1TrackSystem.

Definition at line 59 of file IVP13DSystem.cxx.

59{}

◆ verbose()

bool IVP1System::verbose ( )
inlinestaticinherited

Definition at line 86 of file IVP1System.h.

86{ return s_vp1verbose; }// Returns true if env var VP1_VERBOSE_OUTPUT=1
static const bool s_vp1verbose
Definition IVP1System.h:158

◆ volumeResetRequested

void VP1GeometrySystem::volumeResetRequested ( VolumeHandle * vh)
protectedslot

Definition at line 2876 of file VP1GeometrySystem.cxx.

2877{
2878 if (!vh)
2879 return;
2880 deselectAll();
2881 vh->reset();
2882 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2883}

◆ volumeStateChangeRequested

void VP1GeometrySystem::volumeStateChangeRequested ( VolumeHandle * vh,
VP1GeoFlags::VOLSTATE state )
protectedslot

Definition at line 2865 of file VP1GeometrySystem.cxx.

2866{
2867 //might not use this slot presently...
2868 if (!vh)
2869 return;
2870 deselectAll();
2871 vh->setState(state);
2872 m_d->phisectormanager->updateRepresentationsOfVolsAroundZAxis();
2873}

◆ warnOnDisabledNotifications()

void IVP13DSystemSimple::warnOnDisabledNotifications ( ) const
inherited

Definition at line 221 of file IVP13DSystemSimple.cxx.

222{
223 QList<SoNode*> nodesR;
224 QList<SoNode*> nodesE;
225 m_d->getNodesWithDisabledNotifications(m_d->rootR, nodesR);
226 m_d->getNodesWithDisabledNotifications(m_d->rootE, nodesE);
227 if (!nodesR.isEmpty()) {
228 message("WARNING: Found "+str(nodesR.count())+" node"+QString(nodesR.count()>1?"s":0)+" with disabled notifications in permanent scenegraph:");
229 for (SoNode * node : nodesR)
230 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
231 }
232 if (!nodesE.isEmpty()) {
233 message("WARNING: Found "+str(nodesE.count())+" node"+QString(nodesE.count()>1?"s":0)+" with disabled notifications in event scenegraph:");
234 for (SoNode * node : nodesE)
235 message(" => Node ("+str(node)+") of type "+QString(node->getTypeId().getName().getString())+", named "+QString(node->getName().getString()));
236 }
237}

Member Data Documentation

◆ m_d

Imp* VP1GeometrySystem::m_d
protected

Definition at line 105 of file VP1GeometrySystem.h.

◆ s_vp1verbose

const bool IVP1System::s_vp1verbose = VP1QtUtils::environmentVariableIsOn("VP1_VERBOSE_OUTPUT")
staticprivateinherited

Definition at line 158 of file IVP1System.h.


The documentation for this class was generated from the following files: