The tool of course also needs to access the event-level TTree holding the event-wise trigger information.
Perhaps the most important function that people need. It can tell the user whether a given LVL1 item or HLT chain passed in the current event.
By default the function returns the "physics decision", but it can be asked to give more detailed results as well. The function tries to be smart, so if the user asks for information that is not available in the given D3PD, it should just print a warning. (And return kFALSE.)
For a description of the types of trigger results, have a look at the documentation of the TrigDefs::DecisionTypes enumeration.
31 TrigDecisionToolD3PD::TrigDecisionToolD3PD( TTree* eventTree, TTree* confTree,
33 : TNamed(
"TrigDecisionToolD3PD",
"Trigger decision tool" ),
35 Trig::ConfigAccess( confTree ),
36 Trig::ChainGroupHandling() {
57 Bool_t TrigDecisionToolD3PD::IsPassed(
const std::string&
name,
61 GetConfigSvc().Load( GetSMK(), GetL1PSK(), GetHLTPSK() );
68 if(
name.find(
"L1_" ) !=
name.npos ) {
71 if( (
id = GetConfigSvc().GetCTPId(
name ) ) < 0 ) {
78 const Int_t word =
id / 32;
79 const Int_t bit =
id % 32;
86 case TrigDefs::Physics:
87 if( GetDetailLevel() >= 0 ) {
88 return ( ( ( * GetL1Result( Trig::DataAccess::TAV ) )[ word ] >> bit ) & 0
x1 );
91 "The requested information is not available in the input" );
96 if( GetDetailLevel() >= 1 ) {
97 return ( ( ( * GetL1Result( Trig::DataAccess::TBP ) )[ word ] >> bit ) & 0
x1 );
100 "The requested information is not available in the input" );
105 if( GetDetailLevel() >= 1 ) {
106 return ( ( ( * GetL1Result( Trig::DataAccess::TAP ) )[ word ] >> bit ) & 0
x1 );
109 "The requested information is not available in the input" );
114 Warning(
"IsPassed",
"Decision type not recognised. Returning physics decision." );
115 if( GetDetailLevel() >= 0 ) {
116 return ( ( ( * GetL1Result( Trig::DataAccess::TAV ) )[ word ] >> bit ) & 0
x1 );
119 "The requested information is not available in the input" );
127 if( (
id = GetConfigSvc().GetChainId(
name ) ) < 0 ) {
136 if(
name.find(
"L2_" ) !=
name.npos ) {
141 std::vector< short >::const_iterator
begin,
end;
144 case TrigDefs::Physics:
145 if( GetDetailLevel() >= 0 ) {
146 begin = GetL2Result( Trig::DataAccess::Physics )->begin();
147 end = GetL2Result( Trig::DataAccess::Physics )->end();
150 "The requested information is not available in the input" );
154 case TrigDefs::requireDecision:
155 if( GetDetailLevel() >= 1 ) {
156 begin = GetL2Result( Trig::DataAccess::Raw )->begin();
157 end = GetL2Result( Trig::DataAccess::Raw )->end();
160 "The requested information is not available in the input" );
165 if( GetDetailLevel() >= 2 ) {
166 begin = GetL2Result( Trig::DataAccess::Resurrected )->begin();
167 end = GetL2Result( Trig::DataAccess::Resurrected )->end();
170 "The requested information is not available in the input" );
174 case TrigDefs::passedThrough:
175 if( GetDetailLevel() >= 2 ) {
176 begin = GetL2Result( Trig::DataAccess::PassedThrough )->begin();
177 end = GetL2Result( Trig::DataAccess::PassedThrough )->end();
180 "The requested information is not available in the input" );
185 Warning(
"IsPassed",
"Decision type not recognised. Returning physics decision." );
186 if( GetDetailLevel() >= 0 ) {
187 begin = GetL2Result( Trig::DataAccess::Physics )->begin();
188 end = GetL2Result( Trig::DataAccess::Physics )->end();
191 "The requested information is not available in the input" );
210 if(
name.find(
"EF_" ) !=
name.npos ) {
215 std::vector< short >::const_iterator
begin,
end;
218 case TrigDefs::Physics:
219 if( GetDetailLevel() >= 0 ) {
220 begin = GetEFResult( Trig::DataAccess::Physics )->begin();
221 end = GetEFResult( Trig::DataAccess::Physics )->end();
224 "The requested information is not available in the input" );
228 case TrigDefs::requireDecision:
229 if( GetDetailLevel() >= 1 ) {
230 begin = GetEFResult( Trig::DataAccess::Raw )->begin();
231 end = GetEFResult( Trig::DataAccess::Raw )->end();
234 "The requested information is not available in the input" );
239 if( GetDetailLevel() >= 2 ) {
240 begin = GetEFResult( Trig::DataAccess::Resurrected )->begin();
241 end = GetEFResult( Trig::DataAccess::Resurrected )->end();
244 "The requested information is not available in the input" );
248 case TrigDefs::passedThrough:
249 if( GetDetailLevel() >= 2 ) {
250 begin = GetEFResult( Trig::DataAccess::PassedThrough )->begin();
251 end = GetEFResult( Trig::DataAccess::PassedThrough )->end();
254 "The requested information is not available in the input" );
259 Warning(
"IsPassed",
"Decision type not recognised. Returning physics decision." );
260 if( GetDetailLevel() >= 0 ) {
261 begin = GetEFResult( Trig::DataAccess::Physics )->begin();
262 end = GetEFResult( Trig::DataAccess::Physics )->end();
265 "The requested information is not available in the input" );
285 Error(
"IsPassed",
"We've arrived at a serious programming bug!" );