25#include <Inventor/SoPath.h>
26#include <Inventor/nodes/SoSeparator.h>
29#include "CLHEP/Units/SystemOfUnits.h"
30#include "CaloEvent/CaloCluster.h"
31#include "CaloEvent/CaloClusterContainer.h"
36 QList<VP1CaloClusterCollection*> cols;
63 return std::max(1*CLHEP::mm,
scale.second*(
scale.first?log(1+fabs(energy)):energy));
97 const double dEta = 0.05;
98 const double dPhi = 0.05;
99 const double theEta =
eta();
100 const double thePhi =
phi();
103 m_genericBox->setParametersForBarrelEtaPhiCell( theEta-0.5*dEta, theEta+0.5*dEta,thePhi-0.5*dPhi, thePhi+0.5*dPhi,
106 m_genericBox->setParametersForEndCapEtaPhiCell( theEta-0.5*dEta, theEta+0.5*dEta,thePhi-0.5*dPhi, thePhi+0.5*dPhi,
130 double phi(c->phi());
139 const bool cutval =
cut(c);
140 if (cutval!=c->attached()) {
169 m_d->theclass =
this;
170 m_d->controller = controller;
174 m_d->last_highestEnergy = 0;
175 m_d->showOutlines =
false;
176 m_d->considerTransverseEnergies =
true;
183 connect(controller,SIGNAL(scaleChanged(
const QPair<bool,double>&)),
this,SLOT(
setScale(
const QPair<bool,double>&)));
191 connect(controller,SIGNAL(cutAllowedPhiChanged(
const QList<VP1Interval>&)),
this,SLOT(
setAllowedPhi(
const QList<VP1Interval>&)));
200 if (
m_d->sephelper) {
201 SoSeparator * sep =
m_d->sephelper->topSeparator();
202 delete m_d->sephelper;
235 if (cluster->attached()&&e<cluster->energyForLengthAndCuts(
this))
236 e=cluster->energyForLengthAndCuts(
this);
246 double newhighest =
m_d->calculateHighestVisibleClusterEnergy();
247 if (
m_d->last_highestEnergy == newhighest)
249 m_d->last_highestEnergy = newhighest;
256 return m_d->last_highestEnergy;
267 SoSeparator * sep =
new SoSeparator;
268 sep->setName(
"ClusterSepHelperTopSep");
274 for ( ; it != itE; ++it) {
278 m_d->clusters << clusterHandle;
279 m_d->recheckCut(clusterHandle);
290 SoNode * pickedNode = pickedPath->getNodeFromTail(0);
293 if (pickedNode->getTypeId()==SoGenericBox::getClassTypeId()) {
295 if (c->genericBox()==pickedNode) {
296 cluster = c->cluster();
303 if (!cluster||!clusterHandle)
304 return QStringList() <<
"Error: Collection "+
m_d->key+
" does not have cluster information for picked node";
307 if (
m_d->controller->printInfoOnClick()) {
308 l <<
" Eta: "+
str(cluster->
eta());
309 l <<
" Phi: "+
str(cluster->
phi());
310 l <<
" Energy [GeV]: "+
str(clusterHandle->
energy()/CLHEP::GeV);
312 if (
m_d->controller->printVerboseInfoOnClick()) {
313 l <<
"(no verbose information available)";
317 if (
m_d->controller->zoomOnClick()) {
319 std::set<SoCamera*>::iterator it,itE = cameras.end();
320 for (it=cameras.begin();it!=itE;++it)
330 m_d->sephelper->largeChangesBegin();
336 m_d->sephelper->largeChangesEnd();
342 if (
m_d->allowedEnergies==i)
344 m_d->allowedEnergies=i;
350 m_d->recheckCut(cluster);
360 if (
m_d->allowedEta==i)
368 m_d->recheckCut(cluster);
378 if (
m_d->allowedPhi==i)
386 m_d->recheckCut(cluster);
393#include <Inventor/nodes/SoMaterial.h>
417 if (
m_d->showOutlines==b)
432 if (
m_d->considerTransverseEnergies==b)
434 m_d->considerTransverseEnergies=b;
439 bool attachPrev(cluster->
attached());
440 m_d->recheckCut(cluster);
441 if (attachPrev&&cluster->
attached())
Scalar phi() const
phi method
Storable container for CaloCluster.
VP1Interval cutAllowedEta() const
bool showVolumeOutLines() const
bool useTransverseEnergies() const
VP1Interval cutAllowedEnergies() const
QList< VP1Interval > cutAllowedPhi() const
QPair< bool, double > scale() const
Principal data class for CaloCell clusters.
virtual double eta() const
Retrieve eta independent of signal state.
virtual double phi() const
Retrieve phi independent of signal state.
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.
ClusterHandle(const CaloCluster *c)
double transverseEnergy() const
const CaloCluster * cluster() const
double m_transverseEnergy
void updateShapePars(VP1CaloClusterCollection::Imp *d)
const CaloCluster * m_cluster
double energyForLengthAndCuts(const VP1CaloClusterCollection::Imp *d)
void attach(VP1CaloClusterCollection::Imp *d)
void detach(VP1ExtraSepLayerHelper *sh)
SoGenericBox * genericBox()
SoGenericBox * m_genericBox
QList< ClusterHandle * > clusters
bool considerTransverseEnergies
VP1ExtraSepLayerHelper * sephelper
double calculateHighestVisibleClusterEnergy() const
CaloClusterSysController * controller
VP1CaloClusterCollection * theclass
double energyToLength(const double &energy)
VP1Interval allowedEnergies
static const double calo_start_z
static const double calo_crack_eta
QList< VP1Interval > allowedPhi
void recheckCut(ClusterHandle *c)
QPair< bool, double > scale
static const double calo_start_r
bool cut(ClusterHandle *c)
double last_highestEnergy
static QList< VP1CaloClusterCollection * > createCollections(IVP1System *, CaloClusterSysController *)
QString provideSection() const
void assignDefaultMaterial(SoMaterial *) const
void setConsiderTransverseEnergies(bool)
~VP1CaloClusterCollection()
void setAllowedEnergies(const VP1Interval &)
QString provideText() const
void setShowVolumeOutLines(bool)
void setAllowedPhi(const QList< VP1Interval > &)
VP1CaloClusterCollection(const QString &key, IVP1System *sys, CaloClusterSysController *)
QStringList infoOnClicked(SoPath *pickedPath)
void setScale(const QPair< bool, double > &)
void setAllowedEta(const VP1Interval &)
void recheckHighestVisibleClusterEnergy()
void highestVisibleClusterEnergyChanged()
double highestVisibleClusterEnergy() const
static VP1CameraHelper * animatedZoomToPath(SoCamera *camera, SoGroup *sceneroot, SoPath *path, double duration_in_secs=1.0, double clipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
IVP1System * systemBase() const
SoMaterial * material() const
virtual void largeChangesEnd()
virtual void init(VP1MaterialButtonBase *button=0)
SoSeparator * collSep() const
All 3D objects from this coll.
virtual void largeChangesBegin()
void visibilityChanged(bool)
VP1StdCollection(IVP1System *, const QString &helperClassName)