24#include <Inventor/C/errors/debugerror.h>
25#include <Inventor/nodes/SoLineSet.h>
26#include <Inventor/nodes/SoPointSet.h>
27#include <Inventor/nodes/SoVertexProperty.h>
28#include <Inventor/nodes/SoMaterial.h>
29#include <Inventor/nodes/SoCone.h>
30#include <Inventor/nodes/SoSeparator.h>
31#include <Inventor/nodes/SoTranslation.h>
32#include <Inventor/nodes/SoRotationXYZ.h>
33#include <Inventor/nodes/SoScale.h>
34#include <Inventor/nodes/SoSwitch.h>
39 #include "GeoModelKernel/Units.h"
40 #define SYSTEM_OF_UNITS GeoModelKernelUnits
42 #include "GaudiKernel/SystemOfUnits.h"
43 #define SYSTEM_OF_UNITS Gaudi::Units
62 SoSeparator *
sep =
nullptr;
83 double scale = (10.0 * SYSTEM_OF_UNITS::m) / (100.0*SYSTEM_OF_UNITS::GeV);
84 double maxR = 0.0 * SYSTEM_OF_UNITS::m;
116 m_d->theclass =
this;
121 m_d->m_randomMat = 0;
123 m_d->m_bTaggingCollSwitch =
new SoSwitch();
141 if (
m_d->m_randomMat)
m_d->m_randomMat->unref();
142 if (
m_d->cone)
m_d->cone->unref();
143 if (
m_d->sep)
m_d->sep->unref();
164 return 0 !=
m_d->sep;
172 if (
m_d->m_randomMat) {
173 m_d->m_randomMat->unref();
174 m_d->m_randomMat = 0;
203 m_d->sep =
new SoSeparator();
208 if (not collHandleJet)
return m_d->sep;
209 SbVec3f origin(0.,0.,0.);
232 m_d->createShapeFromJetParameters(collHandleJet,
m_d->coneR(),
m_d->eta(),
m_d->phi(),
m_d->energyForLengthAndCuts(), origin);
240 m_d->updateConeHeightParameters();
246 const double&
phi,
const double&
energy,
const SbVec3f& origin)
252 sep =
new SoSeparator();
262 double thetaMax = 2.*atan(exp(-(
eta+inputconeR)));
263 double thetaMin = 2.*atan(exp(-(
eta-inputconeR)));
264 double deltaTheta = fabs(thetaMax-thetaMin);
265 double etaScale = deltaTheta/(2.*inputconeR);
268 SoTranslation *translate =
new SoTranslation();
270 SoRotationXYZ *flip =
new SoRotationXYZ();
271 flip->axis=SoRotationXYZ::Z;
274 SoRotationXYZ *ytoz =
new SoRotationXYZ();
275 ytoz->axis=SoRotationXYZ::X;
279 SoRotationXYZ *rotationPhi =
new SoRotationXYZ();
280 rotationPhi->axis=SoRotationXYZ::Z;
281 rotationPhi->angle =
phi+
M_PI/2.;
284 SoRotationXYZ *rotationEta =
new SoRotationXYZ();
285 double signEta = fabs(
eta)/
eta;
286 double theta = 2.*atan(signEta*exp(-fabs(
eta)));
288 rotationEta->axis=SoRotationXYZ::X;
289 rotationEta->angle=
theta;
296 SoScale* myScale =
new SoScale();
299 myScale->scaleFactor.setValue(etaScale,1.,etaScale);
302 SoTranslation *transvertex =
new SoTranslation();
303 transvertex->translation = origin;
305 sep->addChild(transvertex);
306 sep->addChild(rotationPhi);
307 sep->addChild(rotationEta);
310 sep->addChild(translate);
311 sep->addChild(myScale);
324 SoNode * lastChild =
sep->getChild(
sep->getNumChildren()-1 );
325 if (lastChild->getTypeId() == SoCone::getClassTypeId())
357 trans->translation = SbVec3f(0,-0.5*
h, 0);
362 SbString strHeight, strRadius;
364 (
cone->bottomRadius).
get(strRadius);
385 if (
sep->getNumChildren()<6) {
392 SoNode * sixthChild =
sep->getChild(5);
393 if (sixthChild->getTypeId()!=SoTranslation::getClassTypeId()) {
397 SoNode * lastChild =
sep->getChild(
sep->getNumChildren()-1);
398 if (lastChild->getTypeId()!=SoCone::getClassTypeId()) {
419 return *(
m_d->m_jet);
463 l +=
" - pt: " + QString::number(
m_d->pt());
464 l +=
" - e: " + QString::number(
m_d->energy());
465 l +=
" - eta: " + QString::number(
m_d->eta());
466 l +=
" - phi: " + QString::number(
m_d->phi());
467 l +=
" - m: " + QString::number(
m_d->m_jet->m());
468 l +=
" - rapidity: " + QString::number(
m_d->m_jet->rapidity());
469 l +=
" - type: " + QString::number(
m_d->m_jet->type());
470 l +=
" - px: " + QString::number(
m_d->m_jet->px());
471 l +=
" - py: " + QString::number(
m_d->m_jet->py());
472 l +=
" - pz: " + QString::number(
m_d->m_jet->pz());
473 l +=
" - numConstituents: " + QString::number(
m_d->m_jet->numConstituents());
475 l +=
" - SizeParameter: " + QString::number(
m_d->m_jet->getSizeParameter());
480 l +=
" - AlgorithmType: " + QString::fromStdString( algName );
484 l +=
" - InputType: " + QString::fromStdString( inputType );
487 l +=
" - 'MV2c20' b-tagging weight: " + QString::number(
m_d->m_bTagWeightMV2c20 );
488 l +=
" - 'MV2c10' b-tagging weight: " + QString::number(
m_d->m_bTagWeightMV2c10 );
489 l +=
" - 'MV1' b-tagging weight: " + QString::number(
m_d->m_bTagWeightMV1 );
506 l +=
"pt: " + QString::number(
m_d->pt());
507 l +=
", e: " + QString::number(
m_d->energy());
508 l +=
", eta: " + QString::number(
m_d->eta());
509 l +=
", phi: " + QString::number(
m_d->phi());
510 l +=
", MV2c20: " + QString::number(
m_d->m_bTagWeightMV2c20 );
511 l +=
", MV2c10: " + QString::number(
m_d->m_bTagWeightMV2c10 );
512 l +=
", MV1: " + QString::number(
m_d->m_bTagWeightMV1 );
529 TSOSitem->setText(0, QString(
"Info:" ) );
531 QString dParameters(
"(");
539 dParameters+=QString::number(
m_d->pt());
540 dParameters+=
", e: ";
541 dParameters+=QString::number(
m_d->energy());
542 dParameters+=
", eta: ";
543 dParameters+=QString::number(
m_d->eta());
544 dParameters+=
", phi: ";
545 dParameters+=QString::number(
m_d->phi());
546 dParameters+=
", m: ";
547 dParameters+=QString::number(
m_d->m_jet->m());
548 dParameters+=
", rapidity: ";
549 dParameters+=QString::number(
m_d->m_jet->rapidity());
555 dParameters +=
" [more info in the main Message Box]";
557 TSOSitem->setText(1, dParameters );
610 r = (rand() /
static_cast<double>(RAND_MAX));
611 g = (rand() /
static_cast<double>(RAND_MAX));
612 b = (rand() /
static_cast<double>(RAND_MAX));
616 if ( (
r-1.0)*(
r-1.0)+g*g+b*b < r2*0.5 )
618 else if (
r*
r/(
r*
r+g*g+b*b) > 0.8 )
620 else if (
r*
r+g*g+b*b < r2*2.0 )
630 " not be selected such as to satisfy all separation criterias");
650 if (!isRandomColors && !
m_d->m_randomMat)
653 if (isRandomColors && !
m_d->m_randomMat) {
654 m_d->m_randomMat =
new SoMaterial;
655 m_d->m_randomMat->ref();
660 int i =
m_d->sep->findChild(
m_d->m_randomMat);
662 if ( (i>=0) == isRandomColors ) {
667 if (!isRandomColors )
668 m_d->sep->removeChild(
m_d->m_randomMat);
670 m_d->sep->insertChild(
m_d->m_randomMat,
m_d->sep->getNumChildren()-1);
679 std::cout <<
"old switch: " <<
m_d->m_bTaggingCollSwitch <<
" - new: " << bTaggingSwitch << std::endl;
682 m_d->m_bTagged->removeChild(
m_d->m_bTaggingCollSwitch);
685 m_d->m_bTaggingCollSwitch = 0;
686 m_d->m_bTaggingCollSwitch = bTaggingSwitch;
689 m_d->m_bTagged->addChild( bTaggingSwitch );
703 std::cout <<
"B-TAG UPDATE - jet eta: " <<
m_d->eta() <<
", phi: " <<
m_d->phi() <<
" - tagger: " << bTaggingTagger <<
" - cut: " << bTaggingCut <<
" - weight: " << bTaggingWeight;
705 if (bTaggingWeight > bTaggingCut) {
706 m_d->m_bTagged->whichChild = SO_SWITCH_ALL;
707 std::cout <<
" ON" << std::endl;
710 m_d->m_bTagged->whichChild = SO_SWITCH_NONE;
711 std::cout <<
" OFF" << std::endl;
726 if (myBTag ==
nullptr) {
727 VP1Msg::messageWarningRed(
"It was not possible to access the pointer to b-tagging info, for the selected collection! Returning 'weight': 0.0");
757 if (tagger==
"MV2c20")
759 else if (tagger==
"MV2c10")
761 else if (tagger==
"MV2c00")
764 VP1Msg::message(
"Tagger '" + QString::fromStdString(tagger) +
"' not found! Returning weight=0.0 ...");
770 str <<
"\"coneR\":"<<
m_d->coneR() <<
", ";
771 str <<
"\"phi\":" <<
m_d->phi() <<
", ";
772 str <<
"\"eta\":" <<
m_d->eta() <<
", ";
773 str <<
"\"energy\":" <<
m_d->energyForLengthAndCuts();
Scalar theta() const
theta method
const AODCollHandleBase * collHandle() const
void updateMaterial()
Called after some configuration related to material changes.
QTreeWidgetItem * browserTreeItem() const
Return the QTreeWidgetItem;.
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Create and fill the object browser QTreeWidgetItem.
Header file for AthHistogramAlgorithm.
Base class for collections holding AOD objects of iParticle type Handles pt etc cuts Local data:
IParticleHandleBase(IParticleCollHandleBase *)
void updateConeHeightParameters() const
bool considerTransverseEnergies
double m_bTagWeightMV2c10
void updateConeHeightParameters(SoCone *, SoTranslation *, const double &energy) const
void createShapeFromJetParameters(const IParticleCollHandle_Jet *collHandleJet, const double &coneR, const double &eta, const double &phi, const double &energy, const SbVec3f &origin)
void rerandomiseMaterial()
double m_JetFitterCombNN_pb
SoSwitch * m_bTaggingCollSwitch
double m_JetFitterCombNN_pu
double energyForLengthAndCuts() const
IParticleHandle_Jet * theclass
double transverseEnergy() const
const IParticleCollHandle_Jet * theCollHandle
double m_bTagWeightMV2c20
double m_JetFitterCombNN_pc
virtual void clear3DObjects()
Delete objects.
virtual double charge() const
Returns unknown() in case of trouble.
double getBTaggingWeight(const std::string &tagger)
void updateBTagging(const std::string &bTaggingTagger, const double &bTaggingCut)
IParticleHandle_Jet(IParticleCollHandleBase *, const xAOD::Jet *)
double transverseEnergy() const
void setMaxR(const double &maxR)
void rerandomiseMaterial()
virtual bool has3DObjects()
Returns true if the 3D objects have been created.
virtual void dumpToJSON(std::ofstream &) const
virtual SoNode * nodes()
Returns the 3Dobjects.
double energyForCuts() const
void fillObjectBrowser(QList< QTreeWidgetItem * > &listOfItems)
This gives the list of object's properties, shown in the 'Information' field in the Browser,...
void updateBTaggingSwitch(SoSwitch *bTaggingSwitch)
QString shortInfo() const
This returns the information shown about the object in the object browser.
virtual ~IParticleHandle_Jet()
void setScale(const double &sc, bool useEt)
const xAOD::IParticle & iParticle() const
virtual QStringList clicked() const
This gives the complete information about the object, shown in the main Message Box.
static void messageVerbose(const QString &)
static void message(const QString &, IVP1System *sys=0)
static void messageWarningRed(const QString &str, IVP1System *sys=0)
SoMaterial * material() const
static QString str(const QString &s)
bool MVx_discriminant(const std::string &taggername, double &value) const
Class providing the definition of the 4-vector interface.
const Amg::Vector3D & position() const
Returns the 3-pos.
bool exists(const std::string &filename)
does a file exist
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
Jet_v1 Jet
Definition of the current "jet version".
BTagging_v1 BTagging
Definition of the current "BTagging version".
Vertex_v1 Vertex
Define the latest version of the vertex class.