00001 #include <iostream>
00002 #include <stdio.h>
00003 #include "HepMC/GenEvent.h"
00004 #include "HepMC/IO_GenEvent.h"
00005 #include "HepMC/GenParticle.h"
00006 #include "HepMC/GenVertex.h"
00007 #include "HepMC/IO_AsciiParticles.h"
00008 #include "HepMC/SimpleVector.h"
00009 #include "HepPDT/ParticleData.hh"
00010 #include "CLHEP/Vector/LorentzVector.h"
00011
00012 using namespace std;
00013
00014
00015 #include "TH1.h"
00016 #include <TH2.h>
00017 #include "TFile.h"
00018 #include "TMath.h"
00019 #include "TLorentzVector.h"
00020
00021 #include "fastjet/PseudoJet.hh"
00022 #include "fastjet/ClusterSequence.hh"
00023 #include "fastjet/JetDefinition.hh"
00024 #include "fastjet/SISConePlugin.hh"
00025
00026
00027 #include "../include/DiJetAnalysis.h"
00028
00029
00030
00031
00032
00033
00034 DiJetAnalysis::DiJetAnalysis()
00035 {
00036
00037 }
00038
00039
00040
00041
00042 DiJetAnalysis::~DiJetAnalysis()
00043 {
00044 while (!m_histVector.empty()){
00045 delete m_histVector.back();
00046 m_histVector.pop_back();
00047 }
00048 }
00049
00050
00051
00052
00053 int DiJetAnalysis::Init(double tr_max_eta, double tr_min_pt )
00054 {
00055
00056
00057 m_max_eta=tr_max_eta;
00058
00059
00060 m_min_pt=tr_min_pt;
00061
00062
00063 m_outputFileName="DiJetAnalysis.root";
00064 m_outputRootDir="DiJet";
00065
00066
00067 m_jet_count=baseAnalysis::initHist(string("jet_count"), string("Nr of Jets"), string("Nr Jets"),16, -0.5, 15.5);
00068
00069
00070
00071
00072 m_jet_pt=baseAnalysis::initHist(string("jet_pt"),string("Jet Transverse Momentum"),string("Jet p_{T} [GeV]"),
00073 50, 0.,150.);
00074 m_jet_pt_log=baseAnalysis::initHist(string("jet_pt_logscale"),string("Jet Transverse Momentum -logscale-"),
00075 string("Jet p_{T} [GeV]"), 50, 0.,150.);
00076 m_leadingjet_pt=baseAnalysis::initHist(string("leadingjet_pt"),string("Leading Jet Transverse Momentum"),string("Jet p_{T} [GeV]"),
00077 50, 0.,150.);
00078 m_leadingjet_pt_log=baseAnalysis::initHist(string("leadingjet_pt_logscale"),string("Leading Jet Transverse Momentum -logscale-"),
00079 string("Jet p_{T} [GeV]"), 50, 0.,150.);
00080 m_secondleadingjet_pt=baseAnalysis::initHist(string("secondleadingjet_pt"),string("Second leading Jet Transverse Momentum"),
00081 string("Jet p_{T} [GeV]"), 50, 0.,150.);
00082 m_secondleadingjet_pt_log=baseAnalysis::initHist(string("secondleadingjet_pt_logscale"),
00083 string("Second leading Jet Transverse Momentum -logscale-"),
00084 string("Jet p_{T} [GeV]"), 50, 0.,150.);
00085
00086 m_jet_phi=baseAnalysis::initHist(string("jet_phi"),string("Jet Phi angle"),string("Jet #varphi"), 64, 0., 6.4);
00087 m_jet_eta=baseAnalysis::initHist(string("jet_eta"),string("Jet Pseudo rapidity"),string("Jet #eta"),60, -6., 6.);
00088
00089 m_charged_particle_multiplicity=baseAnalysis::initHist(string("charged_particle_multiplicity"),string("Number of charged Particles in the Event"),string("charged particle multiplicity"),100, 0., 1000.);
00090 m_charged_particle_temp_pt= new TH1D("DiJet_charged_particle_mean_pt","temp histogramm",200,0,200.);
00091 m_charged_particle_pt=baseAnalysis::initHist("charged_particle_pt","p_{T} of charged particles","p_{T}",25,0,25.);
00092 m_charged_particle_mean_pt=baseAnalysis::initHist(string("charged_particle_mean_pt"),string("Avarage p_{T} charged Particles in the Event"),string("charged particle #bar{p}_{T}"),50, 0., 10.);
00093 m_charged_particle_rms_pt=baseAnalysis::initHist(string("charged_particle_rms_pt"),string("RMS p_{T} charged Particles in the Event"),string("charged particle #sigma(p_{T})"),50, 0., 10.);
00094
00095
00096 m_jet_Deta_leadingJet_secondJet=baseAnalysis::initHist(string("jet_Deta_leadingJet_secondJet"),string("#Delta#eta leading and second leading Jet"),string("#Delta#eta"), 60, 0., 6.);
00097 m_jet_Dphi_leadingJet_secondJet=baseAnalysis::initHist(string("jet_Dphi_leadingJet_secondJet"),string("#Delta#varphi leading and second leading Jet"),string("#Delta#varphi"), 64, 0., 3.2);
00098 m_jet_DR_leadingJet_secondJet=baseAnalysis::initHist(string("jet_DR_leadingJet_secondJet"),string("#DeltaR leading and second leading Jet"),string("#DeltaR"), 60, 0., 15.);
00099
00100 for(unsigned int hist=0; hist< m_histVector.size(); hist++)
00101 {
00102 std::ostringstream counter_s;
00103 counter_s << hist;
00104 std::string histogram_name=m_outputRootDir;
00105 histogram_name+="_";
00106 histogram_name+=counter_s.str();
00107 histogram_name+="_";
00108 histogram_name+=m_histVector[hist]->GetName();
00109 m_histVector[hist]->SetName(histogram_name.c_str());
00110 }
00111 return SUCCESS;
00112 }
00113
00114
00115
00116
00117
00118 int DiJetAnalysis::Process(HepMC::GenEvent* hepmcevt)
00119 {
00120
00121 unsigned int chargeParticlecount=0;
00122
00123
00124 m_charged_particle_temp_pt->Reset();
00125
00126
00127
00128
00129 for ( HepMC::GenEvent::particle_const_iterator p = hepmcevt->particles_begin(); p != hepmcevt->particles_end(); ++p )
00130 {
00131
00132 int pid = (*p)->pdg_id();
00133
00134
00135
00136 if(chargedParticle(pid)==NOTCHARGED) continue;
00137
00138
00139 if (!((*p)->status() == 1)) continue;
00140
00141 m_charged_particle_temp_pt->Fill((*p)->momentum().perp());
00142 m_charged_particle_pt->Fill((*p)->momentum().perp());
00143 chargeParticlecount++;
00144
00145 }
00146
00147
00148 CLHEP::HepLorentzVector lv_leadingJet(0,0,0,0);
00149
00150
00151 if(!m_inclusive_jets.size()) {
00152 int test = FindJet(hepmcevt);
00153 if(test<=0){
00154 cout <<"no jets found - return failure" << endl;
00155
00156 }
00157 }
00158
00159
00160 m_jet_count->Fill(m_inclusive_jets.size());
00161 m_charged_particle_multiplicity->Fill(chargeParticlecount);
00162 m_charged_particle_mean_pt->Fill(m_charged_particle_temp_pt->GetMean());
00163 m_charged_particle_rms_pt->Fill(m_charged_particle_temp_pt->GetRMS());
00164
00165
00166 m_charged_particle_temp_pt->Reset();
00167
00168 if(m_inclusive_jets.size()){
00169
00170 for(unsigned int i=0; i<m_inclusive_jets.size(); i++) {
00171 m_jet_pt->Fill(m_inclusive_jets[i].perp());
00172 m_jet_pt_log->Fill(m_inclusive_jets[i].perp());
00173 }
00174
00175 m_leadingjet_pt->Fill(m_inclusive_jets[0].perp());
00176 m_leadingjet_pt_log->Fill(m_inclusive_jets[0].perp());
00177 m_secondleadingjet_pt->Fill(m_inclusive_jets[1].perp());
00178 m_secondleadingjet_pt_log->Fill(m_inclusive_jets[1].perp());
00179
00180
00181 m_jet_phi->Fill(m_inclusive_jets[0].phi());
00182 m_jet_eta->Fill(m_inclusive_jets[0].eta());
00183
00184 CLHEP::HepLorentzVector lv_firstJet(m_inclusive_jets[0].px(), m_inclusive_jets[0].py(), m_inclusive_jets[0].pz(), m_inclusive_jets[0].e());
00185 if(m_inclusive_jets.size() > 1 ) {
00186 CLHEP::HepLorentzVector lv_secondJet(m_inclusive_jets[1].px(), m_inclusive_jets[1].py(), m_inclusive_jets[1].pz(), m_inclusive_jets[1].e());
00187 m_jet_DR_leadingJet_secondJet->Fill(abs(lv_firstJet.deltaR(lv_secondJet)));
00188 m_jet_Deta_leadingJet_secondJet->Fill(abs(lv_firstJet.eta()-lv_secondJet.eta()));
00189 m_jet_Dphi_leadingJet_secondJet->Fill(abs(lv_firstJet.vect().deltaPhi(lv_secondJet.vect())));
00190 }
00191 }
00192 return SUCCESS;
00193 }
00194
00195
00196
00197