|
ATLAS Offline Software
|
Go to the documentation of this file.
32 #include <Inventor/nodes/SoSeparator.h>
33 #include <Inventor/nodes/SoLevelOfDetail.h>
34 #include <Inventor/nodes/SoMaterial.h>
53 std::map<int,std::pair<SoLevelOfDetail*,std::pair<VP1ExtraSepLayerHelper*,VP1ExtraSepLayerHelper*> > >
regionindex2lodhelpers;
82 m_colourmethod(ByTechOnly), m_highlightweight(999999.0)
96 " (\"Auto\" switches mode based on distance to camera)");
109 SoSeparator * sep_detail =
new SoSeparator;
110 sep_detail->setName(
"PRDColl_sep_detail");
111 SoSeparator * sep_simple =
new SoSeparator;
112 sep_simple->setName(
"PRDColl_sep_simple");
137 delete it->second.second.first;
138 delete it->second.second.second;
139 it->second.first->unref();
167 bool safeToLoad(
false);
192 message(
"Required geometry not enabled in job.");
235 typename T::const_iterator element, lastElement(container->end());
239 if ( container->size()==0 && container->begin()!=lastElement ) {
246 bool fallback(
false);
248 if ( container->size()!=0 && container->begin()==lastElement ) {
250 theclass->
messageDebug(
"Retrieved empty container. This might be misleading. Now going to attempt to load prds via iterators instead.");
253 +
", so we won't attempt that anyway!! Thus we assume there there are simply no prd's.");
255 if(sg_access.
retrieve(firstElementD, lastElementD,
true)) {
256 if (firstElementD==lastElementD) {
257 theclass->
messageDebug(
"No prd's found when accessed by iterators either. It seems that there really are just no prds in this collection.");
262 theclass->
messageDebug(
"Failed retrieval by iterators. We take that as a sign that there really are just no prds in this collection ");
270 int ignoredUnsafeHandle_NoPRD(0);
271 int ignoredUnsafeHandle_NoDetElem(0);
272 int ignoredUnsafeHandle_NotSane(0);
273 typename T::base_value_type::const_iterator prd, prdLast;
283 for ( element = container->begin(); element!=lastElement ; ++element) {
284 prd = (*element)->begin(), prdLast = (*element)->end();
285 for ( ; prd!=prdLast ; ++prd) {
288 ++ignoredUnsafeHandle_NoPRD;
293 if (!handle->
isSane()) ignoredUnsafeHandle_NotSane++;
295 ++ignoredUnsafeHandle_NoDetElem;
309 for (; firstElementD!=lastElementD; ++firstElementD ) {
310 prd = firstElementD->begin(), prdLast = firstElementD->end();
311 for ( ; prd!=prdLast ; ++prd) {
314 ++ignoredUnsafeHandle_NoPRD;
319 if (!handle->
isSane()) ignoredUnsafeHandle_NotSane++;
322 ++ignoredUnsafeHandle_NoDetElem;
337 if (ignoredUnsafeHandle_NoPRD)
338 theclass->
message(
"WARNING - ignoring "+
str(ignoredUnsafeHandle_NoPRD)+
" null prd pointer(s).");
339 if (ignoredUnsafeHandle_NoDetElem)
340 theclass->
message(
"WARNING - ignoring "+
str(ignoredUnsafeHandle_NoDetElem)+
" prd pointer(s) with null detector elements.");
341 if (ignoredUnsafeHandle_NotSane)
342 theclass->
message(
"WARNING - found "+
str(ignoredUnsafeHandle_NotSane)+
" prd pointer(s) which fail sanity checks (i.e. contain NaNs).");
362 SoSeparator * collsep = theclass->collSep();
365 bool save = collsep->enableNotify(
false);
368 if (collsep->findChild(sephelper_detail->topSeparator())<0)
369 collsep->addChild(sephelper_detail->topSeparator());
372 if (collsep->findChild(sephelper_detail->topSeparator())>-1)
373 collsep->removeChild(sephelper_detail->topSeparator());
377 if (collsep->findChild(sephelper_simple->topSeparator())<0)
378 collsep->addChild(sephelper_simple->topSeparator());
381 if (collsep->findChild(sephelper_simple->topSeparator())>-1)
382 collsep->removeChild(sephelper_simple->topSeparator());
386 if (collsep->findChild(sep_lods)<0)
387 collsep->addChild(sep_lods);
390 if (collsep->findChild(sep_lods)>-1)
391 collsep->removeChild(sep_lods);
394 collsep->enableNotify(
true);
414 messageVerbose(
"Collection detail level combo box changed index");
474 const float complexity = 0.3f;
477 sephelper_detail =
it->second.second.first;
478 sephelper_simple =
it->second.second.second;
480 it->second.first->screenArea.setValue(
lodArea()*(sephelper_detail->
topSeparator()->getNumChildren()+1)/(complexity+0.5f));
483 SoLevelOfDetail * lod =
new SoLevelOfDetail;
484 SoSeparator * sep_detail =
new SoSeparator;
485 SoSeparator * sep_simple =
new SoSeparator;
486 lod->addChild(sep_detail);
487 lod->addChild(sep_simple);
488 lod->screenArea.setValue(
lodArea()/(complexity+0.5
f));
495 std::pair<SoLevelOfDetail*,std::pair<VP1ExtraSepLayerHelper*,VP1ExtraSepLayerHelper*> >
496 (lod,std::pair<VP1ExtraSepLayerHelper*,VP1ExtraSepLayerHelper*>(sephelper_detail,sephelper_simple));
556 connect(controller,SIGNAL(cutAllowedPhiChanged(
const QList<VP1Interval>&)),
568 messageVerbose(
"PRDCollHandleBase::recheckCutStatusOfAllHandles");
587 messageVerbose(
"PRDCollHandleBase::recheckCutStatusOfAllVisibleHandles");
595 if ((*it)->visible())
605 messageVerbose(
"PRDCollHandleBase::recheckCutStatusOfAllNotVisibleHandles");
610 if (!(*it)->visible())
651 (*it)->updateMaterial();
667 (*it)->update3DObjects();
683 (*it)->update3DObjects();
701 (*it)->updateMaterial();
719 (*it)->updateMaterial();
730 case SIMPLE:
return "SIMPLE";
732 case AUTO:
return "AUTO";
733 default:
return "Unknown (ERROR)";
743 case ByTrack:
return "ByTrack";
745 default:
return "Unknown (ERROR)";
774 return "Inner Detector PRDs";
776 return "ID Space Points";
784 return "Muon Spectrometer PRDs";
785 default:
return "Unknown Section";
796 return "Inner Detector PRD collections in event";
798 return "Space Point collections in event";
804 return "Muon Spectrometer PRD collections in event";
805 default:
return "Error: PRDDetType not recognised.";
863 bool allPhiAllowed = allowedPhi.count()==1&&allowedPhi.at(0).isAllR();
864 bool allEtaAllowed = allowedEta.isAllR();
865 if (allEtaAllowed&&allPhiAllowed)
867 if (allowedPhi.isEmpty()||allowedEta.isEmpty())
870 if (!allEtaAllowed) {
871 if (!allowedEta.contains(
p.eta()))
874 if (!allPhiAllowed) {
JetConstituentVector::iterator iterator
void detailLevelChanged()
QList< VP1Interval > allowedPhi
Template for Muon PRD containers (which are basically collections of MuonPrepDataCollections).
virtual DETAIL defaultDetailLevel() const
virtual ~PRDCollHandleBase()
virtual bool cut(PRDHandleBase *)=0
Scalar phi() const
phi method
void serialise(const std::vector< const IRoiDescriptor * > &rois, roiserial_type &s)
serialise an entire vector of IRoiDescriptors
QString provideSection() const
void recheckCutStatus(PRDHandleBase *)
void setGeneralPRDDetailLevel(DETAIL)
void messageVerbose(const QString &) const
void disableUnrestoredChecks()
virtual void postLoadInitialisation()
PRDSysCommonData * common() const
virtual QColor defaultColor() const =0
void addHandle(PRDHandleBase *)
virtual void init(VP1MaterialButtonBase *button=0)
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
virtual void largeChangesBegin()
static QString toString(const DETAIL &)
void collVisibilityChanged(bool)
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
void recheckCutStatusOfAllHandles()
virtual bool isSane() const
Returns false if the PRD is not safe to draw.
COLOURMETHOD m_colourmethod
static QString str(const QString &s)
DETAIL generalprddetaillevel
void messageDebug(const QString &) const
virtual PRDHandleBase * addPRD(const Trk::PrepRawData *)=0
void setAllowedPhi(const QList< VP1Interval > &)
qint32 provideCollTypeID() const
virtual void assignDefaultMaterial(SoMaterial *) const
QStringList getKeys() const
QComboBox * comboBox_detailLevel
void getLODSeparators(int index, VP1ExtraSepLayerHelper *&sephelper_detail, VP1ExtraSepLayerHelper *&sephelper_simple)
void setAllowedEta(const VP1Interval &)
virtual void setupSettingsFromControllerSpecific(PRDSystemController *)
def save(self, fileName="./columbo.out")
PRDCollHandleBase(PRDDetType::Type, PRDSysCommonData *, const QString &key)
void setHighLightWeight(const double &)
SoMaterial * getHighLightMaterial()
void registerPRD2Handle(const Trk::PrepRawData *prd, PRDHandleBase *handle)
void setExtraWidgetsState(const QByteArray &)
VP1ExtraSepLayerHelper * sephelper_detail
QString provideSectionToolTip() const
QList< QWidget * > provideExtraWidgetsForGuiRow() const
void updateDetailSepAttachments()
void visibilityChanged(bool)
static bool hasSCTGeometry()
DETAIL detailLevel() const
void setupSettingsFromController(PRDSystemController *)
void restore(QCheckBox *sb)
static qint32 typeToInt(const Type &t)
static bool hasTRTGeometry()
void recheckCutStatusOfAllNotVisibleHandles()
QByteArray extraWidgetsState() const
double highLightMaterialWeight() const
VP1ExtraSepLayerHelper * sephelperSimpleNodes() const
Trk::PrepRawDataContainer< TRT_DriftCircleCollection > TRT_DriftCircleContainer
void cleanupPtrContainer(T &) const
bool retrieve(const T *&, const QString &key) const
SoMaterial * highlightmaterial
void detailComboBoxItemChanged()
virtual const Trk::PrepRawData * getPRD() const =0
IVP1System * systemBase() const
bool contains(const double &x) const
QList< VP1Interval > cutAllowedPhi() const
bool highLightOutliers() const
PRDCollHandleBase::COLOURMETHOD colourMethod() const
VP1ExtraSepLayerHelper * sephelper_simple
Eigen::Matrix< double, 3, 1 > Vector3D
virtual float lodArea() const
VP1ExtraSepLayerHelper * sephelperDetailedNodes() const
VP1Interval cutAllowedEta() const
std::string typeToString(Magnet::Type type)
virtual void largeChangesEnd()
bool etaPhiCut(PRDHandleBase *)
virtual void init(VP1MaterialButtonBase *mat=0)
static void setMatColor(SoMaterial *, const double &r, const double &g, const double &b, const double &brightness=0.0, const double &transp=0.0)
IVP13DSystem * system() const
std::map< int, std::pair< SoLevelOfDetail *, std::pair< VP1ExtraSepLayerHelper *, VP1ExtraSepLayerHelper * > > > regionindex2lodhelpers
void recheckCutStatusOfAllVisibleHandles()
virtual QString provideText() const
SoSeparator * collSep() const
All 3D objects from this coll.
void message(const QString &) const
std::vector< PRDHandleBase * > prdhandles
static bool hasPixelGeometry()
SoGroup * drawOptions(PRDDetType::Type) const
void setHighLightOutliers(bool)
bool highLightOutliers() const
SoMaterial * highLightMaterial() const
static bool hasMuonGeometry()
std::vector< PRDHandleBase * > & getPrdHandles()
virtual void deselectAll(SoCooperativeSelection *exception_sel=0)
virtual Amg::Vector3D center() const
void setColourMethod(PRDCollHandleBase::COLOURMETHOD)
PRDCollHandleBase * theclass
virtual const TrkDetElementBase * detectorElement() const =0
return the detector element corresponding to this PRD The pointer will be zero if the det el is not d...