DESY Hbb Analysis Framework
Functions
AnalyserTriggerExample.cc File Reference
#include "Analysis/Tools/interface/Analyser.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 7 of file AnalyserTriggerExample.cc.

References analysis::tools::BaseAnalyser::analysis(), analysis::tools::BaseAnalyser::config(), analysis::tools::Candidate::eta(), analysis::tools::Analyser::event(), analysis::tools::BaseAnalyser::nEvents(), analysis::tools::Candidate::phi(), analysis::tools::Candidate::pt(), analysis::tools::TriggerAnalyser::selectionHLT(), analysis::tools::TriggerAnalyser::selectionL1(), and analysis::tools::TriggerAnalyser::triggerObjectsL1Jets().

8 {
9  TH1::SetDefaultSumw2(); // proper treatment of errors when scaling histograms
10 
11  Analyser trigger(argc,argv);
12 
13  auto analysis = trigger.analysis(); // that's the usual Analysis class
14 
15  for ( int i = 0 ; i < trigger.nEvents() ; ++i )
16  {
17  if ( ! trigger.event(i) ) continue;
18  // trigger selection
19  if ( ! trigger.selectionHLT() ) continue;
20  if ( ! trigger.selectionL1 () ) continue; // to be used in case of "OR" of seeds
21 
22  // One can always use the usual Analysis to retrieve some information
23  auto l1jets_ana = analysis->collection<TriggerObject>(trigger.config()->triggerObjectsL1Jets());
24  for ( int j = 0 ; j < l1jets_ana->size() ; ++j )
25  {
26  TriggerObject l1jet = l1jets_ana->at(j);
27  std::cout << "L1 Jet (Analysis): pT = " << l1jet.pt() << ", " << l1jet.eta() << ", " << l1jet.phi() << std::endl;
28  }
29  std::cout << "----" << std::endl;
30 
31  // But sometimes there is a method in the analyser one can use directly
32  // L1 jets trigger objects
33  auto l1jets = trigger.triggerObjectsL1Jets();
34  for ( auto jet : l1jets )
35  {
36  std::cout << "L1 Jet (Analyser): pT = " << jet->pt() << ", " << jet->eta() << ", " << jet->phi() << std::endl;
37  }
38  std::cout << "====" << std::endl;
39  }
40 
41  return 0;
42 }
float eta() const
returns the pseudorapidity
Definition: Candidate.cc:134
float phi() const
returns the azimuthal angle
Definition: Candidate.cc:135
float pt() const
returns the transverse momentum
Definition: Candidate.cc:133