TriggerUA5.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Rivet.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/Projections/Beam.hh"
00005 #include "Rivet/Projections/ChargedFinalState.hh"
00006 #include "Rivet/Projections/TriggerUA5.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   TriggerUA5::TriggerUA5() {
00012     setName("TriggerUA5");
00013     
00014     addProjection(Beam(), "Beam");
00015     addProjection(ChargedFinalState(-5.6, 5.6), "CFS");
00016   }
00017 
00018 
00019   void TriggerUA5::project(const Event& evt) {
00020     _n_plus = 0;
00021     _n_minus = 0;
00022 
00023     // Start with the assumption that the trigger fails
00024     _decision_sd = false;
00025     _decision_nsd_1 = false;
00026     _decision_nsd_2 = false;
00027 
00028     // Triggers can be different for pp and ppbar running
00029     const Beam& b = applyProjection<Beam>(evt, "Beam");
00030     _samebeams = (b.beams().first.pdgId() == b.beams().second.pdgId());
00031 
00032     // Count hodoscope hits
00033     const ChargedFinalState& cfs = applyProjection<ChargedFinalState>(evt, "CFS");
00034     foreach (const Particle& p, cfs.particles()) {
00035       const double eta = p.momentum().pseudorapidity();
00036       if (inRange(eta, -5.6, -2.0)) _n_minus++;
00037       else if (inRange(eta, 2.0, 5.6)) _n_plus++;
00038     }
00039     getLog() << Log::DEBUG << "Trigger -: " << _n_minus << ", Trigger +: " << _n_plus << endl;
00040 
00041     // Common SD/NSD trigger requirement: must activate at least one hodoscope
00042     if (_n_minus == 0 && _n_plus == 0) return;
00043     _decision_sd = true;
00044 
00045     // Extra NSD trigger requirements
00046     if (_n_minus == 0 || _n_plus == 0) return;
00047     _decision_nsd_1 = true;
00048     if (_n_minus < 2 || _n_plus < 2) return;
00049     _decision_nsd_2 = true;
00050   }
00051 
00052 
00053 }