Page MenuHomeHEPForge

JetRetrieverLive.cc
No OneTemporary

JetRetrieverLive.cc

#include "JetRetrieverLive.hh"
#include "cdf/JetClustFinder.hh"
#include "cdf/MidPointFinder.hh"
#include "fastjet/FastJetFinder.hh"
#include "fastjet/SISConeFinder.hh"
#include "celljet/CellJetFinder.hh"
#include "D0/D0RunIIConeFinder.hh"
#include "atlas/ConeFinderTool.h"
#include "atlas/FastKtTool.h"
namespace SpartyJet {
JetRetrieverLive::JetRetrieverLive(SpartyEventDrawer* drawer,SpartyGui* gui) {
init();
m_parent = drawer;
m_spartygui = gui;
m_guiIsOpen = false;
m_onTheFlyGui = NULL;
m_tool = NULL;
}
void JetRetrieverLive::init() {
m_toolChanged = true;
m_currentAlg = ALG_JETCLU;
m_params = new Parameters();
m_tool = NULL;
m_name = "Undefined";
}
void JetRetrieverLive::close_onthefly_gui() {
m_onTheFlyGui->CloseWindow();
}
void JetRetrieverLive::delete_tool() {
delete m_tool;
m_tool = NULL;
}
void JetRetrieverLive::set_params(Parameters* newparams) {
m_params = newparams;
}
void JetRetrieverLive::new_tool(AlgCode algtype) {
m_toolChanged = true;
if(m_tool) delete m_tool;
std::cout << "jetrieverlvie::newtool() " << std::endl;
m_currentAlg = algtype;
cdf::JetClustFinder* temptool1;
cdf::MidPointFinder* temptool2;
fastjet::FastJetFinder* temptool3;
fastjet::SISConeFinder* temptool4;
D0::D0RunIIConeFinder* temptool5;
atlas::ConeFinderTool* temptool6;
atlas::FastKtTool* temptool7;
pythia::CellJetFinder* temptool8;
switch(algtype){
case ALG_JETCLU:
temptool1 = new cdf::JetClustFinder("");
temptool1->set_seedThreshold( m_params->JetClu_seedThreshold);
temptool1->set_coneRadius( m_params->JetClu_coneRadius);
temptool1->set_adjacencyCut( m_params->JetClu_adjacencyCut);
temptool1->set_maxIterations( m_params->JetClu_maxIterations);
temptool1->set_iratch( m_params->JetClu_iratch);
temptool1->set_overlapThreshold( m_params->JetClu_overlapThreshold);
m_tool = temptool1;
break;
case ALG_MIDPOINT:
std::cout << "adding midpoint options to tool" << std::endl;
temptool2 = new cdf::MidPointFinder("");
temptool2->set_second_pass( m_params->MidPoint_doSecondPass);
temptool2->set_seedThreshold( m_params->MidPoint_seedThreshold);
temptool2->set_coneRadius( m_params->MidPoint_coneRadius);
temptool2->set_coneAreaFraction( m_params->MidPoint_coneAreaFraction);
temptool2->set_maxPairSize( m_params->MidPoint_maxPairSize);
temptool2->set_maxIterations( m_params->MidPoint_maxIterations);
temptool2->set_overlapThreshold( m_params->MidPoint_overlapThreshold);
temptool2->set_reduceConeSize( m_params->MidPoint_reduceConeSize);
m_tool = temptool2;
break;
case ALG_FASTJET:
temptool3 = new fastjet::FastJetFinder("");
temptool3->set_aachen( m_params->FastJet_aachen);
temptool3->set_area( m_params->FastJet_area);
temptool3->set_inclusive( m_params->FastJet_inclusive);
temptool3->set_exclusive( m_params->FastJet_exclusive);
temptool3->set_Rparam( m_params->FastJet_Rparam);
temptool3->set_ptmin( m_params->FastJet_ptmin);
temptool3->set_dcut( m_params->FastJet_dcut);
temptool3->set_ghost_etamax( m_params->FastJet_ghost_etamax);
temptool3->set_repeat( m_params->FastJet_repeat);
temptool3->set_ghost_area( m_params->FastJet_ghost_area);
temptool3->set_grid_scatter( m_params->FastJet_grid_scatter);
temptool3->set_kt_scatter( m_params->FastJet_kt_scatter);
temptool3->set_mean_ghost_kt( m_params->FastJet_mean_ghost_kt);
m_tool = temptool3;
break;
case ALG_SISCONE:
temptool4 = new fastjet::SISConeFinder("");
temptool4->set_area( m_params->SISCone_area);
temptool4->set_inclusive( m_params->SISCone_inclusive);
temptool4->set_exclusive( m_params->SISCone_exclusive);
temptool4->set_coneRadius( m_params->SISCone_coneRadius);
temptool4->set_overlapThreshold( m_params->SISCone_overlapThreshold);
temptool4->set_nPassMax( m_params->SISCone_nPassMax);
temptool4->set_ptmin( m_params->SISCone_protojetptmin);
temptool4->set_caching( m_params->SISCone_caching);
temptool4->set_ghost_etamax( m_params->SISCone_ghost_etamax);
temptool4->set_repeat( m_params->SISCone_repeat);
temptool4->set_ghost_area( m_params->SISCone_ghost_area);
temptool4->set_grid_scatter( m_params->SISCone_grid_scatter);
temptool4->set_kt_scatter( m_params->SISCone_kt_scatter);
temptool4->set_mean_ghost_kt( m_params->SISCone_mean_ghost_kt);
m_tool = temptool4;
break;
case ALG_D0CONE:
temptool5 = new D0::D0RunIIConeFinder("");
temptool5->set_second_pass( m_params->D0Cone_do_second_pass);
temptool5->set_killDuplicate( m_params->D0Cone_kill_duplicate);
temptool5->set_coneRadius( m_params->D0Cone_cone_radius);
temptool5->set_minJetEt( m_params->D0Cone_min_jet_Et);
temptool5->set_splitRatio( m_params->D0Cone_split_ratio);
temptool5->set_farRatio( m_params->D0Cone_far_ratio);
temptool5->set_EtMinRatio( m_params->D0Cone_Et_min_ratio);
temptool5->set_duplicate_dR( m_params->D0Cone_duplicate_dR);
temptool5->set_duplicate_dPT( m_params->D0Cone_duplicate_dPT);
temptool5->set_searchFactor( m_params->D0Cone_search_factor);
temptool5->set_pTMinLeadingProtojet( m_params->D0Cone_pT_min_leading_protojet);
temptool5->set_pTMinSecondProtojet( m_params->D0Cone_pT_min_second_protojet);
temptool5->set_mergeMax( m_params->D0Cone_merge_max);
temptool5->set_pTMinNoMerge( m_params->D0Cone_pT_min_nomerge);
temptool5->set_itemEtThreshold( m_params->D0Cone_Item_ET_Threshold);
temptool5->set_Zvertex( m_params->D0Cone_Zvertex);
m_tool = temptool5;
break;
case ALG_ATLASCONE:
temptool6 = new atlas::ConeFinderTool("");
temptool6->set_config(m_params->AtlasCone_coneRadius,
m_params->AtlasCone_seedPt,
m_params->AtlasCone_splitmerge);
m_tool = temptool6;
break;
case ALG_ATLASKT:
temptool7 = new atlas::FastKtTool("");
temptool7->simple_config(m_params->AtlasKt_findername,
m_params->AtlasKt_m_rParameter);
m_tool = temptool7;
break;
case ALG_CELLJET:
temptool8 = new pythia::CellJetFinder("");
temptool8->set_minEt( m_params->CellJet_eTjetMinIn);
temptool8->set_coneRadius( m_params->CellJet_coneRadiusIn);
temptool8->set_seedEt( m_params->CellJet_eTseedIn);
m_tool = temptool8;
break;
}
}
void JetRetrieverLive::SetOnTheFlyOpen(bool x) {
std::cout << "setting ontheflyopen to " << x << std::endl;
m_guiIsOpen = x;
}
void JetRetrieverLive::edit() {
if(!isOpen()) {
if(m_onTheFlyGui != NULL) {std::cout << "deleting object" << std::endl;delete m_onTheFlyGui;}
m_onTheFlyGui = new OnTheFlyGui(this,m_parent,m_spartygui);
SetOnTheFlyOpen(true);
}
}
void JetRetrieverLive::fill_collections(JetInputCollection* input, JetCollExtended& jet_coll) {
std::cout << "in fill collections" << std::endl;
std::cout << "creating spartyjettool object " << std::endl;
JetInputCollection inputtemp = *input;
Jet::jet_list_t outputJets;
cout << "input particles" << endl;
cout << "# : px py pz E\n";
Jet *tjet;
for(unsigned i = 0; i < inputtemp.size(); i++) {
tjet = inputtemp[i];
cout << i << " : "
<< tjet->px() << " "
<< tjet->py() << " "
<< tjet->pz() << " "
<< tjet->E() << endl;
}
// if(m_toolChanged) { // event can change though...
SpartyJetTool sparty;
std::cout << "*************************************" << std::endl;
std::cout << "Running SpartyJet..." << std::endl;
std::cout << "*************************************" << std::endl;
//jet_coll = sparty.getjets(m_tool,inputtemp);
outputJets = sparty.getjets(m_tool,inputtemp);
// jet_coll = SpartyJet::getjets(m_tool,);
m_toolChanged = false;
// }
std::cout << "*************************************" << std::endl;
std::cout << "*************************************" << std::endl;
std::cout << "PRINTING OUT JET_COLL RIGHT OUT OF SPARTYJET" << std::endl;
std::cout << "*************************************" << std::endl;
std::cout << "*************************************" << std::endl;
Jet::jet_list_t::iterator iter = outputJets.begin();
Jet::jet_list_t::iterator itE = outputJets.end();
cout << "# : px py pz e\n";
for( ; iter != itE; iter++) {
// tjet = outputJets[i];
tjet = *iter;
cout << "------------------------------------------" << endl;
cout << "JET index " << tjet->index() << ", "
<< tjet->px() << ", "
<< tjet->py() << ", "
<< tjet->pz() << ", "
<< tjet->E() << ", " << endl;
cout << "------------------------------------------" << endl;
cout << "constituents : " << tjet->getConstituentNum() << endl;
Jet::constit_vect_t::iterator citer = tjet->firstConstituent();
Jet::constit_vect_t::iterator citE = tjet->lastConstituent();
Jet *cjet;
for(; citer != citE; citer++) {
cjet = *citer;
// std::cout << "address : " << citer << std::endl;
cout << "index " << cjet->index() << ", "
<< cjet->px() << ", "
<< cjet->py() << ", "
<< cjet->pz() << ", "
<< cjet->E() << endl;
}
} // end loop over output jets
Jet* jet;
for(unsigned i = 0; i < outputJets.size(); i++) {
jet = outputJets[i];
std::cout << " Jet " << i << " : " << jet->e() << " " << jet->px() << " " << jet->py() << " " << jet->pz() << std::endl;
std::cout << "looping over constituents" << std::endl;
}
std::cout << "after running, input size : " << input->size() << std::endl;
std::cout << "after running, jet_coll size : " << jet_coll.size() << std::endl;
std::cout << "finished filling collections" << std::endl;
} // namespace SpartyJet
}

File Metadata

Mime Type
text/x-c
Expires
Thu, Apr 24, 6:39 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4833465
Default Alt Text
JetRetrieverLive.cc (10 KB)

Event Timeline