diff --git a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py index 7590aec0f51dc18282ee5a305e44b9afce5b6b53..251c4a68899e1221f0eadb5712b51d49995f6012 100644 --- a/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py +++ b/Tracker/TrackerDigitization/FaserSCT_Digitization/test/FaserSCT_DigitizationDbg.py @@ -12,6 +12,7 @@ from AthenaConfiguration.TestDefaults import defaultTestFiles from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg +from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg #from Digitization.DigitizationParametersConfig import writeDigitizationMetadata from FaserSCT_Digitization.FaserSCT_DigitizationConfigNew import FaserSCT_DigitizationCfg #from MCTruthSimAlgs.RecoTimingConfig import MergeRecoTimingObjCfg @@ -32,17 +33,29 @@ ConfigFlags.Beam.NumberOfCollisions = 0. ConfigFlags.GeoModel.FaserVersion = "FASER-00" # Always needed ConfigFlags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01" # Always needed to fool autoconfig +ConfigFlags.Digitization.TruthOutput = True + ConfigFlags.lock() # Core components acc = MainServicesSerialCfg() acc.merge(PoolReadCfg(ConfigFlags)) acc.merge(PoolWriteCfg(ConfigFlags)) + #acc.merge(writeDigitizationMetadata(ConfigFlags)) # Inner Detector acc.merge(FaserSCT_DigitizationCfg(ConfigFlags)) +# Output Stream customization +oStream = acc.getEventAlgo("OutputStreamRDO") +oStream.ItemList += ["EventInfo#*", + "McEventCollection#TruthEvent", + "McEventCollection#GEN_EVENT", + "ScintHitCollection#*", + "FaserSiHitCollection#SCT_Hits" + ] + # Timing #acc.merge(MergeRecoTimingObjCfg(ConfigFlags)) diff --git a/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/CMakeLists.txt b/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/CMakeLists.txt index 8f864c585062f623dc4f6e6252004784dfd37c54..6aa38cf1d61fa19b459f66fe5ec4041c166166cd 100644 --- a/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/CMakeLists.txt +++ b/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/CMakeLists.txt @@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PRIVATE graphics/VTI12/VTI12Systems/VTI12TrackSystems graphics/VTI12/VTI12Systems/VTI12SimHitSystems + graphics/VTI12/VTI12Systems/VTI12RawDataSystems graphics/VTI12/VTI12Systems/VTI12GeometrySystems graphics/VTI12/VTI12Systems/VTI12GuideLineSystems ) @@ -26,4 +27,4 @@ atlas_add_library( VTI12FaserPlugin VTI12FaserPlugin/*.h src/*.cxx src/*.qrc PUBLIC_HEADERS VTI12FaserPlugin LINK_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets - PRIVATE_LINK_LIBRARIES VP1Base VTI12GuideLineSystems VTI12GeometrySystems VTI12SimHitSystems VTI12TrackSystems) + PRIVATE_LINK_LIBRARIES VP1Base VTI12GuideLineSystems VTI12GeometrySystems VTI12SimHitSystems VTI12RawDataSystems VTI12TrackSystems) diff --git a/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/src/VP1FaserChannel.cxx b/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/src/VP1FaserChannel.cxx index 79b2a54c20695839d93f3396c3755729fdd1c126..478b929050e0daab47b4b7a3df1b3bd375cc142e 100755 --- a/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/src/VP1FaserChannel.cxx +++ b/graphics/VTI12/VTI12Plugins/VTI12FaserPlugin/src/VP1FaserChannel.cxx @@ -17,6 +17,7 @@ #include "VTI12GeometrySystems/VP1GeometrySystem.h" #include "VTI12GuideLineSystems/VP1GuideLineSystem.h" #include "VTI12SimHitSystems/VP1SimHitSystem.h" +#include "VTI12RawDataSystems/VP1RawDataSystem.h" #include "VP1Base/VP1QtUtils.h" VP1FaserChannel::VP1FaserChannel() @@ -29,6 +30,7 @@ VP1FaserChannel::VP1FaserChannel() void VP1FaserChannel::init() { addSystem(new VP1TrackSystem); + addSystem(new VP1RawDataSystem); addSystem(new VP1SimHitSystem); addSystem(new VP1GeometrySystem); addSystem(new VP1GuideLineSystem); diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/CMakeLists.txt b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..946dd9d49f17176badde8bd3b31ece19da0a307b --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/CMakeLists.txt @@ -0,0 +1,45 @@ +################################################################################ +# Package: VTI12RawDataSystems +################################################################################ + +# Declare the package name: +atlas_subdir( VTI12RawDataSystems ) + +# Declare the package's dependencies: +atlas_depends_on_subdirs( PUBLIC + DetectorDescription/GeoPrimitives + graphics/VP1/VP1Base + PRIVATE + Event/EventPrimitives + GaudiKernel + Tracker/TrackerDetDescr/TrackerIdentifier + Tracker/TrackerDetDescr/TrackerReadoutGeometry + Tracker/TrackerRawEvent/TrackerRawData + graphics/VP1/VP1HEPVis + graphics/VTI12/VTI12Utils ) + +# External dependencies: +find_package( Coin3D ) +find_package( Eigen ) +find_package( Qt5 COMPONENTS Core Gui Widgets ) +find_package( GeoModelCore ) + +# Generate UI files automatically: +set( CMAKE_AUTOUIC TRUE ) +# Generate MOC files automatically: +set( CMAKE_AUTOMOC TRUE ) +# Generate resource files automatically: +set( CMAKE_AUTORCC TRUE ) +# to let CMake find .h files automatically-generated from .ui files +set(CMAKE_INCLUDE_CURRENT_DIR ON) + + +# Component(s) in the package: +atlas_add_library( VTI12RawDataSystems VTI12RawDataSystems/*.h src/*.h src/*.cxx src/*.qrc + PUBLIC_HEADERS VTI12RawDataSystems + INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} + PRIVATE_INCLUDE_DIRS ${COIN3D_INCLUDE_DIRS} +# FILES LUCID_RawEvent/LUCID_Digit.h + LINK_LIBRARIES ${EIGEN_LIBRARIES} GeoPrimitives VP1Base GL + PRIVATE_LINK_LIBRARIES ${COIN3D_LIBRARIES} ${GEOMODELCORE_LIBRARIES} EventPrimitives GaudiKernel TrackerIdentifier TrackerReadoutGeometry TrackerRawData VP1HEPVis VTI12Utils ) + diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCollBase.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCollBase.h new file mode 100644 index 0000000000000000000000000000000000000000..866bb8404bb664927f642d6ee6d5dfef5c38cef6 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCollBase.h @@ -0,0 +1,77 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataCollBase // +// // +// Description: ... // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATACOLLBASE_H +#define VP1RAWDATACOLLBASE_H + +#include "VP1Base/VP1StdCollection.h" +#include "VTI12RawDataSystems/VP1RawDataFlags.h" +#include "VP1Base/VP1Interval.h" +#include <vector> + +class VP1RawDataHandleBase; +class VP1RawDataCommonData; +class VP1ExtraSepLayerHelper; + +class VP1RawDataCollBase : public VP1StdCollection { + + Q_OBJECT + +public: + + VP1RawDataCollBase(VP1RawDataCommonData*,const QString& key); + virtual ~VP1RawDataCollBase(); + virtual void init(VP1MaterialButtonBase* mat=0); + + VP1RawDataCommonData * common() const { return m_common; } + VP1ExtraSepLayerHelper * sepHelper() const; + + virtual bool usesTrackerPartsCuts() { return false; }//Override if InDet + +public slots: + void setAllowedEta(const VP1Interval&); + void setAllowedPhi(const QList<VP1Interval>&); + void setEnabledTrackerParts(VP1RawDataFlags::TrackerPartsFlags); + +//Nb: RawDataHandleBase needs eta() and phi() method. + +protected: + QString provideText() const; + +//For use in load() reimplementations: + void addHandle(VP1RawDataHandleBase*);//Return pointer to the handle. Base class (this) will own it. + + virtual bool cut(VP1RawDataHandleBase*) = 0;//Return true if should be shown (based on various cuts not including eta and phi), false otherwise. + + //For rechecking cut status: + void recheckCutStatus(VP1RawDataHandleBase*); + void recheckCutStatusOfAllHandles(); + void recheckCutStatusOfAllVisibleHandles(); + void recheckCutStatusOfAllNotVisibleHandles(); + + std::vector<VP1RawDataHandleBase*>& getHandles(); + +private slots: + void collVisibilityChanged(bool); + +private: + VP1RawDataCommonData * m_common; + class Imp; + Imp * m_d; + +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataColl_SCT_RDO.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataColl_SCT_RDO.h new file mode 100644 index 0000000000000000000000000000000000000000..78870c26b9c2dedbbb75c4b3434511c8c2bc253e --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataColl_SCT_RDO.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataColl_SCT_RDO // +// // +// Description: Collection of SCT RDO's // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATACOLL_SCT_RDO_H +#define VP1RAWDATACOLL_SCT_RDO_H + +#include "VTI12RawDataSystems/VP1RawDataCollBase.h" +#include "VTI12RawDataSystems/VP1RawDataFlags.h" + +class VP1RawDataColl_SCT_RDO : public VP1RawDataCollBase { +public: + + static QStringList availableCollections(IVP1System*); + + VP1RawDataColl_SCT_RDO(VP1RawDataCommonData*,const QString& key); + virtual ~VP1RawDataColl_SCT_RDO(); + + bool cut(VP1RawDataHandleBase*); + + bool usesInDetPartsCuts() { return true; }//To get InDet parts cuts + +protected: + void assignDefaultMaterial(SoMaterial*) const; + bool load(); + qint32 provideCollTypeID() const { return 1; } + QString provideSection() const { return "Inner Detector"; } + +private: + + class Imp; + Imp * m_d; + +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCommonData.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCommonData.h new file mode 100644 index 0000000000000000000000000000000000000000..2ecf69bb53f7d17b060d79607d0e00477e9393c6 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataCommonData.h @@ -0,0 +1,64 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataCommonData // +// // +// Description: Common pointers, data, node-to-object maps // +// etc. for the raw data system // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATACOMMONDATA_H +#define VP1RAWDATACOMMONDATA_H + +#include "VP1Base/VP1HelperClassBase.h" +#include <QObject> + +class VP1RawDataHandleBase; +class VP1RawDataSysController; +class IVP13DSystem; +class HitsSoNodeManager; +class SoTransform; +class SoGroup; + +class VP1RawDataCommonData : public QObject, public VP1HelperClassBase { + + Q_OBJECT + +public: + + VP1RawDataCommonData(IVP13DSystem * sys,VP1RawDataSysController*); + virtual ~VP1RawDataCommonData(); + + VP1RawDataSysController * controller() { return m_controller; } + IVP13DSystem * system() { return m_system; } + HitsSoNodeManager * nodeManager() const { return m_nodeManager; } + + void registerTransformAndHandle(SoTransform*,VP1RawDataHandleBase*); + void clearEventData();//clears transform-to-handle map. + VP1RawDataHandleBase* getHandle(SoTransform*); + + void updateVolumeOutlines(SoGroup*);//updates children under the group recursively. + +private slots: + void setShowVolumeOutLines(bool); + +private: + + VP1RawDataSysController * m_controller; + IVP13DSystem * m_system; + HitsSoNodeManager * m_nodeManager; + + class Imp; + Imp * m_d; + +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataFlags.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataFlags.h new file mode 100644 index 0000000000000000000000000000000000000000..aa7026978b014395013a09d5b68d125bd32de4a1 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataFlags.h @@ -0,0 +1,39 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Common flags used in the raw data system. // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: November 2007 // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATAFLAGS_H +#define VP1RAWDATAFLAGS_H + +#include <QFlags> + +class VP1RawDataFlags { +public: + + enum TrackerPartsFlag { + None = 0x000000, + Upstream = 0x000001, + Central = 0x000002, + Downstream = 0x000004, + All = 0x000007 + }; + Q_DECLARE_FLAGS(TrackerPartsFlags, TrackerPartsFlag) + +private: + VP1RawDataFlags(); + ~VP1RawDataFlags(); +}; + +Q_DECLARE_OPERATORS_FOR_FLAGS(VP1RawDataFlags::TrackerPartsFlags) + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandleBase.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandleBase.h new file mode 100644 index 0000000000000000000000000000000000000000..5db612656bd4c9ea3be4c5c5d8b188a31143784f --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandleBase.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataHandleBase // +// // +// Description: Base class for RDO handles // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: April 2008 (rewritten January 2009) // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATAHANDLEBASE_H +#define VP1RAWDATAHANDLEBASE_H + +class SoNode; +class SoTransform; +class SoMaterial; +class VP1RawDataCommonData; + +#include "VTI12RawDataSystems/VP1RawDataCollBase.h" +#include "VTI12RawDataSystems/VP1RawDataFlags.h" + +#include <QStringList> + +#include "GeoPrimitives/GeoPrimitives.h" + + + +class VP1RawDataHandleBase { +public: + + VP1RawDataHandleBase(VP1RawDataCollBase*); + virtual ~VP1RawDataHandleBase(); + + VP1RawDataCollBase* coll() const { return m_coll; } + VP1RawDataCommonData * common() const { return m_coll->common(); } + + void setVisible(bool); + bool visible() const { return m_visible; } + + void update3DObjects(); + virtual QStringList clicked(bool verbose) const = 0;//Called when user selects the node (stringlist is displayed in messagebox). + + virtual Amg::Vector3D center();//Default impl. uses the transform + + virtual VP1RawDataFlags::TrackerPartsFlags inTrackerParts() const { return VP1RawDataFlags::None; }//Override if Tracker + + static QString unsignedToHex(unsigned); + + void updateShownOutlines(); + +protected: + + virtual SoNode * buildShape() = 0; + virtual SoTransform * buildTransform() = 0; + + // It is illegal to copy/assign a VP1RawDataHandleBase: + VP1RawDataHandleBase( const VP1RawDataHandleBase & ); + VP1RawDataHandleBase & operator= ( const VP1RawDataHandleBase & ); + +private: + class Imp; + Imp * m_d; + //Here for inlining: + VP1RawDataCollBase * m_coll; + bool m_visible; + +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandle_SCT_RDO.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandle_SCT_RDO.h new file mode 100644 index 0000000000000000000000000000000000000000..db1d184ab95a6e8c108c73fff155ab08e41dc972 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataHandle_SCT_RDO.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataHandle_SCT_RDO // +// // +// Description: Handle for SCT RDO's // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: April 2008 (rewritten January 2009) // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATAHANDLE_SCT_RDO_H +#define VP1RAWDATAHANDLE_SCT_RDO_H + +#include "VTI12RawDataSystems/VP1RawDataHandleBase.h" +class FaserSCT_RDORawData; + +namespace TrackerDD { class SiDetectorElement; } + +class VP1RawDataHandle_SCT_RDO : public VP1RawDataHandleBase { +public: + + VP1RawDataHandle_SCT_RDO(VP1RawDataCollBase*,const FaserSCT_RDORawData*); + virtual ~VP1RawDataHandle_SCT_RDO(); + QStringList clicked(bool verbose) const; + + VP1RawDataFlags::TrackerPartsFlags inTrackerParts() const; + +protected: + SoNode * buildShape(); + SoTransform * buildTransform(); + const FaserSCT_RDORawData* m_data; + const TrackerDD::SiDetectorElement * element() const;//null in case of errors +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSysController.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSysController.h new file mode 100644 index 0000000000000000000000000000000000000000..3ebc964ac5a08d4c4865abc1b5e350f5c0aa75bf --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSysController.h @@ -0,0 +1,104 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataSysController // +// // +// Description: Raw data system controller . // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATASYSCONTROLLER_H +#define VP1RAWDATASYSCONTROLLER_H + +#include "VP1Base/VP1Controller.h" +#include "VTI12RawDataSystems/VP1RawDataFlags.h" +class SoGroup; + +class VP1RawDataSysController : public VP1Controller { + + Q_OBJECT + +public: + + VP1RawDataSysController(IVP1System * sys); + virtual ~VP1RawDataSysController(); + + void actualRestoreSettings(VP1Deserialise&); + int currentSettingsVersion() const; + void actualSaveSettings(VP1Serialise&) const; + + VP1CollectionWidget * collWidget() const; + + /////////////////////////////////// + // Access Methods for settings // + /////////////////////////////////// + + //To put at start of the system scenegraph: + SoGroup * drawOptions() const; + + //Materials: +// SoMaterial * trtHTMaterial() const; +// SoMaterial * bcmHighAttMaterial() const; + + //Interactions (no change signals needed): + bool printInfoOnClick() const; + bool printVerboseInfoOnClick() const; + bool zoomOnClick() const; + + //General cuts: + VP1Interval cutAllowedEta() const; + QList<VP1Interval> cutAllowedPhi() const;//All off: empty list. All on: list with one entry: ]-inf,inf[ + + //Other cuts: + VP1RawDataFlags::TrackerPartsFlags enabledTrackerParts() const; +// bool trtRequireHT() const; +// VP1Interval trtAllowedToT() const; +// unsigned lucidMinQDC() const; + + //Display options: + bool showVolumeOutLines() const; +// bool useSpecialTRTHTMaterial() const; +// bool useSpecialBCMHighAttMaterial() const; + + /////////////////////////////////////// + // Signals for changes in settings // + /////////////////////////////////////// +signals: + void cutAllowedEtaChanged(const VP1Interval&); + void cutAllowedPhiChanged(const QList<VP1Interval>&); + void showVolumeOutLinesChanged(bool); +// void useSpecialTRTHTMaterialChanged(bool); +// void useSpecialBCMHighAttMaterialChanged(bool); + void enabledTrackerPartsChanged(VP1RawDataFlags::TrackerPartsFlags); +// void trtRequireHTChanged(bool); +// void trtAllowedToTChanged(const VP1Interval&);//nano-seconds +// void lucidMinQDCChanged(unsigned); + +private: + + class Imp; + Imp * m_d; + +// //For verbose output: +// template <class T> static QString toString( const T& t ) { return VP1Controller::toString(t); }//unhide base methods +// static QString toString( const QPair<bool,double>& par ); +private slots: + void possibleChange_cutAllowedEta(); + void possibleChange_cutAllowedPhi(); + void possibleChange_showVolumeOutLines(); +// void possibleChange_useSpecialTRTHTMaterial(); +// void possibleChange_useSpecialBCMHighAttMaterial(); + void possibleChange_enabledTrackerParts(); +// void possibleChange_trtRequireHT(); +// void possibleChange_trtAllowedToT(); +// void possibleChange_lucidMinQDC(); +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSystem.h b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSystem.h new file mode 100644 index 0000000000000000000000000000000000000000..3526c8dceb10710e333a29c30c2625b23ef8c3d8 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/VTI12RawDataSystems/VP1RawDataSystem.h @@ -0,0 +1,42 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Header file for class VP1RawDataSystem // +// // +// Description: System displaying raw data (RDO's) +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: June 2008 (rewritten January 2009) // +// // +//////////////////////////////////////////////////////////////// + +#ifndef VP1RAWDATASYSTEM_H +#define VP1RAWDATASYSTEM_H + +#include "VP1Base/IVP13DSystemSimple.h" + +class VP1RawDataSystem : public IVP13DSystemSimple { + + Q_OBJECT + + public: + VP1RawDataSystem(); + virtual ~VP1RawDataSystem(); + void buildEventSceneGraph(StoreGateSvc* sg, SoSeparator *root); + void systemerase(); + void systemuncreate(); + void userPickedNode(SoNode* pickedNode, SoPath * pickedPath); + virtual QWidget * buildController(); + QByteArray saveState(); + void restoreFromState(QByteArray); + +private: + class Imp; + Imp * m_d; +}; + +#endif diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCollBase.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCollBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d1268b0d361f107f295622f75d3032dbbe50433c --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCollBase.cxx @@ -0,0 +1,245 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataCollBase // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataCollBase.h" +#include "VTI12RawDataSystems/VP1RawDataCommonData.h" +#include "VTI12RawDataSystems/VP1RawDataHandleBase.h" +#include "VTI12RawDataSystems/VP1RawDataSysController.h" +#include "VP1Base/VP1ExtraSepLayerHelper.h" +#include "VP1Base/IVP13DSystem.h" +#include "VP1Base/VP1Msg.h" + +#include "GeoPrimitives/GeoPrimitives.h" +#include "EventPrimitives/EventPrimitives.h" + +//____________________________________________________________________ +class VP1RawDataCollBase::Imp { +public: + QString key; + bool commonCuts(VP1RawDataHandleBase*handle); + VP1ExtraSepLayerHelper * sepHelper; + VP1Interval allowedEta; + QList<VP1Interval> allowedPhi; + VP1RawDataFlags::TrackerPartsFlags allowedTrackerParts; + std::vector<VP1RawDataHandleBase*> handles; + int iupdategui; +}; + + +//____________________________________________________________________ +VP1RawDataCollBase::VP1RawDataCollBase(VP1RawDataCommonData*common,const QString& key) + : VP1StdCollection(common->system(),"RawDataColl_"+key), m_common(common), m_d(new Imp) +{ + m_d->key = key; + m_d->sepHelper = 0; + m_d->iupdategui = 0; +} + +//____________________________________________________________________ +void VP1RawDataCollBase::init(VP1MaterialButtonBase*) +{ + VP1StdCollection::init();//Must be here + m_d->allowedTrackerParts = (usesTrackerPartsCuts() ? VP1RawDataFlags::None : VP1RawDataFlags::All); + connect(this,SIGNAL(visibilityChanged(bool)),this,SLOT(collVisibilityChanged(bool))); + + connect(m_common->controller(),SIGNAL(cutAllowedEtaChanged(const VP1Interval&)), + this,SLOT(setAllowedEta(const VP1Interval&))); + setAllowedEta(m_common->controller()->cutAllowedEta()); + + connect(m_common->controller(),SIGNAL(cutAllowedPhiChanged(const QList<VP1Interval>&)), + this,SLOT(setAllowedPhi(const QList<VP1Interval>&))); + setAllowedPhi(m_common->controller()->cutAllowedPhi()); + + connect(m_common->controller(),SIGNAL(enabledTrackerPartsChanged(VP1RawDataFlags::TrackerPartsFlags)), + this,SLOT(setEnabledTrackerParts(VP1RawDataFlags::TrackerPartsFlags))); + setEnabledTrackerParts(m_common->controller()->enabledTrackerParts()); +} + +//____________________________________________________________________ +VP1ExtraSepLayerHelper * VP1RawDataCollBase::sepHelper() const +{ + if (!m_d->sepHelper) + m_d->sepHelper = new VP1ExtraSepLayerHelper(collSep()); + return m_d->sepHelper; +} + +//____________________________________________________________________ +VP1RawDataCollBase::~VP1RawDataCollBase() +{ + std::vector<VP1RawDataHandleBase*>::iterator it(m_d->handles.begin()),itE(m_d->handles.end()); + for (;it!=itE;++it) + delete *it; + m_d->handles.clear(); + + delete m_d->sepHelper; + delete m_d; +} + +//____________________________________________________________________ +QString VP1RawDataCollBase::provideText() const +{ + return m_d->key; +} + +//____________________________________________________________________ +void VP1RawDataCollBase::collVisibilityChanged(bool vis) +{ + if (VP1Msg::verbose()) + messageVerbose("TrackCollHandleBase::collVisibilityChanged => "+str(vis)); + if (vis) + recheckCutStatusOfAllNotVisibleHandles();//Fixme -> ofallhandles? All must be not visible anyway... + else + recheckCutStatusOfAllVisibleHandles(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::setAllowedEta(const VP1Interval&e) +{ + if (m_d->allowedEta==e) + return; + bool relaxed(e.contains(m_d->allowedEta)); + bool tightened(m_d->allowedEta.contains(e)); + m_d->allowedEta=e; + if (relaxed) + recheckCutStatusOfAllNotVisibleHandles(); + else if (tightened) + recheckCutStatusOfAllVisibleHandles(); + else + recheckCutStatusOfAllHandles(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::setAllowedPhi(const QList<VP1Interval>&l) +{ + if (m_d->allowedPhi==l) + return; + m_d->allowedPhi=l; + recheckCutStatusOfAllHandles(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::setEnabledTrackerParts(VP1RawDataFlags::TrackerPartsFlags f) +{ + if (!usesTrackerPartsCuts()) + return; + if (m_d->allowedTrackerParts==f) + return; + bool relaxed((m_d->allowedTrackerParts&f) == m_d->allowedTrackerParts); + bool tightened((m_d->allowedTrackerParts&f) == f); + m_d->allowedTrackerParts=f; + if (relaxed) + recheckCutStatusOfAllNotVisibleHandles(); + else if (tightened) + recheckCutStatusOfAllVisibleHandles(); + else + recheckCutStatusOfAllHandles(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::addHandle(VP1RawDataHandleBase*handle) +{ + if (handle) + m_d->handles.push_back(handle); + if (!((m_d->iupdategui)++)%200) + systemBase()->updateGUI(); +} + +//____________________________________________________________________ +bool VP1RawDataCollBase::Imp::commonCuts(VP1RawDataHandleBase*handle) +{ + if (allowedTrackerParts!=VP1RawDataFlags::All) + if (!(handle->inTrackerParts()&allowedTrackerParts)) + return false; + + bool allPhiAllowed = allowedPhi.count()==1&&allowedPhi.at(0).isAllR(); + bool allEtaAllowed = allowedEta.isAllR(); + if (allEtaAllowed&&allPhiAllowed) + return true; + if (allowedPhi.isEmpty()||allowedEta.isEmpty()) + return false; + Amg::Vector3D p = handle->center(); + if (!allEtaAllowed) { + if (!allowedEta.contains(p.eta())) + return false; + } + if (!allPhiAllowed) { + double phi(p.phi()); + foreach(VP1Interval i,allowedPhi) { + if (i.contains(phi)||i.contains(phi+2*M_PI)||i.contains(phi-2*M_PI)) + return true; + } + return false; + } + return true; +} + +//____________________________________________________________________ +void VP1RawDataCollBase::recheckCutStatus(VP1RawDataHandleBase*handle) +{ + handle->setVisible( visible() && cut(handle) && m_d->commonCuts(handle) ); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::recheckCutStatusOfAllHandles() +{ + if (!isLoaded()) + return; + common()->system()->deselectAll(); + largeChangesBegin(); + std::vector<VP1RawDataHandleBase*>::iterator it(m_d->handles.begin()),itE(m_d->handles.end()); + int i(0); + for (;it!=itE;++it) { + recheckCutStatus(*it); + if (!(i++%200)) + systemBase()->updateGUI();//since called from ::actualLoad<..>(..) + } + largeChangesEnd(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::recheckCutStatusOfAllVisibleHandles() +{ + if (!isLoaded()) + return; + //This method is called when a cut is tightened - thus we better start by deselectAll to avoid weird highlighting issues. + common()->system()->deselectAll(); + + largeChangesBegin(); + std::vector<VP1RawDataHandleBase*>::iterator it(m_d->handles.begin()),itE(m_d->handles.end()); + for (;it!=itE;++it) { + if ((*it)->visible()) + recheckCutStatus(*it); + } + largeChangesEnd(); +} + +//____________________________________________________________________ +void VP1RawDataCollBase::recheckCutStatusOfAllNotVisibleHandles() +{ + if (!isLoaded()) + return; + largeChangesBegin(); + std::vector<VP1RawDataHandleBase*>::iterator it(m_d->handles.begin()),itE(m_d->handles.end()); + for (;it!=itE;++it) { + if (!(*it)->visible()) + recheckCutStatus(*it); + } + largeChangesEnd(); +} + +//____________________________________________________________________ +std::vector<VP1RawDataHandleBase*>& VP1RawDataCollBase::getHandles() +{ + return m_d->handles; +} diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataColl_SCT_RDO.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataColl_SCT_RDO.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0bd153df5509991ae0ccbc7d600551cc056d98b9 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataColl_SCT_RDO.cxx @@ -0,0 +1,83 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataColl_SCT_RDO // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataColl_SCT_RDO.h" +#include "VTI12RawDataSystems/VP1RawDataHandle_SCT_RDO.h" +#include "VTI12Utils/VP1JobConfigInfo.h" +#include "VP1Base/VP1MaterialButton.h" +#include "VTI12Utils/VP1SGContentsHelper.h" +#include "VTI12Utils/VP1SGAccessHelper.h" +#include "TrackerRawData/FaserSCT_RDO_Container.h" + + +//____________________________________________________________________ +QStringList VP1RawDataColl_SCT_RDO::availableCollections(IVP1System*sys) +{ + return VP1SGContentsHelper(sys).getKeys<FaserSCT_RDO_Container>(); +} + +//____________________________________________________________________ +class VP1RawDataColl_SCT_RDO::Imp { +public: +}; + + +//____________________________________________________________________ +VP1RawDataColl_SCT_RDO::VP1RawDataColl_SCT_RDO(VP1RawDataCommonData*common,const QString& key) + : VP1RawDataCollBase(common,key), m_d(new Imp) +{ +} + +//____________________________________________________________________ +VP1RawDataColl_SCT_RDO::~VP1RawDataColl_SCT_RDO() +{ + delete m_d; +} + +//____________________________________________________________________ +void VP1RawDataColl_SCT_RDO::assignDefaultMaterial(SoMaterial*m) const +{ + VP1MaterialButton::setMaterialParameters( m, 1.0, 1.0, 0.0, 0.1 ); +} + +//____________________________________________________________________ +bool VP1RawDataColl_SCT_RDO::load() +{ + if (!VP1JobConfigInfo::hasSCTGeometry()) { + message("SCT geometry not configured in job"); + return false; + } + const FaserSCT_RDO_Container* rdoContainer; + if (!VP1SGAccessHelper(systemBase()).retrieve(rdoContainer,text())) { + message("Problems retrieving container with key "+text()); + return false; + } + FaserSCT_RDO_Container::const_iterator itColl(rdoContainer->begin()), itCollE(rdoContainer->end()); + for (;itColl!=itCollE;++itColl) { + if (!*itColl||(*itColl)->empty()) + continue; + FaserSCT_RDO_Collection::const_iterator itRDO((*itColl)->begin()), itRDOE((*itColl)->end()); + for (;itRDO!=itRDOE;++itRDO) + addHandle(new VP1RawDataHandle_SCT_RDO(this,*itRDO)); + } + +// recheckCutStatusOfAllHandles(); + return true; +} + +//____________________________________________________________________ +bool VP1RawDataColl_SCT_RDO::cut(VP1RawDataHandleBase*) +{ + return true; +} diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCommonData.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCommonData.cxx new file mode 100644 index 0000000000000000000000000000000000000000..6d0cb1ba0e8840aa5cbe72ca0826cbda7ff95c6b --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataCommonData.cxx @@ -0,0 +1,106 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataCommonData // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataCommonData.h" +#include "VTI12RawDataSystems/VP1RawDataSysController.h" +#include "VTI12RawDataSystems/VP1RawDataHandleBase.h" +#include "VTI12Utils/HitsSoNodeManager.h" +#include "VP1Base/IVP13DSystem.h" +#include <map> +#include "VP1HEPVis/nodes/SoGenericBox.h" +#include <Inventor/nodes/SoGroup.h> + +//____________________________________________________________________ +class VP1RawDataCommonData::Imp { +public: + std::map<SoTransform*,VP1RawDataHandleBase*> transform2handle; + static void setShowVolumeOutlines(SoGroup*nodegroup,bool showvol); + bool showVolOutlines; +}; + + + +//____________________________________________________________________ +VP1RawDataCommonData::VP1RawDataCommonData(IVP13DSystem * sys,VP1RawDataSysController* controller) + : VP1HelperClassBase(sys,"VP1RawDataCommonData"), + m_controller(controller), m_system(sys), + m_nodeManager(new HitsSoNodeManager(sys)), m_d(new Imp) +{ + SoGenericBox::initClass(); + m_d->showVolOutlines = controller->showVolumeOutLines(); + connect(controller,SIGNAL(showVolumeOutLinesChanged(bool)), + this,SLOT(setShowVolumeOutLines(bool))); +} + +//____________________________________________________________________ +VP1RawDataCommonData::~VP1RawDataCommonData() +{ + delete m_nodeManager; + delete m_d; +} + +//____________________________________________________________________ +void VP1RawDataCommonData::registerTransformAndHandle(SoTransform*t,VP1RawDataHandleBase*h) +{ + if (t&&h) { + m_d->transform2handle[t]=h; + } +} + +//____________________________________________________________________ +void VP1RawDataCommonData::clearEventData() +{ + m_d->transform2handle.clear(); +} + +//____________________________________________________________________ +VP1RawDataHandleBase* VP1RawDataCommonData::getHandle(SoTransform*t) +{ + if (!t) + return 0; + std::map<SoTransform*,VP1RawDataHandleBase*>::iterator it = m_d->transform2handle.find(t); + return it==m_d->transform2handle.end() ? 0 : it->second; +} + +//_____________________________________________________________________________________ +void VP1RawDataCommonData::Imp::setShowVolumeOutlines(SoGroup*nodegroup,bool showvol) +{ + for (int i = 0; i<nodegroup->getNumChildren();++i) { + SoNode * n = nodegroup->getChild(i); + if (n->getTypeId().isDerivedFrom(SoGenericBox::getClassTypeId())) { + if (static_cast<SoGenericBox*>(n)->drawEdgeLines.getValue()!=showvol) + static_cast<SoGenericBox*>(n)->drawEdgeLines.setValue(showvol); + } else if (n->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) { + setShowVolumeOutlines(static_cast<SoGroup*>(n),showvol); + } + } +} + +//_____________________________________________________________________________________ +void VP1RawDataCommonData::updateVolumeOutlines(SoGroup * g) +{ + Imp::setShowVolumeOutlines(g,m_d->showVolOutlines); +} + +//_____________________________________________________________________________________ +void VP1RawDataCommonData::setShowVolumeOutLines(bool b) +{ + if (m_d->showVolOutlines==b) + return; + m_d->showVolOutlines = b; + std::map<SoTransform*,VP1RawDataHandleBase*>::iterator it, itE = m_d->transform2handle.end(); + for (it=m_d->transform2handle.begin();it!=itE;++it) + it->second->updateShownOutlines(); +} + diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandleBase.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandleBase.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bfea5d68da53b81612e1367fa6ae3b2cd57d2c64 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandleBase.cxx @@ -0,0 +1,185 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataHandleBase // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: April 2008 // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataHandleBase.h" +#include "VTI12RawDataSystems/VP1RawDataCommonData.h" +#include "VP1Base/VP1ExtraSepLayerHelper.h" + +#include <Inventor/nodes/SoSeparator.h> +#include <Inventor/nodes/SoTransform.h> +#include <Inventor/nodes/SoMaterial.h> + +#include <sstream> + +//____________________________________________________________________ +class VP1RawDataHandleBase::Imp { +public: + Imp() : sep(0),isAttached(false) {} + void rebuild3DObjects(VP1RawDataHandleBase*); + void ensureAttach3DObjects(VP1RawDataHandleBase*theclass); + void ensureDetach3DObjects(VP1RawDataHandleBase*theclass); + void ensureInitSepAndTransform(VP1RawDataHandleBase*theclass); + SoSeparator * sep;//First child is transform, second - if present - is node. + bool isAttached; + + bool hasShape() const + { + return sep&&sep->getNumChildren()>1; + } + + void clearShape() + { + if (hasShape()) { + sep->removeChild(1); + } + } +}; + +//____________________________________________________________________ +VP1RawDataHandleBase::VP1RawDataHandleBase( VP1RawDataCollBase* coll ) + : m_d(new Imp), m_coll(coll), m_visible(false)//,m_currentmaterial(0) +{ + +} + +//____________________________________________________________________ +VP1RawDataHandleBase::~VP1RawDataHandleBase() +{ + if (m_visible) + m_d->ensureDetach3DObjects(this); + m_d->clearShape(); + if (m_d->sep) + m_d->sep->unref(); + delete m_d; +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::setVisible(bool vis) +{ + if (vis==m_visible) + return; + m_visible=vis; + if (vis) { + if (!m_d->hasShape()) + m_d->rebuild3DObjects(this); + m_d->ensureAttach3DObjects(this); + } else { + m_d->ensureDetach3DObjects(this); + } +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::update3DObjects() +{ + if (m_visible) { + m_d->rebuild3DObjects(this); + } else { + //Simply clear the present 3D objects. They will only be recreated if/when the handle becomes visible again. + m_d->clearShape(); + } +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::Imp::ensureInitSepAndTransform(VP1RawDataHandleBase*theclass) +{ + if (sep) + return; + sep = new SoSeparator; + sep->ref(); + SoTransform * transform = theclass->buildTransform(); + sep->addChild(transform); + theclass->common()->registerTransformAndHandle(transform,theclass); + +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::Imp::rebuild3DObjects(VP1RawDataHandleBase*theclass) +{ + if (!sep) { + if (!theclass->m_visible) + return; + ensureInitSepAndTransform(theclass); + ensureAttach3DObjects(theclass); + } + + bool save(false); + if (theclass->m_visible) + save = sep->enableNotify(false); + + clearShape(); + + SoNode * shape = theclass->buildShape(); + sep->addChild(shape); + + theclass->updateShownOutlines(); + + if (save) { + sep->enableNotify(true); + sep->touch(); + } +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::Imp::ensureAttach3DObjects(VP1RawDataHandleBase*theclass) +{ + if (isAttached) + return; + isAttached = true; + + VP1ExtraSepLayerHelper * sh(theclass->m_coll->sepHelper()); + if (sep && sh) + sh->addNode(sep); +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::Imp::ensureDetach3DObjects(VP1RawDataHandleBase*theclass) +{ + if (!isAttached) + return; + isAttached = false; + + VP1ExtraSepLayerHelper * sh(theclass->m_coll->sepHelper()); + if (sep && sh) + sh->removeNode(sep); +} + +//____________________________________________________________________ +QString VP1RawDataHandleBase::unsignedToHex(unsigned i) +{ + std::ostringstream s; + s << "0x" << std::hex << i; + return QString(s.str().c_str()).toUpper(); +} + +//____________________________________________________________________ +Amg::Vector3D VP1RawDataHandleBase::center() +{ + m_d->ensureInitSepAndTransform(this); + assert(m_d->sep + && m_d->sep->getNumChildren()>0 + && m_d->sep->getChild(0)->getTypeId().isDerivedFrom(SoTransform::getClassTypeId())); + + float x,y,z; + static_cast<SoTransform*>(m_d->sep->getChild(0))->translation.getValue().getValue(x,y,z); + //NB: We assume that the center part of the transform is zero + return Amg::Vector3D(x,y,z); +} + +//____________________________________________________________________ +void VP1RawDataHandleBase::updateShownOutlines() +{ + if (!m_d->sep) + return; + common()->updateVolumeOutlines(m_d->sep); +} diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandle_SCT_RDO.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandle_SCT_RDO.cxx new file mode 100644 index 0000000000000000000000000000000000000000..9cbf757eafb8edfa8dea6a8cea19f31553126201 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataHandle_SCT_RDO.cxx @@ -0,0 +1,148 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataHandle_SCT_RDO // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: April 2008 (rewritten January 2009) // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataHandle_SCT_RDO.h" +#include "VTI12RawDataSystems/VP1RawDataCommonData.h" +#include "VTI12Utils/HitsSoNodeManager.h" +#include "VTI12Utils/VP1DetInfo.h" +#include "VTI12Utils/VP1LinAlgUtils.h" + +#include <Inventor/nodes/SoLineSet.h> +#include <Inventor/nodes/SoVertexProperty.h> + +#include "TrackerReadoutGeometry/SCT_DetectorManager.h" +#include "TrackerReadoutGeometry/SiDetectorElement.h" + +//#include "InDetReadoutGeometry/InDetReadoutGeometry/SCT_ModuleSideDesign.h" // old CMT +#include "TrackerReadoutGeometry/SCT_ModuleSideDesign.h" // new CMake + +#include "TrackerRawData/FaserSCT_RDORawData.h" +#include "TrackerIdentifier/FaserSCT_ID.h" + +#include "GeoPrimitives/GeoPrimitives.h" + + +//____________________________________________________________________ +VP1RawDataHandle_SCT_RDO::VP1RawDataHandle_SCT_RDO(VP1RawDataCollBase* coll,const FaserSCT_RDORawData*data) + : VP1RawDataHandleBase(coll), m_data(data) +{ +} + +//____________________________________________________________________ +VP1RawDataHandle_SCT_RDO::~VP1RawDataHandle_SCT_RDO() +{ +} + +//____________________________________________________________________ +QStringList VP1RawDataHandle_SCT_RDO::clicked(bool verbose) const +{ + static const FaserSCT_ID * idhelper = VP1DetInfo::sctIDHelper(); + QStringList l; + l << " ===> FaserSCT_RDORawData"; + l << " Data word: "+unsignedToHex(m_data->getWord()); + if (verbose) { + if (idhelper) { + Identifier id(m_data->identify()); + if (idhelper->station(id) == -1 ) l << " Part: Upstream Station"; + else if (idhelper->station(id) == 0) l << " Part: Central Station"; + else l << " Part: Downstream Station"; + // bool barrel(false); + // if (idhelper->barrel_ec(id)==-2) l << " Part: End Cap C"; + // else if (idhelper->barrel_ec(id)==2) l << " Part: End Cap A"; + // else { l << " Part: Barrel"; barrel = true; } + // l << " "+QString(barrel?"Layer":"Disk")+": "+QString::number(idhelper->layer_disk(id)); + l << " Plane: "+QString::number(idhelper->layer(id)); + l << " Phi module: "+QString::number(idhelper->phi_module(id)); + l << " Eta module: "+QString::number(idhelper->eta_module(id)); + l << " Side: "+QString(idhelper->side(id)==0 ? "0":"1"); + l << " Group Size: "+QString::number(m_data->getGroupSize()); + if (m_data->getGroupSize()>1) + l << " Strips: "+QString::number(idhelper->strip(id))+".."+QString::number(idhelper->strip(id)+m_data->getGroupSize()-1); + else + l << " Strip: "+QString::number(idhelper->strip(id)); + } + //Fixme: Try dynamic cast to SCT3_RawData, and print more information if it succeeds. + } + return l; +} + +//____________________________________________________________________ +SoNode * VP1RawDataHandle_SCT_RDO::buildShape() +{ + static const FaserSCT_ID * idhelper = VP1DetInfo::sctIDHelper(); + const TrackerDD::SiDetectorElement * elem = element(); + const int ngroup = m_data->getGroupSize(); + if (!elem||ngroup<1) + return common()->nodeManager()->getShapeNode_Point();//fixme: warn + + const TrackerDD::SCT_ModuleSideDesign& design = dynamic_cast<const TrackerDD::SCT_ModuleSideDesign&>(elem->design()); + + SoLineSet * line = new SoLineSet; + SoVertexProperty * vertices = new SoVertexProperty; + line->vertexProperty = vertices; + + Amg::Transform3D invTransform(elem->transform().inverse()); + const int ifirststrip(idhelper ? idhelper->strip(m_data->identify()) : 0); + int iver(0); + std::pair<TrackerDD::SiLocalPosition,TrackerDD::SiLocalPosition> localEnds; + for (int i=0;i<ngroup;++i) { + std::pair< Amg::Vector3D, Amg::Vector3D > globalEnds = elem->endsOfStrip(design.positionFromStrip(ifirststrip+i)); + Amg::Vector3D localA(invTransform*globalEnds.first); + Amg::Vector3D localB(invTransform*globalEnds.second); + localEnds = design.endsOfStrip(design.positionFromStrip(ifirststrip+i)); + vertices->vertex.set1Value(iver++,localA.x(),localA.y(),0); + vertices->vertex.set1Value(iver++,localB.x(),localB.y(),0); + line->numVertices.set1Value(i,2); + } + return line; +} + +//____________________________________________________________________ +SoTransform * VP1RawDataHandle_SCT_RDO::buildTransform() +{ + const TrackerDD::SiDetectorElement * elem = element(); + if (!elem) + return common()->nodeManager()->getUnitTransform();//fixme: warn + return VP1LinAlgUtils::toSoTransform(elem->transform()); +} + +//____________________________________________________________________ +const TrackerDD::SiDetectorElement * VP1RawDataHandle_SCT_RDO::element() const +{ + const TrackerDD::SCT_DetectorManager * detmgr = VP1DetInfo::sctDetMgr(); + if (!detmgr) + return 0; + return detmgr->getDetectorElement(m_data->identify()); +} + +// //____________________________________________________________________ +// SoMaterial * VP1RawDataHandle_SCT_RDO::determineMaterial() const +// { +// return common()->sctMaterial(); +// } + +//____________________________________________________________________ +VP1RawDataFlags::TrackerPartsFlags VP1RawDataHandle_SCT_RDO::inTrackerParts() const +{ + const TrackerDD::SiDetectorElement * elem = element(); + if (!elem) + return VP1RawDataFlags::All; + + static const FaserSCT_ID * idhelper = VP1DetInfo::sctIDHelper(); + Identifier id(m_data->identify()); + if (idhelper->station(id) == -1 ) return VP1RawDataFlags::Upstream; + if (idhelper->station(id) == 0 ) return VP1RawDataFlags::Central; + if (idhelper->station(id) == 1 ) return VP1RawDataFlags::Downstream; + return VP1RawDataFlags::All; + +} diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSysController.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSysController.cxx new file mode 100644 index 0000000000000000000000000000000000000000..341035c6c30240673536b05a75b3603c3ef943f3 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSysController.cxx @@ -0,0 +1,298 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataSysController // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: January 2009 // +// // +//////////////////////////////////////////////////////////////// + +#define VP1IMPVARNAME m_d + +#include "VTI12RawDataSystems/VP1RawDataSysController.h" +#include "ui_vp1rawdatacontrollerform.h" +#include "ui_rawdata_settings_display_form.h" +#include "ui_rawdata_settings_interactions_form.h" +#include "ui_rawdata_settings_cuts_form.h" +#include "VP1Base/VP1Serialise.h" +#include "VP1Base/VP1Deserialise.h" +#include "VP1Base/VP1CollectionWidget.h" + +#include "GaudiKernel/SystemOfUnits.h" + +#include <cmath> + + +//____________________________________________________________________ +class VP1RawDataSysController::Imp { +public: + Ui::VP1RawDataControllerForm ui; + Ui::RawDataSysSettingsCutsForm ui_cuts; + Ui::RawDataSysSettingsInteractionsForm ui_int; + Ui::RawDataSysSettingsDisplayForm ui_display; + VP1CollectionWidget * collWidget; + + VP1Interval last_cutAllowedEta; + QList<VP1Interval> last_cutAllowedPhi;//All off: empty list. All on: list with one entry: ]-inf,inf[ + bool last_showVolumeOutLines; +// bool last_useSpecialTRTHTMaterial; +// bool last_useSpecialBCMHighAttMaterial; + VP1RawDataFlags::TrackerPartsFlags last_enabledTrackerParts; +// bool last_trtRequireHT; +// VP1Interval last_trtAllowedToT; +// unsigned last_lucidMinQDC; +}; + +//____________________________________________________________________ +VP1RawDataSysController::VP1RawDataSysController(IVP1System * sys) + : VP1Controller(sys,"VP1RawDataSysController"), m_d(new Imp) +{ + m_d->ui.setupUi(this); + + m_d->collWidget = new VP1CollectionWidget; + setupCollWidgetInScrollArea(m_d->ui.collWidgetScrollArea,m_d->collWidget); + + initDialog(m_d->ui_display, m_d->ui.pushButton_settings_display); + initDialog(m_d->ui_int, m_d->ui.pushButton_settings_interactions); + initDialog(m_d->ui_cuts, m_d->ui.pushButton_settings_cuts); + + m_d->ui_display.widget_drawOptions->setLineWidths(1.5); + m_d->ui_display.widget_drawOptions->setPointSizes(2.5); + m_d->ui_display.widget_drawOptions->setComplexityDisabled(); + + m_d->ui_cuts.etaPhiCutWidget->setEtaCutEnabled(false); + +// m_d->ui_display.matButton_trtht->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0)); +// m_d->ui_display.matButton_bcmhighatt->setMaterial(VP1MaterialButton::createMaterial(1.0,0.0,0.0)); + + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Setup connections which monitor changes in the controller so that we may emit signals as appropriate: // + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + + // -> cutAllowedEta: + addUpdateSlot(SLOT(possibleChange_cutAllowedEta())); + connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedEtaChanged(const VP1Interval&))); + + // -> cutAllowedPhi: + addUpdateSlot(SLOT(possibleChange_cutAllowedPhi())); + connectToLastUpdateSlot(m_d->ui_cuts.etaPhiCutWidget,SIGNAL(allowedPhiChanged(const QList<VP1Interval>&))); + + // -> showVolumeOutLines + addUpdateSlot(SLOT(possibleChange_showVolumeOutLines())); + connectToLastUpdateSlot(m_d->ui_display.checkBox_showVolumeOutLines); + + // -> useSpecialTRTHTMaterial +// addUpdateSlot(SLOT(possibleChange_useSpecialTRTHTMaterial())); +// connectToLastUpdateSlot(m_d->ui_display.checkBox_trtHTUseSpecialMat); + + // -> useSpecialBCMHighAttMaterial +// addUpdateSlot(SLOT(possibleChange_useSpecialBCMHighAttMaterial())); +// connectToLastUpdateSlot(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat); + + // -> enabledTrackerParts + addUpdateSlot(SLOT(possibleChange_enabledTrackerParts())); + connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_tracker_upstream); + connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_tracker_central); + connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_tracker_downstream); +// connectToLastUpdateSlot(m_d->ui_cuts.checkBox_cut_indet_endcapC); + + // -> trtRequireHT +// addUpdateSlot(SLOT(possibleChange_trtRequireHT())); +// connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_needHT); + + // -> trtAllowedToT +// addUpdateSlot(SLOT(possibleChange_trtAllowedToT())); +// connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMin); +// connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMin); +// connectToLastUpdateSlot(m_d->ui_cuts.checkbox_cut_trt_TotMax); +// connectToLastUpdateSlot(m_d->ui_cuts.spinBox_cut_trt_ToTMax); + + // -> lucidMinQDC +// addUpdateSlot(SLOT(possibleChange_lucidMinQDC())); +// connectToLastUpdateSlot(m_d->ui_cuts.spinBox_lucid_qdc_min); + + initLastVars(); +} + +//____________________________________________________________________ +VP1RawDataSysController::~VP1RawDataSysController() +{ + delete m_d; +} + + +//____________________________________________________________________ +int VP1RawDataSysController::currentSettingsVersion() const +{ + return 1; +} + +//____________________________________________________________________ +void VP1RawDataSysController::actualSaveSettings(VP1Serialise&s) const +{ + s.save(m_d->ui_cuts.etaPhiCutWidget); + s.save(m_d->ui_cuts.checkBox_cut_tracker_upstream); + s.save(m_d->ui_cuts.checkBox_cut_tracker_central); + s.save(m_d->ui_cuts.checkBox_cut_tracker_downstream); +// s.save(m_d->ui_cuts.checkBox_cut_indet_endcapC); +// s.save(m_d->ui_cuts.checkbox_cut_trt_needHT); +// s.save(m_d->ui_cuts.checkbox_cut_trt_TotMin); +// s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMin); +// s.save(m_d->ui_cuts.checkbox_cut_trt_TotMax); +// s.save(m_d->ui_cuts.spinBox_cut_trt_ToTMax); + s.save(m_d->ui_display.checkBox_showVolumeOutLines); + s.save(m_d->ui_display.widget_drawOptions); +// s.save(m_d->ui_display.checkBox_trtHTUseSpecialMat); +// s.save(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat); +// s.save(m_d->ui_display.matButton_trtht); +// s.save(m_d->ui_display.matButton_bcmhighatt); + s.save(m_d->ui_int.checkBox_printinfo); + s.save(m_d->ui_int.checkBox_printinfo_verbose); + s.save(m_d->ui_int.checkBox_zoom); +// s.save(m_d->ui_cuts.spinBox_lucid_qdc_min);//Version 1+ +} + +//____________________________________________________________________ +void VP1RawDataSysController::actualRestoreSettings(VP1Deserialise& s) +{ + if (s.version()<0||s.version()>1) { + message("Warning: State data in .vp1 file has unsupported version ("+str(s.version())+")"); + return; + } + s.restore(m_d->ui_cuts.etaPhiCutWidget); + s.restore(m_d->ui_cuts.checkBox_cut_tracker_upstream); + s.restore(m_d->ui_cuts.checkBox_cut_tracker_central); + s.restore(m_d->ui_cuts.checkBox_cut_tracker_downstream); +// s.restore(m_d->ui_cuts.checkBox_cut_indet_endcapC); +// s.restore(m_d->ui_cuts.checkbox_cut_trt_needHT); +// s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMin); +// s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMin); +// s.restore(m_d->ui_cuts.checkbox_cut_trt_TotMax); +// s.restore(m_d->ui_cuts.spinBox_cut_trt_ToTMax); + s.restore(m_d->ui_display.checkBox_showVolumeOutLines); + s.restore(m_d->ui_display.widget_drawOptions); +// s.restore(m_d->ui_display.checkBox_trtHTUseSpecialMat); +// s.restore(m_d->ui_display.checkBox_bcmHighAttUseSpecialMat); +// s.restore(m_d->ui_display.matButton_trtht); +// s.restore(m_d->ui_display.matButton_bcmhighatt); + s.restore(m_d->ui_int.checkBox_printinfo); + s.restore(m_d->ui_int.checkBox_printinfo_verbose); + s.restore(m_d->ui_int.checkBox_zoom); +// if (s.version()>=1) +// s.restore(m_d->ui_cuts.spinBox_lucid_qdc_min); +} + +//____________________________________________________________________ +VP1CollectionWidget * VP1RawDataSysController::collWidget() const +{ + return m_d->collWidget; +} + +//____________________________________________________________________ +SoGroup * VP1RawDataSysController::drawOptions() const +{ + return m_d->ui_display.widget_drawOptions->drawOptionsGroup(); +} + +//____________________________________________________________________ +bool VP1RawDataSysController::printInfoOnClick() const { return m_d->ui_int.checkBox_printinfo->isChecked(); } +bool VP1RawDataSysController::printVerboseInfoOnClick() const { return m_d->ui_int.checkBox_printinfo_verbose->isChecked(); } +bool VP1RawDataSysController::zoomOnClick() const { return m_d->ui_int.checkBox_zoom->isChecked(); } + +//____________________________________________________________________ +VP1Interval VP1RawDataSysController::cutAllowedEta() const +{ + return m_d->ui_cuts.etaPhiCutWidget->allowedEta(); +} + +//____________________________________________________________________ +QList<VP1Interval> VP1RawDataSysController::cutAllowedPhi() const +{ + return m_d->ui_cuts.etaPhiCutWidget->allowedPhi(); +} + +//____________________________________________________________________ +bool VP1RawDataSysController::showVolumeOutLines() const +{ + return m_d->ui_display.checkBox_showVolumeOutLines->isChecked(); +} + +//____________________________________________________________________ +// bool VP1RawDataSysController::useSpecialTRTHTMaterial() const +// { +// return m_d->ui_display.checkBox_trtHTUseSpecialMat->isChecked(); +// } + +// //____________________________________________________________________ +// bool VP1RawDataSysController::useSpecialBCMHighAttMaterial() const +// { +// return m_d->ui_display.checkBox_bcmHighAttUseSpecialMat->isChecked(); +// } + +//____________________________________________________________________ +VP1RawDataFlags::TrackerPartsFlags VP1RawDataSysController::enabledTrackerParts() const +{ + VP1RawDataFlags::TrackerPartsFlags f; + if (m_d->ui_cuts.checkBox_cut_tracker_upstream->isChecked()) + f |= VP1RawDataFlags::Upstream; + if (m_d->ui_cuts.checkBox_cut_tracker_central->isChecked()) + f |= VP1RawDataFlags::Central; + if (m_d->ui_cuts.checkBox_cut_tracker_downstream->isChecked()) + f |= VP1RawDataFlags::Downstream; +// if (m_d->ui_cuts.checkBox_cut_indet_endcapC->isChecked()) +// f |= VP1RawDataFlags::EndCapNegative; + return f; +} + +//____________________________________________________________________ +// bool VP1RawDataSysController::trtRequireHT() const +// { +// return m_d->ui_cuts.checkbox_cut_trt_needHT->isChecked(); +// } + +// //____________________________________________________________________ +// VP1Interval VP1RawDataSysController::trtAllowedToT() const +// { +// VP1Interval i( (m_d->ui_cuts.checkbox_cut_trt_TotMin->isChecked() ? (m_d->ui_cuts.spinBox_cut_trt_ToTMin->value()-0.5)*3.125*Gaudi::Units::nanosecond : -VP1Interval::inf() ), +// (m_d->ui_cuts.checkbox_cut_trt_TotMax->isChecked() ? (m_d->ui_cuts.spinBox_cut_trt_ToTMax->value()+0.5)*3.125*Gaudi::Units::nanosecond : VP1Interval::inf() ) ); +// return i.lower()>i.upper() ? VP1Interval() : i; +// } + +// //____________________________________________________________________ +// unsigned VP1RawDataSysController::lucidMinQDC() const +// { +// return m_d->ui_cuts.spinBox_lucid_qdc_min->value(); +// } + +// //____________________________________________________________________ +// SoMaterial * VP1RawDataSysController::trtHTMaterial() const +// { +// return getMaterial(m_d->ui_display.matButton_trtht); +// } + +// //____________________________________________________________________ +// SoMaterial * VP1RawDataSysController::bcmHighAttMaterial() const +// { +// return getMaterial(m_d->ui_display.matButton_bcmhighatt); +// } + +/////////////////////////////////////////////////////////////////////////// +// Test for possible changes in values and emit signals as appropriate: +// (possibleChange_XXX() slots code provided by macros) +#define VP1CONTROLLERCLASSNAME VP1RawDataSysController +#include "VP1Base/VP1ControllerMacros.h" +POSSIBLECHANGE_IMP(cutAllowedEta) +POSSIBLECHANGE_IMP(cutAllowedPhi) +POSSIBLECHANGE_IMP(showVolumeOutLines) +// POSSIBLECHANGE_IMP(useSpecialTRTHTMaterial) +// POSSIBLECHANGE_IMP(useSpecialBCMHighAttMaterial) +POSSIBLECHANGE_IMP(enabledTrackerParts) +// POSSIBLECHANGE_IMP(trtRequireHT) +// POSSIBLECHANGE_IMP(trtAllowedToT) +// POSSIBLECHANGE_IMP(lucidMinQDC) diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSystem.cxx b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSystem.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d4a01e93d683cfbf7e552b4ea530ce88899e1034 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/VP1RawDataSystem.cxx @@ -0,0 +1,191 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +//////////////////////////////////////////////////////////////// +// // +// Implementation of class VP1RawDataSystem // +// // +// Author: Thomas H. Kittelmann (Thomas.Kittelmann@cern.ch) // +// Initial version: June 2008 (rewritten January 2009) // +// // +//////////////////////////////////////////////////////////////// + +#include "VTI12RawDataSystems/VP1RawDataSystem.h" +#include "VTI12RawDataSystems/VP1RawDataSysController.h" +#include "VTI12RawDataSystems/VP1RawDataColl_SCT_RDO.h" +#include "VTI12RawDataSystems/VP1RawDataCommonData.h" +#include "VTI12RawDataSystems/VP1RawDataHandleBase.h" +#include "VP1Base/VP1Serialise.h" +#include "VP1Base/VP1Deserialise.h" +#include "VP1Base/VP1CollectionWidget.h" +#include "VP1Base/VP1CameraHelper.h" +#include <Inventor/nodes/SoSeparator.h> +#include <Inventor/nodes/SoSwitch.h> +#include <Inventor/nodes/SoTransform.h> +#include <Inventor/SoPath.h> + +//____________________________________________________________________ +class VP1RawDataSystem::Imp { +public: + Imp(VP1RawDataSystem*tc) : theclass(tc), controller(0), common(0) {} + VP1RawDataSystem* theclass; + VP1RawDataSysController * controller; + VP1RawDataCommonData * common; + + template <class T> + QList<VP1RawDataCollBase*> createSpecificCollections() { + QList<VP1RawDataCollBase*> l; + foreach (QString name, T::availableCollections(theclass)) { + ensureInitCommonData(); + T * col = new T(common,name); + col->init(); + l << col; + } + return l; + } + QList<VP1RawDataCollBase*> createCollections() { + QList<VP1RawDataCollBase*> l; + // l << createSpecificCollections<VP1RawDataColl_PixelRDO>(); + l << createSpecificCollections<VP1RawDataColl_SCT_RDO>(); + // l << createSpecificCollections<VP1RawDataColl_TRT_RDO>(); + // l << createSpecificCollections<VP1RawDataColl_BCM_RDO>(); + // l << createSpecificCollections<VP1RawDataColl_LUCID>(); + return l; + } + + void ensureInitCommonData() { + if (!common) { + theclass->ensureBuildController(); + common = new VP1RawDataCommonData(theclass,controller); + } + } + +}; + +//_____________________________________________________________________________________ +VP1RawDataSystem::VP1RawDataSystem() + : IVP13DSystemSimple("RawHits", + "System showing Raw Data (RDO's)", + "Thomas.Kittelmann@cern.ch"), + m_d(new Imp(this)) +{ +} + +//____________________________________________________________________ +VP1RawDataSystem::~VP1RawDataSystem() + { + delete m_d; +} + +//_____________________________________________________________________________________ +void VP1RawDataSystem::systemerase() +{ + //Save present states and then clear all event data and related gui elements. + if (m_d->controller) + m_d->controller->collWidget()->clear(); + + if (m_d->common) + m_d->common->clearEventData(); +} + +//_____________________________________________________________________________________ +void VP1RawDataSystem::systemuncreate() +{ + delete m_d->common; + m_d->common = 0; +} + +//_____________________________________________________________________________________ +void VP1RawDataSystem::buildEventSceneGraph(StoreGateSvc*, SoSeparator *root) +{ + root->addChild(m_d->controller->drawOptions()); + + //Create collection list based on contents of event store, populate + //gui and apply states: + m_d->controller->collWidget()->setCollections(m_d->createCollections()); + + //Add collections to event scenegraph: + foreach (VP1StdCollection* col,m_d->controller->collWidget()->collections<VP1StdCollection>()) + root->addChild(col->collSwitch()); +} + +//_____________________________________________________________________________________ +QWidget * VP1RawDataSystem::buildController() +{ + m_d->controller = new VP1RawDataSysController(this); + return m_d->controller; +} + +//_____________________________________________________________________________________ +void VP1RawDataSystem::userPickedNode(SoNode*, SoPath * pickedPath) { + messageVerbose("userPickedNode"); + + //Look for separator whose first child is known transform (also pop a few times). + m_d->ensureInitCommonData(); + VP1RawDataHandleBase* handle(0); + int i(1); + for (; i < pickedPath->getLength(); ++i) { + if (pickedPath->getNodeFromTail(i)->getTypeId()==SoSeparator::getClassTypeId()) { + SoSeparator * sep = static_cast<SoSeparator*>(pickedPath->getNodeFromTail(i)); + if (sep->getNumChildren()>0&&sep->getChild(0)->getTypeId()==SoTransform::getClassTypeId()) { + SoTransform * transform = static_cast<SoTransform*>(sep->getChild(0)); + handle = m_d->common->getHandle(transform); + if (handle) + break; + } + } + } + for (int j=0;j<i;++j) + pickedPath->pop(); + + if (!handle) { + message("WARNING: Unknown node clicked."); + return; + } + + if (m_d->controller->printInfoOnClick()) { + message(handle->clicked(m_d->controller->printVerboseInfoOnClick())); + } + if (m_d->controller->zoomOnClick()) { + std::set<SoCamera*> cameras(getCameraList()); + std::set<SoCamera*>::iterator it,itE = cameras.end(); + for (it=cameras.begin();it!=itE;++it) + VP1CameraHelper::animatedZoomToPath(*it,handle->coll()->collSep(),pickedPath,2.0,1.0); + } + +} + +//_____________________________________________________________________________________ +QByteArray VP1RawDataSystem::saveState() +{ + VP1Serialise serialise(0/*version*/,this); + ensureBuildController(); + + serialise.save(IVP13DSystemSimple::saveState()); + + serialise.save(m_d->controller->collWidget()); + serialise.save(m_d->controller->saveSettings()); + + serialise.disableUnsavedChecks();//We do the testing in the controller + + return serialise.result(); +} + +//_____________________________________________________________________________________ +void VP1RawDataSystem::restoreFromState(QByteArray ba) +{ + VP1Deserialise state(ba,this); + if (state.version()<0||state.version()>0) { + message("Warning: State data in .vp1 file is in wrong format - ignoring!"); + return; + } + ensureBuildController(); + IVP13DSystemSimple::restoreFromState(state.restoreByteArray()); + + state.restore(m_d->controller->collWidget()); + m_d->controller->restoreSettings(state.restoreByteArray()); + + state.disableUnrestoredChecks();//We do the testing in the controller +} diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_cuts_form.ui b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_cuts_form.ui new file mode 100644 index 0000000000000000000000000000000000000000..e31cb80654dea675d7a72ae2b1b719746a9578ac --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_cuts_form.ui @@ -0,0 +1,311 @@ +<ui version="4.0" > + <class>RawDataSysSettingsCutsForm</class> + <widget class="QWidget" name="RawDataSysSettingsCutsForm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>218</width> + <height>383</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QGroupBox" name="groupBox_2" > + <property name="title" > + <string>Direction</string> + </property> + <layout class="QVBoxLayout" > + <property name="margin" > + <number>4</number> + </property> + <item> + <widget class="VP1EtaPhiCutWidget" native="1" name="etaPhiCutWidget" /> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_cuts_idgeneral" > + <property name="title" > + <string>Cuts: Inner Detector General</string> + </property> + <layout class="QHBoxLayout" name="_2" > + <property name="spacing" > + <number>0</number> + </property> + <property name="margin" > + <number>6</number> + </property> + <item> + <layout class="QGridLayout" name="_3" > + <property name="horizontalSpacing" > + <number>-1</number> + </property> + <property name="verticalSpacing" > + <number>0</number> + </property> + <item row="0" column="0" colspan="2" > + <widget class="QLabel" name="label_9" > + <property name="text" > + <string>Show data from parts:</string> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="checkBox_cut_tracker_upstream" > + <property name="text" > + <string>Barrel A</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QCheckBox" name="checkBox_cut_tracker_central" > + <property name="text" > + <string>Barrel C</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="checkBox_cut_tracker_downstream" > + <property name="text" > + <string>Endcap A</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <!-- + <item row="2" column="1" > + <widget class="QCheckBox" name="checkBox_cut_indet_endcapC" > + <property name="text" > + <string>Endcap C</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + --> + </layout> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>1</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox_cuts_trt" > + <property name="title" > + <string>Cuts: TRT</string> + </property> + <layout class="QHBoxLayout" name="_4" > + <property name="margin" > + <number>6</number> + </property> + <item> + <layout class="QGridLayout" name="_5" > + <property name="horizontalSpacing" > + <number>-1</number> + </property> + <property name="verticalSpacing" > + <number>0</number> + </property> + <item row="0" column="0" colspan="2" > + <widget class="QCheckBox" name="checkbox_cut_trt_needHT" > + <property name="toolTip" > + <string>If set, do not show TRT PRD which have the 'isNoise' flag set.</string> + </property> + <property name="text" > + <string>Require High Threshold</string> + </property> + <property name="checked" > + <bool>false</bool> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QCheckBox" name="checkbox_cut_trt_TotMin" > + <property name="toolTip" > + <string>If set, do not show TRT PRD which have the 'isNoise' flag set.</string> + </property> + <property name="text" > + <string>ToT min:</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QSpinBox" name="spinBox_cut_trt_ToTMin" > + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix" > + <string> x 3.125ns</string> + </property> + <property name="maximum" > + <number>24</number> + </property> + <property name="singleStep" > + <number>1</number> + </property> + <property name="value" > + <number>4</number> + </property> + </widget> + </item> + <item row="2" column="0" > + <widget class="QCheckBox" name="checkbox_cut_trt_TotMax" > + <property name="toolTip" > + <string>If set, do not show TRT PRD which have the 'isNoise' flag set.</string> + </property> + <property name="text" > + <string>ToT max:</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item row="2" column="1" > + <widget class="QSpinBox" name="spinBox_cut_trt_ToTMax" > + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> + </property> + <property name="suffix" > + <string> x 3.125ns</string> + </property> + <property name="maximum" > + <number>24</number> + </property> + <property name="singleStep" > + <number>1</number> + </property> + <property name="value" > + <number>23</number> + </property> + </widget> + </item> + </layout> + </item> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>1</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Cuts: LUCID</string> + </property> + <layout class="QHBoxLayout" name="horizontalLayout" > + <property name="margin" > + <number>6</number> + </property> + <item> + <widget class="QLabel" name="label" > + <property name="text" > + <string>QDC >=</string> + </property> + </widget> + </item> + <item> + <widget class="QSpinBox" name="spinBox_lucid_qdc_min" > + <property name="maximum" > + <number>9999</number> + </property> + <property name="value" > + <number>200</number> + </property> + </widget> + </item> + <item> + <spacer name="horizontalSpacer" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>72</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="spacing" > + <number>0</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pushButton_close" > + <property name="text" > + <string>&Close</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>VP1EtaPhiCutWidget</class> + <extends>QWidget</extends> + <header>VP1Base/VP1EtaPhiCutWidget.h</header> + <container>1</container> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_display_form.ui b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_display_form.ui new file mode 100644 index 0000000000000000000000000000000000000000..ed4c03383bacedb9b285cfc9a498f9bd139ff0b7 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_display_form.ui @@ -0,0 +1,127 @@ +<ui version="4.0" > + <class>RawDataSysSettingsDisplayForm</class> + <widget class="QWidget" name="RawDataSysSettingsDisplayForm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>278</width> + <height>203</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2" > + <item> + <widget class="QGroupBox" name="groupBox_5" > + <property name="title" > + <string>Draw options</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout" > + <item> + <widget class="QCheckBox" name="checkBox_showVolumeOutLines" > + <property name="toolTip" > + <string>Decorate shapes with lines at the edges (current only certain shapes such as muon chambers are supported)</string> + </property> + <property name="text" > + <string>Show outlines</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="VP1DrawOptionsWidget" native="1" name="widget_drawOptions" /> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" > + <item> + <widget class="QCheckBox" name="checkBox_trtHTUseSpecialMat" > + <property name="text" > + <string>TRT HT colour:</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="VP1MaterialButton" name="matButton_trtht" > + <property name="text" > + <string/> + </property> + </widget> + </item> + </layout> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout_2" > + <item> + <widget class="QCheckBox" name="checkBox_bcmHighAttUseSpecialMat" > + <property name="text" > + <string>BCM High attenuation colour:</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="VP1MaterialButton" name="matButton_bcmhighatt" > + <property name="text" > + <string/> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="spacing" > + <number>0</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>1</width> + <height>5</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pushButton_close" > + <property name="text" > + <string>&Close</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <customwidgets> + <customwidget> + <class>VP1DrawOptionsWidget</class> + <extends>QWidget</extends> + <header>VP1Base/VP1DrawOptionsWidget.h</header> + <container>1</container> + </customwidget> + <customwidget> + <class>VP1MaterialButton</class> + <extends>QPushButton</extends> + <header>VP1Base/VP1MaterialButton.h</header> + </customwidget> + </customwidgets> + <resources/> + <connections/> +</ui> diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_interactions_form.ui b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_interactions_form.ui new file mode 100644 index 0000000000000000000000000000000000000000..59f11ef2015937c884630b59abc63807060a3f2a --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/rawdata_settings_interactions_form.ui @@ -0,0 +1,107 @@ +<ui version="4.0" > + <class>RawDataSysSettingsInteractionsForm</class> + <widget class="QWidget" name="RawDataSysSettingsInteractionsForm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>189</width> + <height>177</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QVBoxLayout" > + <item> + <widget class="QGroupBox" name="groupBox" > + <property name="title" > + <string>Action on cluster selection</string> + </property> + <layout class="QVBoxLayout" > + <item> + <layout class="QVBoxLayout" > + <property name="spacing" > + <number>-1</number> + </property> + <item> + <widget class="QCheckBox" name="checkBox_printinfo" > + <property name="text" > + <string>Print information</string> + </property> + <property name="checked" > + <bool>true</bool> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" > + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Fixed</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QCheckBox" name="checkBox_printinfo_verbose" > + <property name="text" > + <string>Verbose</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QCheckBox" name="checkBox_zoom" > + <property name="text" > + <string>Zoom</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item> + <layout class="QHBoxLayout" > + <property name="spacing" > + <number>0</number> + </property> + <item> + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="pushButton_close" > + <property name="text" > + <string>&Close</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/vp1rawdatacontrollerform.ui b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/vp1rawdatacontrollerform.ui new file mode 100644 index 0000000000000000000000000000000000000000..cf1910be1c7ecd9424f94d95d5975df6aafd5486 --- /dev/null +++ b/graphics/VTI12/VTI12Systems/VTI12RawDataSystems/src/vp1rawdatacontrollerform.ui @@ -0,0 +1,105 @@ +<ui version="4.0" > + <class>VP1RawDataControllerForm</class> + <widget class="QWidget" name="VP1RawDataControllerForm" > + <property name="geometry" > + <rect> + <x>0</x> + <y>0</y> + <width>262</width> + <height>133</height> + </rect> + </property> + <property name="windowTitle" > + <string>Form</string> + </property> + <layout class="QGridLayout" name="gridLayout" > + <property name="leftMargin" > + <number>6</number> + </property> + <property name="topMargin" > + <number>6</number> + </property> + <property name="rightMargin" > + <number>0</number> + </property> + <property name="bottomMargin" > + <number>4</number> + </property> + <property name="horizontalSpacing" > + <number>0</number> + </property> + <property name="verticalSpacing" > + <number>2</number> + </property> + <item row="0" column="0" colspan="2" > + <widget class="QWidget" native="1" name="widget_settingsButtonsPlaceholder" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <layout class="QHBoxLayout" > + <property name="spacing" > + <number>0</number> + </property> + <property name="margin" > + <number>0</number> + </property> + <item> + <widget class="QPushButton" name="pushButton_settings_cuts" > + <property name="toolTip" > + <string>Configure track cuts on quantities such as eta, phi and momentum</string> + </property> + <property name="text" > + <string>Cuts</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_settings_display" > + <property name="toolTip" > + <string>Configure track colours</string> + </property> + <property name="text" > + <string>Display</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="pushButton_settings_interactions" > + <property name="toolTip" > + <string>Settings for what happens in response to selections (printout, zooms, ...)</string> + </property> + <property name="text" > + <string>Interactions</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="0" column="2" > + <spacer> + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + <property name="sizeType" > + <enum>QSizePolicy::Preferred</enum> + </property> + <property name="sizeHint" stdset="0" > + <size> + <width>1</width> + <height>10</height> + </size> + </property> + </spacer> + </item> + <item row="1" column="0" colspan="3" > + <widget class="QScrollArea" name="collWidgetScrollArea" /> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui>