ATLAS Offline Software
Loading...
Searching...
No Matches
CBNT_BeamInstrumentation Class Reference

#include <CBNT_BeamInstrumentation.h>

Inheritance diagram for CBNT_BeamInstrumentation:
Collaboration diagram for CBNT_BeamInstrumentation:

Public Member Functions

 CBNT_BeamInstrumentation (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~CBNT_BeamInstrumentation ()
virtual StatusCode CBNT_initialize () override
virtual StatusCode CBNT_execute () override
virtual StatusCode CBNT_finalize () override
virtual StatusCode CBNT_clear () override
virtual StatusCode initialize () override
virtual StatusCode execute () override
virtual StatusCode finalize () override
virtual StatusCode pre_execute ()
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Types

enum  { NOT_VALID = -999 }

Protected Member Functions

template<class T>
void addBranch (const std::string &branchname, T &obj, const std::string &leaflist)
template<class T>
void addBranch (const std::string &branchname, T *&obj)
template<class T>
void addBranch (const std::string &branchname, T *&obj, int bufferSize, int splitLevel)
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::string m_ntpath
std::string m_ntTitle
TTree * m_nt
MsgStream * m_log
const LArEM_IDm_emId
const LArHEC_IDm_hecId
const LArFCAL_IDm_fcalId
const LArOnlineIDm_onlineId

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::string add_name (const char *base, const std::string &extension)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

bool m_neverReturnFailure
std::string m_containerKey1
std::string m_containerKey2
std::string m_containerKey3
std::string m_containerKey4
std::string m_containerKey5
std::vector< std::string > m_scint_names
std::vector< std::string > m_bpc_names
float * m_scint_adc
float * m_scint_tdc
float * m_bpc_x
float * m_bpc_y
int m_trig
float m_clock
bool m_bpc_raw
float * m_bpc_up
float * m_bpc_down
float * m_bpc_left
float * m_bpc_right
float * m_bpc_adc_hor
float * m_bpc_adc_ver
bool m_trig_array
std::vector< unsigned int > m_triggflag
int m_trig_id
std::vector< long > * m_trig_sel
bool m_initialized
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 12 of file CBNT_BeamInstrumentation.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
NOT_VALID 

Definition at line 56 of file CBNT_TBRecBase.h.

56{NOT_VALID = -999};

Constructor & Destructor Documentation

◆ CBNT_BeamInstrumentation()

CBNT_BeamInstrumentation::CBNT_BeamInstrumentation ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 14 of file CBNT_BeamInstrumentation.cxx.

14 : CBNT_TBRecBase(name, pSvcLocator)
15{
16 declareProperty("ContainerKey1",m_containerKey1="ScintillatorCont");
17 declareProperty("ContainerKey2",m_containerKey2="BPCCont");
18 declareProperty("ContainerKey3",m_containerKey3="BPCRawCont");
19 declareProperty("ContainerKey4",m_containerKey4="TBPhase");
20 declareProperty("ContainerKey5",m_containerKey5="TBTrigPat");
21 declareProperty("BPCRAW", m_bpc_raw=false);
22 declareProperty("BPCnames",m_bpc_names);
23 declareProperty("Scintnames",m_scint_names);
24 declareProperty("TrigArray",m_trig_array=false);
25 declareProperty("TrigPattern",m_triggflag);
26 declareProperty("NeverReturnFailure", m_neverReturnFailure=false);
27 m_scint_adc=NULL;
28 m_scint_tdc=NULL;
29 m_bpc_x=NULL;
30 m_bpc_y=NULL;
31 m_bpc_up=NULL;
32 m_bpc_down=NULL;
33 m_bpc_left=NULL;
34 m_bpc_right=NULL;
35 m_bpc_adc_hor=NULL;
36 m_bpc_adc_ver=NULL;
37 m_trig_sel = 0;
38 m_clock = 0;
39 m_trig = 0;
40 m_trig_id = 0;
41}
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< std::string > m_scint_names
std::vector< std::string > m_bpc_names
std::vector< unsigned int > m_triggflag
CBNT_TBRecBase(const std::string &name, ISvcLocator *pSvcLocator)

◆ ~CBNT_BeamInstrumentation()

CBNT_BeamInstrumentation::~CBNT_BeamInstrumentation ( )
virtual

Definition at line 43 of file CBNT_BeamInstrumentation.cxx.

44{//Clean up arrays of ntuple entries (if they have been booked)
45 if (m_scint_adc)
46 delete[] m_scint_adc;
47 if (m_scint_tdc)
48 delete[] m_scint_tdc;
49 if ( m_bpc_x)
50 delete[] m_bpc_x;
51 if ( m_bpc_y)
52 delete[] m_bpc_y;
53 if (m_bpc_up)
54 delete[] m_bpc_up;
55 if (m_bpc_down)
56 delete[] m_bpc_down;
57 if (m_bpc_right)
58 delete[] m_bpc_right;
59 if (m_bpc_left)
60 delete[] m_bpc_left;
61 if (m_bpc_adc_ver)
62 delete[] m_bpc_adc_ver;
63 if (m_bpc_adc_hor)
64 delete[] m_bpc_adc_hor;
65}

Member Function Documentation

◆ add_name()

std::string CBNT_BeamInstrumentation::add_name ( const char * base,
const std::string & extension )
private

Definition at line 305 of file CBNT_BeamInstrumentation.cxx.

305 {
306 std::string retval(base);
307 for (unsigned i=0;i<extension.size();i++) {
308 const char& ch=extension[i];
309 if (ch=='=' || ch==':' || ch=='/')
310 continue; //Inore these characters
311 else if (ch=='-')
312 retval.append("m");//replace by letter m
313 else if (ch=='+')
314 retval.append("p");//replace by letter p
315 else
316 retval.append(1,ch);
317 }
318 return retval;
319}
std::string base
Definition hcg.cxx:81

◆ addBranch() [1/3]

template<class T>
void CBNT_TBRecBase::addBranch ( const std::string & branchname,
T & obj,
const std::string & leaflist )
inlineprotectedinherited

Definition at line 44 of file CBNT_TBRecBase.h.

44 {
45 m_nt->Branch(branchname.c_str(), &obj, leaflist.c_str());
46 }

◆ addBranch() [2/3]

template<class T>
void CBNT_TBRecBase::addBranch ( const std::string & branchname,
T *& obj )
inlineprotectedinherited

Definition at line 47 of file CBNT_TBRecBase.h.

47 {
48 obj = new T();
49 m_nt->Branch(branchname.c_str(), &obj);
50 }
unsigned long long T

◆ addBranch() [3/3]

template<class T>
void CBNT_TBRecBase::addBranch ( const std::string & branchname,
T *& obj,
int bufferSize,
int splitLevel )
inlineprotectedinherited

Definition at line 51 of file CBNT_TBRecBase.h.

51 {
52 obj = new T();
53 m_nt->Branch(branchname.c_str(), &obj, bufferSize, splitLevel);
54 }

◆ CBNT_clear()

StatusCode CBNT_BeamInstrumentation::CBNT_clear ( )
overridevirtual

Reimplemented from CBNT_TBRecBase.

Definition at line 321 of file CBNT_BeamInstrumentation.cxx.

322{
323 if(m_trig_sel) m_trig_sel->clear();
324 return StatusCode::SUCCESS;
325}

◆ CBNT_execute()

StatusCode CBNT_BeamInstrumentation::CBNT_execute ( )
overridevirtual

Reimplemented from CBNT_TBRecBase.

Definition at line 153 of file CBNT_BeamInstrumentation.cxx.

154{
155 ATH_MSG_DEBUG ( "in execute()" );
156
157 const TBScintillatorCont * scintc = nullptr;
158 StatusCode sc = evtStore()->retrieve(scintc,m_containerKey1);
159 if (sc.isFailure())
160 {
161 ATH_MSG_ERROR ( " Cannot read TBScintillatorCont from StoreGate! key= " << m_containerKey1 );
163 return StatusCode::SUCCESS;
164 } else {
165 return StatusCode::FAILURE;
166 }
167 }
168 else
169 {
170 const unsigned nScint=m_scint_names.size();
171 for (const TBScintillator * scint : *scintc) {
172 const std::string name = scint->getDetectorName();
173 //In the initialize method we build the vectors of ntuple-items for ADCs and BPCs that
174 //the same scintillators have the same index. We search the name-vector and use the index
175 //for m_scint_adc and m_scint_tdc
176 unsigned NtupleVectorIndex;
177 for ( NtupleVectorIndex=0; NtupleVectorIndex!=nScint; NtupleVectorIndex++)
178 if (name==m_scint_names[NtupleVectorIndex]) {
179 // log << MSG::DEBUG << "Scintillator '" << name << "' not found." << endmsg;
180 break;
181 }
182 if (NtupleVectorIndex==nScint)
183 continue; //Name not found for this event
184 //Otherwise: Fill nutple
185 m_scint_adc[NtupleVectorIndex] = scint->getSignal();
186 m_scint_tdc[NtupleVectorIndex] = scint->getTimeSignal();
187 } //end loop over scintillator-container
188 }
189
190 const TBBPCCont * bpcc = nullptr;
191 sc = evtStore()->retrieve(bpcc,m_containerKey2);
192 if (sc.isFailure())
193 {
194 ATH_MSG_ERROR ( " Cannot read TBBPCCont from StoreGate! key= " << m_containerKey2 );
196 return StatusCode::SUCCESS;
197 } else {
198 return StatusCode::FAILURE;
199 }
200 }
201 else
202 {
203 const unsigned nBPCs=m_bpc_names.size();
204 for (const TBBPC * bpc : *bpcc) {
205 std::string name = bpc->getDetectorName();
206 unsigned NtupleVectorIndex;
207 for ( NtupleVectorIndex=0; NtupleVectorIndex!=nBPCs; NtupleVectorIndex++)
208 if (name==m_bpc_names[NtupleVectorIndex])
209 break;
210 if (NtupleVectorIndex==nBPCs)
211 continue; //Name not found for this event
212 //Otherwise: Fill nutple
213 m_bpc_x[NtupleVectorIndex] = bpc->getXPos();
214 m_bpc_y[NtupleVectorIndex] = bpc->getYPos();
215 } //end loop over scintillator container
216 }
217
218 if (m_bpc_raw==true) { //bpc raw
219 TBBPCRawCont * bpccr = nullptr;
220 sc = evtStore()->retrieve(bpccr, m_containerKey3);
221 if (sc.isFailure()){
222 ATH_MSG_ERROR ( " Cannot read TBBPCRawCont from StoreGate! key= " <<m_containerKey3);
223 } else {
224 const unsigned nBPCs=m_bpc_names.size();
225 for (const TBBPCRaw * bpcr : *bpccr) {
226 std::string name = bpcr->getDetectorName();
227 unsigned NtupleVectorIndex;
228 for ( NtupleVectorIndex=0; NtupleVectorIndex!=nBPCs; NtupleVectorIndex++){
229 ATH_MSG_DEBUG (" loading 1");
230 if (name==m_bpc_names[NtupleVectorIndex]){
231 ATH_MSG_DEBUG (" Ntuple Vector"<<NtupleVectorIndex);
232 m_bpc_up[NtupleVectorIndex] = bpcr->getTDCUp();
233 m_bpc_down[NtupleVectorIndex] = bpcr->getTDCDown();
234 m_bpc_right[NtupleVectorIndex] = bpcr->getTDCRight();
235 m_bpc_left[NtupleVectorIndex] = bpcr->getTDCLeft();
236 m_bpc_adc_hor[NtupleVectorIndex] = bpcr->getADCHorizontal();
237 m_bpc_adc_ver[NtupleVectorIndex] = bpcr->getADCVertical();
238 }
239 }
240 }
241 }
242 } //bpcraw
243
244 const TBPhase * phase = nullptr;
245 sc = evtStore()->retrieve(phase,m_containerKey4);
246 if (sc.isFailure())
247 {
248 ATH_MSG_ERROR ( " Cannot read TBPhase from StoreGate! key= " << m_containerKey4 );
250 return StatusCode::SUCCESS;
251 } else {
252 return StatusCode::FAILURE;
253 }
254 }
255 else
256 {
257 m_clock = phase->getPhase();
258 }
259
260 const TBTriggerPatternUnit * trig = nullptr;
261 sc = evtStore()->retrieve(trig,m_containerKey5);
262 if (sc.isFailure())
263 {
264 ATH_MSG_ERROR ( " Cannot read TBTriggerPatternUnit from StoreGate! key= " << m_containerKey5 );
266 return StatusCode::SUCCESS;
267 } else {
268 return StatusCode::FAILURE;
269 }
270 }
271 else
272 {
273 m_trig = trig->getTriggerWord();
274 }
275
276
277 //Trigger Array, returns array of triggers with corresponding 0 or 1 for each event
278
279 if (m_trig_array==true) {
280 unsigned int word =trig->getTriggerWord();
281
282 // Checking if objects in triggflag triggered
284
285 m_trig_sel->reserve(m_triggflag.size()+1);
286 for(int unsigned i=0;i<m_triggflag.size()+1;i++){
287 bool triggbol=0;
288 m_trig_id=i;
289 triggbol=((word & m_triggflag[i])!=0);
290 if(triggbol){
291 (*m_trig_sel)[i]=1;
292 }
293 }
294 }
295
296 return StatusCode::SUCCESS;
297}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
static Double_t sc
unsigned int getTriggerWord() const
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ CBNT_finalize()

StatusCode CBNT_BeamInstrumentation::CBNT_finalize ( )
overridevirtual

Reimplemented from CBNT_TBRecBase.

Definition at line 299 of file CBNT_BeamInstrumentation.cxx.

300{
301 ATH_MSG_DEBUG ( "in finalize()" );
302 return StatusCode::SUCCESS;
303}

◆ CBNT_initialize()

StatusCode CBNT_BeamInstrumentation::CBNT_initialize ( )
overridevirtual

Reimplemented from CBNT_TBRecBase.

Definition at line 67 of file CBNT_BeamInstrumentation.cxx.

68{
69 ATH_MSG_DEBUG ( "in initialize()" );
70
71// NTuple::Tuple* ntuplePtr;
72// ntuplePtr = this->nt();
73 const unsigned nScint=m_scint_names.size();
74 m_scint_adc=new float[nScint];
75 m_scint_tdc=new float[nScint];
76 for (unsigned i=0;i<nScint;i++) {
77 const std::string ADCItemName=add_name("Beam/sADC_",m_scint_names[i]);
78 const std::string ADCItemNameDesc = ADCItemName + "/F";
79// sc=ntuplePtr->addItem(ADCItemName,m_scint_adc[i],0,4095);
80 addBranch(ADCItemName,m_scint_adc[i],ADCItemNameDesc);
81 const std::string TDCItemName=add_name("Beam/sTDC_",m_scint_names[i]);
82 const std::string TDCItemNameDesc=TDCItemName+"/F";
83// sc=ntuplePtr->addItem(TDCItemName,m_scint_tdc[i],0,4095);
84 addBranch(TDCItemName,m_scint_tdc[i],TDCItemNameDesc);
85 }
86
87 const unsigned nBPCs=m_bpc_names.size();
88 m_bpc_x=new float[nBPCs];
89 m_bpc_y=new float[nBPCs];
90 for (unsigned i=0;i<nBPCs;i++) {
91 const std::string BPCxItemName=add_name("Beam/bpcX_",m_bpc_names[i]);
92 const std::string BPCxItemNameDesc=BPCxItemName+"/F";
93// sc = ntuplePtr->addItem (BPCxItemName,m_bpc_x[i],-150,150);
94 addBranch(BPCxItemName,m_bpc_x[i],BPCxItemNameDesc);
95 const std::string BPCyItemName=add_name("Beam/bpcY_",m_bpc_names[i]);
96 const std::string BPCyItemNameDesc=BPCyItemName+"/F";
97 addBranch(BPCyItemName,m_bpc_y[i],BPCyItemNameDesc);
98 }
99
100 // BPC RAW, set to false by default
101 if(m_bpc_raw==true) {// bpc raw
102
103 m_bpc_up=new float[nBPCs];
104 m_bpc_down=new float[nBPCs];
105 m_bpc_left=new float[nBPCs];
106 m_bpc_right=new float[nBPCs];
107 m_bpc_adc_hor=new float[nBPCs];
108 m_bpc_adc_ver=new float[nBPCs];
109
110 for (unsigned i=0;i<nBPCs;i++) {
111 const std::string BPCupItemName=add_name("Beam/bpcUp_",m_bpc_names[i]);
112 const std::string BPCupItemNameDesc=BPCupItemName+"/F";
113// sc = ntuplePtr->addItem(BPCupItemName,m_bpc_up[i],0,2056);
114 addBranch(BPCupItemName,m_bpc_up[i],BPCupItemNameDesc);
115 const std::string BPCdownItemName=add_name("Beam/bpcDown_",m_bpc_names[i]);
116 const std::string BPCdownItemNameDesc=BPCdownItemName+"/F";
117 addBranch(BPCdownItemName,m_bpc_down[i],BPCdownItemNameDesc);
118 const std::string BPCrightItemName=add_name("Beam/bpcRight_",m_bpc_names[i]);
119 const std::string BPCrightItemNameDesc=BPCrightItemName+"/F";
120 addBranch(BPCrightItemName,m_bpc_right[i],BPCrightItemNameDesc);
121 const std::string BPCleftItemName=add_name("Beam/bpcLeft_",m_bpc_names[i]);
122 const std::string BPCleftItemNameDesc=BPCleftItemName+"/F";
123 addBranch(BPCleftItemName,m_bpc_left[i],BPCleftItemNameDesc);
124 const std::string BPChorItemName=add_name("Beam/bpcADCHor_",m_bpc_names[i]);
125 const std::string BPChorItemNameDesc=BPChorItemName+"/F";
126 addBranch(BPChorItemName,m_bpc_adc_hor[i],BPChorItemNameDesc);
127 const std::string BPCverItemName=add_name("Beam/bpcADCVer_",m_bpc_names[i]);
128 const std::string BPCverItemNameDesc=BPCverItemName+"/F";
129 addBranch(BPCverItemName,m_bpc_adc_ver[i],BPCverItemNameDesc);
130 }
131 } //bpcraw
132
133// sc = ntuplePtr->addItem ("Beam/Trigger",m_trig, 0, 20);
134 addBranch("Beam/Trigger",m_trig,"Trigger/I");
135 // trigger array
136 ATH_MSG_DEBUG (" m_trig_array"<<m_trig_array);
137 if (m_trig_array==true) {
138
139 ATH_MSG_DEBUG (" loading array ntuple");
140// sc = ntuplePtr->addItem("Beam/NTrig",m_trig_id,0,50);
141 addBranch("Beam/NTrig",m_trig_id,"Ntrig/I");
142
143// sc = ntuplePtr->addItem("Beam/Trig_Array",m_trig_id,m_trig_sel);
144 addBranch("Beam/Trig_Array",m_trig_sel);
145 }
146
147// sc = ntuplePtr->addItem ("Beam/Clock",m_clock, 0, 10000);
148 addBranch ("Beam/Clock",m_clock, "Clock/F");
149 return StatusCode::SUCCESS;
150
151}
std::string add_name(const char *base, const std::string &extension)
void addBranch(const std::string &branchname, T &obj, const std::string &leaflist)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode CBNT_TBRecBase::execute ( )
overridevirtualinherited

Definition at line 154 of file CBNT_TBRecBase.cxx.

154 {
155
157
158 // run pre-execution
159 try {
160 sc = this->pre_execute();
161 }
162
163 catch( const std::exception& Exception ) {
164 *m_log << MSG::ERROR << " Standard exception "
165 << Exception.what()
166 << " caught from sub-algorithm::CBNT_pre_execute (). Disable !" << endmsg ;
167 sc = this->setProperty(BooleanProperty( "Enable",false ) );
168 return StatusCode::FAILURE;
169
170 }
171 catch (...) {
172 *m_log << MSG::ERROR << " Unknown exception "
173 << " caught from sub-algorithm::CBNT_pre_execute (). Disable !" << endmsg ;
174 sc = this->setProperty(BooleanProperty( "Enable",false ) );
175 return StatusCode::FAILURE;
176 }
177
178 if (sc.isFailure()) {
179 *m_log << MSG::ERROR << "CBNT_pre_execute() failed. Disable !" << endmsg;
180 sc = this->setProperty(BooleanProperty( "Enable",false ) );
181 return sc;
182 }
183
184 // now subalgorithm execution
185 try {
186 sc = this->CBNT_execute();
187 }
188
189 catch( const std::exception& Exception ) {
190 *m_log << MSG::ERROR << " Standard exception "
191 << Exception.what()
192 << " caught from sub-algorithm::CBNT_execute () :" << endmsg ;
193 return StatusCode::FAILURE;
194 }
195 catch (...) {
196 *m_log << MSG::ERROR << " Unknown exception "
197 << " caught from sub-algorithm::CBNT_execute () :" << endmsg ;
198 return StatusCode::FAILURE;
199 }
200
201 return sc;
202}
#define endmsg
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
virtual StatusCode CBNT_execute()
MsgStream * m_log
virtual StatusCode pre_execute()

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ finalize()

StatusCode CBNT_TBRecBase::finalize ( )
overridevirtualinherited

Definition at line 205 of file CBNT_TBRecBase.cxx.

205 {
206
208
209 //now subalgorithm finalisation
210 try {
211 sc = this->CBNT_finalize();
212 }
213 catch( const std::exception& Exception ) {
214 *m_log << MSG::ERROR << " Standard exception "
215 << Exception.what()
216 << " caught from sub-algorithm::CBNT_finalize () :" << endmsg ;
217 }
218 catch (...) {
219 *m_log << MSG::ERROR << " Unknown exception "
220 << " caught from sub-algorithm::CBNT_finalize () :" << endmsg ;
221 }
222
223 return sc;
224}
virtual StatusCode CBNT_finalize()

◆ initialize()

StatusCode CBNT_TBRecBase::initialize ( )
overridevirtualinherited

Definition at line 22 of file CBNT_TBRecBase.cxx.

22 {
23 m_log=new MsgStream(msgSvc(), name());
24
25 *m_log << MSG::DEBUG << "Initializing CBNT_TBRecBase base class" << endmsg;
26
27 const CaloCell_ID* idHelper = nullptr;
28 ATH_CHECK( detStore()->retrieve (idHelper, "CaloCell_ID") );
29 m_emId=idHelper->em_idHelper();
30 m_fcalId=idHelper->fcal_idHelper();
31 m_hecId=idHelper->hec_idHelper();
32
33
34 if (!m_emId) {
35 (*m_log) << MSG::ERROR << "Could not access lar EM ID helper" << endmsg;
36 return StatusCode::FAILURE;
37 }
38 if (!m_fcalId) {
39 (*m_log) << MSG::ERROR << "Could not access lar FCAL ID helper" << endmsg;
40 return StatusCode::FAILURE;
41 }
42 if (!m_hecId) {
43 (*m_log) << MSG::ERROR << "Could not access lar HEC ID helper" << endmsg;
44 return StatusCode::FAILURE;
45 }
46
47 StatusCode sc = detStore()->retrieve(m_onlineId, "LArOnlineID");
48 if (sc.isFailure()) {
49 (*m_log) << MSG::ERROR << "Could not get LArOnlineID helper !" << endmsg;
50 return StatusCode::FAILURE;
51 }
52 else {
53 (*m_log) << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
54 }
55
56
57 m_initialized=true;
58 return StatusCode::SUCCESS;
59}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
const LArOnlineID * m_onlineId
const LArFCAL_ID * m_fcalId
const LArEM_ID * m_emId
const LArHEC_ID * m_hecId
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition CaloCell_ID.h:75
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition CaloCell_ID.h:63
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition CaloCell_ID.h:69
msgSvc
Provide convenience handles for various services.
Definition StdJOSetup.py:36

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ pre_execute()

StatusCode CBNT_TBRecBase::pre_execute ( )
virtualinherited

Definition at line 61 of file CBNT_TBRecBase.cxx.

61 {
62
64
65 if(!m_initialized) {
66
67 if (m_ntpath.size()==0 || m_ntTitle.size()==0) {
68 *m_log << MSG::ERROR << "Need to set variable 'm_ntpath' and 'm_ntTitle' in constructor of deriving class!" << endmsg;
69 return StatusCode::FAILURE;
70 }
71
72 size_t i=m_ntpath.rfind('/');
73 if (i==std::string::npos) {
74 *m_log << MSG::ERROR << "Expected at least on '/' in path " << m_ntpath << endmsg;
75 return StatusCode::FAILURE;
76 }
77 std::string basepath(m_ntpath.begin(),m_ntpath.begin()+i);
78 //std::cout << "Basepath" << basepath << std::endl;
79
80 // retrieve pointer to THistSvc
81 ServiceHandle<ITHistSvc> tHistSvc("THistSvc", name());
82 ATH_CHECK( tHistSvc.retrieve() );
83
84 // get TTree
85 sc = tHistSvc->getTree(m_ntpath,m_nt);
86 if (sc.isFailure()) {
87 *m_log << MSG::ERROR << "Unable to retrieve TTree : " << m_ntpath << endmsg;
88 return sc;
89 }
90 /*
91 NTupleFilePtr file1(ntupleSvc(),basepath);
92 if (!file1){
93 (*m_log) << MSG::ERROR << "Could not get NTupleFilePtr with path " << basepath << " failed" << endmsg;
94 return StatusCode::FAILURE;
95 }
96 NTuplePtr nt(ntupleSvc(),m_ntpath);
97 if (!nt) {
98 nt=ntupleSvc()->book(m_ntpath,CLID_ColumnWiseTuple,m_ntTitle);
99 }
100 if (!nt){
101 (*m_log) << MSG::ERROR << "Booking of NTuple at "<< m_ntpath << " and name " << m_ntTitle << " failed" << endmsg;
102 return StatusCode::FAILURE;
103 }
104 m_nt=nt;
105 */
106 //std::cout << "Ntuple ptr:" << m_nt << std::endl;
107
108 // subalgorithm initialisation
109 try {
110 sc = this->CBNT_initialize();
111 }
112 catch( const std::exception& Exception ) {
113 *m_log << MSG::ERROR << " Standard exception "
114 << Exception.what()
115 << " caught from sub-algorithm::CBNT_initialize () :" << endmsg ;
116 }
117 catch (...) {
118 *m_log << MSG::ERROR << " Unknown exception "
119 << " caught from sub-algorithm::CBNT_initialize () :" << endmsg ;
120 }
121
122 if (sc.isFailure())
123 {
124 *m_log << MSG::ERROR << "CBNT_initialize() failed" << endmsg;
125 return sc;
126 }
127
128 m_initialized=true;
129 }
130
131 // clear data members
132 try {
133 sc = this->CBNT_clear();
134 }
135 catch( const std::exception& Exception ) {
136 *m_log << MSG::ERROR << " Standard exception "
137 << Exception.what()
138 << " caught from sub-algorithm::CBNT_clear () :" << endmsg ;
139 }
140 catch (...) {
141 *m_log << MSG::ERROR << " Unknown exception "
142 << " caught from sub-algorithm::CBNT_clear () :" << endmsg ;
143 }
144
145 if (sc.isFailure()) {
146 *m_log << MSG::ERROR << "CBNT_clear() failed" << endmsg;
147 return sc;
148 }
149
150 return StatusCode::SUCCESS ;
151}
std::string m_ntTitle
virtual StatusCode CBNT_clear()
std::string m_ntpath
virtual StatusCode CBNT_initialize()

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_bpc_adc_hor

float * CBNT_BeamInstrumentation::m_bpc_adc_hor
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_adc_ver

float * CBNT_BeamInstrumentation::m_bpc_adc_ver
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_down

float * CBNT_BeamInstrumentation::m_bpc_down
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_left

float * CBNT_BeamInstrumentation::m_bpc_left
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_names

std::vector<std::string> CBNT_BeamInstrumentation::m_bpc_names
private

Definition at line 35 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_raw

bool CBNT_BeamInstrumentation::m_bpc_raw
private

Definition at line 42 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_right

float * CBNT_BeamInstrumentation::m_bpc_right
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_up

float* CBNT_BeamInstrumentation::m_bpc_up
private

Definition at line 43 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_x

float * CBNT_BeamInstrumentation::m_bpc_x
private

Definition at line 37 of file CBNT_BeamInstrumentation.h.

◆ m_bpc_y

float * CBNT_BeamInstrumentation::m_bpc_y
private

Definition at line 37 of file CBNT_BeamInstrumentation.h.

◆ m_clock

float CBNT_BeamInstrumentation::m_clock
private

Definition at line 39 of file CBNT_BeamInstrumentation.h.

◆ m_containerKey1

std::string CBNT_BeamInstrumentation::m_containerKey1
private

Definition at line 29 of file CBNT_BeamInstrumentation.h.

◆ m_containerKey2

std::string CBNT_BeamInstrumentation::m_containerKey2
private

Definition at line 30 of file CBNT_BeamInstrumentation.h.

◆ m_containerKey3

std::string CBNT_BeamInstrumentation::m_containerKey3
private

Definition at line 31 of file CBNT_BeamInstrumentation.h.

◆ m_containerKey4

std::string CBNT_BeamInstrumentation::m_containerKey4
private

Definition at line 32 of file CBNT_BeamInstrumentation.h.

◆ m_containerKey5

std::string CBNT_BeamInstrumentation::m_containerKey5
private

Definition at line 33 of file CBNT_BeamInstrumentation.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emId

const LArEM_ID* CBNT_TBRecBase::m_emId
protectedinherited

Definition at line 65 of file CBNT_TBRecBase.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fcalId

const LArFCAL_ID* CBNT_TBRecBase::m_fcalId
protectedinherited

Definition at line 67 of file CBNT_TBRecBase.h.

◆ m_hecId

const LArHEC_ID* CBNT_TBRecBase::m_hecId
protectedinherited

Definition at line 66 of file CBNT_TBRecBase.h.

◆ m_initialized

bool CBNT_TBRecBase::m_initialized
privateinherited

Definition at line 40 of file CBNT_TBRecBase.h.

◆ m_log

MsgStream* CBNT_TBRecBase::m_log
protectedinherited

Definition at line 63 of file CBNT_TBRecBase.h.

◆ m_neverReturnFailure

bool CBNT_BeamInstrumentation::m_neverReturnFailure
private

Definition at line 27 of file CBNT_BeamInstrumentation.h.

◆ m_nt

TTree* CBNT_TBRecBase::m_nt
protectedinherited

Definition at line 61 of file CBNT_TBRecBase.h.

◆ m_ntpath

std::string CBNT_TBRecBase::m_ntpath
protectedinherited

Definition at line 58 of file CBNT_TBRecBase.h.

◆ m_ntTitle

std::string CBNT_TBRecBase::m_ntTitle
protectedinherited

Definition at line 58 of file CBNT_TBRecBase.h.

◆ m_onlineId

const LArOnlineID* CBNT_TBRecBase::m_onlineId
protectedinherited

Definition at line 68 of file CBNT_TBRecBase.h.

◆ m_scint_adc

float* CBNT_BeamInstrumentation::m_scint_adc
private

Definition at line 37 of file CBNT_BeamInstrumentation.h.

◆ m_scint_names

std::vector<std::string> CBNT_BeamInstrumentation::m_scint_names
private

Definition at line 34 of file CBNT_BeamInstrumentation.h.

◆ m_scint_tdc

float * CBNT_BeamInstrumentation::m_scint_tdc
private

Definition at line 37 of file CBNT_BeamInstrumentation.h.

◆ m_trig

int CBNT_BeamInstrumentation::m_trig
private

Definition at line 38 of file CBNT_BeamInstrumentation.h.

◆ m_trig_array

bool CBNT_BeamInstrumentation::m_trig_array
private

Definition at line 46 of file CBNT_BeamInstrumentation.h.

◆ m_trig_id

int CBNT_BeamInstrumentation::m_trig_id
private

Definition at line 49 of file CBNT_BeamInstrumentation.h.

◆ m_trig_sel

std::vector<long>* CBNT_BeamInstrumentation::m_trig_sel
private

Definition at line 50 of file CBNT_BeamInstrumentation.h.

◆ m_triggflag

std::vector<unsigned int> CBNT_BeamInstrumentation::m_triggflag
private

Definition at line 47 of file CBNT_BeamInstrumentation.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: