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

#include <MissingEtHandle.h>

Inheritance diagram for MissingEtHandle:
Collaboration diagram for MissingEtHandle:

Classes

class  Imp

Public Member Functions

 MissingEtHandle (AODCollHandleBase *, const xAOD::MissingET *)
virtual ~MissingEtHandle ()
virtual bool has3DObjects ()
 Returns true if the 3D objects have been created.
virtual void clear3DObjects ()
 Delete objects.
virtual SoNode * nodes ()
 Returns the 3Dobjects.
virtual SoMaterial * determineMaterial ()
 Should be implemented by children, in order to change the material depending on the interface etc.
void setScale (const double &sc)
void updateHeight ()
virtual QStringList clicked () const
 This gives the complete information about the object, shown in the main Message Box.
double phi () const
double met () 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 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.
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.
virtual QStringList baseInfo () const
void updateObjectBrowser ()
 Update object browser QTreeWidgetItem.
QTreeWidgetItem * browserTreeItem () const
 Return the QTreeWidgetItem;.
virtual void dumpToJSON (std::ofstream &) const

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

Private Attributes

Impm_d
bool m_visible
AODCollHandleBasem_collhandle
SoMaterial * m_currentmaterial

Detailed Description

Definition at line 25 of file MissingEtHandle.h.

Constructor & Destructor Documentation

◆ MissingEtHandle()

MissingEtHandle::MissingEtHandle ( AODCollHandleBase * ch,
const xAOD::MissingET * met )

Definition at line 116 of file MissingEtHandle.cxx.

117 : AODHandleBase(ch), m_d(new Imp)
118{
119 VP1Msg::messageVerbose("MissingEtHandle::MissingEtHandle() - constructor");
120 m_d->theclass = this;
121 m_d->m_met = met;
122
123 m_d->sep = 0;
124 m_d->cone = 0;
125 // m_d->m_randomMat = 0;
126
127 // m_d->theCollHandle = dynamic_cast<const MissingEtCollHandle*>(collHandle());
128 m_d->theCollHandle = 0;
129}
AODHandleBase(AODCollHandleBase *)
double met() const
static void messageVerbose(const QString &)
Definition VP1Msg.cxx:84

◆ ~MissingEtHandle()

MissingEtHandle::~MissingEtHandle ( )
virtual

Definition at line 132 of file MissingEtHandle.cxx.

133{
134 // VP1Msg::messageVerbose("MissingEtHandle::~MissingEtHandle() - destructor");
135 // if (m_d->m_randomMat) m_d->m_randomMat->unref();
136 if (m_d->cone) m_d->cone->unref();
137 if (m_d->base) m_d->base->unref();
138 if (m_d->sep) m_d->sep->unref();
139 delete m_d;
140}

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 message(const QString &, IVP1System *sys=0)
Definition VP1Msg.cxx:30

◆ baseInfo()

QStringList AODHandleBase::baseInfo ( ) const
virtualinherited

Reimplemented in IParticleHandleBase, and VertexHandle.

Definition at line 247 of file AODHandleBase.cxx.

248{
249 VP1Msg::messageDebug("AODHandleBase::baseInfo()");
250
251 QStringList l;
252
253
254 // Amg::Vector3D mom = momentum()/1000;
255 // if (mom.mag2()==0.0) {
256 // l << "Momentum : 0 (undefined)";
257 // } else {
258 // l << "Momentum [GeV]: "+VP1Msg::str(mom);
259 // l << "|Pt|/|P| [GeV]: "+VP1Msg::str(mom.perp())+" / " + VP1Msg::str(mom.mag());
260 // l << VP1Msg::str("(")+QChar(0x03B7)+","+QChar(0x03D5)+VP1Msg::str(")=(")
261 // +VP1Msg::str(mom.eta())+VP1Msg::str(",")+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ))+VP1Msg::str(")");
262 //
263 // l << "Eta: "+VP1Msg::str(mom.eta());
264 // l << "Phi: "+VP1Msg::str(VP1LinAlgUtils::phiFromXY(mom.x(), mom.y() ));
265 // }
266 // l<<"Hit summary: Pix["+VP1Msg::str(getNPixelHits())+"], SCT["+VP1Msg::str(getNSCTHits())+"], TRT["+VP1Msg::str(getNTRTHits())
267 // +"], MDT["+QString::number(getNMDTHits())+"], RPC["+QString::number(getNRPCHits())+"], TGC["+QString::number(getNTGCHits())+"], CSC["+QString::number(getNCSCHits())+"].";
268 //
269 // return l;
270 // int pdg = pdgCode();
271 // if (pdg) {
272 // bool ok;
273 // QString name = VP1ParticleData::particleName(pdg,ok);
274 // if (ok)
275 // l << "pdg: "+QString::number(pdg)+" ["+name+"]";
276 // else
277 // l << "pdg: "+QString::number(pdg);
278 // }
279
280 if (l.length() == 0)
281 l << "baseInfo : (undefined)";
282
283 return l;
284}
static void messageDebug(const QString &)
Definition VP1Msg.cxx:39
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}

◆ clear3DObjects()

void MissingEtHandle::clear3DObjects ( )
virtual

Delete objects.

Implements AODHandleBase.

Definition at line 165 of file MissingEtHandle.cxx.

165 {
166 // VP1Msg::messageVerbose("MissingEtHandle::clear3DObjects()");
167
168 // if (m_d->m_randomMat) {
169 // m_d->m_randomMat->unref();
170 // m_d->m_randomMat = 0;
171 // }
172 if (m_d->cone) {
173 m_d->cone->unref();
174 m_d->cone = 0;
175 }
176 if (m_d->sep) {
177 m_d->sep->unref();
178 m_d->sep = 0;
179 }
180
181}

◆ clicked()

QStringList MissingEtHandle::clicked ( ) const
virtual

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

Implements AODHandleBase.

Definition at line 366 of file MissingEtHandle.cxx.

367{
368 VP1Msg::messageDebug("MissingEtHandle::clicked()");
369
370 QStringList l;
371 l << "--MissingEt: ";
372 //l << AODHandleBase::baseInfo();
373
374 // info and parameters,
375 // they go in the "Information" column in the Browser window
376 // see: http://acode-browser.usatlas.bnl.gov/lxr/source/atlas/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingET_v1.h
377 //
378 l +=" - Name: " + m_d->name();
379 l +=" - MissingEt: " + QString::number(m_d->met() / SYSTEM_OF_UNITS::GeV) +" [GeV]";
380 l +=" - Phi: " + QString::number(m_d->phi());
381 l +=" - SumEt: " + QString::number(m_d->sumet() / SYSTEM_OF_UNITS::GeV) +" [GeV]";
382 l +=" - mpx: " + QString::number(m_d->mpx() / SYSTEM_OF_UNITS::GeV) +" [GeV]" ;
383 l +=" - mpy: " + QString::number(m_d->mpy() / SYSTEM_OF_UNITS::GeV) +" [GeV]";
384
385 return l;
386}

◆ 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 * MissingEtHandle::determineMaterial ( )
virtual

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 143 of file MissingEtHandle.cxx.

143 {
144 // By default we use the collection material.
145 // std::cout<<"VertexHandle::determineMaterial() - collHandle()->material()"<<collHandle()->material()<<std::endl;
146 return collHandle()->material();
147}
const AODCollHandleBase * collHandle() const
SoMaterial * material() const

◆ dumpToJSON()

virtual void AODHandleBase::dumpToJSON ( std::ofstream & ) const
inlinevirtualinherited

◆ ensureInitSubSysHitInfo()

void MissingEtHandle::ensureInitSubSysHitInfo ( ) const
private

◆ fillObjectBrowser()

void MissingEtHandle::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.

'MissingEt0')

Reimplemented from AODHandleBase.

Definition at line 454 of file MissingEtHandle.cxx.

455{
456 AODHandleBase::fillObjectBrowser(listOfItems); // Obligatory!
457
458 QTreeWidgetItem* TSOSitem = new QTreeWidgetItem(browserTreeItem());
459
460 // Jet "Object" title, in the Browser window
461 TSOSitem->setText(0, QString("Info: " ) );
462
463 QString dParameters("(");
464
465 // info and parameters,
466 // they go in the "Information" column in the Browser window
467 dParameters+="name: ";
468 dParameters+=m_d->name();
469 dParameters+=", met: ";
470 dParameters+=QString::number(m_d->met());
471 dParameters+=", phi: ";
472 dParameters+=QString::number(m_d->phi());
473 dParameters+=", sumet: ";
474 dParameters+=QString::number(m_d->sumet());
475
476 dParameters+="";
477
478 dParameters+=")";
479
480 dParameters += " [more info in the main Message Box]";
481
482 TSOSitem->setText(1, dParameters );
483
484 /*
485 * TODO: check jets parameters
486 */
487 /*
488 for (unsigned int i=0; i<m_d->trackparticle->numberOfParameters() ; ++i){
489
490 QTreeWidgetItem* TSOSitem = new QTreeWidgetItem(browserTreeItem());
491 TSOSitem->setText(0, QString("Parameter "+QString::number( i+1 ) ) );
492 QString pos(", Position = (");
493 pos+=QString::number(m_d->trackparticle->parameterX(i));
494 pos+=", ";
495 pos+=QString::number(m_d->trackparticle->parameterY(i));
496 pos+=", ";
497 pos+=QString::number(m_d->trackparticle->parameterZ(i));
498 pos+=")";
499
500 switch (m_d->trackparticle->parameterPosition(i)){
501 case xAOD::BeamLine:
502 TSOSitem->setText(1, QString("BeamLine" )+pos );
503 break;
504 case xAOD::FirstMeasurement:
505 TSOSitem->setText(1, QString("FirstMeasurement")+pos );
506 break;
507 case xAOD::LastMeasurement:
508 TSOSitem->setText(1, QString("LastMeasurement" )+pos );
509 break;
510 case xAOD::CalorimeterEntrance:
511 TSOSitem->setText(1, QString("CalorimeterEntrance")+pos );
512 break;
513 case xAOD::CalorimeterExit:
514 TSOSitem->setText(1, QString("CalorimeterExit" )+pos );
515 break;
516 case xAOD::MuonSpectrometerEntrance:
517 TSOSitem->setText(1, QString("MuonSpectrometerEntrance")+pos );
518 break;
519 default:
520 TSOSitem->setText(1, QString("Undefined")+pos );
521 }
522 }
523 */
524
525
526 // TODO - add more.
527}
QTreeWidgetItem * browserTreeItem() const
Return the QTreeWidgetItem;.
virtual void fillObjectBrowser(QList< QTreeWidgetItem * > &list)
Create and fill the object browser QTreeWidgetItem.

◆ has3DObjects()

bool MissingEtHandle::has3DObjects ( )
virtual

Returns true if the 3D objects have been created.

Reimplemented from AODHandleBase.

Definition at line 157 of file MissingEtHandle.cxx.

158{
159 // VP1Msg::messageVerbose("MissingEtHandle::has3DObjects()");
160 return 0 != m_d->sep;
161}

◆ met()

double MissingEtHandle::met ( ) const

Definition at line 540 of file MissingEtHandle.cxx.

540 {
541 /*VP1Msg::messageVerbose("eta: " + QString::number(m_met->eta()) );*/
542 return m_d->met();
543}

◆ nodes()

SoNode * MissingEtHandle::nodes ( )
virtual

Returns the 3Dobjects.

Implements AODHandleBase.

Definition at line 189 of file MissingEtHandle.cxx.

189 {
190
191 VP1Msg::messageVerbose("MissingEtHandle::nodes()");
192
193 if (m_d->sep) {
194 VP1Msg::messageVerbose("d->sep already defined (" + VP1Msg::str(m_d->sep) + "). Returning d->sep.");
195 return m_d->sep; // FIXME - do we need to check if anything need to be redrawn?
196 }
197 if (!m_d->sep) {
198 VP1Msg::messageVerbose("d->sep not defined. Creating shapes and a new d->sep.");
199 m_d->sep = new SoSeparator();
200 m_d->sep->ref();
201 }
202
203 m_d->theCollHandle = dynamic_cast<const MissingEtCollHandle*>(collHandle());
204 m_d->theCollSettingsButton = &(m_d->theCollHandle->collSettingsButton());
205
206
207// SbVec3f origin(0.,0.,0.);
208 /* TODO: ask if origin info is present in xAOD, like in the old Jet class
209 if ( m_d->m_met->origin() ) {
210 origin.setValue(m_d->m_met->origin()->position().x(),
211 m_d->m_met->origin()->position().y(),
212 m_d->m_met->origin()->position().z());
213 }
214 */
215
216 VP1Msg::messageVerbose("creating the shapes");
217
218
219 /*
220 * Here the 3D shapes are created
221 */
222 m_d->createShapeFromJetParameters();
223
224 return m_d->sep;
225}
static QString str(const QString &s)
Definition VP1String.h:49

◆ 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 MissingEtHandle::phi ( ) const

Definition at line 533 of file MissingEtHandle.cxx.

533 {
534 /*VP1Msg::messageVerbose("phi: " + QString::number(m_met->phi()) );*/
535 return m_d->phi();
536}

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

◆ setScale()

void MissingEtHandle::setScale ( const double & sc)

Definition at line 151 of file MissingEtHandle.cxx.

151{ m_d->scale = sc; }
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 MissingEtHandle::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.

'MissingEt0')

Reimplemented from AODHandleBase.

Definition at line 436 of file MissingEtHandle.cxx.

437{
438 VP1Msg::messageDebug("MissingEtHandle::shortInfo()");
439
440 QString l;
441
442 l += m_d->name();
443 l += ", met: " + QString::number(m_d->met() / SYSTEM_OF_UNITS::GeV) +" [GeV]";
444 l += ", phi: " + QString::number(m_d->phi());
445
446 return l;
447}

◆ type()

virtual QString MissingEtHandle::type ( ) const
inlinevirtual

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

Reimplemented from AODHandleBase.

Definition at line 56 of file MissingEtHandle.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}

◆ updateHeight()

void MissingEtHandle::updateHeight ( )

Definition at line 228 of file MissingEtHandle.cxx.

228 {
229 m_d->updateConeHeightParameters();
230}

◆ updateMaterial()

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}

◆ 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* MissingEtHandle::m_d
private

Definition at line 70 of file MissingEtHandle.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: