ATLAS Offline Software
Loading...
Searching...
No Matches
ALFA_Raw2Digit.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ALFA_Raw2Digit_h
6#define ALFA_Raw2Digit_h
7
8
10#include "Gaudi/Property.h"
11
12
13// for ALFA
17
20
21
22#include <fstream>
23#include <sstream>
24#include <string>
25#include <sys/stat.h>
26#include <sys/types.h>
27#include <dirent.h>
28
29#include "TROOT.h"
30#include "TString.h"
31
32class TH1F;
33class TH2I;
34class TH2D;
35class TTree;
36class TFile;
37
38
39
41{
42public:
43 ALFA_Raw2Digit(const std::string& name, ISvcLocator* pSvcLocator);
44
45 StatusCode initialize();
46 StatusCode execute(const EventContext& ctx);
47 StatusCode finalize();
48
49private:
50 StatusCode recordCollection();
51 StatusCode recordODCollection();
52 StatusCode mapping();
53 StatusCode ChanPlot(uint32_t pot_n, uint32_t iLayer, uint32_t MarChan, uint32_t &chan_i, uint32_t &chan_j);
54
55
56 Gaudi::Property<std::string> m_ALFA_RawDataCollectionKey{this, "ALFA_RawDataCollectionKey", "ALFA_RawData"};
57
58 int m_nEvents{};
59
60 int m_mbID{};
61 int m_pmfID{};
62 int m_fibID{};
63
65 int m_MapChan{};
66
67 int m_pot{};
68 int m_plate{};
69 int m_fiber{};
70
71 int m_ODpot{};
72 int m_ODside{};
73 int m_ODplate{};
74 int m_ODfiber{};
75
76
77 int m_maroc2fiber[8][20][64]{};
78 int m_maroc2mapmt[8][20][64]{};
79 int m_mapmt2maroc[8][20][64]{};
80
81 int m_pmf2layer[8][23]{};
82
83 int m_OD_pmf2layer[8][4]{};
84 int m_OD_pmf_maroc2fiber[8][4][64]{};
85 int m_OD_pmf_maroc2side[8][4][64]{};
86
87 int m_mb2det[8]{};
88
89
90 uint32_t m_lumi_block{};
91 uint16_t m_charge_1[8]{}, m_charge_2[8]{};
92 std::vector<bool> m_trigger_pattern;
93 bool m_pot_b[8]{}, m_layer_b[8][20]{}, m_fiber_b[8][20][64]{}, m_trigger_pattern_b[8][16]{};
94 Int_t m_n_hits_lay[8][20]{};
95 Int_t m_event_no{};
97
98
99 Int_t m_pmf_chan_hit_counter[8][23][64]{};
100 Int_t m_hit_counter[8]{};
101
102
105
106 std::string m_key_DigitCollection{"ALFA_DigitCollection"};
107 std::string m_key_ODDigitCollection{"ALFA_ODDigitCollection"};
108
109 std::ifstream m_inChan;
110 std::ifstream m_inPMF;
111 std::ifstream m_inOD;
112 std::ifstream m_inDet;
113
114 std::string m_mapname;
115 std::stringstream m_s;
118 std::string m_CanName;
119
121 uint32_t m_chan_i{}, m_chan_j{};
122
123private:
124 //allowed values (m_strMeasuredDataType="testbeam", "tunnel"), default value is "tunnel"
125 //this property is needed due to different mapping in the testbeam and the tunnel data
126 Gaudi::Property<std::string> m_strMeasuredDataType{this, "MeasuredDataType", "tunnel"};
127
128private:
129 std::ofstream m_toFile;
130};
131
132
133#endif
bool m_fiber_b[8][20][64]
StatusCode mapping()
int m_pmf2layer[8][23]
StatusCode recordODCollection()
int m_OD_pmf_maroc2fiber[8][4][64]
uint16_t m_charge_2[8]
std::string m_h_loc3
std::string m_CanName
int m_mapmt2maroc[8][20][64]
std::string m_h_loc1
std::ifstream m_inDet
std::string m_mapname
bool m_trigger_pattern_b[8][16]
std::ifstream m_inPMF
std::ifstream m_inChan
ALFA_DigitCollection * m_digitCollection
std::string m_h_name3
std::ofstream m_toFile
Gaudi::Property< std::string > m_strMeasuredDataType
std::stringstream m_s
ALFA_Raw2Digit(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode recordCollection()
ALFA_ODDigitCollection * m_ODdigitCollection
std::string m_key_ODDigitCollection
Int_t m_hit_counter[8]
std::ifstream m_inOD
uint16_t m_charge_1[8]
StatusCode finalize()
uint32_t m_lumi_block
std::string m_key_DigitCollection
int m_OD_pmf_maroc2side[8][4][64]
Int_t m_pmf_chan_hit_counter[8][23][64]
StatusCode initialize()
int m_maroc2fiber[8][20][64]
StatusCode execute(const EventContext &ctx)
Execute method.
std::vector< bool > m_trigger_pattern
int m_maroc2mapmt[8][20][64]
StatusCode ChanPlot(uint32_t pot_n, uint32_t iLayer, uint32_t MarChan, uint32_t &chan_i, uint32_t &chan_j)
Int_t m_n_hits_lay[8][20]
std::string m_h_name2
std::string m_h_name1
int m_OD_pmf2layer[8][4]
std::string m_h_loc2
Gaudi::Property< std::string > m_ALFA_RawDataCollectionKey
bool m_layer_b[8][20]
TString m_rootOutputFileName
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)