ATLAS_2010_S8817804.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 #include "Rivet/Analysis.hh"
00004 #include "Rivet/RivetAIDA.hh"
00005 #include "Rivet/Tools/BinnedHistogram.hh"
00006 #include "Rivet/Tools/Logging.hh"
00007 #include "Rivet/Projections/FastJets.hh"
00008 
00009 namespace Rivet{
00010 
00011   class ATLAS_2010_S8817804;
00012   
00013   AnalysisBuilder<ATLAS_2010_S8817804> plugin_ATLAS_2010_S8817804;
00014   
00015   /// @brief ATLAS inclusive jet pT spectrum, di-jet Mass and di-jet chi
00016   
00017   class ATLAS_2010_S8817804: public Analysis{
00018     
00019   public:
00020     
00021     ATLAS_2010_S8817804(): Analysis("ATLAS_2010_S8817804"), _rapMax(2.8), _leadPTCut(60. * GeV), _asymmetryCut(log(30.)), _ySumCut(2.2){
00022       setBeams(PROTON, PROTON);
00023       setNeedsCrossSection(true);
00024     }
00025     
00026     void init(){
00027       FinalState fs;
00028       addProjection(fs, "FinalState");
00029       addProjection(FastJets(fs, FastJets::ANTIKT, 0.6), "AntiKT06");
00030       addProjection(FastJets(fs, FastJets::ANTIKT, 0.4), "AntiKT04");      
00031 
00032       double ybins[] = {0.0, 0.3, 0.8, 1.2, 2.1, 2.8};
00033 
00034       double massBinsForChi[] = { 340. * GeV, 520. * GeV, 800. * GeV, 1200. * GeV};//, 1700. * GeV, 2500. * GeV};
00035       
00036       int ptDsOffset = 1;
00037       int massDsOffset = 11;
00038       int chiDsOffset = 21;
00039       
00040       for(Jet_Alg alg = AKT4; alg != ALG_END; alg = Jet_Alg(alg + 1)){
00041         for(int highbin = 0, lowbin = highbin++; highbin != sizeof(ybins) / sizeof(double); ++lowbin, ++highbin){
00042 
00043           _pTHistos[alg].addHistogram(ybins[lowbin], ybins[highbin],
00044                                       bookHistogram1D(lowbin + ptDsOffset, 1, 1));
00045         }
00046         
00047         ptDsOffset = 6;
00048         
00049         for(int highbin = 0, lowbin = highbin++; highbin != sizeof(ybins) / sizeof(double); ++lowbin, ++highbin){
00050 
00051           _massVsY[alg].addHistogram(ybins[lowbin], ybins[highbin],
00052                                      bookHistogram1D(massDsOffset + lowbin, 1, 1));
00053         }
00054        
00055         massDsOffset = 16;
00056         
00057         for(int highbin=0, lowbin = highbin++; highbin != sizeof(massBinsForChi) / sizeof(double); ++lowbin, ++highbin){
00058 
00059           _chiVsMass[alg].addHistogram(massBinsForChi[lowbin], massBinsForChi[highbin],
00060                                        bookHistogram1D(chiDsOffset + lowbin, 1, 1));
00061           
00062         }
00063         
00064         chiDsOffset = 24;
00065         
00066       }
00067             
00068       return;
00069     }
00070     
00071     void analyze(const Event &evt){
00072         
00073       const Jets &kt6Jets = applyProjection<FastJets>(evt, "AntiKT06").jets(30.*GeV);
00074       const Jets &kt4Jets = applyProjection<FastJets>(evt, "AntiKT04").jets(30.*GeV);
00075       
00076       const Jets* jetAr[2];
00077       jetAr[AKT4] = &kt4Jets;
00078       jetAr[AKT6] = &kt6Jets;
00079                   
00080       for(Jet_Alg alg = AKT4; alg != ALG_END; alg = Jet_Alg(alg + 1)){
00081         
00082         const Jet *jet1 = 0, *jet2 = 0;
00083         double pt1 = -1.;
00084         double pt2 = -1.;
00085         
00086         for(Jets::const_iterator jet = jetAr[alg]->begin();
00087             jet != jetAr[alg]->end(); ++jet){
00088           double pT = jet->momentum().pT();
00089           double fabsy = fabs(jet->momentum().rapidity());
00090           _pTHistos[alg].fill(fabsy, pT, evt.weight());
00091           
00092           if(fabsy < _rapMax){
00093             if(pT > pt1){
00094               if(jet1 != 0){
00095                 jet2 = jet1;
00096                 pt2 = jet2->momentum().pT();
00097               }
00098               jet1 = &(*jet);
00099               pt1 = pT;
00100             }else if(pT > pt2){
00101               jet2 = &(*jet);
00102               pt2 = pT;
00103             }
00104           }
00105         }
00106         
00107         if( jet1 == 0 || jet2 == 0 || pt1 < _leadPTCut){
00108           continue;
00109         }
00110         
00111         FourMomentum mom1 = jet1->momentum();
00112         FourMomentum mom2 = jet2->momentum();
00113         FourMomentum total = mom1 + mom2;
00114         double rap1 = mom1.rapidity();
00115         
00116         double absRap1 = fabs(rap1);
00117         
00118         double rap2 = mom2.rapidity();
00119         double absRap2 = fabs(rap2);
00120         double ymax = (absRap1 > absRap2)? absRap1: absRap2;
00121         double chi = exp(fabs(rap1 - rap2));
00122         double mass = total.mass();
00123         
00124         if(fabs(rap1 + rap2) < _ySumCut && fabs(rap1 - rap2) < _asymmetryCut){
00125           _chiVsMass[alg].fill(mass, chi, evt.weight());
00126         }
00127         
00128         _massVsY[alg].fill(ymax, mass, evt.weight());
00129         
00130       }
00131       
00132       return;
00133     }
00134     
00135     void finalize(){
00136             
00137       const double xs = crossSectionPerEvent() / picobarn;
00138             
00139       for(Jet_Alg alg = AKT4; alg != ALG_END; alg = Jet_Alg(alg + 1)){
00140         _pTHistos[alg].scale(xs, this);
00141         _massVsY[alg].scale(xs, this);
00142         _chiVsMass[alg].scale(xs, this);
00143       }
00144   
00145       return;
00146     }
00147     
00148   private:
00149     
00150     // The max rapidity of a jet used in this analysis
00151     double _rapMax;
00152     // The pT cut on the leading jet 
00153     double _leadPTCut;
00154     // maximum rapidity asymmetry between two jets in the chi plots
00155     double _asymmetryCut;
00156     // maximum sum of rapidities of two jets in the chi plot
00157     double _ySumCut;
00158     
00159     enum Jet_Alg{AKT4=0, AKT6=1, ALG_END};
00160         
00161     // The inclusive pT spectrum for akt6 and akt4 jets (array index is jet type from enum above)
00162     BinnedHistogram<double> _pTHistos[2];
00163     
00164     // The di-jet mass spectrum binned in rapidity for akt6 and akt4 jets (array index is jet type from enum above)
00165     BinnedHistogram<double> _massVsY[2];
00166     
00167     // The di-jet chi distribution binned in mass for akt6 and akt4 jets (array index is jet type from enum above)
00168     BinnedHistogram<double> _chiVsMass[2];
00169     
00170     
00171   };
00172 }