forked from UCATLAS/xAODAnaHelpers
/
HLTJetRoIBuilder.h
100 lines (73 loc) · 2.18 KB
/
HLTJetRoIBuilder.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/**
* @file HLTJetRoIBuilder.h
* @author John Alison <john.alison@cern.ch>
* @brief This class builds HLT jets and thier associated objects
*
*/
#ifndef xAODAnaHelpers_HLTJetRoIBuilder_H
#define xAODAnaHelpers_HLTJetRoIBuilder_H
// algorithm wrapper
#include "xAODAnaHelpers/Algorithm.h"
#include "TrigDecisionTool/Feature.h"
namespace Trig {
class TrigDecisionTool;
}
class HLTJetRoIBuilder : public xAH::Algorithm
{
public:
// configuration variables
/**
@brief name of trigger chain to load
*/
std::string m_trigItem;
/**
@brief Do we load a full BJet trigger chain?
*/
bool m_doHLTBJet;
/**
@brief Do we load a jet trigger chain?
*/
bool m_doHLTJet;
/**
@brief Name of the output container
*/
std::string m_outContainerName;
private:
Trig::TrigDecisionTool* m_trigDecTool; //!
std::string m_jetName; //!
std::string m_trkName; //!
std::string m_vtxName; //!
EL::StatusCode buildHLTBJets ();
EL::StatusCode buildHLTJets ();
public:
// this is a standard constructor
HLTJetRoIBuilder (std::string className = "HLTJetRoIBuilder");
// these are the functions inherited from Algorithm
virtual EL::StatusCode setupJob (EL::Job& job);
virtual EL::StatusCode fileExecute ();
virtual EL::StatusCode histInitialize ();
virtual EL::StatusCode changeInput (bool firstFile);
virtual EL::StatusCode initialize ();
virtual EL::StatusCode execute ();
virtual EL::StatusCode postExecute ();
virtual EL::StatusCode finalize ();
virtual EL::StatusCode histFinalize ();
/// @cond
// this is needed to distribute the algorithm to the workers
ClassDef(HLTJetRoIBuilder, 1);
/// @endcond
template<class Object, class Collection>
const Object* getTrigObject(Trig::Feature<Collection>& feature){
const Collection* trigCol = feature.cptr();
if ( !trigCol ) {
std::cout << "ERROR: No Trig Collection pointer" << std::endl;
return 0;
}
if(trigCol->size() != 1){
std::cout << "ERROR Trig Collection size " << trigCol->size() << std::endl;
return 0;;
}
return trigCol->at(0);
}
};
#endif