testD0RunIIcone.cc

Go to the documentation of this file.
00001 
00002 #include <list.h>
00003 
00004 #include "energycluster/ILConeAlgorithm.hpp"
00005 #include "HepEntity.h"
00006 
00007 
00008 
00009 int main() {
00010 
00011   
00012   HepEntity el;
00013   list<const HepEntity*> *ensemble = new list<const HepEntity*>;
00014 
00015 
00016   //fill some test 4-vectors with E, px, py, pz
00017   el.Fill(100., 25., 25., 25.);
00018   ensemble->push_back(new HepEntity(el));
00019   el.Fill(105., 20., 30., 30.);
00020   ensemble->push_back(new HepEntity(el));
00021   el.Fill(60., 20., 20., 20.);
00022   ensemble->push_back(new HepEntity(el));
00023   el.Fill(95., 65., 10., 20.);
00024   ensemble->push_back(new HepEntity(el));
00025   
00026   el.Fill(110., 25., -25., -25.);
00027   ensemble->push_back(new HepEntity(el));
00028   el.Fill(100., 23., -25., -25.);
00029   ensemble->push_back(new HepEntity(el));
00030   el.Fill(101., 25., -20., -25.);
00031   ensemble->push_back(new HepEntity(el));
00032   el.Fill(102., 25., -25., -23.);
00033   ensemble->push_back(new HepEntity(el));
00034   
00035   //print information about initial 4-vectors
00036   cout << "list->size()=" << ensemble->size() << endl;
00037   int i=1;
00038   for (list<const HepEntity*>::iterator it = ensemble->begin(); it != ensemble->end(); ++it) {
00039     cout << "4-vector " << i++ << " : E=" << (*it)->E << " pT=" << (*it)->pT() << " y=" << (*it)->y() << " phi=" << (*it)->phi() << endl; 
00040   }
00041 
00042   //initialize D0RunII cone algorithm
00043   float cone_radius = 0.5;
00044   float min_jet_Et = 8.0;
00045   float split_ratio = 0.5;
00046 
00047   float far_ratio=0.5;
00048   float Et_min_ratio=0.5;
00049   bool kill_duplicate=true;
00050   float duplicate_dR=0.005; 
00051   float duplicate_dPT=0.01; 
00052   float search_factor=1.0; 
00053   float pT_min_leading_protojet=0.; 
00054   float pT_min_second_protojet=0.;
00055   int merge_max=10000; 
00056   float pT_min_nomerge=0.;
00057 
00058   ILConeAlgorithm<HepEntity> 
00059     ilegac(cone_radius, min_jet_Et, split_ratio,
00060        far_ratio, Et_min_ratio, kill_duplicate, duplicate_dR, 
00061        duplicate_dPT, search_factor, pT_min_leading_protojet, 
00062        pT_min_second_protojet, merge_max, pT_min_nomerge);
00063  
00064   float Item_ET_Threshold = 0.;
00065   //float* Item_ET_Threshold_ptr = &Item_ET_Threshold;
00066 
00067   list<HepEntity> jets;
00068   ilegac.makeClusters(jets, *ensemble, Item_ET_Threshold);
00069 
00070   list<HepEntity>::iterator it;
00071   cout << "Number of jets = " << jets.size() << endl;
00072   for (it=jets.begin(); it!=jets.end(); ++it) {
00073     cout << "jet: E=" << (*it).E << " pT=" << (*it).pT() << " y=" << (*it).y() << " phi=" << (*it).phi() << endl; 
00074   }
00075 
00076   return 0;
00077 
00078 }