00001
00002
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/RivetAIDA.hh"
00005 #include "Rivet/Tools/Logging.hh"
00006 #include "Rivet/Projections/FinalState.hh"
00007 #include "Rivet/Projections/ChargedFinalState.hh"
00008 #include "Rivet/Projections/FastJets.hh"
00009 #include "Rivet/Projections/Beam.hh"
00010 #include "Rivet/Projections/VetoedFinalState.hh"
00011
00012 namespace Rivet
00013 {
00014 class CMS_2011_I930319 : public Analysis
00015 {
00016
00017 public:
00018
00019
00021 CMS_2011_I930319()
00022 : Analysis("CMS_2011_I930319")
00023
00024 {
00025 setBeams(PROTON,PROTON);
00026 }
00027
00028
00029 double evcounter_mb;
00030 double evcounter_dijet;
00031
00032
00033 void init() {
00034 const FinalState fs(-6.0,6.0,0.0*GeV);
00035 addProjection(fs, "FS");
00036 addProjection(FastJets(fs, FastJets::ANTIKT, 0.5), "Jets");
00037
00038 VetoedFinalState fsv(fs);
00039 fsv.vetoNeutrinos();
00040 fsv.addVetoPairDetail(MUON, 0.0*GeV, 99999.9*GeV);
00041 addProjection(fsv, "fsv");
00042
00043
00044 const ChargedFinalState fschrgd(-6.0,6.0,0.0*GeV);
00045 addProjection(fschrgd, "fschrgd");
00046 VetoedFinalState fschrgdv(fschrgd);
00047 fschrgdv.vetoNeutrinos();
00048 addProjection(fschrgdv, "fschrgdv");
00049
00050 evcounter_mb = 0;
00051 evcounter_dijet = 0;
00052
00053 if(fuzzyEquals(sqrtS()/GeV, 900, 1E-3)){
00054 _hist_mb_09 = bookHistogram1D(1,1,1);
00055 _hist_dijet_09 = bookHistogram1D(2,1,1);
00056 }
00057
00058 if(fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)){
00059 _hist_mb_7 = bookHistogram1D(3,1,1);
00060 _hist_dijet_7 = bookHistogram1D(4,1,1);
00061 }
00062
00063 }
00064
00065 void analyze(const Event& event) {
00066 const double weight = event.weight();
00067
00068
00069 const FinalState& fsv = applyProjection<FinalState>(event, "fsv");
00070 if (fsv.empty()) vetoEvent;
00071
00072
00073
00074
00075 double count_chrg_forward = 0;
00076 double count_chrg_backward = 0;
00077 const FinalState& fschrgdv = applyProjection<FinalState>(event, "fschrgdv");
00078
00079 foreach (const Particle& p, fschrgdv.particles()) {
00080 if( 3.9 < p.momentum().pseudorapidity() &&
00081 p.momentum().pseudorapidity() < 4.4){count_chrg_forward++;}
00082 if(-4.4 < p.momentum().pseudorapidity() &&
00083 p.momentum().pseudorapidity() < -3.9){count_chrg_backward++;}
00084
00085 }
00086
00087 if(count_chrg_forward*count_chrg_backward==0) {
00088 vetoEvent;
00089 }
00090
00091 const FastJets& jetpro = applyProjection<FastJets>(event, "Jets");
00092 const Jets& jets = jetpro.jetsByPt(7.0*GeV);
00093
00094
00095
00096
00097
00098 evcounter_mb += weight;
00099 foreach (const Particle& p, fsv.particles()) {
00100
00101 if(fuzzyEquals(sqrtS()/GeV, 900, 1E-3)) {_hist_mb_09 ->
00102 fill(fabs(p.momentum().pseudorapidity()), weight * p.momentum().E()/GeV );}
00103
00104 if(fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)) {_hist_mb_7 ->
00105 fill(fabs(p.momentum().pseudorapidity()), weight * p.momentum().E()/GeV );}
00106
00107 }
00108
00109
00110
00111
00112 if(jets.size()>1){
00113
00114 signed int index_1 = -1;
00115 signed int index_2 = -1;
00116
00117 double tempmax_1 = -100;
00118 double tempmax_2 = -100;
00119
00120
00121 for(signed int ijets = 0; ijets < (int)jets.size(); ijets++){
00122 if(tempmax_1 == -100 || tempmax_1 < jets[ijets].momentum().pT()/GeV)
00123 {
00124 tempmax_1 = jets[ijets].momentum().pT()/GeV;
00125 index_1 = ijets;
00126 }
00127 }
00128
00129
00130
00131 for(signed int ijets = 0; ijets < (int)jets.size(); ijets++){
00132 if(tempmax_2 == -100 || tempmax_2 < jets[ijets].momentum().pT()/GeV){
00133 if(jets[ijets].momentum().pT()/GeV < tempmax_1){
00134 tempmax_2 = jets[ijets].momentum().pT()/GeV;
00135 index_2 = ijets;
00136 }
00137 }
00138 }
00139
00140
00141 if(index_1 != -1 && index_2 != -1){
00142
00143 double diffphi = jets[index_2].momentum().phi() - jets[index_1].momentum().phi();
00144 if(diffphi < -PI){ diffphi += 2.0*PI; }
00145 if(diffphi > PI){ diffphi -= 2.0*PI; }
00146 diffphi = fabs(diffphi);
00147
00148
00149
00150
00151
00152
00153 if(fuzzyEquals(sqrtS()/GeV, 900, 1E-3)){
00154
00155
00156 if(jets[index_1].momentum().pT()/GeV > 8.0 && jets[index_2].momentum().pT()/GeV >8.0){
00157
00158
00159 if(fabs(jets[index_1].momentum().pseudorapidity()) < 2.5 &&
00160 fabs(jets[index_2].momentum().pseudorapidity()) < 2.5){
00161
00162
00163 if(fabs(diffphi-PI) < 1.0){
00164 evcounter_dijet += weight;
00165
00166
00167 foreach (const Particle& p, fsv.particles()){
00168 _hist_dijet_09->
00169 fill(fabs(p.momentum().pseudorapidity()), weight*p.momentum().E()/GeV);
00170
00171 }
00172 }
00173 }
00174 }
00175 }
00176
00177
00178
00179
00180
00181
00182
00183 if(fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)){
00184
00185
00186 if(jets[index_1].momentum().pT()/GeV > 20.0 && jets[index_2].momentum().pT()/GeV > 20.0){
00187
00188
00189 if(fabs(jets[index_1].momentum().pseudorapidity()) < 2.5 &&
00190 fabs(jets[index_2].momentum().pseudorapidity()) < 2.5){
00191
00192
00193 if(fabs(diffphi-PI) < 1.0){
00194 evcounter_dijet += weight;
00195
00196
00197 foreach (const Particle& p, fsv.particles()){
00198 _hist_dijet_7->
00199 fill(fabs(p.momentum().pseudorapidity()), weight*p.momentum().E()/GeV);
00200
00201 }
00202 }
00203 }
00204 }
00205 }
00206
00207 }
00208 }
00209 }
00210
00211
00212 void finalize() {
00213
00214 const double norm_dijet = evcounter_dijet*2.0 ;
00215 const double norm_mb = evcounter_mb*2.0 ;
00216
00217 if(fuzzyEquals(sqrtS()/GeV, 900, 1E-3)){
00218 scale(_hist_mb_09, 1.0/norm_mb);
00219 scale(_hist_dijet_09, 1.0/norm_dijet);
00220 }
00221
00222 if(fuzzyEquals(sqrtS()/GeV, 7000, 1E-3)){
00223 scale(_hist_dijet_7, 1.0/norm_dijet);
00224 scale(_hist_mb_7, 1.0/norm_mb);
00225 }
00226
00227 getLog() << Log::INFO << " " << endl;
00228 getLog() << Log::INFO << "Number of MB events: " << norm_mb << endl;
00229 getLog() << Log::INFO << "Number of di-jet events : " << norm_dijet <<endl;
00230
00231 }
00232
00233
00234 private:
00235
00236 AIDA::IHistogram1D *_hist_mb_09;
00237 AIDA::IHistogram1D *_hist_dijet_09;
00238 AIDA::IHistogram1D *_hist_mb_7;
00239 AIDA::IHistogram1D *_hist_dijet_7;
00240
00241
00242 };
00243
00244
00245
00246
00247 AnalysisBuilder<CMS_2011_I930319> plugin_CMS_2011_I930319;
00248
00249
00250
00251 }