ANNSelectionTool.h 4.48 KB
Newer Older
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
101
102
103
104
105
/*
  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/

///////////////////////////////////////////////////////////////////
// ANNSelectionTool.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////

#ifndef MUGIRLNSANNSELECTIONTOOL_H
#define MUGIRLNSANNSELECTIONTOOL_H

#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "MuGirlInterfaces/IANNSelectionTool.h"
#include "MuGirlInterfaces/ICandidateTool.h"
#include "MuGirlInterfaces/CandidateSummary.h"
#include "MuGirlSelection/AnnResults_tgcfix_barrel_bad.h"
#include "MuGirlSelection/AnnResults_tgcfix_barrel_good.h"
#include "MuGirlSelection/AnnResults_tgcfix_barrel_endcap.h"
#include "MuGirlSelection/AnnResults_tgcfix_magnet.h"

#include "MuGirlSelection/AnnResults_barrelg_gt5.h"
#include "MuGirlSelection/AnnResults_barrelb_gt5.h"
#include "MuGirlSelection/AnnResults_overlapreg_gt5.h"
#include "MuGirlSelection/AnnResults_overlapmag_gt5.h"
#include "MuGirlSelection/AnnResults_endcap_gt5.h"
#include "MuGirlSelection/AnnResults_endcap_lt5.h"
#include "MuGirlSelection/AnnResults_forward_gt5.h"
#include "MuGirlSelection/AnnResults_forward_lt5.h"


#include "MuGirlSelection/test_barrel.h"
#include "MuGirlSelection/test_endcap.h"
#include "TrigMuonEvent/TrigMuonEFTrack.h"
#include "TrigMuonEvent/MuonFeature.h"
	
class MuonFeature;
class TrigMuonEFTrack;

class AtlasDetectorID;
class Identifier;

namespace Rec
{
class TrackParticle;
}
namespace Trk
{
class MeasuredPerigee;
}
namespace MuGirlNS
{
class ICandidateTool;
class AnnResults_tgcfix_barrel_good;
class AnnResults_tgcfix_barrel_bad;
class AnnResults_tgcfix_barrel_endcap;
class AnnResults_tgcfix_magnet;
class AnnResults_tgcfix_forward_gt5;
class AnnResults_tgcfix_forward_lt5;
class AnnResults_tgcfix_endcap_gt5;
class AnnResults_tgcfix_endcap_lt5;
class AnnResults_tgcfix_barrelg_gt5;
class AnnResults_tgcfix_barrelb_gt5;
class AnnResults_tgcfix_overlapreg_gt5;
class AnnResults_tgcfix_overlapmag_gt5;

/** @class ANNSelectionTool

    This is for the Doxygen-Documentation.
    Please delete these lines and fill in information about
    the Algorithm!
    Please precede every member function declaration with a
    short Doxygen comment stating the purpose of this function.

    @author  Sofia Vallecorsa <sofia.vallecorsa@cern.ch>
*/
class CandidateSummary;


class ANNSelectionTool : virtual public IANNSelectionTool, public AthAlgTool
{
public:
    ANNSelectionTool(const std::string&,const std::string&,const IInterface*);

    /** default destructor */
    virtual ~ANNSelectionTool ();

    /** standard Athena-Algorithm method */
    virtual StatusCode initialize();
    /** standard Athena-Algorithm method */
    virtual StatusCode finalize  ();
    typedef double (MuGirlNS::ANNSelectionTool::*ANNFunction)(CandidateSummary* info);

    virtual void evaluateANN(CandidateSummary* info,double v[8], double NN[2]);

private:
    /** member variables for algorithm properties: */

    template <class T>
    StatusCode retrieve(ToolHandle<T>& pHandle, bool bError = false)
    {
        StatusCode sc = pHandle.retrieve();
        if (sc.isFailure())
        {
            if (bError)
106
                msg(MSG::ERROR) << "Cannot retrieve " << pHandle << endmsg;
107
            else
108
                msg(MSG::WARNING) << "Cannot retrieve " << pHandle << endmsg;
109
110
        }
        else
111
            msg(MSG::INFO) << "Retrieved " << pHandle << endmsg;
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
        return sc;
    }

    /** member variables for algorithm properties: */

    ToolHandle<MuGirlNS::ICandidateTool>  m_pMuGirlCandidateTool;

    int calculateRegion(double pt, double eta);
    double evaluateAnnBarrelGoodLowPt(CandidateSummary* info);
    double evaluateAnnBarrelBadLowPt(CandidateSummary* info);
    double evaluateAnnEndCapLowPt(CandidateSummary* info);
    double evaluateAnnForwardLowPt(CandidateSummary* info);
    double evaluateAnnRegionOverlapLowPt(CandidateSummary* info);
    double evaluateAnnMagnetOverlapLowPt(CandidateSummary* info);

    double evaluateAnnBarrelGoodHighPt(CandidateSummary* info);
    double evaluateAnnBarrelBadHighPt(CandidateSummary* info);
    double evaluateAnnEndCapHighPt(CandidateSummary* info);
    double evaluateAnnForwardHighPt(CandidateSummary* info);
    double evaluateAnnRegionOverlapHighPt(CandidateSummary* info);
    double evaluateAnnMagnetOverlapHighPt(CandidateSummary* info);

    double evaluateAnnTest_barrel(CandidateSummary* info);
    double evaluateAnnTest_endcap(CandidateSummary* info);
};
} // end of namespace

#endif