38#include <Inventor/nodes/SoSeparator.h>
39#include <Inventor/nodes/SoSwitch.h>
40#include <Inventor/nodes/SoMaterial.h>
41#include <Inventor/nodes/SoTexture2.h>
50 #include "GeoModelKernel/Units.h"
51 #define SYSTEM_OF_UNITS GeoModelKernelUnits
53 #include "GaudiKernel/SystemOfUnits.h"
54 #define SYSTEM_OF_UNITS Gaudi::Units
59#if defined BUILDVP1LIGHT
97 QStringList caloClusterList;
106 theclass->systemBase()->updateGUI();
126 m_d->theclass =
this;
127 m_d->updateGUICounter = 0;
128 m_d->collSettingsButton=0;
135 m_d->last_highestEnergy = 0;
136 m_d->showOutlines =
false;
137 m_d->considerTransverseEnergies =
true;
149 QString safetext(
text());
150 safetext.replace(
' ',
'_');
151 safetext.replace(
'[',
'_');
152 safetext.replace(
']',
'_');
153 safetext.replace(
'/',
'_');
154 safetext.replace(
'.',
'_');
155 safetext.replace(
',',
'_');
156 safetext.replace(
'<',
'_');
157 safetext.replace(
'>',
'_');
158 safetext.replace(
'&',
'_');
187 m_d->collSettingsButton->setMaterialText(
name());
190 m_d->collSettingsButton->setCollHandle(
this);
239 return std::max(1*SYSTEM_OF_UNITS::mm,
m_d->scale.second*(
m_d->scale.first?log(1+fabs(energy)):energy));
247 return m_d->showOutlines;
256#include <Inventor/nodes/SoMaterial.h>
270 VP1Msg::messageDebug(
"setting scale: (" + QString::number(s.first) +
", " + QString::number(s.second) +
" )");
294 message(
"ERROR Handle of wrong type!");
332 connect(controller,SIGNAL(cutAllowedPhiChanged(
const QList<VP1Interval>&)),
this,SLOT(
setCutAllowedPhi(
const QList<VP1Interval>&)));
338 connect(controller,SIGNAL(scaleChanged(
const QPair<bool,double>&)),
this,SLOT(
setScale(
const QPair<bool,double>&)));
375 if (!
m_d->collSettingsButton){
376 messageVerbose(
"CaloCluster - No collSettingsButton set! Can't call init(), so crash is imminent...");
377 throw std::runtime_error(
"CaloCluster - No collSettingsButton set!");
379 return *
m_d->collSettingsButton;
398 return m_d->collSettingsButton->isTransverseEnergy();
406 if (
m_d->showOutlines==b)
return;
421 message(
"ERROR Handle of wrong type!");
438 #if defined BUILDVP1LIGHT
449 if( !(
systemBase()->getEvent())->retrieve( coll,
name().toStdString()).isSuccess() ) {
450 QString errMsg =
"Failed to retrieve " +
name();
451 message(
"Error: Could not retrieve collection with key="+
name());
456 message(
"Error: Could not retrieve collection with key="+
name());
465 if( ! coll->hasStore() ) {
466 message(
"No auxiliary store got associated to the CaloCluster container with key: " +
name());
476 for ( it = coll->
begin() ; it != itEnd; ++it) {
477 m_d->possiblyUpdateGUI();
479 messageDebug(
"WARNING: Ignoring null CaloCluster pointer.");
500 message(
"CaloCluster::cut() --- to be implemented......");
504 double jEnergy = handle->energyForCuts();
505 double jEnergySqr = jEnergy * jEnergy;
506 messageVerbose(
"object's energy, object's energy^2, allowedPt^2, isPtAll: " + QString::number(jEnergy) +
" - " + QString::number(jEnergySqr) +
" - " +
getCutAllowedPt().toString() +
" - " + QString::number(
int(
getPtAllowall())) );
521 double phi = handle->phi();
524 messageVerbose(
"object's phi, phiCut, PhiAll: " + QString::number(
phi) +
" - " + phirange.toString() +
" - " + QString::number(
int(
getPhiAllowall())) );
525 if (phirange.contains(
phi)||phirange.contains(
phi+2*
M_PI)||phirange.contains(
phi-2*
M_PI)) {
543 messageVerbose(
"Not a IParticleCollHandle_CaloCluster. Calling base method...");
556 messageDebug(
"IParticleCollHandle_CaloCluster::showParametersChanged to "+
str(val));
564 messageDebug(
"IParticleCollHandle_CaloCluster::highestVisibleClusterEnergy()");
565 return m_d->last_highestEnergy;
572 messageDebug(
"IParticleCollHandle_CaloCluster::Imp::calculateHighestVisibleClusterEnergy()");
587 if ( e < cluster->energyForCuts() )
590 message(
"ERROR Handle of wrong type!");
603 if (
m_d->last_highestEnergy == newhighest)
605 m_d->last_highestEnergy = newhighest;
614 messageDebug(
"IParticleCollHandle_CaloCluster::persistifiableState() - start...");
625 serialise.disableUnsavedChecks();
638 serialise.save(
m_d->collSettingsButton->saveState());
640 messageDebug(
"IParticleCollHandle_CaloCluster::persistifiableState() - end.");
641 return serialise.result();
650 messageDebug(
"Warning: Ignoring state with wrong version");
663 if (extraWidgetState!=QByteArray())
667 messageDebug(
"restoring material collection button...");
670 messageDebug(
"reset all caches storing values for cuts...");
678 str <<
"\""<<
name().toLatin1().data()<<
"\":{";
682 if (handle->visible()) {
683 if (num)
str <<
",\n";
684 str <<
"\"Clus "<<num++<<
"\":{";
685 handle->dumpToJSON(
str);
Scalar phi() const
phi method
const AODSysCommonData * common() const
void recheckCutStatusOfAllHandles()
void recheckCutStatusOfAllNotVisibleHandles()
void recheckCutStatusOfAllVisibleHandles()
void setExtraWidgetsState(const QByteArray &)
QByteArray extraWidgetsState() const
void setupSettingsFromController(const AODSystemController *)
void update3DObjectsOfAllHandles()
void collVisibilityChanged(bool)
const QString & name() const
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const VP1Interval & getCutAllowedEta()
IParticleCollHandleBase(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType)
virtual AODHandleBase * getNextHandle()
virtual void handleIterationBegin()
void setCutAllowedPt(const VP1Interval &)
const QList< VP1Interval > & getCutAllowedPhi()
const VP1Interval & getCutAllowedPt()
virtual bool cut(AODHandleBase *)
QList< AODHandleBase * > getHandlesList() const
void setCutAllowedPhi(const QList< VP1Interval > &)
void addHandle(AODHandleBase *)
void setCutAllowedEta(const VP1Interval &)
QPair< bool, double > scale
double last_highestEnergy
VP1Interval allowedEnergies
CaloClusterCollectionSettingsButton * collSettingsButton
VP1ExtraSepLayerHelper * sephelper
QList< VP1Interval > allowedPhi
IParticleCollHandle_CaloCluster * theclass
bool considerTransverseEnergies
double energyToLength(const double &energy) const
void setState(const QByteArray &)
Provide specific implementation.
static const double calo_start_r
void setShowVolumeOutLines(bool)
virtual void dumpToJSON(std::ofstream &) const
IParticleCollHandle_CaloCluster(AODSysCommonData *, const QString &name, xAOD::Type::ObjectType type)
static const double calo_start_z
virtual bool cut(AODHandleBase *)
static const double calo_crack_eta
double highestVisibleClusterEnergy() const
QByteArray persistifiableState() const
Provide specific implementation.
void recheckHighestVisibleClusterEnergy()
const CaloClusterCollectionSettingsButton & collSettingsButton() const
void highestVisibleClusterEnergyChanged()
double calculateHighestVisibleClusterEnergy()
void resetCachedValuesCuts()
QPair< bool, double > scale() const
void showParametersChanged(bool)
bool showOutlines() const
static QStringList availableCollections(IVP1System *)
virtual void setupSettingsFromControllerSpecific(const AODSystemController *)
For extensions specific to this collection.
virtual void init(VP1MaterialButtonBase *matBut=0)
virtual ~IParticleCollHandle_CaloCluster()
bool isConsiderTransverseEnergy() const
SoGenericBox * genericBox()
virtual bool has3DObjects()
Returns true if the 3D objects have been created.
void updateShape(IParticleCollHandle_CaloCluster *coll)
double energyForCuts() const
Interface for non-const operations on an auxiliary store.
QByteArray restoreByteArray()
void disableUnrestoredChecks()
void restore(QCheckBox *sb)
void messageVerbose(const QString &) const
void message(const QString &) const
IVP1System * systemBase() const
void messageDebug(const QString &) const
static void messageVerbose(const QString &)
static void messageDebug(const QString &)
QStringList getKeys() const
SoMaterial * material() const
virtual void largeChangesEnd()
virtual void init(VP1MaterialButtonBase *button=0)
virtual void largeChangesBegin()
void visibilityChanged(bool)
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
ObjectType
Type of objects that have a representation in the xAOD EDM.
@ CaloCluster
The object is a calorimeter cluster.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.