ATLAS Offline Software
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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. More...
 
virtual void clear3DObjects ()
 Delete objects. More...
 
virtual SoNode * nodes ()
 Returns the 3Dobjects. More...
 
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. More...
 
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. More...
 
const xAOD::IParticleiParticle () const
 
virtual double charge () const
 Returns unknown() in case of trouble. More...
 
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?) More...
 
QString shortInfo () const
 This returns the information shown about the object in the object browser. More...
 
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. More...
 
virtual QStringList baseInfo () const
 
virtual Amg::Vector3D momentum () const
 
virtual double mass () const
 Returns unknown() in case of trouble. More...
 
bool hasCharge () const
 
bool hasMass () const
 
const AODSysCommonDatacommon () const
 
void setVisible (bool)
 use by the collection handle. More...
 
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. More...
 
virtual void rebuild3DObjects ()
 
virtual void attach3DObjects ()
 Connect to the scene graph. More...
 
virtual void detach3DObjects ()
 Remove from the scene graph. More...
 
void updateMaterial ()
 Called after some configuration related to material changes. More...
 
SoMaterial * currentMaterial () const
 Returns the current material of the handle. More...
 
void updateObjectBrowser ()
 Update object browser QTreeWidgetItem. More...
 
QTreeWidgetItem * browserTreeItem () const
 Return the QTreeWidgetItem;. More...
 

Static Public Member Functions

static int numberOfInstances ()
 
static double unknown ()
 

Protected Member Functions

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

Private Member Functions

void ensureInitSubSysHitInfo () const
 
double getBTaggingWeight (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
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 }

◆ ~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 
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 );
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 }

◆ 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 }

◆ 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 
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 }

◆ 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 
195  if (!m_currentmaterial)
196  return;//Can never have been attached!
197  if (has3DObjects() && m_collhandle->sepHelper()) {
199  }
200 
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 }

◆ 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 }

◆ getBTaggingWeight()

double IParticleHandle_Jet::getBTaggingWeight ( 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;
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 }

◆ 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(); }

◆ hasMass()

bool IParticleHandleBase::hasMass ( ) const
inlineinherited

Definition at line 60 of file IParticleHandleBase.h.

60 { return mass()!=unknown(); }

◆ 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_TrackParticle, and IParticleHandle_Muon.

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;
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 }

◆ numberOfInstances()

int AODHandleBase::numberOfInstances ( )
staticinherited

Definition at line 87 of file AODHandleBase.cxx.

88 {
89  return Imp::nobjhandles;
90 }

◆ 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) {
144  detach3DObjects();
145  }
146 
147  clear3DObjects();
148  nodes(); // rebuilds the 3D shapes
149 
150  //Attach if visible:
151  if (m_visible) {
152  attach3DObjects();
153  }
154 }

◆ rerandomiseMaterial()

void IParticleHandle_Jet::rerandomiseMaterial ( )

Definition at line 158 of file IParticleHandle_Jet.cxx.

◆ 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;}

◆ 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) {
110 
111  if (!has3DObjects())
112  rebuild3DObjects();//The call to rebuild also fixes attached state.
113  else
114  attach3DObjects();
115  } else {
117  detach3DObjects();
118  }
119 
121 }

◆ 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()

static 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.
131  clear3DObjects();
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
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  {
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 
216  if (!m_currentmaterial)
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) {
223  detach3DObjects();
224  m_currentmaterial->unref();
225  m_currentmaterial = newmat;
226  attach3DObjects();
228  } else {
229  newmat->unref();
230  }
231  } else {
232  //Just clear material.
233  m_currentmaterial->unref();
234  m_currentmaterial = 0;
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 }

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:
IParticleHandle_Jet::Imp::m_randomMat
SoMaterial * m_randomMat
Definition: IParticleHandle_Jet.cxx:64
AODHandleBase::visible
bool visible() const
Definition: AODHandleBase.h:54
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
IParticleHandle_Jet::Imp::m_bTagged
SoSwitch * m_bTagged
Definition: IParticleHandle_Jet.cxx:65
IParticleHandle_Jet::Imp::createShapeFromJetParameters
void createShapeFromJetParameters(const IParticleCollHandle_Jet *collHandleJet, const double &coneR, const double &eta, const double &phi, const double &energy, const SbVec3f &origin)
Definition: IParticleHandle_Jet.cxx:245
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
AODHandleBase::unknown
static double unknown()
Definition: AODHandleBase.h:93
IParticleHandle_Jet::Imp::phi
double phi() const
Definition: IParticleHandle_Jet.cxx:93
IParticleHandle_Jet::Imp::sep
SoSeparator * sep
Definition: IParticleHandle_Jet.cxx:62
VP1StdCollection::material
SoMaterial * material() const
Definition: VP1StdCollection.cxx:220
AODHandleBase::detach3DObjects
virtual void detach3DObjects()
Remove from the scene graph.
Definition: AODHandleBase.cxx:191
xAOD::Jet_v1::getAssociatedObject
const T * getAssociatedObject(const std::string &name) const
get a single associated object this compact form throws an exception if the object is not existing
xAOD::JetAlgorithmType::algName
const std::string & algName(ID id)
Converts a JetAlgorithmType::ID into a string.
Definition: JetContainerInfo.cxx:67
VP1ExtraSepLayerHelper::addNodeUnderMaterial
void addNodeUnderMaterial(SoNode *, SoMaterial *)
Definition: VP1ExtraSepLayerHelper.cxx:190
AODHandleBase::m_collhandle
AODCollHandleBase * m_collhandle
Definition: AODHandleBase.h:126
AODHandleBase::collHandle
const AODCollHandleBase * collHandle() const
Definition: AODHandleBase.h:55
AODHandleBase::determineMaterial
virtual SoMaterial * determineMaterial()=0
Should be implemented by children, in order to change the material depending on the interface etc.
VP1ExtraSepLayerHelper::removeNodeUnderMaterial
void removeNodeUnderMaterial(SoNode *, SoMaterial *)
Definition: VP1ExtraSepLayerHelper.cxx:216
AODHandleBase::fillObjectBrowser
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Create and fill the object browser QTreeWidgetItem.
Definition: AODHandleBase.cxx:288
AODHandleBase::has3DObjects
virtual bool has3DObjects()
Returns true if the 3D objects have been created.
Definition: AODHandleBase.h:57
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
IParticleHandle_Jet::Imp::updateConeHeightParameters
void updateConeHeightParameters(SoCone *, SoTranslation *, const double &energy) const
Definition: IParticleHandle_Jet.cxx:343
xAOD::Vertex_v1::position
const Amg::Vector3D & position() const
Returns the 3-pos.
IParticleHandle_Jet::Imp::transverseEnergy
double transverseEnergy() const
Definition: IParticleHandle_Jet.cxx:96
xAOD::Jet_v1::getAlgorithmType
JetAlgorithmType::ID getAlgorithmType() const
Definition: Jet_v1.cxx:249
xAOD::Jet_v1::getInputType
JetInput::Type getInputType() const
Definition: Jet_v1.cxx:253
IParticleHandleBase::charge
virtual double charge() const =0
xAOD::JetInput::typeName
const std::string & typeName(Type id)
Definition: JetContainerInfo.cxx:199
VP1String::str
static QString str(const QString &s)
Definition: VP1String.h:49
AODHandleBase::currentMaterialChanged
virtual void currentMaterialChanged()
Definition: AODHandleBase.h:111
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
IParticleHandle_Jet::getBTaggingWeight
double getBTaggingWeight(std::string tagger)
Definition: IParticleHandle_Jet.cxx:719
IParticleHandle_Jet::Imp::energy
double energy() const
Definition: IParticleHandle_Jet.cxx:95
AODCollHandleBase::common
const AODSysCommonData * common() const
Definition: AODCollHandleBase.h:88
IParticleHandle_Jet::Imp::m_JetFitterCombNN_pb
double m_JetFitterCombNN_pb
Definition: IParticleHandle_Jet.cxx:73
AODCollHandleBase::incrementNShownHandles
void incrementNShownHandles()
Definition: AODCollHandleBase.h:132
VP1LinAlgUtils::phiFromXY
static double phiFromXY(const double &x, const double &y)
Definition: VP1LinAlgUtils.cxx:374
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
AODHandleBase::attach3DObjects
virtual void attach3DObjects()
Connect to the scene graph.
Definition: AODHandleBase.cxx:157
xAOD::Jet_v1::pz
float pz() const
The z-component of the jet's momentum.
Definition: Jet_v1.cxx:99
xAOD::Jet_v1::type
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
Definition: Jet_v1.cxx:85
xAOD::JetAttribute::OriginVertex
@ OriginVertex
Definition: JetAttributes.h:255
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
jobOptions_CavernBackground.inputType
inputType
Definition: jobOptions_CavernBackground.py:21
IParticleCollHandle_Jet
Definition: IParticleCollHandle_Jet.h:26
lumiFormat.i
int i
Definition: lumiFormat.py:92
IParticleHandle_Jet::m_d
Imp * m_d
Definition: IParticleHandle_Jet.h:82
xAOD::Jet_v1::getSizeParameter
float getSizeParameter() const
Definition: Jet_v1.cxx:245
IParticleHandle_Jet::Imp::m_bTagWeightMV1
double m_bTagWeightMV1
Definition: IParticleHandle_Jet.cxx:70
IParticleHandle_Jet::Imp::theclass
IParticleHandle_Jet * theclass
Definition: IParticleHandle_Jet.cxx:57
AODHandleBase::Imp::nobjhandles
static std::atomic< int > nobjhandles
Definition: AODHandleBase.cxx:56
IParticleHandle_Jet::Imp::rerandomiseMaterial
void rerandomiseMaterial()
Definition: IParticleHandle_Jet.cxx:592
IParticleHandleBase::momentum
virtual Amg::Vector3D momentum() const
Definition: IParticleHandleBase.h:52
IParticleHandle_Jet::Imp::energyForLengthAndCuts
double energyForLengthAndCuts() const
Definition: IParticleHandle_Jet.cxx:98
AODHandleBase::visibleStateChanged
virtual void visibleStateChanged()
Dummy implementation does nothing.
Definition: AODHandleBase.cxx:316
AODSysCommonData::deregisterHandle
void deregisterHandle(AODHandleBase *h)
Definition: AODSysCommonData.cxx:67
IParticleHandle_Jet::Imp::cone
SoCone * cone
Definition: IParticleHandle_Jet.cxx:63
AODHandleBase::browserTreeItem
QTreeWidgetItem * browserTreeItem() const
Return the QTreeWidgetItem;.
Definition: AODHandleBase.cxx:311
IParticleHandle_Jet::Imp::m_JetFitterCombNN_pc
double m_JetFitterCombNN_pc
Definition: IParticleHandle_Jet.cxx:74
IParticleHandle_Jet::Imp::scale
double scale
Definition: IParticleHandle_Jet.cxx:83
xAOD::JetAlgorithmType::ID
ID
//////////////////////////////////////// JetAlgorithmType::ID defines most common physics jet finding...
Definition: JetContainerInfo.h:29
IParticleHandle_Jet::Imp::pt
double pt() const
Definition: IParticleHandle_Jet.cxx:92
xAOD::Jet_v1::py
float py() const
The y-component of the jet's momentum.
Definition: Jet_v1.cxx:94
AODCollHandleBase::decrementNShownHandles
void decrementNShownHandles()
Definition: AODCollHandleBase.h:133
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
IParticleHandle_Jet::Imp::m_jet
const xAOD::Jet * m_jet
Definition: IParticleHandle_Jet.cxx:60
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
xAOD::JetInput::Type
Type
Definition: JetContainerInfo.h:54
xAOD::Jet_v1::rapidity
virtual double rapidity() const
The true rapidity (y) of the particle.
Definition: Jet_v1.cxx:67
IParticleHandle_Jet::Imp::considerTransverseEnergies
bool considerTransverseEnergies
Definition: IParticleHandle_Jet.cxx:81
IParticleHandle_Jet::rerandomiseMaterial
void rerandomiseMaterial()
Definition: IParticleHandle_Jet.cxx:158
python.selection.number
number
Definition: selection.py:20
xAOD::Jet_v1::px
float px() const
The x-component of the jet's momentum.
Definition: Jet_v1.cxx:90
IParticleHandle_Jet::Imp::m_JetFitterCombNN_pu
double m_JetFitterCombNN_pu
Definition: IParticleHandle_Jet.cxx:75
IParticleHandle_Jet::Imp::m_bTagWeightMV2c10
double m_bTagWeightMV2c10
Definition: IParticleHandle_Jet.cxx:72
IParticleHandleBase::IParticleHandleBase
IParticleHandleBase(IParticleCollHandleBase *)
Definition: IParticleHandleBase.cxx:59
VP1Msg::messageVerbose
static void messageVerbose(const QString &)
Definition: VP1Msg.cxx:84
AODHandleBase::nodes
virtual SoNode * nodes()=0
Returns the 3Dobjects.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
AODHandleBase::m_d
Imp * m_d
Definition: AODHandleBase.h:120
IParticleHandle_Jet::Imp::m_bTaggingCollSwitch
SoSwitch * m_bTaggingCollSwitch
Definition: IParticleHandle_Jet.cxx:66
AODHandleBase::m_visible
bool m_visible
Definition: AODHandleBase.h:125
IParticleHandle_Jet::Imp::maxR
double maxR
Definition: IParticleHandle_Jet.cxx:84
AODCollHandleBase::sepHelper
const VP1ExtraSepLayerHelper * sepHelper() const
Definition: AODCollHandleBase.h:90
xAOD::BTaggingUtilities::getBTagging
const BTagging * getBTagging(const SG::AuxElement &part)
Access the default xAOD::BTagging object associated to an object.
Definition: BTaggingUtilities.cxx:37
IParticleHandleBase::mass
virtual double mass() const
Returns unknown() in case of trouble.
Definition: IParticleHandleBase.cxx:78
xAOD::Jet_v1::m
virtual double m() const
The invariant mass of the particle.
Definition: Jet_v1.cxx:59
VP1Msg::messageDebug
static void messageDebug(const QString &)
Definition: VP1Msg.cxx:39
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
VP1Msg::message
static void message(const QString &, IVP1System *sys=0)
Definition: VP1Msg.cxx:30
IParticleHandle_Jet::Imp::m_bTagWeightMV2c20
double m_bTagWeightMV2c20
Definition: IParticleHandle_Jet.cxx:71
AODHandleBase::rebuild3DObjects
virtual void rebuild3DObjects()
Definition: AODHandleBase.cxx:137
IParticleHandle_Jet::Imp::eta
double eta() const
Definition: IParticleHandle_Jet.cxx:94
AODHandleBase::Imp::m_objBrowseTree
QTreeWidgetItem * m_objBrowseTree
Definition: AODHandleBase.cxx:65
str
Definition: BTagTrackIpAccessor.cxx:11
VP1Msg::messageWarningRed
static void messageWarningRed(const QString &str, IVP1System *sys=0)
Definition: VP1Msg.cxx:57
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
AODSysCommonData::registerHandle
void registerHandle(AODHandleBase *h)
Definition: AODSysCommonData.cxx:60
xAOD::Jet_v1::numConstituents
size_t numConstituents() const
Number of constituents in this jets (this is valid even when reading a file where the constituents ha...
Definition: Jet_v1.cxx:153
AODHandleBase::m_currentmaterial
SoMaterial * m_currentmaterial
Definition: AODHandleBase.h:127
IParticleHandle_Jet::Imp::coneR
double coneR() const
Definition: IParticleHandle_Jet.cxx:97
xAOD::BTagging_v1::MVx_discriminant
bool MVx_discriminant(const std::string &taggername, double &value) const
Definition: BTagging_v1.cxx:381
AODHandleBase::clear3DObjects
virtual void clear3DObjects()=0
Delete objects.