ATLAS Offline Software
Loading...
Searching...
No Matches
IParticleHandle_Jet Class Reference

#include <IParticleHandle_Jet.h>

Inheritance diagram for IParticleHandle_Jet:
Collaboration diagram for IParticleHandle_Jet:

Classes

class  Imp

Public Member Functions

 IParticleHandle_Jet (IParticleCollHandleBase *, const xAOD::Jet *)
virtual ~IParticleHandle_Jet ()
virtual bool has3DObjects ()
 Returns true if the 3D objects have been created.
virtual void clear3DObjects ()
 Delete objects.
virtual SoNode * nodes ()
 Returns the 3Dobjects.
void fillObjectBrowser (QList< QTreeWidgetItem * > &listOfItems)
 This gives the list of object's properties, shown in the 'Information' field in the Browser, once the user clicked on one particular item (e.g.
void setScale (const double &sc, bool useEt)
void setMaxR (const double &maxR)
void updateHeight ()
void rerandomiseMaterial ()
virtual QStringList clicked () const
 This gives the complete information about the object, shown in the main Message Box.
const xAOD::IParticleiParticle () const
virtual double charge () const
 Returns unknown() in case of trouble.
double phi () const
double eta () const
double energy () const
double transverseEnergy () const
double energyForCuts () const
virtual QString type () const
 return very short word with type (maybe link with collection type?)
QString shortInfo () const
 This returns the information shown about the object in the object browser.
void updateMaterial (bool)
void updateBTagging (const std::string &bTaggingTagger, const double &bTaggingCut)
void updateBTaggingSwitch (SoSwitch *bTaggingSwitch)
virtual void dumpToJSON (std::ofstream &) const
SoMaterial * determineMaterial ()
 Should be implemented by children, in order to change the material depending on the interface etc.
virtual QStringList baseInfo () const
virtual Amg::Vector3D momentum () const
virtual double mass () const
 Returns unknown() in case of trouble.
bool hasCharge () const
bool hasMass () const
const AODSysCommonDatacommon () const
void setVisible (bool)
 use by the collection handle.
bool visible () const
const AODCollHandleBasecollHandle () const
virtual void update3DObjects ()
 Called after some configuration changes, or when the object is first created. Must be overloaded by children.
virtual void rebuild3DObjects ()
virtual void attach3DObjects ()
 Connect to the scene graph.
virtual void detach3DObjects ()
 Remove from the scene graph.
void updateMaterial ()
 Called after some configuration related to material changes.
SoMaterial * currentMaterial () const
 Returns the current material of the handle.
void updateObjectBrowser ()
 Update object browser QTreeWidgetItem.
QTreeWidgetItem * browserTreeItem () const
 Return the QTreeWidgetItem;.

Static Public Member Functions

static int numberOfInstances ()
static double unknown ()

Protected Member Functions

virtual void visibleStateChanged ()
 Dummy implementation does nothing.
virtual void currentMaterialChanged ()

Private Member Functions

void ensureInitSubSysHitInfo () const
double getBTaggingWeight (const std::string &tagger)

Private Attributes

Impm_d
bool m_visible
AODCollHandleBasem_collhandle
SoMaterial * m_currentmaterial

Detailed Description

Definition at line 32 of file IParticleHandle_Jet.h.

Constructor & Destructor Documentation

◆ IParticleHandle_Jet()

IParticleHandle_Jet::IParticleHandle_Jet ( IParticleCollHandleBase * ch,
const xAOD::Jet * jet )

Definition at line 112 of file IParticleHandle_Jet.cxx.

113: IParticleHandleBase(ch), m_d(new Imp)
114{
115 // VP1Msg::messageVerbose("IParticleHandle_Jet::IParticleHandle_Jet() - constructor");
116 m_d->theclass = this;
117 m_d->m_jet = jet;
118
119 m_d->sep = 0;
120 m_d->cone = 0;
121 m_d->m_randomMat = 0;
122 m_d->m_bTagged = 0;
123 m_d->m_bTaggingCollSwitch = new SoSwitch();
124
125 // get b-tagging weights for different taggers
126 m_d->m_bTagWeightMV1 = getBTaggingWeight("MV1");
127 m_d->m_bTagWeightMV2c20 = getBTaggingWeight("MV2c20");
128 m_d->m_bTagWeightMV2c10 = getBTaggingWeight("MV2c10");
129 m_d->m_JetFitterCombNN_pb = getBTaggingWeight("JetFitterCombNN_pb");
130 m_d->m_JetFitterCombNN_pc = getBTaggingWeight("JetFitterCombNN_pc");
131 m_d->m_JetFitterCombNN_pu = getBTaggingWeight("JetFitterCombNN_pu");
132
133
134// m_d->theCollHandle = dynamic_cast<const IParticleCollHandle_Jet*>(collHandle());
135}
IParticleHandleBase(IParticleCollHandleBase *)
double getBTaggingWeight(const std::string &tagger)

◆ ~IParticleHandle_Jet()

IParticleHandle_Jet::~IParticleHandle_Jet ( )
virtual

Definition at line 138 of file IParticleHandle_Jet.cxx.

139{
140 // VP1Msg::messageVerbose("IParticleHandle_Jet::~IParticleHandle_Jet() - destructor");
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();
144 delete m_d;
145}

Member Function Documentation

◆ attach3DObjects()

void AODHandleBase::attach3DObjects ( )
virtualinherited

Connect to the scene graph.

Definition at line 157 of file AODHandleBase.cxx.

158{
159 VP1Msg::messageVerbose("AODHandleBase::attach3DObjects");
160
161 if (!m_currentmaterial) {
163 m_currentmaterial->ref();
165 }
166 if (has3DObjects() && m_collhandle->sepHelper()) {
167 VP1Msg::messageVerbose("Adding nodes to sep helper...");
168
169 m_collhandle->common()->registerHandle(this);
170
171 // debug
172 // std::cout<<"m_collhandle->sepHelper() = " << m_collhandle->sepHelper()<<std::endl;
173 SoNode* tmp = nodes();
174 // std::cout << "tmp nodes = "<< tmp << std::endl;
175
176 // m_collhandle->sepHelper()->addNodeUnderMaterial( nodes(), m_currentmaterial );
177 m_collhandle->sepHelper()->addNodeUnderMaterial( tmp, m_currentmaterial );
178
179 } else {
180 if (!has3DObjects()) {
181 VP1Msg::message("AODHandleBase::attach3DObjects() - No 3D objects to attach!");
182 }
183 if (!m_collhandle->sepHelper()) VP1Msg::message("AODHandleBase::attach3DObjects() - No sep helper!");
184 }
185 // if (label_sep && theclass->common()->textSep() && theclass->common()->controller()->doTrackLabels())
186 // theclass->common()->textSep()->addChild(label_sep);
187 //
188}
virtual void currentMaterialChanged()
SoMaterial * m_currentmaterial
virtual SoNode * nodes()=0
Returns the 3Dobjects.
virtual bool has3DObjects()
Returns true if the 3D objects have been created.
virtual SoMaterial * determineMaterial()=0
Should be implemented by children, in order to change the material depending on the interface etc.
AODCollHandleBase * m_collhandle
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84
static void message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30

◆ baseInfo()

QStringList IParticleHandleBase::baseInfo ( ) const
virtualinherited

Reimplemented from AODHandleBase.

Definition at line 85 of file IParticleHandleBase.cxx.

86{
87 QStringList l;
88 Amg::Vector3D mom = momentum()/1000;
89 if (mom.mag2()==0.0) {
90 l << "Momentum : 0 (undefined)";
91 } else {
92 l << "Momentum [GeV]: "+VP1Msg::str(mom);
93 l << "|Pt|/|P| [GeV]: "+VP1Msg::str(mom.perp())+" / " + VP1Msg::str(mom.mag());
94 l << VP1Msg::str("(")+QChar(0x03B7)+","+QChar(0x03D5)+VP1Msg::str(")=(")
96
97 l << "Eta: "+VP1Msg::str(mom.eta());
98 l << "Phi: "+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ));
99 }
100 // l<<"Hit summary: Pix["+VP1Msg::str(getNPixelHits())+"], SCT["+VP1Msg::str(getNSCTHits())+"], TRT["+VP1Msg::str(getNTRTHits())
101 // +"], MDT["+QString::number(getNMDTHits())+"], RPC["+QString::number(getNRPCHits())+"], TGC["+QString::number(getNTGCHits())+"], CSC["+QString::number(getNCSCHits())+"].";
102 //
103 // return l;
104 // int pdg = pdgCode();
105 // if (pdg) {
106 // bool ok;
107 // QString name = VP1ParticleData::particleName(pdg,ok);
108 // if (ok)
109 // l << "pdg: "+QString::number(pdg)+" ["+name+"]";
110 // else
111 // l << "pdg: "+QString::number(pdg);
112 // }
113
114 return l;
115}
virtual Amg::Vector3D momentum() const
static double phiFromXY(const double &x, const double &y)
static QString str(const QString &s)
Definition VP1String.h:49
Eigen::Matrix< double, 3, 1 > Vector3D
l
Printing final latex table to .tex output file.

◆ browserTreeItem()

QTreeWidgetItem * AODHandleBase::browserTreeItem ( ) const
inherited

Return the QTreeWidgetItem;.

Definition at line 311 of file AODHandleBase.cxx.

311 {
312 return m_d->m_objBrowseTree;
313}

◆ charge()

double IParticleHandle_Jet::charge ( ) const
virtual

Returns unknown() in case of trouble.

Implements IParticleHandleBase.

Definition at line 424 of file IParticleHandle_Jet.cxx.

425{
426 //return m_d->trackparticle->charge(); // TODO: check in Jet interface if a "charge" is defined
427 return 0; // FIXME: dummy value now
428}

◆ clear3DObjects()

void IParticleHandle_Jet::clear3DObjects ( )
virtual

Delete objects.

Implements AODHandleBase.

Definition at line 169 of file IParticleHandle_Jet.cxx.

169 {
170 // VP1Msg::messageVerbose("IParticleHandle_Jet::clear3DObjects()");
171
172 if (m_d->m_randomMat) {
173 m_d->m_randomMat->unref();
174 m_d->m_randomMat = 0;
175 }
176 if (m_d->cone) {
177 m_d->cone->unref();
178 m_d->cone = 0;
179 }
180 if (m_d->sep) {
181 m_d->sep->unref();
182 m_d->sep = 0;
183 }
184
185}

◆ clicked()

QStringList IParticleHandle_Jet::clicked ( ) const
virtual

This gives the complete information about the object, shown in the main Message Box.

Implements AODHandleBase.

Definition at line 455 of file IParticleHandle_Jet.cxx.

456{
457 QStringList l;
458
459 l << "--Jet:";
460
461 //l << IParticleHandleBase::baseInfo();
462
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());
474
475 l += " - SizeParameter: " + QString::number(m_d->m_jet->getSizeParameter());
476// l += " - SizeParameter: " + QString::number(int(m_d->m_jet->getSizeParameter()*10));
477
478 xAOD::JetAlgorithmType::ID jetAlgID = m_d->m_jet->getAlgorithmType();
479 std::string algName = xAOD::JetAlgorithmType::algName(jetAlgID);
480 l += " - AlgorithmType: " + QString::fromStdString( algName );
481
482 xAOD::JetInput::Type jetAlgType = m_d->m_jet->getInputType();
483 std::string inputType = xAOD::JetInput::typeName(jetAlgType);
484 l += " - InputType: " + QString::fromStdString( inputType );
485
486
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 );
490
491
492 l << "------";
493
494 return l;
495}
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
const std::string & typeName(Type id)

◆ collHandle()

const AODCollHandleBase * AODHandleBase::collHandle ( ) const
inlineinherited

Definition at line 55 of file AODHandleBase.h.

55{ return m_collhandle; }

◆ common()

const AODSysCommonData * AODHandleBase::common ( ) const
inherited

Definition at line 93 of file AODHandleBase.cxx.

94{
95 return std::as_const(m_collhandle)->common();
96}

◆ currentMaterial()

SoMaterial * AODHandleBase::currentMaterial ( ) const
inlineinherited

Returns the current material of the handle.

Definition at line 76 of file AODHandleBase.h.

76{ return m_currentmaterial; }

◆ currentMaterialChanged()

virtual void AODHandleBase::currentMaterialChanged ( )
inlineprotectedvirtualinherited

Definition at line 111 of file AODHandleBase.h.

111{};

◆ detach3DObjects()

void AODHandleBase::detach3DObjects ( )
virtualinherited

Remove from the scene graph.

Definition at line 191 of file AODHandleBase.cxx.

192{
193 VP1Msg::messageVerbose("AODHandleBase::detach3DObjects");
194
196 return;//Can never have been attached!
197 if (has3DObjects() && m_collhandle->sepHelper()) {
198 m_collhandle->sepHelper()->removeNodeUnderMaterial(nodes(),m_currentmaterial);
199 }
200
201 m_collhandle->common()->deregisterHandle(this);
202
203 // if (label_sep && theclass->common()->textSep())
204 // theclass->common()->textSep()->removeChild(label_sep);
205}

◆ determineMaterial()

SoMaterial * IParticleHandleBase::determineMaterial ( )
virtualinherited

Should be implemented by children, in order to change the material depending on the interface etc.

This will (by default) return the collection material.

Implements AODHandleBase.

Definition at line 71 of file IParticleHandleBase.cxx.

71 {
72 // By default we use the collection material.
73 // std::cout<<"AODHandleBase::determineMaterial() - collHandle()->material()"<<collHandle()->material()<<std::endl;
74 return collHandle()->material();
75}
const AODCollHandleBase * collHandle() const
SoMaterial * material() const

◆ dumpToJSON()

void IParticleHandle_Jet::dumpToJSON ( std::ofstream & str) const
virtual

Reimplemented from AODHandleBase.

Definition at line 769 of file IParticleHandle_Jet.cxx.

769 {
770 str << "\"coneR\":"<<m_d->coneR() <<", ";
771 str << "\"phi\":" <<m_d->phi() <<", ";
772 str << "\"eta\":" <<m_d->eta() <<", ";
773 str << "\"energy\":" <<m_d->energyForLengthAndCuts();
774}

◆ energy()

double IParticleHandle_Jet::energy ( ) const

Definition at line 580 of file IParticleHandle_Jet.cxx.

580{ return m_d->energy(); }

◆ energyForCuts()

double IParticleHandle_Jet::energyForCuts ( ) const

Definition at line 584 of file IParticleHandle_Jet.cxx.

584{ return m_d->energyForLengthAndCuts(); }

◆ ensureInitSubSysHitInfo()

void IParticleHandle_Jet::ensureInitSubSysHitInfo ( ) const
private

◆ eta()

double IParticleHandle_Jet::eta ( ) const

Definition at line 573 of file IParticleHandle_Jet.cxx.

573 {
574 /*VP1Msg::messageVerbose("eta: " + QString::number(m_jet->eta()) );*/
575 return m_d->eta();
576}

◆ fillObjectBrowser()

void IParticleHandle_Jet::fillObjectBrowser ( QList< QTreeWidgetItem * > & listOfItems)
virtual

This gives the list of object's properties, shown in the 'Information' field in the Browser, once the user clicked on one particular item (e.g.

'Jet0')

Reimplemented from AODHandleBase.

Definition at line 522 of file IParticleHandle_Jet.cxx.

523{
524 IParticleHandleBase::fillObjectBrowser(listOfItems); // Obligatory!
525
526 QTreeWidgetItem* TSOSitem = new QTreeWidgetItem(browserTreeItem());
527
528 // Jet "Object" title, in the Browser window
529 TSOSitem->setText(0, QString("Info:" ) );
530
531 QString dParameters("(");
532
533 // jet info and parameters,
534 // they go in the "Information" column in the Browser window
535 // see: http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h
536 //
537
538 dParameters+="pt: ";
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());
550
551 dParameters+="";
552
553 dParameters+=")";
554
555 dParameters += " [more info in the main Message Box]";
556
557 TSOSitem->setText(1, dParameters );
558
559
560}
QTreeWidgetItem * browserTreeItem() const
Return the QTreeWidgetItem;.
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Create and fill the object browser QTreeWidgetItem.

◆ getBTaggingWeight()

double IParticleHandle_Jet::getBTaggingWeight ( const std::string & tagger)
private

Definition at line 719 of file IParticleHandle_Jet.cxx.

720{
721 double weight = 0.0;
722
723 const xAOD::BTagging * myBTag = nullptr;
724 myBTag = xAOD::BTaggingUtilities::getBTagging( *m_d->m_jet );
725
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"); //("It was not possible to access the tagger '"+ tagger +"' for the selected collection: " + m_d->m_jet->getInputType() + m_d->m_jet->getAlgorithmType() );
728 return weight;
729 }
730
731
732
733 // const xAOD::BTagging * myBTag = nullptr;
734 // myBTag = d->m_jet->btagging();
735
736 // if (myBTag == nullptr) {
737 // VP1Msg::messageWarningRed("It was not possible to access the pointer to b-tagging info, for the selected collection! Returning 'weight': 0.0"); //("It was not possible to access the tagger '"+ tagger +"' for the selected collection: " + d->m_jet->getInputType() + d->m_jet->getAlgorithmType() );
738 // return weight;
739 // }
740
741
742 // TODO: add the other taggers
743
744// if (tagger == "MV1")
745// weight = myBTag->MV1_discriminant();
746
747 /* these methods have been removed in xAODBTagging-00-00-35 (cfr. SVN changesets 797165 + 801102)
748 else if (tagger == "JetFitterCombNN_pb")
749 weight = myBTag->JetFitterCombNN_pb();
750 else if (tagger == "JetFitterCombNN_pc")
751 weight = myBTag->JetFitterCombNN_pc();
752 else if (tagger == "JetFitterCombNN_pu")
753 weight = myBTag->JetFitterCombNN_pu();
754 */
755
756// else if (tagger=="MV2c20")
757 if (tagger=="MV2c20")
758 /*const bool hasMv2c20 =*/ myBTag->MVx_discriminant("MV2c20", weight);
759 else if (tagger=="MV2c10")
760 /*const bool hasMv2c10 =*/ myBTag->MVx_discriminant("MV2c10", weight);
761 else if (tagger=="MV2c00")
762 /*const bool hasMv2c00 =*/ myBTag->MVx_discriminant("MV2c00", weight);
763 else
764 VP1Msg::message("Tagger '" + QString::fromStdString(tagger) + "' not found! Returning weight=0.0 ...");
765
766 return weight;
767}
static void messageWarningRed(const QString &str, IVP1System *sys=0)
Definition VP1Msg.cxx:57
bool MVx_discriminant(const std::string &taggername, double &value) const
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
BTagging_v1 BTagging
Definition of the current "BTagging version".
Definition BTagging.h:17

◆ has3DObjects()

bool IParticleHandle_Jet::has3DObjects ( )
virtual

Returns true if the 3D objects have been created.

Reimplemented from AODHandleBase.

Definition at line 161 of file IParticleHandle_Jet.cxx.

162{
163 // VP1Msg::messageVerbose("IParticleHandle_Jet::has3DObjects()");
164 return 0 != m_d->sep;
165}

◆ hasCharge()

bool IParticleHandleBase::hasCharge ( ) const
inlineinherited

Definition at line 59 of file IParticleHandleBase.h.

59{ return charge()!=unknown(); }
static double unknown()
virtual double charge() const =0

◆ hasMass()

bool IParticleHandleBase::hasMass ( ) const
inlineinherited

Definition at line 60 of file IParticleHandleBase.h.

60{ return mass()!=unknown(); }
virtual double mass() const
Returns unknown() in case of trouble.

◆ iParticle()

const xAOD::IParticle & IParticleHandle_Jet::iParticle ( ) const
virtual

Implements IParticleHandleBase.

Definition at line 417 of file IParticleHandle_Jet.cxx.

418{
419 return *(m_d->m_jet);
420}

◆ mass()

double IParticleHandleBase::mass ( ) const
virtualinherited

Returns unknown() in case of trouble.

Definition at line 78 of file IParticleHandleBase.cxx.

79{
80 return 0.0;
81}

◆ momentum()

virtual Amg::Vector3D IParticleHandleBase::momentum ( ) const
inlinevirtualinherited

Reimplemented in IParticleHandle_Electron, IParticleHandle_Muon, and IParticleHandle_TrackParticle.

Definition at line 52 of file IParticleHandleBase.h.

52{ return Amg::Vector3D(0,0,0); }

◆ nodes()

SoNode * IParticleHandle_Jet::nodes ( )
virtual

Returns the 3Dobjects.

Implements AODHandleBase.

Definition at line 193 of file IParticleHandle_Jet.cxx.

193 {
194
195 VP1Msg::messageVerbose("IParticleHandle_Jet::nodes()");
196
197 if (m_d->sep) {
198 VP1Msg::messageVerbose("d->sep already defined (" + VP1Msg::str(m_d->sep) + "). Returning d->sep.");
199 return m_d->sep; // FIXME - do we need to check if anything need to be redrawn?
200 }
201 if (!m_d->sep) {
202 VP1Msg::messageVerbose("d->sep not defined. Creating shapes and a new d->sep.");
203 m_d->sep = new SoSeparator();
204 m_d->sep->ref();
205 }
206
207 const IParticleCollHandle_Jet* collHandleJet = dynamic_cast<const IParticleCollHandle_Jet*>(collHandle());
208 if (not collHandleJet) return m_d->sep; //would nullptr be better?
209 SbVec3f origin(0.,0.,0.);
210 /* TODO: ask if origin info is present in xAOD, like in the old Jet class
211 if ( m_d->m_jet->origin() ) {
212 origin.setValue(m_d->m_jet->origin()->position().x(),
213 m_d->m_jet->origin()->position().y(),
214 m_d->m_jet->origin()->position().z());
215 }
216 */
217
218 const xAOD::Vertex * vtx;
219 bool exists = m_d->m_jet->getAssociatedObject(xAOD::JetAttribute::OriginVertex, vtx);
220
221 if( exists && vtx ) {
222 origin.setValue(vtx->position().x(),vtx->position().y(),vtx->position().z());
223 }
224
225
226 VP1Msg::messageVerbose("creating the shapes");
227
228
229 /*
230 * Here the 3D cone (SoCone) for the jet has to be created (and m_d->sep is updated)
231 */
232 m_d->createShapeFromJetParameters(collHandleJet, m_d->coneR(), m_d->eta(), m_d->phi(), m_d->energyForLengthAndCuts(), origin);
233
234
235 return m_d->sep;
236}
const Amg::Vector3D & position() const
Returns the 3-pos.
bool exists(const std::string &filename)
does a file exist
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ numberOfInstances()

int AODHandleBase::numberOfInstances ( )
staticinherited

Definition at line 87 of file AODHandleBase.cxx.

88{
89 return Imp::nobjhandles;
90}
static std::atomic< int > nobjhandles

◆ phi()

double IParticleHandle_Jet::phi ( ) const

Definition at line 566 of file IParticleHandle_Jet.cxx.

566 {
567 /*VP1Msg::messageVerbose("phi: " + QString::number(m_jet->phi()) );*/
568 return m_d->phi();
569}

◆ rebuild3DObjects()

void AODHandleBase::rebuild3DObjects ( )
virtualinherited

Definition at line 137 of file AODHandleBase.cxx.

138{
139 QString tmp2 = (m_visible==true)?"True":"False";
140 VP1Msg::messageDebug("AODHandleBase::rebuild3DObjects() - with m_visible="+tmp2 );
141
142 //Ensure we are always detached while updating.
143 if (m_visible) {
145 }
146
148 nodes(); // rebuilds the 3D shapes
149
150 //Attach if visible:
151 if (m_visible) {
153 }
154}
virtual void clear3DObjects()=0
Delete objects.
virtual void detach3DObjects()
Remove from the scene graph.
virtual void attach3DObjects()
Connect to the scene graph.
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39

◆ rerandomiseMaterial()

void IParticleHandle_Jet::rerandomiseMaterial ( )

Definition at line 158 of file IParticleHandle_Jet.cxx.

158{m_d->rerandomiseMaterial(); }

◆ setMaxR()

void IParticleHandle_Jet::setMaxR ( const double & maxR)

Definition at line 155 of file IParticleHandle_Jet.cxx.

155{ m_d->maxR = maxR * SYSTEM_OF_UNITS::m; }

◆ setScale()

void IParticleHandle_Jet::setScale ( const double & sc,
bool useEt )

Definition at line 152 of file IParticleHandle_Jet.cxx.

152{ m_d->scale = sc; m_d->considerTransverseEnergies= useEt;}
static Double_t sc

◆ setVisible()

void AODHandleBase::setVisible ( bool vis)
inherited

use by the collection handle.

Definition at line 99 of file AODHandleBase.cxx.

100{
101 QString tmp = (vis==true)?"True":"False";
102 QString tmp2 = (m_visible==true)?"True":"False";
103 VP1Msg::messageDebug(QString("AODHandleBase calling setVisible with vis=")+tmp+QString(", and m_visible=")+tmp2 );
104 if (vis==m_visible)
105 return;
106
107 m_visible=vis;
108 if (vis) {
109 m_collhandle->incrementNShownHandles();
110
111 if (!has3DObjects())
112 rebuild3DObjects();//The call to rebuild also fixes attached state.
113 else
115 } else {
116 m_collhandle->decrementNShownHandles();
118 }
119
121}
virtual void rebuild3DObjects()
virtual void visibleStateChanged()
Dummy implementation does nothing.

◆ shortInfo()

QString IParticleHandle_Jet::shortInfo ( ) const
virtual

This returns the information shown about the object in the object browser.

This gives the very short summary for the object's properties, shown in the 'Information' field in the Browser, beside the item number (e.g.

'Jet0')

Reimplemented from AODHandleBase.

Definition at line 501 of file IParticleHandle_Jet.cxx.

502{
503
504 QString l;
505
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 );
513
514 return l;
515}

◆ transverseEnergy()

double IParticleHandle_Jet::transverseEnergy ( ) const

Definition at line 588 of file IParticleHandle_Jet.cxx.

588{ return m_d->transverseEnergy(); } //sin(2*atan(exp(-fabs(eta()))))*energy();

◆ type()

virtual QString IParticleHandle_Jet::type ( ) const
inlinevirtual

return very short word with type (maybe link with collection type?)

Reimplemented from AODHandleBase.

Definition at line 66 of file IParticleHandle_Jet.h.

◆ unknown()

double AODHandleBase::unknown ( )
inlinestaticinherited

Definition at line 93 of file AODHandleBase.h.

93{ return -999.0; }

◆ update3DObjects()

void AODHandleBase::update3DObjects ( )
virtualinherited

Called after some configuration changes, or when the object is first created. Must be overloaded by children.

Definition at line 125 of file AODHandleBase.cxx.

126{
127 if (m_visible) {
129 } else {
130 //Simply clear the present 3D objects. They will only be recreated if/when the track/jet becomes visible again.
132 }
133}

◆ updateBTagging()

void IParticleHandle_Jet::updateBTagging ( const std::string & bTaggingTagger,
const double & bTaggingCut )

Definition at line 695 of file IParticleHandle_Jet.cxx.

696{
697 VP1Msg::messageVerbose("IParticleHandle_Jet::updateBTagging()");
698
699 // get the b-tagging "weight" (the discriminant)
700 //double bTaggingWeight = 0.99; // dummy value for debug only!!!
701 double bTaggingWeight = getBTaggingWeight(bTaggingTagger); // actual value
702
703 std::cout << "B-TAG UPDATE - jet eta: " << m_d->eta() << ", phi: " << m_d->phi() << " - tagger: " << bTaggingTagger << " - cut: " << bTaggingCut << " - weight: " << bTaggingWeight;
704
705 if (bTaggingWeight > bTaggingCut) {
706 m_d->m_bTagged->whichChild = SO_SWITCH_ALL;
707 std::cout << " ON" << std::endl;
708 }
709 else {
710 m_d->m_bTagged->whichChild = SO_SWITCH_NONE;
711 std::cout << " OFF" << std::endl;
712 }
713
714 // for debug: dumping the content of the whole node
715 // SoTools::dumpNode(m_d->sep);
716}

◆ updateBTaggingSwitch()

void IParticleHandle_Jet::updateBTaggingSwitch ( SoSwitch * bTaggingSwitch)

Definition at line 675 of file IParticleHandle_Jet.cxx.

676{
677 VP1Msg::messageVerbose("IParticleHandle_Jet::updateBTaggingSwitch()");
678
679 std::cout << "old switch: " << m_d->m_bTaggingCollSwitch << " - new: " << bTaggingSwitch << std::endl;
680
681 // remove the old switch
682 m_d->m_bTagged->removeChild(m_d->m_bTaggingCollSwitch);
683
684 // updating the jet switch with the Coll switch
685 m_d->m_bTaggingCollSwitch = 0;
686 m_d->m_bTaggingCollSwitch = bTaggingSwitch;
687
688 // add the new switch to the internal b-tagging switch
689 m_d->m_bTagged->addChild( bTaggingSwitch );
690
691}

◆ updateHeight()

void IParticleHandle_Jet::updateHeight ( )

Definition at line 239 of file IParticleHandle_Jet.cxx.

239 {
240 m_d->updateConeHeightParameters();
241}

◆ updateMaterial() [1/2]

void AODHandleBase::updateMaterial ( )
inherited

Called after some configuration related to material changes.

Definition at line 208 of file AODHandleBase.cxx.

209{
210 VP1Msg::messageVerbose("AODHandleBase::updateMaterial()");
211
212 //We need to change the current material. This means we need to
213 //clear the cache. Only if we are visible do we need to do a
214 //detach->clear material->attach cycle to trigger attachment under new material.
215
217 return;//We have no material cached and is thus not attached either.
218 if (m_visible) {
219 //See if the material changed. If it did, detach, update the material, attach again.
220 SoMaterial * newmat = determineMaterial();
221 newmat->ref();
222 if (newmat!=m_currentmaterial) {
224 m_currentmaterial->unref();
225 m_currentmaterial = newmat;
228 } else {
229 newmat->unref();
230 }
231 } else {
232 //Just clear material.
233 m_currentmaterial->unref();
236 }
237}

◆ updateMaterial() [2/2]

void IParticleHandle_Jet::updateMaterial ( bool isRandomColors)

Definition at line 642 of file IParticleHandle_Jet.cxx.

643{
644 VP1Msg::messageVerbose("IParticleHandle_Jet::Imp::updateMaterial()");
645
646 // check if we have 3D objects; if not, return
647 if ( m_d->sep == 0 )
648 return;
649
650 if (!isRandomColors && !m_d->m_randomMat)
651 return;//m_randomMat can never have been attached
652
653 if (isRandomColors && !m_d->m_randomMat) {
654 m_d->m_randomMat = new SoMaterial;
655 m_d->m_randomMat->ref();
657 }
658
659
660 int i = m_d->sep->findChild(m_d->m_randomMat);
661
662 if ( (i>=0) == isRandomColors ) {
663 VP1Msg::messageVerbose("(i>=0)==isRandomColors. Returning.");
664 return;
665 }
666
667 if (!isRandomColors )
668 m_d->sep->removeChild(m_d->m_randomMat);
669 else
670 m_d->sep->insertChild(m_d->m_randomMat, m_d->sep->getNumChildren()-1);
671}

◆ updateObjectBrowser()

void AODHandleBase::updateObjectBrowser ( )
inlineinherited

Update object browser QTreeWidgetItem.

Definition at line 102 of file AODHandleBase.h.

102{};

◆ visible()

bool AODHandleBase::visible ( ) const
inlineinherited

Definition at line 54 of file AODHandleBase.h.

54{ return m_visible; }

◆ visibleStateChanged()

void AODHandleBase::visibleStateChanged ( )
protectedvirtualinherited

Dummy implementation does nothing.

override if need to take action in this case.

Definition at line 316 of file AODHandleBase.cxx.

317{
318 if ( !browserTreeItem()) {
319 VP1Msg::messageVerbose("visibleStateChanged: No m_objBrowseTree!");
320 return;
321 }
322
323 if (!visible()) {
324 browserTreeItem()->setFlags(Qt::ItemFlags()); // not selectable, not enabled
325 } else {
326 browserTreeItem()->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); // selectable, enabled
327 }
328 QFont itemFont = browserTreeItem()->font(0);
329 itemFont.setStrikeOut(!visible());
330 browserTreeItem()->setFont(0, itemFont);
331 browserTreeItem()->setFont(1, itemFont);
332}
bool visible() const

Member Data Documentation

◆ m_collhandle

AODCollHandleBase* AODHandleBase::m_collhandle
privateinherited

Definition at line 126 of file AODHandleBase.h.

◆ m_currentmaterial

SoMaterial* AODHandleBase::m_currentmaterial
privateinherited

Definition at line 127 of file AODHandleBase.h.

◆ m_d

Imp* IParticleHandle_Jet::m_d
private

Definition at line 83 of file IParticleHandle_Jet.h.

◆ m_visible

bool AODHandleBase::m_visible
privateinherited

Definition at line 125 of file AODHandleBase.h.


The documentation for this class was generated from the following files: