jTower.h 6.08 KB
Newer Older
1
/*
2
  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
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
*/

//***************************************************************************
//                           jTower.h  -  description
//                              -------------------
//     begin                : 19 02 2019
//     email                : Alan.Watson@cern.ch, jacob.julian.kempster@cern.ch
//  ***************************************************************************/


#ifndef jTower_H
#define jTower_H

#include <vector>
#include "AthenaKernel/CLASS_DEF.h"
#include "CaloEvent/CaloCellContainer.h"
#include "CaloIdentifier/CaloIdManager.h"
#include "CaloIdentifier/CaloCell_SuperCell_ID.h"

#include "xAODBase/IParticle.h"
#include "xAODCore/AuxStoreAccessorMacros.h"

namespace LVL1 {
  
  //Doxygen class description below:
  /** The jTower class is an interface object for jFEX trigger algorithms
      The purposes are twofold:
      - to provide inputs to the algorithms in a way that reflects the cell
      structure within a tower (the basic element of an jFEX algorithm window)
      - to hide the details of the individual data sources, e.g. which hadronic
      cells are LAr and which are HEC, from the algorithms
      It needs to contain supercell ET values and a tower coordinate or identifier
      (not yet defined). ET values should be on the jFEX's internal ET scale, not MeV.
      This should be a purely transient object, but will need to enter the transient
      event store (so class_def etc will be needed before it can be used for real)
  */
  
  class jTower {
    
  public:
    
    /** Constructors */
    jTower();
46
    jTower(float eta, float phi, int eta_modifier_input, int id_modifier, int posneg, float centre_eta = -1.0, float centre_phi = -1.0, int fcal_layer = -1);
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    
    /** Destructor */
    virtual ~jTower() = default;

    /** Clear supercell ET values */
    void clearET();
    
    /** Clear and resize Identifier value vector */
    void clear_EM_scIDs();
    void clear_HAD_scIDs();

    /** Add to ET of a specified cell in MeV */
    void addET(float et, int cell);

    /** Add to ET of a specified cell */
    void recordMD_ET(float et, int cell);

64
65
66
67
68
69
70
71
72
73
74
75
76
77
    /** Add to eta/phi values of a specified tower */
    void setCentreEta(float ieta);
    void setCentrePhi(float iphi);

    /** Add to Area values of a specified tower */
    void setTTowerArea(float area,int layer);
    float getTTowerArea(int layer) const;

    /** Add to pilup lower and upper thresholds */
    void setMinEtforPileup(int etval){m_minEt_pileup_thr=etval;};
    int getMinEtforPileup() const {return m_minEt_pileup_thr;};
    void setMaxEtforPileup(int etval){m_maxEt_pileup_thr=etval;};
    int getMaxEtforPileup() const {return m_maxEt_pileup_thr;};

78
79
80
81
82
    /** Get coordinates of tower */
    int iEta() const;
    int iPhi() const;
    float eta() {return m_eta;};
    float phi() {return m_phi;};
83
    
84
85
    float eta() const {return m_eta;};
    float phi() const {return m_phi;};
86
87
    float centreEta() const {return m_centre_eta;}
    float centrePhi() const {return m_centre_phi;}
88
    float centrephi_toPI() const {return m_centre_phi_toPI;}
89
    int fcalLayer() const {return m_fcal_layer;}
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
    
    void setEta(const float thiseta){ m_eta = thiseta; }

    int id() {return m_tower_id;};

    int id() const {return m_tower_id;}

    float constid() const {return m_tower_id;};

    /** Get ET of a specified cell in MeV */
    int getET(unsigned int layer, int cell = 0) const;
    
    /** Get ET sum of all cells in the jTower in MeV */
    int getTotalET() const;

    /** Get total ET sum of all cells in a given layer in MeV */
    int getLayerTotalET(unsigned int layer) const;

    /** Get vector of ET values for a given layer in MeV */
    std::vector<int> getLayerETvec(unsigned int layer) const;
    
    /** Get vector of all ET values in MeV */
    std::vector<int> getETs() const {return m_et;};
113
114
115
116
117
118
    
    /** Get EM ET value in MeV */
    int getET_EM() const {return m_et[0];};
    
    /** Get HAD ET value in MeV */
    int getET_HAD() const {return m_et[1];};
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134

    /** Get ET of a specified cell in MeV FLOAT VERSION */
    float getET_float(unsigned int layer, int cell = 0) const;

    /** Get ET sum of all cells in the jTower in MeV FLOAT VERSION */
    float getTotalET_float() const;

    /** Get total ET sum of all cells in a given layer in MeV FLOAT VERSION */
    float getLayerTotalET_float(unsigned int layer) const;

    /** Get vector of ET values for a given layer in MeV FLOAT VERSION */
    std::vector<float> getLayerETvec_float(unsigned int layer) const;

    /** Get vector of all ET values in MeV FLOAT VERSION */
    std::vector<float> getETs_float() const {return m_et_float;};

135
    void setET(int cell, float et);
136
137
138

    /** Set supercell position ID **/
    void setSCID(Identifier ID, int cell, float et, int layer, bool doenergysplit);
139
140
141
142
143
144
    
    /** Noise values for each layer and object **/
    void  setNoiseForMet(int noiseVal,int layer);
    int getNoiseForMet(int layer)const;
    void  setNoiseForJet(int noiseVal,int layer);
    int getNoiseForJet(int layer)const;
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

    std::vector<Identifier> getEMSCIDs() const { return m_EM_scID; }
    std::vector<Identifier> getHADSCIDs() const { return m_HAD_scID; }

    Identifier getEMSCID(int cell) const { return m_EM_scID[cell]; }
    Identifier getHADSCID(int cell) const { return m_HAD_scID[cell]; }

    std::vector<Identifier> getLayerSCIDs(unsigned int layer) const;

    void setPosNeg(int posneg);

    inline int getPosNeg() const {return m_posneg;}

    /** Internal data */
  private:
    float m_eta;
    float m_phi;
162
    
163
164
    int m_tower_id;
    int m_posneg = 0;
165
166
    float m_centre_eta =0;
    float m_centre_phi =0;
167
    float m_centre_phi_toPI=0;
168
169
170
171
    std::vector<Identifier> m_EM_scID;
    std::vector<Identifier> m_HAD_scID;
    std::vector<int> m_et;    
    std::vector<float> m_et_float;
172
    std::vector<float> m_TTowerArea{ 1.0, 1.0};
173
    int m_fcal_layer = -1;
174
175
176
177
    int m_NoiseForMet[2] = {0};
    int m_NoiseForJet[2] = {0};
    int m_minEt_pileup_thr = -999;
    int m_maxEt_pileup_thr = -999;
178
179
180
181
182
183
184
185

  };
  
} // end of namespace

CLASS_DEF( LVL1::jTower , 41848655 , 1 )

#endif