31 const std::vector<int> FEBs={0x39000000, 0x39010000, 0x39018000, 0x39020000, 0x39028000, 0x39030000, 0x39038000, 0x39040000, 0x39048000, 0x39050000, 0x39058000, 0x39060000, 0x39068000};
41 ATH_MSG_WARNING (
" Too many points specified vs the expected content of the ntuple ! " );
49 outfit->SetBranchAddress(
"delay", &
delay);
50 outfit->SetBranchAddress(
"febId", &febid);
51 Long64_t nentries = outfit->GetEntries();
52 std::map<int,int> tmpmap;
53 std::vector<int> febvec;
54 for(Long64_t i = 0; i < nentries; ++i ){
57 if(std::find(febvec.begin(), febvec.end(), febid) == febvec.end()) febvec.push_back(febid);
59 unsigned ndelays = tmpmap.size();
60 if(febvec.size() > 13) {
62 return StatusCode::FAILURE;
69 std::vector<int> *Amplitude =
nullptr;
70 outfit->SetBranchAddress(
"febChannel", &febchannel);
71 outfit->SetBranchAddress(
"gain", &gain);
72 outfit->SetBranchAddress(
"dac", &dac);
73 outfit->SetBranchAddress(
"ADC", &Amplitude);
76 auto larCaliWaveContainerNew = std::make_unique<LArCaliWaveContainer>();
78 ATH_CHECK ( larCaliWaveContainerNew->initialize() );
81 typedef std::map<HWIdentifier,std::map<std::pair<short, int> , std::vector<long int> > > Wavesmap_t;
85 for ( Long64_t iev = 0; iev < nentries; ++iev ) {
86 outfit->GetEvent(iev);
90 auto it = std::find(febvec.begin(), febvec.end(), febid);
91 unsigned int index= it - febvec.begin();
93 ATH_MSG_DEBUG (
"onlineid created " << std::hex <<
id << std::dec);
94 std::pair<short, int> idpair=std::make_pair(gain,dac);
96 if( ! wavesum.count(
id) || ! wavesum[
id].count(idpair)) {
98 wavesum[id][idpair].reserve(totpoints * ndelays);
99 wavesum2[id][idpair].reserve(totpoints * ndelays);
100 wavensum[id][idpair].reserve(totpoints * ndelays);
101 for (
unsigned int i = 0; i < totpoints * ndelays; ++i ){
102 wavesum[id][idpair][i]=0;
103 wavesum2[id][idpair][i]=0;
104 wavensum[id][idpair][i]=0;
108 for (
unsigned int i = 0; i <
upper; ++i) {
119 double dt=
m_dt.value();
120 for(
auto & [hwid, wmap] : wavesum) {
122 for(
auto dgkey : std::views::keys(wavesum[hwid])) {
123 auto dac = dgkey.second;
124 auto gain = dgkey.first;
126 std::vector<double> amp(totpoints * ndelays, 0.);
127 std::vector<double> err(totpoints * ndelays, 0.);
128 std::vector<int> ntrig(totpoints * ndelays, 0);
129 for(
unsigned int i=0; i< totpoints * ndelays; ++i) {
130 if(wavensum[hwid][dgkey][i] > 0) {
131 amp[i] = (double)wavesum[hwid][dgkey][i] / wavensum[hwid][dgkey][i];
132 err[i] = std::sqrt((
double)wavesum2[hwid][dgkey][i] / wavensum[hwid][dgkey][i] - amp[i]*amp[i]);
133 ntrig[i] = wavensum[hwid][dgkey][i];
147 return StatusCode::SUCCESS;