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/ZAnalysis.h"
00028
00029
00030
00031
00032
00033
00034 ZAnalysis::ZAnalysis()
00035 {
00036 }
00037
00038
00039
00040
00041 ZAnalysis::~ZAnalysis()
00042 {
00043 }
00044
00045
00046
00047
00048 int ZAnalysis::Init(double tr_max_eta, double tr_min_pt)
00049 {
00050
00051 m_max_eta=tr_max_eta;
00052
00053
00054 m_min_pt=tr_min_pt;
00055
00056
00057 m_outputFileName="ZBosonAnalysis.root";
00058 m_outputRootDir="Z";
00059
00060
00061
00062
00063 m_jet_count=baseAnalysis::initHist(string("jet_count"), string("Nr of Jets"), string("Nr Jets"),16, -0.5, 15.5);
00064 m_jet_pt=baseAnalysis::initHist(string("leadingjet_pt_high"),string("Leading Jet Transverse Momentum"),string("Jet p_{T} [GeV]"), 200, 0.,1000.);
00065 m_jet_pt_log=baseAnalysis::initHist(string("leadingjet_pt_high_logscale"),string("Leading Jet Transverse Momentum -logscale-"),string("Jet p_{T} [GeV]"), 200, 0.,1000.);
00066
00067 m_Z_count=baseAnalysis::initHist(string("Z_count"), string("Nr of Z-Bosons"), string("Nr Z-Boson"),16, -0.5, 15.5);
00068 m_Z_mass=baseAnalysis::initHist(string("Z_mass"),string("Z Mass"),string("m_{Z} [GeV]"), 80, 70., 110.);
00069 m_Z_mass_log=baseAnalysis::initHist(string("Z_mass_logscale"),string("Z Mass -logscale-"),string("m_{Z} [GeV]"), 80, 70., 110.);
00070
00071 m_Z_pt_high=baseAnalysis::initHist(string("Z_pt_high"),string("Z Transverse Momentum"),string("Z p_{T} [GeV]"), 80, 0., 240.);
00072 m_Z_pt_high_log=baseAnalysis::initHist(string("Z_pt_high_logscale"),string("Z Transverse Momentum -logscale-"),string("Z p_{T} [GeV]"), 80, 0., 240.);
00073 m_Z_pt=baseAnalysis::initHist(string("Z_pt_high"),string("Z Transverse Momentum"),string("Z p_{T} [GeV]"), 50, 0., 25.);
00074 m_Z_pt_log=baseAnalysis::initHist(string("Z_pt_high_logscale"),string("Z Transverse Momentum -logscale-"),string("Z p_{T} [GeV]"), 50, 0., 25.);
00075
00076
00077 m_Z_eta=baseAnalysis::initHist(string("Z_eta"),string("#eta Z-Boson"),string("#eta"), 80, -8., 8.);
00078 m_Z_phi=baseAnalysis::initHist(string("Z_phi"),string("#varphi Z-Boson"),string("#varphi"), 64, -3.2, 3.2);
00079
00080 m_charged_particle_multiplicity=baseAnalysis::initHist(string("charged_particle_multiplicity"),string("Number of charged Particles in the Event"),string("charged particle multiplicity"),100, 0., 300.);
00081
00082
00083 m_charged_particle_temp_pt=baseAnalysis::initHist(string("Z_charged_particle_temp_mean_pt"),string("temp histogramm"),string("Z charged particle temp mean p_{T}"),200,0,100.);
00084 m_charged_particle_pt=baseAnalysis::initHist(string("Z_charged_particle_pt"),string("p_{T} pf charged particles"),string("p_{T}"),200,0,100.);
00085 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.);
00086 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.);
00087
00088 m_charged_particle_pdgID=baseAnalysis::initHist(string("charged_particle_pdgID"),string("charged Particles PDG ID"),string("charged particle pid"),601, -300., 300.);
00089
00090 return true;
00091 }
00092
00093
00094
00095
00096
00097
00098 int ZAnalysis::Process(HepMC::GenEvent* hepmcevt)
00099 {
00100
00101
00102
00103
00104
00105 m_charged_particle_temp_pt->Reset();
00106
00107
00108
00109
00110
00111 int Zcount=0;
00112 int chargeParticlecount=0;
00113
00114
00115 for ( HepMC::GenEvent::particle_const_iterator p = hepmcevt->particles_begin(); p != hepmcevt->particles_end(); ++p )
00116 {
00117 HepMC::GenParticle* ZBoson=0;
00118
00119
00120 int pid = (*p)->pdg_id();
00121
00122
00123
00124
00125
00126 if( pid == 23 && (*p)->end_vertex()){
00127
00128
00129
00130 if (!(*p)->end_vertex()) continue;
00131
00132 HepMC::GenVertex::particle_iterator firstChild = (*p)->end_vertex()->particles_begin(HepMC::children);
00133 HepMC::GenVertex::particle_iterator endChild = (*p)->end_vertex()->particles_end(HepMC::children);
00134
00135
00136 if( ((*firstChild)->pdg_id()) != pid ){
00137 ZBoson = (*p);
00138
00139 m_Z_pt->Fill((*p)->momentum().perp());
00140 m_Z_pt_log->Fill((*p)->momentum().perp());
00141 m_Z_pt_high->Fill((*p)->momentum().perp());
00142 m_Z_pt_high_log->Fill((*p)->momentum().perp());
00143 m_Z_eta->Fill((*p)->momentum().eta());
00144 m_Z_phi->Fill((*p)->momentum().phi());
00145 m_Z_mass->Fill((*p)->momentum().m());
00146 m_Z_mass_log->Fill((*p)->momentum().m());
00147 Zcount++;
00148 }
00149 }
00150
00151
00152
00153
00154
00155
00156 if(!chargedParticle(pid)) continue;
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 if(!IsFinalStateParticle((*p))) {
00172 continue;
00173 }
00174
00175
00176
00177
00178 m_charged_particle_pt->Fill((*p)->momentum().perp());
00179 m_charged_particle_temp_pt->Fill((*p)->momentum().perp());
00180 chargeParticlecount++;
00181 m_charged_particle_pdgID->Fill(pid);
00182 }
00183
00184
00185 CLHEP::HepLorentzVector lv_leadingJet(0,0,0,0);
00186
00187
00188
00189
00190
00191
00192 m_jet_count->Fill(m_inclusive_jets.size());
00193
00194 if(m_inclusive_jets.size()){
00195 m_jet_pt->Fill(m_inclusive_jets[0].perp());
00196 m_jet_pt_log->Fill(m_inclusive_jets[0].perp());
00197 }
00198
00199
00200 m_Z_count->Fill(Zcount);
00201 m_charged_particle_multiplicity->Fill(chargeParticlecount);
00202 m_charged_particle_mean_pt->Fill(m_charged_particle_temp_pt->GetMean());
00203 m_charged_particle_rms_pt->Fill(m_charged_particle_temp_pt->GetRMS());
00204
00205 chargeParticlecount=0;
00206
00207
00208 m_charged_particle_temp_pt->Reset();
00209
00210 return true;
00211 }