ATLAS Offline Software
TBNoiseWrite.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TBREC_TBNOISEWRITE_H
6 #define TBREC_TBNOISEWRITE_H
7 
8 //
9 // class TBNoiseWrite
10 // Write ROOT Tree with noise in randomly triggered events
11 //
13 
14 class TFile;
15 class TTree;
16 class CaloCell_ID;
17 class IToolSvc;
18 class LArDigitContainer;
19 
20 class TBNoiseWrite: public AthAlgorithm {
21  public:
22 
23  TBNoiseWrite(const std::string& name, ISvcLocator* pSvcLocator);
24  virtual ~TBNoiseWrite();
25  virtual StatusCode initialize() override;
26  virtual StatusCode execute() override;
27  virtual StatusCode finalize() override;
28 
29  private:
30  void clear();
32  StatusCode getXcryoYtable(float &x, float &y, float &eBeam);
33 
34  int m_nEvent; // counter
35  int m_nEventRandomTrigger; // counter
36  bool m_first; // First event flag
37 
38  // Run header
39  struct NoiseHeader{
40  int m_nRun;
41  float m_beamMom;
42  float m_xCryo;
43  float m_yTable;
44  };
46 
47  // Variables to be in the TTree
48  //--------------------------
49  // Cell parameters
50  std::vector<unsigned int>* m_cell_id;
51  std::vector<float>* m_cell_energy;
52 
53  // Names and pointers
54  std::string m_digitContainerName;
55  std::string m_caloCellContainerName; // Cell container name
56  std::string m_headerTreeName; // Header Tree name
57  std::string m_noiseTreeName; // Noise Tree name
58  std::string m_rootfile_name; // name of the ROOT file with TBTree
59  TFile* m_rootfile; // and its pointer
60  TTree* m_header_tree; // Header Tree pointer
61  TTree* m_tree; // Noise Tree pointer
62 
64  std::string m_txtFileWithXY;
65 };
66 
67 #endif
TBNoiseWrite::m_noiseTreeName
std::string m_noiseTreeName
Definition: TBNoiseWrite.h:57
TBNoiseWrite::TBNoiseWrite
TBNoiseWrite(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TBNoiseWrite.cxx:25
TBNoiseWrite::NoiseHeader::m_xCryo
float m_xCryo
Beam momentum.
Definition: TBNoiseWrite.h:42
TBNoiseWrite::NoiseHeader::m_beamMom
float m_beamMom
Run number.
Definition: TBNoiseWrite.h:41
TBNoiseWrite::m_cell_id
std::vector< unsigned int > * m_cell_id
Definition: TBNoiseWrite.h:50
TBNoiseWrite::m_cell_energy
std::vector< float > * m_cell_energy
Definition: TBNoiseWrite.h:51
TBNoiseWrite::NoiseHeader::m_yTable
float m_yTable
CryoX.
Definition: TBNoiseWrite.h:43
TBNoiseWrite::m_first
bool m_first
Definition: TBNoiseWrite.h:36
TBNoiseWrite::m_rootfile_name
std::string m_rootfile_name
Definition: TBNoiseWrite.h:58
TBNoiseWrite::m_caloCellContainerName
std::string m_caloCellContainerName
Definition: TBNoiseWrite.h:55
x
#define x
TBNoiseWrite::m_digitContainerName
std::string m_digitContainerName
Definition: TBNoiseWrite.h:54
AthAlgorithm.h
TBNoiseWrite::m_nEventRandomTrigger
int m_nEventRandomTrigger
Definition: TBNoiseWrite.h:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TBNoiseWrite::m_header_tree
TTree * m_header_tree
Definition: TBNoiseWrite.h:60
TBNoiseWrite::m_txtFileWithXY
std::string m_txtFileWithXY
Text file containing xCryo and yTable.
Definition: TBNoiseWrite.h:64
TBNoiseWrite::NoiseHeader::m_nRun
int m_nRun
Definition: TBNoiseWrite.h:40
TBNoiseWrite::getXcryoYtable
StatusCode getXcryoYtable(float &x, float &y, float &eBeam)
Get Xcryo and Ytable from a text file.
Definition: TBNoiseWrite.cxx:151
CaloCell_ID
Helper class for offline cell identifiers.
Definition: CaloCell_ID.h:34
AthAlgorithm
Definition: AthAlgorithm.h:47
TBNoiseWrite::m_tree
TTree * m_tree
Definition: TBNoiseWrite.h:61
TBNoiseWrite::m_header
NoiseHeader m_header
Definition: TBNoiseWrite.h:45
TBNoiseWrite::NoiseHeader
Definition: TBNoiseWrite.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TBNoiseWrite::m_nEvent
int m_nEvent
Definition: TBNoiseWrite.h:34
y
#define y
TBNoiseWrite
Definition: TBNoiseWrite.h:20
TBNoiseWrite::m_headerTreeName
std::string m_headerTreeName
Definition: TBNoiseWrite.h:56
TBNoiseWrite::clear
void clear()
Definition: TBNoiseWrite.cxx:95
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
Generate_ecmenergies.eBeam
float eBeam
Definition: Generate_ecmenergies.py:9
TBNoiseWrite::m_rootfile
TFile * m_rootfile
Definition: TBNoiseWrite.h:59
TBNoiseWrite::initialize
virtual StatusCode initialize() override
Definition: TBNoiseWrite.cxx:55
TBNoiseWrite::~TBNoiseWrite
virtual ~TBNoiseWrite()
Definition: TBNoiseWrite.cxx:52
TBNoiseWrite::execute
virtual StatusCode execute() override
Definition: TBNoiseWrite.cxx:101
TBNoiseWrite::finalize
virtual StatusCode finalize() override
Definition: TBNoiseWrite.cxx:84