Difference: TisTosDVExample (1 vs. 4)

Revision 42009-12-15 - TomaszSkwarnicki

Line: 1 to 1
 
META TOPICPARENT name="TriggerTisTos"

Elaborated example of DaVinci algorithm using TriggerTisTos tool

Added:
>
>
THIS EXAMPLE IS OUT OF DATE AND NEEDS UPDATING PLEASE SEE PYTHON EXAMPLE INSTEAD AND DO EQUIVALENT CALLS IN C++ I WILL TRY TO UPDATE THIS PAGE SOON
 

cpp file

Revision 32008-09-15 - TomaszSkwarnicki

Line: 1 to 1
 
META TOPICPARENT name="TriggerTisTos"

Elaborated example of DaVinci algorithm using TriggerTisTos tool

Line: 71 to 71
  const L0DUReport* pL0DUReport = get( L0DUReportLocation::Default ); info() << " L0 decision= " << pL0DUReport->decision() << endmsg;
Changed:
<
<
std::vector<std::string> l0NamesInHlt = m_TriggerTisTosTool->triggerSelectionNames("L0Trigger*",
>
>
std::vector<std::string> l0NamesInHlt = m_TriggerTisTosTool->triggerSelectionNames("L0*Decision",
  ITriggerTisTos::kAllTriggerSelections); info() << " Names of L0 triggers in Hlt="; dumpvs( l0NamesInHlt ); info() << endmsg;
Line: 80 to 80
  const HltSummary* pHltSummary = get(LHCb::HltSummaryLocation::Default); info() << " Hlt final decision= " << pHltSummary->decision() << endmsg;
Changed:
<
<
// Hlt Alleys bool hltAlleysDecision,dummyTis,dummyTos;
>
>
// Hlt1 (Alleys) bool hlt1Decision,dummyTis,dummyTos;
  m_TriggerTisTosTool->setOfflineInput();
Changed:
<
<
m_TriggerTisTosTool->triggerTisTos("*",hltAlleysDecision,dummyTis,dummyTos); info() << " Hlt Alleys decision= " << hltAlleysDecision;
>
>
m_TriggerTisTosTool->triggerTisTos("Hlt1*Decision",hlt1Decision,dummyTis,dummyTos, ITriggerTisTos::kAllTriggerSelections); // this also works: m_TriggerTisTosTool->triggerTisTos("*",hlt1Decision,dummyTis,dummyTos); info() << " Hlt1 decision= " << hlt1Decision;
  info() << " from OR between "; dumpvs( m_TriggerTisTosTool->triggerSelectionNames() ); info() << endmsg;
Changed:
<
<
// Hlt Selections (B and D) bool hltSelDecision; std::vector< std::string > hltSel; hltSel.push_back("HltSelD*"); hltSel.push_back("HltSelB*"); //done m_TriggerTisTosTool->setOfflineInput(); m_TriggerTisTosTool->triggerTisTos(hltSel,hltSelDecision,dummyTis,dummyTos, ITriggerTisTos::kAllTriggerSelections); info() << " HltSelections (B and D) decision= " << hltSelDecision;
>
>
// Hlt2 (Selections) bool hlt2Decision; m_TriggerTisTosTool->triggerTisTos("Hlt2*Decision",hlt2Decision,dummyTis,dummyTos, ITriggerTisTos::kAllTriggerSelections); info() << " Hlt2 decision= " << hlt2Decision;
  info() << " from OR between "; dumpvs( m_TriggerTisTosTool->triggerSelectionNames() ); info() << endmsg;
Changed:
<
<
// see which Alley triggers were on
>
>
// see which Hlt1 triggers were on
  //done m_TriggerTisTosTool->setOfflineInput();
Changed:
<
<
std::vector<std::string> alleysPass = m_TriggerTisTosTool->triggerSelectionNames( "*",ITriggerTisTos::kAlleyExitsOnly,
>
>
std::vector<std::string> hlt1Pass = m_TriggerTisTosTool->triggerSelectionNames( "Hlt1*Decision",ITriggerTisTos::kAllTriggerSelections,
  ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything, ITriggerTisTos::kAnything);
Changed:
<
<
info() << " Hlt Alley triggers that fired="; dumpvs( alleysPass ); info() << endmsg;
>
>
info() << " Hlt1 triggers that fired="; dumpvs( hlt1Pass ); info() << endmsg;
 
Changed:
<
<
// see which Hlt Selections were on
>
>
// see which Hlt2 Selections were on
  //done m_TriggerTisTosTool->setOfflineInput();
Changed:
<
<
std::vector<std::string> selPass = m_TriggerTisTosTool->triggerSelectionNames( hltSel,ITriggerTisTos::kAllTriggerSelections,
>
>
std::vector<std::string> hlt2Pass = m_TriggerTisTosTool->triggerSelectionNames( "Hlt2*Decision",ITriggerTisTos::kAllTriggerSelections,
  ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything, ITriggerTisTos::kAnything);
Changed:
<
<
info() << " Hlt Selections that succedded="; dumpvs( selPass ); info() << endmsg;
>
>
info() << " Hlt2 Selections that succedded="; dumpvs( hlt2Pass ); info() << endmsg;
 

// Tis,Tos with respect to input particles

Line: 131 to 127
  // L0 Info ---------------------------------------------------------------------------

bool decisionL0,tisL0,tosL0;

Changed:
<
<
m_TriggerTisTosTool->triggerTisTos(**iPart,"L0Trigger*",decisionL0,tisL0,tosL0, ITriggerTisTos::kAllTriggerSelections);
>
>
m_TriggerTisTosTool->triggerTisTos(**iPart,"L0*Decision",decisionL0,tisL0,tosL0, ITriggerTisTos::kAllTriggerSelections);
  if( decisionL0 )continue; info() << " L0 TIS= " << tisL0 << " TOS=" << tosL0 << endmsg;
Line: 150 to 146
  info() << endmsg; }
Changed:
<
<
// Hlt Alley Info ----------------------------------------------------------------------
>
>
// Hlt1 Info ----------------------------------------------------------------------
 
Changed:
<
<
bool decisionAlleys,tisAlleys,tosAlleys; m_TriggerTisTosTool->triggerTisTos("*",decisionAlleys,tisAlleys,tosAlleys); if( decisionAlleys )continue; info() << " Hlt Alleys TIS= " << tisAlleys << " TOS=" << tosAlleys << endmsg;
>
>
bool decisionHlt1,tisHlt1,tosHlt1; m_TriggerTisTosTool->triggerTisTos("Hlt1*Decision",decisionHlt1,tisHlt1,tosHlt1, ITriggerTisTos::kAllTriggerSelections); if( decisionHlt1 )continue; info() << " Hlt1 TIS= " << tisHlt1 << " TOS=" << tosHlt1 << endmsg;
 
Changed:
<
<
if( tisAlleys ){ info() << " Hlt Alleys TIS selections= ";
>
>
if( tisHlt1 ){ info() << " Hlt1 TIS selections= ";
  dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything ) ); info() << endmsg; }
Changed:
<
<
if( tosAlleys ){ info() << " Hlt Alleys TOS selections= ";
>
>
if( tosHlt1 ){ info() << " Hlt1 TOS selections= ";
  dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, ITriggerTisTos::kAnything, ITriggerTisTos::kTrueRequired ) ); info() << endmsg; }
Changed:
<
<
// Hlt SelB Info --------------------------------------------------------------------
>
>
// Hlt2 Info --------------------------------------------------------------------
 
Changed:
<
<
bool decisionSelB,tisSelB,tosSelB; m_TriggerTisTosTool->triggerTisTos("HltSelB*",decisionSelB,tisSelB,tosSelB, ITriggerTisTos::kAllTriggerSelections); if( decisionSelB )continue; info() << " Hlt SelB TIS= " << tisSelB << " TOS=" << tosSelB << endmsg;
>
>
bool decisionHlt2,tisHlt2,tosHlt2; m_TriggerTisTosTool->triggerTisTos("Hlt2*Decision",decisionHlt2,tisHlt2,tosHlt2, ITriggerTisTos::kAllTriggerSelections); if( decisionHlt2 )continue; info() << " Hlt2 TIS= " << tisHlt2 << " TOS=" << tosHlt2 << endmsg;
 
Changed:
<
<
if( tisSelB ){ info() << " Hlt SelB TIS selections= ";
>
>
if( tisHlt2 ){ info() << " Hlt2 TIS selections= ";
  dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything ) ); info() << endmsg; }
Changed:
<
<
if( tosSelB ){ info() << " Hlt SelB TOS selections= ";
>
>
if( tosHlt2 ){ info() << " Hlt Hlt2 TOS selections= ";
  dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, ITriggerTisTos::kAnything, ITriggerTisTos::kTrueRequired ) );
Line: 200 to 196
  setFilterPassed(true); // Ignore returned status return StatusCode::SUCCESS;
Added:
>
>
return StatusCode::SUCCESS;
 }

//=============================================================================

Line: 209 to 207
  debug() << "==> Finalize" << endmsg;
Changed:
<
<
return DVAlgorithm::finalize(); //=== For DC04, return StatusCode::SUCCESS;
>
>
return DVAlgorithm::finalize();
 }

//=============================================================================

Line: 263 to 262
 #endif // TISTOSDVEXAMPLE_H
Changed:
<
<

Sample output for 2 events in B -> K* mu mu MC

>
>

Sample output for 1 event in B -> K* mu mu MC

 
TisTosDVExample                            INFO  L0 decision= 1
Changed:
<
<
TisTosDVExample INFO Names of L0 triggers in Hlt= L0TriggerElectron L0TriggerPhoton L0TriggerLocalPi0 L0TriggerGlobalPi0 L0TriggerHadron L0TriggerMuon L0TriggerDiMuon L0TriggerMuonNoGlob TisTosDVExample INFO Hlt final decision= 1 TisTosDVExample INFO Hlt Alleys decision= 1 from OR between MuonTriggerSingle MuonTriggerDiMuon MuonTriggerIPDiMuon MuonTriggerPureDiMuon MuonTriggerPureIPDiMuon HadTrigger EleTriggerSingle EleTriggerEleTrk PhoTriggerPhoTrk TisTosDVExample INFO HltSelections (B and D) decision= 1 from OR between HltSelDstar HltSelB2DiElectron HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBu2LLK HltSelB2MuMu HltSelB2HH HltSelBd2DstarPi HltSelBd2D0Kstar HltSelBs2DsH HltSelBs2PhiGamma HltSelBs2PhiPhi HltSelBs2DsDs HltSelB2DstarMu HltSelBd2PiPiPi HltSelBu2D0K_KsHH HltSelBd2D0Kstar_KsHH TisTosDVExample INFO Hlt Alley triggers that fired= MuonTriggerIPDiMuon TisTosDVExample INFO Hlt Selections that succedded= HltSelBd2MuMuKstar HltSelB2JpsiX_MuMu TisTosDVExample INFO Particle -511 Pt 3629.67 #-of-daughters 2 #-of-final-state-part 4 -13 Pt 878.252 13 Pt 1265.15 -321 Pt 1386.07 211 Pt 2758.34 TisTosDVExample INFO L0 TIS= 0 TOS=1 TisTosDVExample INFO L0 TOS selections= L0TriggerMuon L0TriggerMuonNoGlob TisTosDVExample INFO Hlt Alleys TIS= 0 TOS=1 TisTosDVExample INFO Hlt Alleys TOS selections= MuonTriggerIPDiMuon TisTosDVExample INFO Hlt SelB TIS= 0 TOS=1 TisTosDVExample INFO Hlt SelB TOS selections= HltSelBd2MuMuKstar HltSelB2JpsiX_MuMu

TisTosDVExample INFO L0 decision= 1 TisTosDVExample INFO Names of L0 triggers in Hlt= L0TriggerElectron L0TriggerPhoton L0TriggerLocalPi0 L0TriggerGlobalPi0 L0TriggerHadron L0TriggerMuon L0TriggerDiMuon L0TriggerMuonNoGlob

>
>
TisTosDVExample INFO Names of L0 triggers in Hlt= L0DiMuonDecision L0ElectronDecision L0GlobalPi0Decision L0HadronDecision L0LocalPi0Decision L0MuonDecision L0MuonNoGlobDecision L0PhotonDecision
 TisTosDVExample INFO Hlt final decision= 1
Changed:
<
<
TisTosDVExample INFO Hlt Alleys decision= 1 from OR between MuonTriggerSingle MuonTriggerDiMuon MuonTriggerIPDiMuon MuonTriggerPureDiMuon MuonTriggerPureIPDiMuon HadTrigger EleTriggerSingle EleTriggerEleTrk PhoTriggerPhoTrk TisTosDVExample INFO HltSelections (B and D) decision= 1 from OR between HltSelDstar HltSelB2DiElectron HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBu2LLK HltSelB2MuMu HltSelB2HH HltSelBd2DstarPi HltSelBd2D0Kstar HltSelBs2DsH HltSelBs2PhiGamma HltSelBs2PhiPhi HltSelBs2DsDs HltSelB2DstarMu HltSelBd2PiPiPi HltSelBu2D0K_KsHH HltSelBd2D0Kstar_KsHH TisTosDVExample INFO Hlt Alley triggers that fired= HadTrigger TisTosDVExample INFO Hlt Selections that succedded= HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBd2DstarPi TisTosDVExample INFO Particle -511 Pt 10235.2 #-of-daughters 2 #-of-final-state-part 4 -13 Pt 674.669 13 Pt 701.803 -321 Pt 6636.12 211 Pt 2244.33
>
>
TisTosDVExample INFO Hlt1 decision= 1 from OR between Hlt1ElectronEleTrkDecision Hlt1ElectronSingleDecision Hlt1HadronDiDecision Hlt1HadronSingleDecision Hlt1MuTrackDecision Hlt1MuonDiMuon2L0NoIPDecision Hlt1MuonDiMuon2L0WithIPDecision Hlt1MuonDiMuonMuonSegNoIPDecision Hlt1MuonDiMuonMuonSegWithIPDecision Hlt1MuonDiMuonNoIPDecision Hlt1MuonDiMuonWithIPDecision Hlt1MuonSingleDecision Hlt1MuonSingleNoIPDecision Hlt1PhotonDiTrackDecision TisTosDVExample INFO Hlt2 decision= 1 from OR between Hlt2SelB2DplusHDecision Hlt2SelB2DstarMuDecision Hlt2SelB2HHDecision Hlt2SelB2JpsiX_MuMuDecision Hlt2SelB2TwoBodyDecision Hlt2SelBd2D0KstarDecision Hlt2SelBd2D0Kstar_KsHHDecision Hlt2SelBd2DstarPiDecision Hlt2SelBd2MuMuKstarDecision Hlt2SelBd2PiPiPiDecision Hlt2SelBiasedDiElectronDecision Hlt2SelBiasedDiMuonDecision Hlt2SelBs2DsDsDecision Hlt2SelBs2DsHDecision Hlt2SelBs2DsRhoDecision Hlt2SelBs2EtacPhiDecision Hlt2SelBs2JpsiEtaDecision Hlt2SelBs2JpsiEtapDecision Hlt2SelBs2PhiGammaDecision Hlt2SelBs2PhiPhiDecision Hlt2SelBu2D0K_KsDDDecision Hlt2SelBu2D0K_KsHHDecision Hlt2SelBu2LLKDecision Hlt2SelDstarDecision Hlt2SelHidValleyDecision Hlt2SelSingleMuonDecision Hlt2SelUnbiasedDiMuonDecision TisTosDVExample INFO Hlt1 triggers that fired= Hlt1MuTrackDecision Hlt1MuonDiMuon2L0NoIPDecision Hlt1MuonDiMuon2L0WithIPDecision Hlt1MuonDiMuonMuonSegNoIPDecision Hlt1MuonDiMuonMuonSegWithIPDecision Hlt1MuonDiMuonNoIPDecision Hlt1MuonDiMuonWithIPDecision Hlt1MuonSingleDecision TisTosDVExample INFO Hlt2 Selections that succedded= Hlt2SelBd2MuMuKstarDecision Hlt2SelBiasedDiMuonDecision Hlt2SelSingleMuonDecision Hlt2SelUnbiasedDiMuonDecision TisTosDVExample INFO Particle 511 Pt 7568.09 #-of-daughters 2 #-of-final-state-part 4 -13 Pt 3858.22 13 Pt 2239.22 321 Pt 2044.32 -211 Pt 210.724
 TisTosDVExample INFO L0 TIS= 0 TOS=1
Changed:
<
<
TisTosDVExample INFO L0 TOS selections= L0TriggerHadron TisTosDVExample INFO Hlt Alleys TIS= 0 TOS=1 TisTosDVExample INFO Hlt Alleys TOS selections= HadTrigger TisTosDVExample INFO Hlt SelB TIS= 0 TOS=1 TisTosDVExample INFO Hlt SelB TOS selections= HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu
>
>
TisTosDVExample INFO L0 TOS selections= L0DiMuonDecision L0MuonDecision L0MuonNoGlobDecision TisTosDVExample INFO Hlt1 TIS= 0 TOS=1 TisTosDVExample INFO Hlt1 TOS selections= Hlt1MuTrackDecision Hlt1MuonDiMuon2L0NoIPDecision Hlt1MuonDiMuon2L0WithIPDecision Hlt1MuonDiMuonMuonSegNoIPDecision Hlt1MuonDiMuonMuonSegWithIPDecision Hlt1MuonDiMuonNoIPDecision Hlt1MuonDiMuonWithIPDecision Hlt1MuonSingleDecision TisTosDVExample INFO Hlt2 TIS= 0 TOS=1 TisTosDVExample INFO Hlt Hlt2 TOS selections= Hlt2SelBd2MuMuKstarDecision Hlt2SelBiasedDiMuonDecision Hlt2SelSingleMuonDecision Hlt2SelUnbiasedDiMuonDecision
 
Deleted:
<
<
-- TomaszSkwarnicki - 01 Oct 2007
 \ No newline at end of file
Added:
>
>
-- TomaszSkwarnicki - 01 Oct 2007, 15 Sep 2008
 \ No newline at end of file

Revision 22007-10-29 - StephenWotton

Line: 1 to 1
 
META TOPICPARENT name="TriggerTisTos"

Elaborated example of DaVinci algorithm using TriggerTisTos tool

Revision 12007-10-02 - TomaszSkwarnicki

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="TriggerTisTos"

Elaborated example of DaVinci algorithm using TriggerTisTos tool

cpp file

// from Gaudi
#include "GaudiKernel/AlgFactory.h" 

// local
#include "TisTosDVExample.h"

#include "Event/L0DUReport.h"

#include "Event/HltSummary.h"

using namespace LHCb;

//-----------------------------------------------------------------------------
// Implementation file for class : TisTosDVExample
//
// 2007-09-24 : Tomasz Skwarnicki
//-----------------------------------------------------------------------------

// Declaration of the Algorithm Factory
DECLARE_ALGORITHM_FACTORY( TisTosDVExample );


//=============================================================================
// Standard constructor, initializes variables
//=============================================================================
TisTosDVExample::TisTosDVExample( const std::string& name,
                                  ISvcLocator* pSvcLocator)
  : DVAlgorithm ( name , pSvcLocator )
{

}
//=============================================================================
// Destructor
//=============================================================================
TisTosDVExample::~TisTosDVExample() {} 

//=============================================================================
// Initialization
//=============================================================================
StatusCode TisTosDVExample::initialize() {
  //=== The following two lines should be commented for DC04 algorithms ! ===
  StatusCode sc = DVAlgorithm::initialize(); 
  if ( sc.isFailure() ) return sc;

  debug() << "==> Initialize" << endmsg;

  m_TriggerTisTosTool = tool<ITriggerTisTos>( "TriggerTisTos",this);

  return StatusCode::SUCCESS;
}

//=============================================================================
// Main execution
//=============================================================================
StatusCode TisTosDVExample::execute() {

  debug() << "==> Execute" << endmsg;

  const std::vector<const Particle*> & parts = desktop()->particles();
  if( parts.size() == 0 )  return StatusCode::SUCCESS;

   //  L0 trigger
  if( !exist<L0DUReport>( L0DUReportLocation::Default ) ){ return StatusCode::SUCCESS;  }    
  const L0DUReport* pL0DUReport = get<L0DUReport>( L0DUReportLocation::Default );
  info() << " L0 decision= " << pL0DUReport->decision() << endmsg;

  std::vector<std::string> l0NamesInHlt = m_TriggerTisTosTool->triggerSelectionNames("L0Trigger*", 
                                                                                     ITriggerTisTos::kAllTriggerSelections);
  info() << " Names of L0 triggers in Hlt="; dumpvs( l0NamesInHlt );  info() << endmsg;

   //  Hlt overall
  if( !exist<HltSummary>( LHCb::HltSummaryLocation::Default ) ){ return StatusCode::SUCCESS;  }    
  const HltSummary* pHltSummary = get<HltSummary>(LHCb::HltSummaryLocation::Default);
  info() << " Hlt final decision= " << pHltSummary->decision() << endmsg;

  //  Hlt Alleys
  bool hltAlleysDecision,dummyTis,dummyTos;
  m_TriggerTisTosTool->setOfflineInput();  
  m_TriggerTisTosTool->triggerTisTos("*",hltAlleysDecision,dummyTis,dummyTos);
  info() << " Hlt Alleys decision= " << hltAlleysDecision;
  info() << " from OR between "; dumpvs( m_TriggerTisTosTool->triggerSelectionNames() ); info() << endmsg;

  //  Hlt Selections (B and D)
  bool hltSelDecision;
  std::vector< std::string > hltSel;
  hltSel.push_back("HltSelD*");
  hltSel.push_back("HltSelB*");
  //done m_TriggerTisTosTool->setOfflineInput();   
  m_TriggerTisTosTool->triggerTisTos(hltSel,hltSelDecision,dummyTis,dummyTos, ITriggerTisTos::kAllTriggerSelections);
  info() << " HltSelections (B and D) decision= " << hltSelDecision;
  info() << " from OR between "; dumpvs( m_TriggerTisTosTool->triggerSelectionNames() ); info() << endmsg;

  //     see which Alley triggers were on
  //done m_TriggerTisTosTool->setOfflineInput();   
  std::vector<std::string> alleysPass = m_TriggerTisTosTool->triggerSelectionNames(
  "*",ITriggerTisTos::kAlleyExitsOnly,
  ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything, ITriggerTisTos::kAnything);
  info() << " Hlt Alley triggers that fired="; dumpvs( alleysPass );  info() << endmsg;


  //     see which Hlt Selections were on
  //done m_TriggerTisTosTool->setOfflineInput();   
  std::vector<std::string> selPass = m_TriggerTisTosTool->triggerSelectionNames(
  hltSel,ITriggerTisTos::kAllTriggerSelections,
  ITriggerTisTos::kTrueRequired, ITriggerTisTos::kAnything, ITriggerTisTos::kAnything);
  info() << " Hlt Selections that succedded="; dumpvs( selPass );  info() << endmsg;


  // Tis,Tos with respect to input particles
  for( std::vector<const Particle*>::const_iterator iPart = parts.begin(); iPart!= parts.end(); ++iPart){

    // Particle Info ---------------------------------------------------------------------------

    const std::vector<const Particle*> finals = descendants()->finalStates(*iPart);
    info() << "    Particle " << (*iPart)->particleID().pid() << " Pt " << (*iPart)->pt()
           << " #-of-daughters " << ((*iPart)->daughtersVector()).size()
           << " #-of-final-state-part " << finals.size();
    for( std::vector<const Particle*>::const_iterator pf=finals.begin();pf!=finals.end();++pf){
      info() << " " << (*pf)->particleID().pid() << " Pt " << (*pf)->pt();
    }
    info() << endmsg;


    // L0 Info ---------------------------------------------------------------------------

    bool decisionL0,tisL0,tosL0;
    m_TriggerTisTosTool->triggerTisTos(**iPart,"L0Trigger*",decisionL0,tisL0,tosL0, ITriggerTisTos::kAllTriggerSelections);
    if( !decisionL0 )continue;    
    info() << "      L0            TIS= " << tisL0 << " TOS=" << tosL0 << endmsg;

    if( tisL0 ){
      info() << "          L0 TIS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kTrueRequired,
                                                   ITriggerTisTos::kAnything ) );
      info() << endmsg;
    }
    if( tosL0 ){
      info() << "          L0 TOS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kAnything,
                                                   ITriggerTisTos::kTrueRequired ) );
      info() << endmsg;
    }

    // Hlt Alley Info ----------------------------------------------------------------------

    bool decisionAlleys,tisAlleys,tosAlleys;
    m_TriggerTisTosTool->triggerTisTos("*",decisionAlleys,tisAlleys,tosAlleys);
    if( !decisionAlleys )continue;    
    info() << "      Hlt Alleys    TIS= " << tisAlleys << " TOS=" << tosAlleys << endmsg;
    
    if( tisAlleys ){
      info() << "          Hlt Alleys TIS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kTrueRequired,
                                                   ITriggerTisTos::kAnything ) );
      info() << endmsg;
    }
    if( tosAlleys ){
      info() << "          Hlt Alleys TOS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kAnything,
                                                   ITriggerTisTos::kTrueRequired ) );
      info() << endmsg;
    }

    // Hlt SelB Info --------------------------------------------------------------------

    bool decisionSelB,tisSelB,tosSelB;
    m_TriggerTisTosTool->triggerTisTos("HltSelB*",decisionSelB,tisSelB,tosSelB, ITriggerTisTos::kAllTriggerSelections);
    if( !decisionSelB )continue;    
    info() << "      Hlt SelB TIS= " << tisSelB << " TOS=" << tosSelB << endmsg;
    
    if( tisSelB ){
      info() << "          Hlt SelB TIS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kTrueRequired,
                                                   ITriggerTisTos::kAnything ) );
      info() << endmsg;
    }
    if( tosSelB ){
      info() << "          Hlt SelB TOS selections= ";
      dumpvs( m_TriggerTisTosTool->triggerSelectionNames( ITriggerTisTos::kAnything, 
                                                   ITriggerTisTos::kAnything,
                                                   ITriggerTisTos::kTrueRequired ) );
      info() << endmsg;
    }

  } // end particle loop

  // Mandatory. Set to true if event is accepted. 
  setFilterPassed(true);   // Ignore returned status
  return StatusCode::SUCCESS;

}

//=============================================================================
//  Finalize
//=============================================================================
StatusCode TisTosDVExample::finalize() {

  debug() << "==> Finalize" << endmsg;

  return DVAlgorithm::finalize(); //=== For DC04, return StatusCode::SUCCESS;
}

//=============================================================================

header file

#ifndef TISTOSDVEXAMPLE_H 
#define TISTOSDVEXAMPLE_H 1

// Include files
// from DaVinci, this is a specialized GaudiAlgorithm
#include "Kernel/DVAlgorithm.h"

#include "Kernel/ITriggerTisTos.h"

/** @class TisTosDVExample TisTosDVExample.h
 *  
 *
 *  @author Tomasz Skwarnicki
 *  @date   2007-09-24
 */
class TisTosDVExample : public DVAlgorithm {
public: 
  /// Standard constructor
  TisTosDVExample( const std::string& name, ISvcLocator* pSvcLocator );

  virtual ~TisTosDVExample( ); ///< Destructor

  virtual StatusCode initialize();    ///< Algorithm initialization
  virtual StatusCode execute   ();    ///< Algorithm execution
  virtual StatusCode finalize  ();    ///< Algorithm finalization

  void dumpvs( const std::vector< std::string > & vs )
  { 
    for( std::vector< std::string >::const_iterator s=vs.begin();s != vs.end(); ++s)
    {
      info() << " " << *s;
    }
  }

protected:

private:

  ITriggerTisTos* m_TriggerTisTosTool;

};
#endif // TISTOSDVEXAMPLE_H

Sample output for 2 events in B -> K* mu mu MC

TisTosDVExample                            INFO  L0 decision= 1
TisTosDVExample                            INFO  Names of L0 triggers in Hlt= L0TriggerElectron L0TriggerPhoton L0TriggerLocalPi0 L0TriggerGlobalPi0 L0TriggerHadron L0TriggerMuon L0TriggerDiMuon L0TriggerMuonNoGlob
TisTosDVExample                            INFO  Hlt final decision= 1
TisTosDVExample                            INFO  Hlt Alleys decision= 1 from OR between  MuonTriggerSingle MuonTriggerDiMuon MuonTriggerIPDiMuon MuonTriggerPureDiMuon MuonTriggerPureIPDiMuon HadTrigger EleTriggerSingle EleTriggerEleTrk PhoTriggerPhoTrk
TisTosDVExample                            INFO  HltSelections (B and D) decision= 1 from OR between  HltSelDstar HltSelB2DiElectron HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBu2LLK HltSelB2MuMu HltSelB2HH HltSelBd2DstarPi HltSelBd2D0Kstar HltSelBs2DsH HltSelBs2PhiGamma HltSelBs2PhiPhi HltSelBs2DsDs HltSelB2DstarMu HltSelBd2PiPiPi HltSelBu2D0K_KsHH HltSelBd2D0Kstar_KsHH
TisTosDVExample                            INFO  Hlt Alley triggers that fired= MuonTriggerIPDiMuon
TisTosDVExample                            INFO  Hlt Selections that succedded= HltSelBd2MuMuKstar HltSelB2JpsiX_MuMu
TisTosDVExample                            INFO     Particle -511 Pt 3629.67 #-of-daughters 2 #-of-final-state-part 4 -13 Pt 878.252 13 Pt 1265.15 -321 Pt 1386.07 211 Pt 2758.34
TisTosDVExample                            INFO       L0            TIS= 0 TOS=1
TisTosDVExample                            INFO           L0 TOS selections=  L0TriggerMuon L0TriggerMuonNoGlob
TisTosDVExample                            INFO       Hlt Alleys    TIS= 0 TOS=1
TisTosDVExample                            INFO           Hlt Alleys TOS selections=  MuonTriggerIPDiMuon
TisTosDVExample                            INFO       Hlt SelB TIS= 0 TOS=1
TisTosDVExample                            INFO           Hlt SelB TOS selections=  HltSelBd2MuMuKstar HltSelB2JpsiX_MuMu

TisTosDVExample                            INFO  L0 decision= 1
TisTosDVExample                            INFO  Names of L0 triggers in Hlt= L0TriggerElectron L0TriggerPhoton L0TriggerLocalPi0 L0TriggerGlobalPi0 L0TriggerHadron L0TriggerMuon L0TriggerDiMuon L0TriggerMuonNoGlob
TisTosDVExample                            INFO  Hlt final decision= 1
TisTosDVExample                            INFO  Hlt Alleys decision= 1 from OR between  MuonTriggerSingle MuonTriggerDiMuon MuonTriggerIPDiMuon MuonTriggerPureDiMuon MuonTriggerPureIPDiMuon HadTrigger EleTriggerSingle EleTriggerEleTrk PhoTriggerPhoTrk
TisTosDVExample                            INFO  HltSelections (B and D) decision= 1 from OR between  HltSelDstar HltSelB2DiElectron HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBu2LLK HltSelB2MuMu HltSelB2HH HltSelBd2DstarPi HltSelBd2D0Kstar HltSelBs2DsH HltSelBs2PhiGamma HltSelBs2PhiPhi HltSelBs2DsDs HltSelB2DstarMu HltSelBd2PiPiPi HltSelBu2D0K_KsHH HltSelBd2D0Kstar_KsHH
TisTosDVExample                            INFO  Hlt Alley triggers that fired= HadTrigger
TisTosDVExample                            INFO  Hlt Selections that succedded= HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu HltSelBd2DstarPi
TisTosDVExample                            INFO     Particle -511 Pt 10235.2 #-of-daughters 2 #-of-final-state-part 4 -13 Pt 674.669 13 Pt 701.803 -321 Pt 6636.12 211 Pt 2244.33
TisTosDVExample                            INFO       L0            TIS= 0 TOS=1
TisTosDVExample                            INFO           L0 TOS selections=  L0TriggerHadron
TisTosDVExample                            INFO       Hlt Alleys    TIS= 0 TOS=1
TisTosDVExample                            INFO           Hlt Alleys TOS selections=  HadTrigger
TisTosDVExample                            INFO       Hlt SelB TIS= 0 TOS=1
TisTosDVExample                            INFO           Hlt SelB TOS selections=  HltSelBd2MuMuKstar HltSelB2DiMuon HltSelB2JpsiX_MuMu

-- TomaszSkwarnicki - 01 Oct 2007

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback