ATLAS Offline Software
Tau1P3PExtraDetails.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
20 
21 #ifndef TAU1P3P_EXTRA_DETAILS_ANALYSIS_H
22 #define TAU1P3P_EXTRA_DETAILS_ANALYSIS_H
23 
24 #include "tauEvent/TauDetails.h"
25 #include "CaloEvent/CaloClusterContainer.h"
26 #include <vector>
27 
28 namespace Analysis
29 {
30  //-------------------------------------------------------------------------
34  //-------------------------------------------------------------------------
36  {
37  friend class TauJet;
39  public:
40  //-----------------------------------------------------------------
41  // Constructors, destructor, operators
42  //-----------------------------------------------------------------
43 
46 
50 
52  virtual ~Tau1P3PExtraDetails();
53 
58  const Tau1P3PExtraDetails& rhs );
59 
60  virtual const std::string& className() const;
61 
62  //-----------------------------------------------------------------
65  //-----------------------------------------------------------------
66  void allocTracksAndSamplings( unsigned tracks, unsigned samplings );
67 
68  //-----------------------------------------------------------------
71  //-----------------------------------------------------------------
72  const CaloCell *closestEtaTrkVertCell( int itrk, int num ) const;
74  const CaloCellContainer *cont,
75  int itrk, int num );
77  int itrk, int num );
78 
79  //-----------------------------------------------------------------
82  //-----------------------------------------------------------------
83  const CaloCell *closestPhiTrkVertCell( int itrk, int num ) const;
85  const CaloCellContainer *cont,
86  int itrk, int num );
88  int itrk, int num );
89 
90  //-----------------------------------------------------------------
93  //-----------------------------------------------------------------
94  const CaloCell *closestEtaTrkCell( int itrk, int num ) const;
95  void setClosestEtaTrkCell( const CaloCell *val,
96  const CaloCellContainer *cont,
97  int itrk, int num );
99  int itrk, int num );
100 
101  //-----------------------------------------------------------------
104  //-----------------------------------------------------------------
105  const CaloCell *closestPhiTrkCell( int itrk,int num ) const;
106  void setClosestPhiTrkCell( const CaloCell *val,
107  const CaloCellContainer *cont,
108  int itrk, int num );
110  int itrk, int num );
111 
112  //-----------------------------------------------------------------
114  //-----------------------------------------------------------------
115  double etaTrackCaloSamp( int itrk, int i ) const;
116  void setEtaTrackCaloSamp( int itrk, int i, double eta );
117 
118  //-----------------------------------------------------------------
120  //-----------------------------------------------------------------
121  double phiTrackCaloSamp( int itrk, int i ) const;
122  void setPhiTrackCaloSamp( int itrk, int i, double eta );
123 
124  //-----------------------------------------------------------------
126  //-----------------------------------------------------------------
127  double sumPTTracks();
128  void setSumPTTracks( double sumPTTracks );
129 
130  unsigned int ntrack() const;
131  unsigned int nsamp() const;
132 
133 
134  private:
135  static const std::string s_className;
136  std::vector<std::vector<ElementLink<CaloCellContainer> > >
138  std::vector<std::vector<ElementLink<CaloCellContainer> > >
140  std::vector<std::vector<ElementLink<CaloCellContainer> > >
142  std::vector<std::vector<ElementLink<CaloCellContainer> > >
144  std::vector<std::vector<double> > m_etaTrackCaloSamp;
145  std::vector<std::vector<double> > m_phiTrackCaloSamp;
147  };
148 
149  //-------------------------------------------------------------------------
150  // Allocate data structures
151  //-------------------------------------------------------------------------
152  inline void Tau1P3PExtraDetails :: allocTracksAndSamplings( unsigned tracks, unsigned samplings )
153  {
154  if( tracks == 0 || samplings == 0 )
155  return;
156 
157  std::vector<ElementLink<CaloCellContainer> > initEL( samplings );
158 
159  m_closestEtaTrkVertCell.clear();
160  m_closestEtaTrkVertCell.resize( tracks, initEL );
161 
162  m_closestEtaTrkCell.clear();
163  m_closestEtaTrkCell.resize( tracks, initEL );
164 
165  m_closestPhiTrkVertCell.clear();
166  m_closestPhiTrkVertCell.resize( tracks, initEL );
167 
168  m_closestPhiTrkCell.clear();
169  m_closestPhiTrkCell.resize( tracks, initEL );
170 
171  std::vector<double> initD( samplings, TauDetails::DEFAULT );
172  m_etaTrackCaloSamp.clear();
173  m_etaTrackCaloSamp.resize( tracks, initD );
174  m_phiTrackCaloSamp.clear();
175  m_phiTrackCaloSamp.resize( tracks, initD );
176  }
177 
178  //-------------------------------------------------------------------------
179  // Cells
180  //-------------------------------------------------------------------------
181  inline const CaloCell *Tau1P3PExtraDetails :: closestEtaTrkVertCell( int itrk, int num ) const
182  {
183  if( m_closestEtaTrkVertCell[itrk][num].isValid() )
184  return *m_closestEtaTrkVertCell[itrk][num];
185  else
186  return 0;
187  }
188 
190  const CaloCellContainer *cont,
191  int itrk, int num )
192  {
193  m_closestEtaTrkVertCell[itrk][num].toContainedElement( *cont,val );
194  }
195 
197  int itrk, int num)
198  {
199  m_closestEtaTrkVertCell[itrk][num] = el;
200  }
201 
202  inline const CaloCell *Tau1P3PExtraDetails :: closestPhiTrkVertCell( int itrk, int num ) const
203  {
204  if( m_closestPhiTrkVertCell[itrk][num].isValid() )
205  return *m_closestPhiTrkVertCell[itrk][num];
206  else
207  return 0;
208  }
209 
211  const CaloCellContainer *cont,
212  int itrk, int num )
213  {
214  m_closestPhiTrkVertCell[itrk][num].toContainedElement( *cont, val );
215  }
216 
217 
219  int itrk, int num)
220  {
221  m_closestPhiTrkVertCell[itrk][num] = el;
222  }
223 
224  inline const CaloCell *Tau1P3PExtraDetails :: closestEtaTrkCell( int itrk, int num ) const
225  {
226  if( m_closestEtaTrkCell[itrk][num].isValid() )
227  return *m_closestEtaTrkCell[itrk][num];
228  else
229  return 0;
230  }
231 
233  const CaloCellContainer *cont,
234  int itrk, int num )
235  {
236  m_closestEtaTrkCell[itrk][num].toContainedElement( *cont, val );
237  }
238 
240  int itrk, int num)
241  {
242  m_closestEtaTrkCell[itrk][num] = el;
243  }
244 
245  inline const CaloCell *Tau1P3PExtraDetails :: closestPhiTrkCell( int itrk, int num ) const
246  {
247  if( m_closestPhiTrkCell[itrk][num].isValid() )
248  return *m_closestPhiTrkCell[itrk][num];
249  else
250  return 0;
251  }
252 
254  const CaloCellContainer *cont,
255  int itrk, int num )
256  {
257  m_closestPhiTrkCell[itrk][num].toContainedElement( *cont, val );
258  }
259 
261  int itrk, int num)
262  {
263  m_closestPhiTrkCell[itrk][num] = el;
264  }
265 
266  //-------------------------------------------------------------------------
267  // Calo samples
268  //-------------------------------------------------------------------------
269  inline double Tau1P3PExtraDetails :: etaTrackCaloSamp( int itrk, int i ) const
270  {
271  return m_etaTrackCaloSamp[itrk][i];
272  }
273 
274  inline void Tau1P3PExtraDetails :: setEtaTrackCaloSamp( int itrk, int i,
275  double eta )
276  {
277  m_etaTrackCaloSamp[itrk][i] = eta ;
278  }
279 
280  inline double Tau1P3PExtraDetails :: phiTrackCaloSamp( int itrk, int i ) const
281  {
282  return m_phiTrackCaloSamp[itrk][i];
283  }
284 
285  inline void Tau1P3PExtraDetails :: setPhiTrackCaloSamp( int itrk, int i,
286  double phi )
287  {
288  m_phiTrackCaloSamp[itrk][i] = phi ;
289  }
290 
292  {
293  return m_sumPTTracks;
294  }
295 
296  inline void Tau1P3PExtraDetails :: setSumPTTracks( double sumPTTracks )
297  {
299  }
300 }
301 
302 #endif // TAU1P3P_EXTRA_DETAILS_ANALYSIS_H
Analysis::Tau1P3PExtraDetails::setClosestPhiTrkCellLink
void setClosestPhiTrkCellLink(const ElementLink< CaloCellContainer > &el, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:260
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
Analysis::Tau1P3PExtraDetails::m_closestPhiTrkCell
std::vector< std::vector< ElementLink< CaloCellContainer > > > m_closestPhiTrkCell
Definition: Tau1P3PExtraDetails.h:143
Analysis::Tau1P3PExtraDetails::setEtaTrackCaloSamp
void setEtaTrackCaloSamp(int itrk, int i, double eta)
Definition: Tau1P3PExtraDetails.h:274
Analysis::Tau1P3PExtraDetails::m_sumPTTracks
double m_sumPTTracks
Definition: Tau1P3PExtraDetails.h:146
Analysis::Tau1P3PExtraDetails::etaTrackCaloSamp
double etaTrackCaloSamp(int itrk, int i) const
Eta of extrapolation point in EM Calo in "i" sampling for track "itrk".
Definition: Tau1P3PExtraDetails.h:269
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
Analysis::Tau1P3PExtraDetails::operator=
Tau1P3PExtraDetails & operator=(const Tau1P3PExtraDetails &rhs)
Assignment operator.
Definition: Tau1P3PExtraDetails.cxx:48
Analysis::TauDetails::DEFAULT
static const float DEFAULT
Definition: TauDetails.h:34
Analysis::Tau1P3PExtraDetails::sumPTTracks
double sumPTTracks()
Sum of PT of tracks.
Definition: Tau1P3PExtraDetails.h:291
Analysis::Tau1P3PExtraDetails::setClosestEtaTrkVertCellLink
void setClosestEtaTrkVertCellLink(const ElementLink< CaloCellContainer > &el, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:196
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
TauDetails.h
Analysis::TauDetails
Definition: TauDetails.h:26
Analysis::Tau1P3PExtraDetails::m_etaTrackCaloSamp
std::vector< std::vector< double > > m_etaTrackCaloSamp
Definition: Tau1P3PExtraDetails.h:144
Analysis::Tau1P3PExtraDetails::setClosestPhiTrkCell
void setClosestPhiTrkCell(const CaloCell *val, const CaloCellContainer *cont, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:253
Analysis::Tau1P3PExtraDetails::closestEtaTrkVertCell
const CaloCell * closestEtaTrkVertCell(int itrk, int num) const
Closest cell to track position at vertex in eta for track "itrk" in samp "num".
Definition: Tau1P3PExtraDetails.h:181
Analysis::Tau1P3PExtraDetails::setClosestEtaTrkVertCell
void setClosestEtaTrkVertCell(const CaloCell *val, const CaloCellContainer *cont, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:189
lumiFormat.i
int i
Definition: lumiFormat.py:85
Analysis::Tau1P3PExtraDetails::setClosestPhiTrkVertCell
void setClosestPhiTrkVertCell(const CaloCell *val, const CaloCellContainer *cont, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:210
Analysis::Tau1P3PExtraDetails::s_className
static const std::string s_className
Definition: Tau1P3PExtraDetails.h:135
Analysis::TauJet
Object for taus common for ESD and AOD.
Definition: Reconstruction/tauEvent/tauEvent/TauJet.h:61
Analysis::Tau1P3PExtraDetails::closestEtaTrkCell
const CaloCell * closestEtaTrkCell(int itrk, int num) const
Closest cell to track position from extrapolation in eta for track "itrk" in samp "num".
Definition: Tau1P3PExtraDetails.h:224
Analysis::Tau1P3PExtraDetails::closestPhiTrkCell
const CaloCell * closestPhiTrkCell(int itrk, int num) const
Closest cell to track position from extrapolation in phi for track "itrk" in samp "num".
Definition: Tau1P3PExtraDetails.h:245
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
Analysis::Tau1P3PExtraDetails::closestPhiTrkVertCell
const CaloCell * closestPhiTrkVertCell(int itrk, int num) const
Closest cell to track position at vertex in phi for track "itrk" in samp "num".
Definition: Tau1P3PExtraDetails.h:202
Analysis::Tau1P3PExtraDetails::setClosestEtaTrkCell
void setClosestEtaTrkCell(const CaloCell *val, const CaloCellContainer *cont, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:232
Analysis::Tau1P3PExtraDetails::setClosestPhiTrkVertCellLink
void setClosestPhiTrkVertCellLink(const ElementLink< CaloCellContainer > &el, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:218
Analysis::Tau1P3PExtraDetails::setPhiTrackCaloSamp
void setPhiTrackCaloSamp(int itrk, int i, double eta)
Definition: Tau1P3PExtraDetails.h:285
Analysis::Tau1P3PExtraDetails::setClosestEtaTrkCellLink
void setClosestEtaTrkCellLink(const ElementLink< CaloCellContainer > &el, int itrk, int num)
Definition: Tau1P3PExtraDetails.h:239
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::Tau1P3PExtraDetails::~Tau1P3PExtraDetails
virtual ~Tau1P3PExtraDetails()
Destructor.
Definition: Tau1P3PExtraDetails.cxx:31
Analysis::Tau1P3PExtraDetails::ntrack
unsigned int ntrack() const
Definition: Tau1P3PExtraDetails.cxx:70
CaloCellContainer
Container class for CaloCell.
Definition: CaloCellContainer.h:55
Analysis::Tau1P3PExtraDetails::m_closestPhiTrkVertCell
std::vector< std::vector< ElementLink< CaloCellContainer > > > m_closestPhiTrkVertCell
Definition: Tau1P3PExtraDetails.h:141
Analysis::Tau1P3PExtraDetails::className
virtual const std::string & className() const
Definition: Tau1P3PExtraDetails.cxx:65
Analysis::Tau1P3PExtraDetails::m_phiTrackCaloSamp
std::vector< std::vector< double > > m_phiTrackCaloSamp
Definition: Tau1P3PExtraDetails.h:145
Analysis::Tau1P3PExtraDetails::phiTrackCaloSamp
double phiTrackCaloSamp(int itrk, int i) const
Phi of extrapolation point in EM Calo in "i" sampling for track "itrk".
Definition: Tau1P3PExtraDetails.h:280
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
Analysis::Tau1P3PExtraDetails
DEPRECATED DO NOT USE - MIGRATE TO TauCommonDetails Extended details class containing information pro...
Definition: Tau1P3PExtraDetails.h:36
Analysis::Tau1P3PExtraDetails::Tau1P3PExtraDetails
Tau1P3PExtraDetails()
Constructor.
Definition: Tau1P3PExtraDetails.cxx:24
Analysis::Tau1P3PExtraDetails::allocTracksAndSamplings
void allocTracksAndSamplings(unsigned tracks, unsigned samplings)
Allocate data structures for given number of tracks and samplings.
Definition: Tau1P3PExtraDetails.h:152
Analysis::Tau1P3PExtraDetails::nsamp
unsigned int nsamp() const
Definition: Tau1P3PExtraDetails.cxx:75
Analysis::Tau1P3PExtraDetails::m_closestEtaTrkVertCell
std::vector< std::vector< ElementLink< CaloCellContainer > > > m_closestEtaTrkVertCell
Definition: Tau1P3PExtraDetails.h:137
Tau1P3PExtraDetailsCnv_p1
Legacy converter.
Definition: Tau1P3PExtraDetailsCnv_p1.h:38
Analysis::Tau1P3PExtraDetails::m_closestEtaTrkCell
std::vector< std::vector< ElementLink< CaloCellContainer > > > m_closestEtaTrkCell
Definition: Tau1P3PExtraDetails.h:139
Analysis::Tau1P3PExtraDetails::setSumPTTracks
void setSumPTTracks(double sumPTTracks)
Definition: Tau1P3PExtraDetails.h:296