Page MenuHomeHEPForge

JetHistoryView.cc
No OneTemporary

JetHistoryView.cc

#include "display/JetHistoryView.hh"
#include "display/EventView.hh"
#include <vector>
using namespace std;
namespace SpartyJet {
void JetHistoryView::buildJet(){
Jet* j = getJet();
SetX(j->eta());
SetY(j->phi());
}
void JetHistoryView::debug(){
std::cout << " JHV "<< this << " item="<< history.item << " hind"<< hindex() << " jet "<< jet() << std::endl;
}
#define LOOP_OVER_CONSTIT( code ) hist_list_t constits; retrieveParentNodes(constits,true,false) ; \
hist_list_t::iterator it = constits.begin();\
hist_list_t::iterator itE = constits.end(); \
for(; it != itE; ++it){ code }
void JetHistoryView::drawConstituents(int color, int style, float size){
TAttMarker m(color,style,size);
//std::cout << " drawConstituents "; debug();
//LOOP_OVER_CONSTIT( std::cout << " --> it="<< *it<< " "; (*it)->debug(); (*it)->drawJet(m); ) ;
LOOP_OVER_CONSTIT( (*it)->drawJet(m); ) ;
}
void JetHistoryView::setConstitutentAtt(TAttMarker &m){
LOOP_OVER_CONSTIT( m.Copy( *(*it) ) ; ) ;
}
void JetHistoryView::setConstitutentStyle(int style){
LOOP_OVER_CONSTIT( (*it)->SetMarkerStyle( style ) ; ) ;
}
void JetHistoryView::setConstitutentColor(int color){
LOOP_OVER_CONSTIT( (*it)->SetMarkerColor( color ) ; ) ;
}
void JetHistoryView::setConstitutentSize(float size){
LOOP_OVER_CONSTIT( (*it)->SetMarkerSize( size ) ; ) ;
}
void JetHistoryView::drawParent(int color, int style, float size){
TAttMarker m(color,style,size);
vector<JetHistoryView*> p = parents();
for (size_t i = 0; i < p.size(); ++i) p[i]->Draw(m);
}
// ////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////
JetHistViewCollection::JetHistViewCollection(JetCollection &jcoll) {
// Copy a JetHistoryView for each jet, from its HistoryElement
Jet::jet_list_t::const_iterator it, itE;
it = jcoll.begin();
itE = jcoll.end();
for (; it != itE; ++it) {
m_hview.push_back(new JetHistoryView(*((*it)->history())));
m_hview.back()->buildJet();
}
}
void JetHistViewCollection::drawConstituents(bool onlyFinalJet) {
for(size_t i = 0 ; i< m_hview.size(); i++) {
m_hview[i]->drawConstituents(EventViewBase::option_low_pt_jet_color);
}
}
/* std::vector<JetHistoryView*> JetHistViewCollection::historyNoConstituent(){
std::vector<JetHistoryView*> hvec;
for(size_t i=0;i< m_hview.size(); i++ ){ if(m_hview[i].parent1()) hvec.push_back(&m_hview[i]);}
return hvec;
}
*/
}

File Metadata

Mime Type
text/x-c
Expires
Thu, Apr 24, 6:31 AM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4882034
Default Alt Text
JetHistoryView.cc (2 KB)

Event Timeline