//  
// Author: Oliver Maria Kind <mailto: kind@mail.desy.de>
// Update: $Id: AtlPhoton.h,v 1.21 2011/09/16 07:17:19 kind Exp $
// Copyright: 2008 (C) Oliver Maria Kind
//
#ifndef ATLAS_AtlPhoton
#define ATLAS_AtlPhoton
#ifndef HEP_HepPhoton
#include <HepPhoton.h>
#endif
#ifndef ATLAS_AtlEMShower
#include <AtlEMShower.h>
#endif
#ifndef ATLAS_AtlTriggerMatch
#include <AtlTriggerMatch.h>
#endif

class AtlPhoton : public HepPhoton, public AtlEMShower,
    public AtlTriggerMatch {
  
 private:
  
 public:
    AtlPhoton();
    AtlPhoton(Int_t Id, Float_t Px, Float_t Py, Float_t Pz, Float_t E,
	      Float_t EMWeight, Float_t BkgWeight,
	      UInt_t OQFlag,
	      UInt_t IsEMBitField, EIsEM IsEM, EAuthor Author,
	      TLorentzVector PCluster);
    virtual ~AtlPhoton();
    virtual void Clear(Option_t *option = "");
    virtual void Print(Option_t *option = "");
    static void PrintHeader();
    static void PrintFooter();

    inline Bool_t IsPhoton()     const { return fAuthor & kPhoton;}  
    inline Bool_t IsConvPhoton() const { return fAuthor & kConvPhoton;}  

    inline Bool_t IsLoose() const {
	// Loose photon selection
	return fIsEM & kPhotonLoose;
    }
    inline Bool_t IsTight() const {
	// Loose photon selection
	return fIsEM & kPhotonTight;
    }


    // Get OQ decision
    UInt_t  IsGoodOQ(); // 0: is good OQ, 1: is bad OQ
    
    
    inline virtual Bool_t IsEM_ClusterEtaRange() const {
	// Cluster eta range
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<1);
    }
    inline virtual Bool_t IsEM_ClusterHadronicLeakage_Loose() const {
	// Cluster leakage into the hadronic calorimeter
	// for loose selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<2);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEnergy_Loose() const {
	// Energy in 2nd sampling (e277)
	// for loose selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<3);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEratio37_Loose() const {
	// Energy ratio in 2nd sampling
	// for loose selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<4);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEratio33_Loose() const {
	// nergy ratio in 2nd sampling
	// for loose selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<5);
    }
    inline virtual Bool_t IsEM_ClusterMiddleWidth_Loose() const {
	// Width in the second sampling
	// for loose selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<6);
    }
    inline virtual Bool_t IsEM_ClusterHadronicLeakage() const {
	// Cluster leakage into the hadronic calorimeter
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<10);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEnergy() const {
	// Energy in 2nd sampling (e277)
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<11);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEratio37() const {
	// Energy ratio in 2nd sampling
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<12);
    }
    inline virtual Bool_t IsEM_ClusterMiddleEratio33() const {
	// Energy ratio in 2nd sampling for photons
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<13);
    }
    inline virtual Bool_t IsEM_ClusterMiddleWidth() const {
	// Width in the second sampling
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<14);
    }
    inline virtual Bool_t IsEM_ClusterStripsEratio() const {
	// Fraction of energy found in 1st sampling 
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<15);
    }
    inline virtual Bool_t IsEM_ClusterStripsDeltaEmax2() const {
	// Energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et)
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<16);
    }
    inline virtual Bool_t IsEM_ClusterStripsDeltaE() const {
	// Difference between 2nd maximum and 1st minimum in
	// strips (e2tsts1-emins1)
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<17);
    }
    inline virtual Bool_t IsEM_ClusterStripsWtot() const {
	// Shower width in 1st sampling
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<18);
    }
    inline virtual Bool_t IsEM_ClusterStripsFracm() const {
	// Shower shape in shower core 1st sampling
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<19);
    }
    inline virtual Bool_t IsEM_ClusterStripsWeta1c() const {
	// Shower width weighted by distance from the maximum one
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<20);
    }
    inline virtual Bool_t IsEM_ClusterStripsDEmaxs1() const {
	// Difference between max and 2nd max in strips
	// for tight selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<21);
    }
    inline virtual Bool_t IsEM_TrackMatchEoverP() const {
	// Energy-momentum match for photon selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<22);
    }
    inline virtual Bool_t IsEM_Isolation() const {
	// Isolation
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<29);
    }
    inline virtual Bool_t IsEM_ClusterIsolation() const {
	// Calorimetric isolation for photon selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<30);
    }
    inline virtual Bool_t IsEM_TrackIsolation() const {
	// Tracker isolation for photon selection
	// (valid for >= Athena rel15.2.2)
	return fIsEMBitField & (0x1<<31);
    }

    ClassDef(AtlPhoton,13) // Atlas photon class
};
#endif
 AtlPhoton.h:1
 AtlPhoton.h:2
 AtlPhoton.h:3
 AtlPhoton.h:4
 AtlPhoton.h:5
 AtlPhoton.h:6
 AtlPhoton.h:7
 AtlPhoton.h:8
 AtlPhoton.h:9
 AtlPhoton.h:10
 AtlPhoton.h:11
 AtlPhoton.h:12
 AtlPhoton.h:13
 AtlPhoton.h:14
 AtlPhoton.h:15
 AtlPhoton.h:16
 AtlPhoton.h:17
 AtlPhoton.h:18
 AtlPhoton.h:19
 AtlPhoton.h:20
 AtlPhoton.h:21
 AtlPhoton.h:22
 AtlPhoton.h:23
 AtlPhoton.h:24
 AtlPhoton.h:25
 AtlPhoton.h:26
 AtlPhoton.h:27
 AtlPhoton.h:28
 AtlPhoton.h:29
 AtlPhoton.h:30
 AtlPhoton.h:31
 AtlPhoton.h:32
 AtlPhoton.h:33
 AtlPhoton.h:34
 AtlPhoton.h:35
 AtlPhoton.h:36
 AtlPhoton.h:37
 AtlPhoton.h:38
 AtlPhoton.h:39
 AtlPhoton.h:40
 AtlPhoton.h:41
 AtlPhoton.h:42
 AtlPhoton.h:43
 AtlPhoton.h:44
 AtlPhoton.h:45
 AtlPhoton.h:46
 AtlPhoton.h:47
 AtlPhoton.h:48
 AtlPhoton.h:49
 AtlPhoton.h:50
 AtlPhoton.h:51
 AtlPhoton.h:52
 AtlPhoton.h:53
 AtlPhoton.h:54
 AtlPhoton.h:55
 AtlPhoton.h:56
 AtlPhoton.h:57
 AtlPhoton.h:58
 AtlPhoton.h:59
 AtlPhoton.h:60
 AtlPhoton.h:61
 AtlPhoton.h:62
 AtlPhoton.h:63
 AtlPhoton.h:64
 AtlPhoton.h:65
 AtlPhoton.h:66
 AtlPhoton.h:67
 AtlPhoton.h:68
 AtlPhoton.h:69
 AtlPhoton.h:70
 AtlPhoton.h:71
 AtlPhoton.h:72
 AtlPhoton.h:73
 AtlPhoton.h:74
 AtlPhoton.h:75
 AtlPhoton.h:76
 AtlPhoton.h:77
 AtlPhoton.h:78
 AtlPhoton.h:79
 AtlPhoton.h:80
 AtlPhoton.h:81
 AtlPhoton.h:82
 AtlPhoton.h:83
 AtlPhoton.h:84
 AtlPhoton.h:85
 AtlPhoton.h:86
 AtlPhoton.h:87
 AtlPhoton.h:88
 AtlPhoton.h:89
 AtlPhoton.h:90
 AtlPhoton.h:91
 AtlPhoton.h:92
 AtlPhoton.h:93
 AtlPhoton.h:94
 AtlPhoton.h:95
 AtlPhoton.h:96
 AtlPhoton.h:97
 AtlPhoton.h:98
 AtlPhoton.h:99
 AtlPhoton.h:100
 AtlPhoton.h:101
 AtlPhoton.h:102
 AtlPhoton.h:103
 AtlPhoton.h:104
 AtlPhoton.h:105
 AtlPhoton.h:106
 AtlPhoton.h:107
 AtlPhoton.h:108
 AtlPhoton.h:109
 AtlPhoton.h:110
 AtlPhoton.h:111
 AtlPhoton.h:112
 AtlPhoton.h:113
 AtlPhoton.h:114
 AtlPhoton.h:115
 AtlPhoton.h:116
 AtlPhoton.h:117
 AtlPhoton.h:118
 AtlPhoton.h:119
 AtlPhoton.h:120
 AtlPhoton.h:121
 AtlPhoton.h:122
 AtlPhoton.h:123
 AtlPhoton.h:124
 AtlPhoton.h:125
 AtlPhoton.h:126
 AtlPhoton.h:127
 AtlPhoton.h:128
 AtlPhoton.h:129
 AtlPhoton.h:130
 AtlPhoton.h:131
 AtlPhoton.h:132
 AtlPhoton.h:133
 AtlPhoton.h:134
 AtlPhoton.h:135
 AtlPhoton.h:136
 AtlPhoton.h:137
 AtlPhoton.h:138
 AtlPhoton.h:139
 AtlPhoton.h:140
 AtlPhoton.h:141
 AtlPhoton.h:142
 AtlPhoton.h:143
 AtlPhoton.h:144
 AtlPhoton.h:145
 AtlPhoton.h:146
 AtlPhoton.h:147
 AtlPhoton.h:148
 AtlPhoton.h:149
 AtlPhoton.h:150
 AtlPhoton.h:151
 AtlPhoton.h:152
 AtlPhoton.h:153
 AtlPhoton.h:154
 AtlPhoton.h:155
 AtlPhoton.h:156
 AtlPhoton.h:157
 AtlPhoton.h:158
 AtlPhoton.h:159
 AtlPhoton.h:160
 AtlPhoton.h:161
 AtlPhoton.h:162
 AtlPhoton.h:163
 AtlPhoton.h:164
 AtlPhoton.h:165
 AtlPhoton.h:166
 AtlPhoton.h:167
 AtlPhoton.h:168
 AtlPhoton.h:169
 AtlPhoton.h:170
 AtlPhoton.h:171
 AtlPhoton.h:172
 AtlPhoton.h:173
 AtlPhoton.h:174
 AtlPhoton.h:175
 AtlPhoton.h:176
 AtlPhoton.h:177
 AtlPhoton.h:178
 AtlPhoton.h:179
 AtlPhoton.h:180
 AtlPhoton.h:181
 AtlPhoton.h:182
 AtlPhoton.h:183
 AtlPhoton.h:184