ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
TrigEFTauMVHypoTool Class Reference

#include <TrigEFTauMVHypoTool.h>

Inheritance diagram for TrigEFTauMVHypoTool:
Collaboration diagram for TrigEFTauMVHypoTool:

Public Member Functions

 TrigEFTauMVHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TrigEFTauMVHypoTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode decide (std::vector< ITrigEFTauMVHypoTool::TauJetInfo > &input) const override
 
virtual bool decide (const ITrigEFTauMVHypoTool::TauJetInfo &i) const override
 

Private Attributes

HLT::Identifier m_decisionId
 
Gaudi::Property< int > m_numTrackMin { this, "numTrackMin", 0, "Minimum number of tracks" }
 
Gaudi::Property< int > m_numTrackMax { this, "numTrackMax", 5, "Maximum number of tracks" }
 
Gaudi::Property< float > m_numWideTrackMax { this, "numWideTrackMax",999, "Maximum number of wide tracks" }
 
Gaudi::Property< double > m_EtCalibMin { this, "EtCalibMin", -10000., "pT Minimum cut" }
 
Gaudi::Property< int > m_level { this, "level", -1, "Select ID Working point" }
 
Gaudi::Property< int > m_method { this, "method", 0, "Select ID method" }
 
Gaudi::Property< bool > m_highpt { this, "highpt", true , "Turn on/off high pt selection" }
 
Gaudi::Property< double > m_highpttrkthr { this, "highpttrkthr", 200000. , "Track threshold for high pt taus" }
 
Gaudi::Property< double > m_highptidthr { this, "highptidthr", 280000., "pT threshold for loosening ID level cut" }
 
Gaudi::Property< double > m_highptjetthr { this, "highptjetthr", 440000., "pT threshold for disabling ID level cut" }
 
Gaudi::Property< double > m_perfTrackPtCut { this, "perfTrackPtCut", 0., "Count tracks above pt threshold in perf step" }
 
Gaudi::Property< bool > m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
 
ToolHandle< GenericMonitoringToolm_monTool { this, "MonTool", "", "Monitoring tool" }
 

Detailed Description

Definition at line 14 of file TrigEFTauMVHypoTool.h.

Constructor & Destructor Documentation

◆ TrigEFTauMVHypoTool()

TrigEFTauMVHypoTool::TrigEFTauMVHypoTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 21 of file TrigEFTauMVHypoTool.cxx.

24  : base_class( type, name, parent ),
26 {
27 }

◆ ~TrigEFTauMVHypoTool()

TrigEFTauMVHypoTool::~TrigEFTauMVHypoTool ( )
virtual

Definition at line 29 of file TrigEFTauMVHypoTool.cxx.

30 {
31 }

Member Function Documentation

◆ decide() [1/2]

bool TrigEFTauMVHypoTool::decide ( const ITrigEFTauMVHypoTool::TauJetInfo i) const
overridevirtual

Definition at line 70 of file TrigEFTauMVHypoTool.cxx.

71 {
72 
73  ATH_MSG_DEBUG(name() << ": in execute()" );
74  // general reset
75  bool pass=false;
76 
77  using namespace Monitored;
78 
79  auto PassedCuts = Monitored::Scalar<int>( "CutCounter", -1 );
80  auto ptAccepted = Monitored::Scalar<float>( "ptAccepted", -1);
81  auto nTrackAccepted = Monitored::Scalar<int>( "nTrackAccepted", -1);
82  auto nWideTrackAccepted = Monitored::Scalar<int>( "nWideTrackAccepted", -1);
83  auto ninputTaus = Monitored::Scalar<int>( "nInputTaus", -1);
84  auto RNNJetScore_0p = Monitored::Scalar<float>( "RNNJetScoreAccepted_0p", -1);
85  auto RNNJetScoreSigTrans_0p = Monitored::Scalar<float>( "RNNJetScoreSigTransAccepted_0p", -1);
86  auto RNNJetScore_1p = Monitored::Scalar<float>( "RNNJetScoreAccepted_1p", -1);
87  auto RNNJetScoreSigTrans_1p = Monitored::Scalar<float>( "RNNJetScoreSigTransAccepted_1p", -1);
88  auto RNNJetScore_mp = Monitored::Scalar<float>( "RNNJetScoreAccepted_mp", -1);
89  auto RNNJetScoreSigTrans_mp = Monitored::Scalar<float>( "RNNJetScoreSigTransAccepted_mp", -1);
90 
91  auto monitorIt = Monitored::Group(m_monTool, PassedCuts, ptAccepted, nTrackAccepted, nWideTrackAccepted, ninputTaus, RNNJetScore_0p, RNNJetScoreSigTrans_0p, RNNJetScore_1p, RNNJetScoreSigTrans_1p, RNNJetScore_mp, RNNJetScoreSigTrans_mp );
92 
93  // general reset
94  PassedCuts = 0;
95 
96  if ( m_acceptAll ) {
97  pass = true;
98  ATH_MSG_DEBUG( "AcceptAll property is set: taking all events" );
99  } else {
100  pass = false;
101  ATH_MSG_DEBUG( "AcceptAll property not set: applying selection" );
102  }
103 
104  //get RoI descriptor
105  auto roiDescriptor = input.roi;
106  float roIZ = roiDescriptor->zed();
107  float roIEta = roiDescriptor->eta();
108  float roIPhi = roiDescriptor->phi();
109 
110  ATH_MSG_DEBUG( "Input RoI eta: " << roIEta << " Input RoI phi: " << roIPhi << " Input RoI z: " << roIZ);
111 
112  auto TauContainer = input.taujetcontainer;
113  ninputTaus = TauContainer->size();
114 
115  for(auto Tau: *TauContainer){
116 
117  ATH_MSG_DEBUG( " tauRec candidate ");
118 
119  double EFet = Tau->pt()*1e-3;
120 
121  if(!( EFet > m_EtCalibMin*1e-3)) continue;
122 
123  ATH_MSG_DEBUG( "Et Calib "<<EFet );
124 
125  PassedCuts++;
126  ptAccepted = EFet;
127 
128  int numTrack = 0, numWideTrack = 0;
129  // raise the track pt threshold when counting tracks in the 'perf' step, to reduce sensitivity to pileup tracks
130  if (m_perfTrackPtCut>0.) {
132  if (track->pt() > m_perfTrackPtCut) numTrack ++;
133  }
135  if (track->pt() > m_perfTrackPtCut) numWideTrack++;
136  }
137  }
138  else {
139  numTrack = Tau->nTracks();
140  numWideTrack = Tau->nTracksIsolation();
141  }
142 
143  ATH_MSG_DEBUG( "Track size "<<numTrack );
144  ATH_MSG_DEBUG( "Wide Track size "<<numWideTrack );
145 
146  // turn off track selection at highpt
147  bool applyTrkSel(true);
148  bool applyMaxTrkSel(true);
149  if(m_highpt && (EFet > m_highpttrkthr*1e-3) ) applyTrkSel = false;
150  if(m_highpt && (EFet > m_highptjetthr*1e-3) ) applyMaxTrkSel = false;
151 
152  if(applyMaxTrkSel && !m_acceptAll) {
153  if( !(numTrack <= m_numTrackMax) ) continue;
154  }
155  if(applyTrkSel && !m_acceptAll) {
156  if( !(numTrack >= m_numTrackMin) ) continue;
157  if( !(numWideTrack <= m_numWideTrackMax) ) continue;
158  }
159 
160  PassedCuts++;
161  nTrackAccepted = numTrack;
162  nWideTrackAccepted = numWideTrack;
163 
164  auto local_level = m_level;
165  //loosen and turn off ID cut at highpt
166  if(m_highpt && (EFet > m_highptidthr*1e-3) && m_level>1) local_level = 1;
167  if(m_highpt && (EFet > m_highptjetthr*1e-3) ) local_level = -1111;
168 
169  ATH_MSG_DEBUG( "Local level " << local_level );
170 
171  //No tau ID
172  if(m_method == 0)
173  {
174  pass = true;
175  PassedCuts++;
176 
177  if(Tau->nTracks() == 0){
178  RNNJetScore_0p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
179  RNNJetScoreSigTrans_0p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
180  } else if ( Tau->nTracks() == 1 ) {
181  RNNJetScore_1p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
182  RNNJetScoreSigTrans_1p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
183  } else {
184  RNNJetScore_mp = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
185  RNNJetScoreSigTrans_mp = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
186  }
187  }
188  else if(m_method == 1)
189  {
190  if(!Tau->hasDiscriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans))
191  ATH_MSG_WARNING( "RNNJetScoreSigTrans not available. Make sure TauWPDecorator is run for RNN!" );
192 
193  ATH_MSG_DEBUG( "RNNJetScoreSigTrans "<< Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans) );
194 
195  if(local_level == -1111)
196  { //noCut, accept this TE
197  pass = true;
198  PassedCuts++;
199  }
200  else if (local_level == 0 && Tau->isTau(xAOD::TauJetParameters::JetRNNSigVeryLoose) == 0 && !m_acceptAll)
201  continue;
202  else if (local_level == 1 && Tau->isTau(xAOD::TauJetParameters::JetRNNSigLoose) == 0 && !m_acceptAll)
203  continue;
204  else if (local_level == 2 && Tau->isTau(xAOD::TauJetParameters::JetRNNSigMedium) == 0 && !m_acceptAll)
205  continue;
206  else if (local_level == 3 && Tau->isTau(xAOD::TauJetParameters::JetRNNSigTight) == 0 && !m_acceptAll)
207  continue;
208 
209  PassedCuts++;
210 
211  if(Tau->nTracks() == 0){
212  RNNJetScore_0p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
213  RNNJetScoreSigTrans_0p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
214  } else if ( Tau->nTracks() == 1 ) {
215  RNNJetScore_1p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
216  RNNJetScoreSigTrans_1p = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
217  } else {
218  RNNJetScore_mp = Tau->discriminant(xAOD::TauJetParameters::RNNJetScore);
219  RNNJetScoreSigTrans_mp = Tau->discriminant(xAOD::TauJetParameters::RNNJetScoreSigTrans);
220  }
221  }
222  else
223  {
224  ATH_MSG_ERROR( " no valid method defined ");
225  continue;
226  }
227 
228  //-------------------------------------------------
229  // At least one Tau matching passed all cuts.
230  // Accept the event!
231  //-------------------------------------------------
232 
233  pass=true;
234 
235  ATH_MSG_DEBUG( "pass hypo tool: "<<pass);
236 
237  } // end of loop in tau objects.
238 
239 
240  return pass;
241 
242 }

◆ decide() [2/2]

virtual StatusCode TrigEFTauMVHypoTool::decide ( std::vector< ITrigEFTauMVHypoTool::TauJetInfo > &  input) const
overridevirtual

◆ initialize()

StatusCode TrigEFTauMVHypoTool::initialize ( )
overridevirtual

Definition at line 33 of file TrigEFTauMVHypoTool.cxx.

34 {
35 
36  ATH_MSG_DEBUG( "in initialize()" );
37 
38  ATH_MSG_DEBUG( "TrigEFTauMVHypoTool will cut on ");
39  ATH_MSG_DEBUG( "param NTrackMin " << m_numTrackMin );
40  ATH_MSG_DEBUG( "param NTrackMax " << m_numTrackMax );
41  ATH_MSG_DEBUG( "param NWideTrackMax " << m_numWideTrackMax );
42  ATH_MSG_DEBUG( "param EtCalib " << m_EtCalibMin );
43  ATH_MSG_DEBUG( "param Level " << m_level );
44  ATH_MSG_DEBUG( "param Method " << m_method );
45  ATH_MSG_DEBUG( "param Highpt with thrs " << m_highpt << " " << m_highpttrkthr << " " << m_highptidthr << " " << m_highptjetthr );
46  if (m_perfTrackPtCut>0.) ATH_MSG_DEBUG( "param perfTrackPtCut: " << m_perfTrackPtCut );
47  ATH_MSG_DEBUG( "------ ");
48 
50  {
51  ATH_MSG_ERROR( "TrigEFTauMVHypoTool is uninitialized! " );
52  return StatusCode::FAILURE;
53  }
54 
55  if( m_method == 0 && m_level != -1111)
56  {
57  ATH_MSG_ERROR( "Incorrect combination of Method and Level." );
58  return StatusCode::FAILURE;
59  }
60  else if((m_level<0 && m_level!=-1111) || m_level>3 )
61  {
62  ATH_MSG_ERROR( "Incorrect Level value provided.");
63  return StatusCode::FAILURE;
64  }
65 
66  return StatusCode::SUCCESS;
67 }

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> TrigEFTauMVHypoTool::m_acceptAll { this, "AcceptAll", false, "Ignore selection" }
private

Definition at line 47 of file TrigEFTauMVHypoTool.h.

◆ m_decisionId

HLT::Identifier TrigEFTauMVHypoTool::m_decisionId
private

Definition at line 30 of file TrigEFTauMVHypoTool.h.

◆ m_EtCalibMin

Gaudi::Property<double> TrigEFTauMVHypoTool::m_EtCalibMin { this, "EtCalibMin", -10000., "pT Minimum cut" }
private

Definition at line 36 of file TrigEFTauMVHypoTool.h.

◆ m_highpt

Gaudi::Property<bool> TrigEFTauMVHypoTool::m_highpt { this, "highpt", true , "Turn on/off high pt selection" }
private

Definition at line 39 of file TrigEFTauMVHypoTool.h.

◆ m_highptidthr

Gaudi::Property<double> TrigEFTauMVHypoTool::m_highptidthr { this, "highptidthr", 280000., "pT threshold for loosening ID level cut" }
private

Definition at line 41 of file TrigEFTauMVHypoTool.h.

◆ m_highptjetthr

Gaudi::Property<double> TrigEFTauMVHypoTool::m_highptjetthr { this, "highptjetthr", 440000., "pT threshold for disabling ID level cut" }
private

Definition at line 42 of file TrigEFTauMVHypoTool.h.

◆ m_highpttrkthr

Gaudi::Property<double> TrigEFTauMVHypoTool::m_highpttrkthr { this, "highpttrkthr", 200000. , "Track threshold for high pt taus" }
private

Definition at line 40 of file TrigEFTauMVHypoTool.h.

◆ m_level

Gaudi::Property<int> TrigEFTauMVHypoTool::m_level { this, "level", -1, "Select ID Working point" }
private

Definition at line 37 of file TrigEFTauMVHypoTool.h.

◆ m_method

Gaudi::Property<int> TrigEFTauMVHypoTool::m_method { this, "method", 0, "Select ID method" }
private

Definition at line 38 of file TrigEFTauMVHypoTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigEFTauMVHypoTool::m_monTool { this, "MonTool", "", "Monitoring tool" }
private

Definition at line 49 of file TrigEFTauMVHypoTool.h.

◆ m_numTrackMax

Gaudi::Property<int> TrigEFTauMVHypoTool::m_numTrackMax { this, "numTrackMax", 5, "Maximum number of tracks" }
private

Definition at line 33 of file TrigEFTauMVHypoTool.h.

◆ m_numTrackMin

Gaudi::Property<int> TrigEFTauMVHypoTool::m_numTrackMin { this, "numTrackMin", 0, "Minimum number of tracks" }
private

Definition at line 32 of file TrigEFTauMVHypoTool.h.

◆ m_numWideTrackMax

Gaudi::Property<float> TrigEFTauMVHypoTool::m_numWideTrackMax { this, "numWideTrackMax",999, "Maximum number of wide tracks" }
private

Definition at line 34 of file TrigEFTauMVHypoTool.h.

◆ m_perfTrackPtCut

Gaudi::Property<double> TrigEFTauMVHypoTool::m_perfTrackPtCut { this, "perfTrackPtCut", 0., "Count tracks above pt threshold in perf step" }
private

Definition at line 45 of file TrigEFTauMVHypoTool.h.


The documentation for this class was generated from the following files:
xAOD::TauJetParameters::RNNJetScoreSigTrans
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
Definition: TauDefs.h:92
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
TrigEFTauMVHypoTool::m_perfTrackPtCut
Gaudi::Property< double > m_perfTrackPtCut
Definition: TrigEFTauMVHypoTool.h:45
TrigEFTauMVHypoTool::m_highpt
Gaudi::Property< bool > m_highpt
Definition: TrigEFTauMVHypoTool.h:39
xAOD::TauJetParameters::classifiedCharged
@ classifiedCharged
Definition: TauDefs.h:406
Tau
Definition: EfficiencyPtPlots.cxx:9
HLT::Identifier::fromToolName
static HLT::Identifier fromToolName(const std::string &tname)
Definition: HLTIdentifier.cxx:31
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigEFTauMVHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigEFTauMVHypoTool.h:49
Monitored
Generic monitoring tool for athena components.
Definition: GenericMonitoringTool.h:30
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigEFTauMVHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition: TrigEFTauMVHypoTool.h:47
xAOD::TauJetParameters::JetRNNSigVeryLoose
@ JetRNNSigVeryLoose
Definition: TauDefs.h:145
TrigEFTauMVHypoTool::m_numTrackMin
Gaudi::Property< int > m_numTrackMin
Definition: TrigEFTauMVHypoTool.h:32
TrigEFTauMVHypoTool::m_highpttrkthr
Gaudi::Property< double > m_highpttrkthr
Definition: TrigEFTauMVHypoTool.h:40
xAOD::TauJetParameters::classifiedIsolation
@ classifiedIsolation
Definition: TauDefs.h:407
TrigEFTauMVHypoTool::m_numWideTrackMax
Gaudi::Property< float > m_numWideTrackMax
Definition: TrigEFTauMVHypoTool.h:34
xAOD::TauJetParameters::JetRNNSigTight
@ JetRNNSigTight
Definition: TauDefs.h:148
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigEFTauMVHypoTool::m_highptidthr
Gaudi::Property< double > m_highptidthr
Definition: TrigEFTauMVHypoTool.h:41
TrigEFTauMVHypoTool::m_EtCalibMin
Gaudi::Property< double > m_EtCalibMin
Definition: TrigEFTauMVHypoTool.h:36
xAOD::TauJetParameters::RNNJetScore
@ RNNJetScore
RNN score for Jet rejection (not transformed)
Definition: TauDefs.h:90
xAOD::TauJetParameters::JetRNNSigMedium
@ JetRNNSigMedium
Definition: TauDefs.h:147
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
TrigEFTauMVHypoTool::m_method
Gaudi::Property< int > m_method
Definition: TrigEFTauMVHypoTool.h:38
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigEFTauMVHypoTool::m_level
Gaudi::Property< int > m_level
Definition: TrigEFTauMVHypoTool.h:37
TrigEFTauMVHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition: TrigEFTauMVHypoTool.h:30
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigEFTauMVHypoTool::m_numTrackMax
Gaudi::Property< int > m_numTrackMax
Definition: TrigEFTauMVHypoTool.h:33
xAOD::TauJetParameters::JetRNNSigLoose
@ JetRNNSigLoose
Definition: TauDefs.h:146
TrigEFTauMVHypoTool::m_highptjetthr
Gaudi::Property< double > m_highptjetthr
Definition: TrigEFTauMVHypoTool.h:42