ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibTools
src
LArMphysOverMcalFromTuple.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
LArCalibTools/LArMphysOverMcalFromTuple.h
"
6
7
#include "
LArIdentifier/LArOnlineID.h
"
8
#include "
CaloIdentifier/CaloGain.h
"
9
#include "
LArRawConditions/LArMphysOverMcalComplete.h
"
10
#include "
LArElecCalib/ILArMphysOverMcal.h
"
11
12
#include "TFile.h"
13
#include "TBranch.h"
14
#include "TTree.h"
15
#include "TChain.h"
16
17
#include <vector>
18
#include <iostream>
19
#include <fstream>
20
#include <string>
21
22
23
LArMphysOverMcalFromTuple::~LArMphysOverMcalFromTuple
()
24
=
default
;
25
26
StatusCode
LArMphysOverMcalFromTuple::stop
()
27
{
28
ATH_MSG_INFO
(
"... in stop()"
);
29
30
// get LArOnlineID helper
31
const
LArOnlineID
* onlineHelper =
nullptr
;
32
ATH_CHECK
(
detStore
()->retrieve(onlineHelper,
"LArOnlineID"
) );
33
34
TChain* outfit =
new
TChain(
"outfit"
);
35
for
(
const
std::string& s :
m_root_file_names
) {
36
outfit->Add(s.c_str());
37
}
38
39
// variable names as in the Ntuple
40
Int_t BarAC;
// 0 = barrel C 1 = barrel A
41
Int_t FT;
// feedthrough 0 - 31
42
Int_t Channel;
// 0 - 14
43
Int_t Slot;
// 1 -14
44
Double_t PhysOCal;
// Mphys/Mcal
45
int
gain = 0;
// LARHIGHGAIN = 0, LARMEDIUMGAIN = 1, LARLOWGAIN = 2,
46
47
outfit->SetBranchAddress(
"Channel"
, &Channel);
48
outfit->SetBranchAddress(
"Slot"
, &Slot);
49
outfit->SetBranchAddress(
"FT"
, &FT);
50
outfit->SetBranchAddress(
"BarAC"
, &BarAC);
51
outfit->SetBranchAddress(
"PhysOCal"
, &PhysOCal);
52
53
54
// Create new LArMphysOverMcalComplete
55
LArMphysOverMcalComplete
* container =
new
LArMphysOverMcalComplete
();
56
// container->setGroupingType(LArConditionsContainerBase::FeedThroughGrouping);
57
container->setGroupingType(
LArConditionsContainerBase::ExtendedFTGrouping
);
58
ATH_CHECK
( container->initialize() );
59
60
61
62
63
// loop over entries in the Tuple, one entry = one channel
64
Long64_t nentries = outfit->GetEntries();
65
for
( Int_t i = 0; i < nentries; i++ )
66
{
67
outfit->GetEntry(i);
68
HWIdentifier
id
= onlineHelper->
channel_Id
(0, BarAC, FT, Slot, Channel);
69
container->set(
id
,gain,PhysOCal);
70
}
71
72
73
// store
74
ATH_CHECK
(
detStore
()->record(container,
m_store_key
) );
75
// Symlink LArMphysOverMcalComplete to ILArMphysOverMcal for further use
76
ILArMphysOverMcal
*larMphysOverMcal =
nullptr
;
77
ATH_CHECK
(
detStore
()->symLink(container,larMphysOverMcal) );
78
79
ATH_MSG_INFO
(
"LArMphysOverMcalyFromTuple stopped!"
);
80
81
return
StatusCode::SUCCESS;
82
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
CaloGain.h
ILArMphysOverMcal.h
LArMphysOverMcalComplete.h
LArMphysOverMcalFromTuple.h
LArOnlineID.h
AthCommonAlgorithm< Gaudi::Algorithm >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
Definition
AthCommonDataStore.h:95
HWIdentifier
Definition
HWIdentifier.h:13
ILArMphysOverMcal
Definition
ILArMphysOverMcal.h:13
LArConditionsContainerBase::ExtendedFTGrouping
@ ExtendedFTGrouping
Definition
LArConditionsContainerBase.h:49
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition
LArMphysOverMcalComplete.h:29
LArMphysOverMcalFromTuple::~LArMphysOverMcalFromTuple
virtual ~LArMphysOverMcalFromTuple()
LArMphysOverMcalFromTuple::m_root_file_names
StringArrayProperty m_root_file_names
list of input ntuple file names
Definition
LArMphysOverMcalFromTuple.h:46
LArMphysOverMcalFromTuple::stop
virtual StatusCode stop() override
IAlgorithm::stop() : Where the action takes place...
Definition
LArMphysOverMcalFromTuple.cxx:26
LArMphysOverMcalFromTuple::m_store_key
StringProperty m_store_key
key of the PhysWave collection in StoreGate
Definition
LArMphysOverMcalFromTuple.h:49
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition
LArOnlineID_Base.cxx:1275
LArOnlineID
Definition
LArOnlineID.h:21
Generated on
for ATLAS Offline Software by
1.17.0