ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
TBBPCRec Class Reference

#include <TBBPCRec.h>

Inheritance diagram for TBBPCRec:
Collaboration diagram for TBBPCRec:

Public Member Functions

 TBBPCRec (const std::string &name, ISvcLocator *pSvcLocator)
 
virtual ~TBBPCRec ()
 
virtual StatusCode initialize () override
 
virtual StatusCode execute () override
 
virtual StatusCode finalize () override
 
StatusCode getnewcalib ()
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
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. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

std::string m_SGkey
 
std::string m_SGrecordkey
 
std::string m_calib_filename
 
unsigned int m_runnumber
 
std::vector< std::string > m_bpc_names
 
std::vector< float > m_bpc_calibX
 
std::vector< float > m_bpc_calibY
 
std::vector< float > m_bpc_leftright
 
std::vector< float > m_bpc_updown
 
std::vector< float > m_bpc_udoffset
 
std::vector< float > m_bpc_lroffset
 
std::vector< float > m_bpc_invX
 
std::vector< float > m_bpc_invY
 
std::vector< float > m_tdccutmin
 
std::vector< float > m_tdccutmax
 
std::vector< float > m_tdccutlr
 
std::vector< float > m_tdccutud
 
std::vector< float > m_rotation
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 22 of file TBBPCRec.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TBBPCRec()

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

Definition at line 21 of file TBBPCRec.cxx.

22  :
23  AthAlgorithm(name,pSvcLocator)
24  {
25  // job options
26 
27  declareProperty("SGkey", m_SGkey="BPCRawCont");
28  declareProperty("SGrecordkey", m_SGrecordkey="BPCCont");
29  declareProperty("CalibFileName", m_calib_filename="H6BPCCalib.txt");
30 
31  declareProperty("BPCnames", m_bpc_names);
32  declareProperty("BPCcalibX", m_bpc_calibX);
33  declareProperty("BPCcalibY", m_bpc_calibY);
34  declareProperty("BPCleftright", m_bpc_leftright);
35  declareProperty("BPCupdown", m_bpc_updown);
36  declareProperty("BPCudoffset", m_bpc_udoffset);
37  declareProperty("BPClroffset", m_bpc_lroffset);
38 
39  declareProperty("BPCinvX", m_bpc_invX);
40  declareProperty("BPCinvY", m_bpc_invY);
41  m_runnumber = 0;
42 
43  declareProperty("TDCmin", m_tdccutmin);
44  declareProperty("TDCmax", m_tdccutmax);
45  declareProperty("TDClrcut", m_tdccutlr);
46  declareProperty("TDCudcut", m_tdccutud);
47  declareProperty("BPCRotation", m_rotation);
48  }

◆ ~TBBPCRec()

TBBPCRec::~TBBPCRec ( )
virtual

Definition at line 50 of file TBBPCRec.cxx.

51 { }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

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

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

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

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

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

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

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

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

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

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

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ 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.

95 { return m_detStore; }

◆ evtStore() [1/2]

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.

85 { return m_evtStore; }

◆ evtStore() [2/2]

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

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

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode TBBPCRec::execute ( )
overridevirtual

Definition at line 60 of file TBBPCRec.cxx.

61 {
62  ATH_MSG_DEBUG ( "In execute()" );
63  const EventContext& ctx = Gaudi::Hive::currentContext();
64 
65  // Get run number and get new calib constants -----------------------------
66  unsigned int thisrun=ctx.eventID().run_number();
67 
68  if(thisrun != m_runnumber)
69  {
70  m_runnumber= thisrun;
72  }
73  // ------------------------------------------------------------------------
74 
75  // Reconstruct BPC :
76  TBBPCRawCont * bpcrawCont;
77  StatusCode sc = evtStore()->retrieve(bpcrawCont, m_SGkey);
78  if (sc.isFailure()){
79  ATH_MSG_DEBUG ( "TBObjectReco: Retrieval of "<<m_SGkey<<" failed" );
80  }else {
81  ATH_MSG_DEBUG ( "TBBPCRec : Retrieval of "<<m_SGkey<<" succeed : cont size=" << bpcrawCont->size());
82 
83  TBBPCCont * bpcCont = new TBBPCCont();
84 
85  // Loop over BPC
86  for (const TBBPCRaw * bpcraw : *bpcrawCont) {
87  std::string name = bpcraw->getDetectorName();
88  unsigned int ind=0;
89  // Find calibration index for this BPC
90  while(ind<m_bpc_names.size())
91  {
92  if(name==m_bpc_names[ind]) break;
93  else ind++;
94  }
95  if(ind==m_bpc_names.size()){
96  ATH_MSG_ERROR( "No calibrations for BPC" <<name);
97  continue;
98  }
99 
100  // build new BPC
101  TBBPC * bpc = new TBBPC(name);
102  // hit position
103  float xpos = m_bpc_calibX[ind]*(bpcraw->getTDCLeft()-m_bpc_leftright[ind]*bpcraw->getTDCRight()+m_bpc_lroffset[ind]);
104  // PL at least true for BPC5 y = -y!
105  float ypos = -(m_bpc_calibY[ind]*(bpcraw->getTDCUp()-m_bpc_updown[ind]*bpcraw->getTDCDown()+m_bpc_udoffset[ind]));
106 
107 
108  // perform rotation
109  // PWK 29/06/05 only if m_rotation is set
110 
111  float xposR;
112  float yposR;
113 
114  if (m_rotation.size()>0) {
115  xposR = xpos*cos(m_rotation[ind]) - ypos*sin(m_rotation[ind]);
116  yposR = xpos*sin(m_rotation[ind]) + ypos*cos(m_rotation[ind]);
117  } else {
118  xposR = xpos;
119  yposR = ypos;
120  }
121 
122  ATH_MSG_DEBUG ( "BPC " << name << " PosX = " << xpos << " PosY = " <<ypos );
123  ATH_MSG_DEBUG ( "BPC " << name << " PosXR = " << xposR << " PosYR = " << yposR );
124 
125  bpc->setXPos(xposR);
126  bpc->setYPos(yposR);
127 
128 
129  // pulse
130  bpc->setXPulse(1.*bpcraw->getADCHorizontal());
131  bpc->setYPulse(1.*bpcraw->getADCVertical());
132 
133 
134  // addition September 27 2004
135  // let, in addition to the existing conditions, XPosOverflow and YPosOverflow
136  // be 'true' if either of the left/right or up/down TDC counts falls outside
137  // the range 5 -> 2047
138 
139  // this way, overflows indicate undesirable conditions in general
140 
141  // must find out what causes a real overflow
142 
143  bool xcut = false;
144  bool ycut = false;
145 
146 
147  //PWK 29/06/05 set xcut, ycut true only if TDCmin, TDCmax properties set
148 
149  if (m_tdccutmin.size()>0 && m_tdccutmax.size()>0) {
150 
151  if (bpcraw->getTDCLeft()>m_tdccutmax[ind] || bpcraw->getTDCLeft()<m_tdccutmin[ind]) {xcut = true;}
152  if (bpcraw->getTDCRight()>m_tdccutmax[ind] || bpcraw->getTDCRight()<m_tdccutmin[ind]) {xcut = true;}
153 
154  if (bpcraw->getTDCUp()>m_tdccutmax[ind] || bpcraw->getTDCUp()<m_tdccutmin[ind]) {ycut = true;}
155  if (bpcraw->getTDCDown()>m_tdccutmax[ind] || bpcraw->getTDCDown()<m_tdccutmin[ind]) {ycut = true;}
156 
157  }
158 
159  if (xcut == true)
160  ATH_MSG_INFO ( "TDC left/right out of range " );
161 
162  if (ycut == true)
163  ATH_MSG_INFO ( "TDC up/down out of range " );
164 
165  //PWK 29/06/05 set xcut, ycut true only if TDClrcut, TDCudcut properties set
166 
167  if (m_tdccutlr.size()>0) {
168  if (bpcraw->getTDCLeft()+bpcraw->getTDCRight() < m_tdccutlr[ind])
169  {
170  xcut = true;
171  ATH_MSG_INFO ( "TDC left+right sum below cutoff for BPC " << ind );
172  }
173  }
174  if (m_tdccutud.size()>0) {
175  if (bpcraw->getTDCUp()+bpcraw->getTDCDown() < m_tdccutud[ind])
176  {
177  ycut = true;
178  ATH_MSG_INFO ( "TDC up+down sum below cutoff for BPC " << ind );
179  }
180  }
181 
182  // Overflows
183  bpc->setXPosOverflow(bpcraw->isOverflow(TBBPCRaw::tdcLeft)||bpcraw->isOverflow(TBBPCRaw::tdcRight)||xcut);
184  bpc->setYPosOverflow(bpcraw->isOverflow(TBBPCRaw::tdcUp)||bpcraw->isOverflow(TBBPCRaw::tdcDown)||ycut);
185  bpc->setXPulseOverflow(bpcraw->isOverflow(TBBPCRaw::adcHorizontal));
186  bpc->setYPulseOverflow(bpcraw->isOverflow(TBBPCRaw::adcVertical));
187 
188 
189  bpcCont->push_back(bpc);
190  }
191 
192  sc = evtStore()->record(bpcCont,m_SGrecordkey);
193  if ( sc.isFailure( ) ) {
194  ATH_MSG_FATAL ( "Cannot record BPCCont" );
195  }
196  }
197 
198  if ( sc.isFailure( ) ) {
199  setFilterPassed(false);
200  } else {
201  setFilterPassed(true);
202  }
203 
204  return StatusCode::SUCCESS;
205 
206 }

◆ 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 }

◆ finalize()

StatusCode TBBPCRec::finalize ( )
overridevirtual

Definition at line 210 of file TBBPCRec.cxx.

211 {
212  return StatusCode::SUCCESS;
213 }

◆ getnewcalib()

StatusCode TBBPCRec::getnewcalib ( )

Definition at line 215 of file TBBPCRec.cxx.

216 {
217  // Get calib constant from an ASCII file with the following structure :
218  //
219  // runnumber
220  // bpcnumber1 coeff1 coeff2 ... coeff8
221  // bpcnumber2 coeff1 coeff2 ... coeff8
222  // ...
223  // bpcnumber6 coeff1 coeff2 ... coeff8
224  // runnumber
225  // ...
226  //
227  // coeff must have the following order :
228  // bpcnumber calibX calibY leftright updown lroffset udoffset invX invY
229 
230  ATH_MSG_DEBUG ( "Get new calibs for run " << m_runnumber);
231 
232  int bpcnumber= m_bpc_names.size();
233 
234  m_bpc_calibX.clear(); m_bpc_calibX.resize(bpcnumber);
235  m_bpc_calibY.clear(); m_bpc_calibY.resize(bpcnumber);
236  m_bpc_leftright.clear(); m_bpc_leftright.resize(bpcnumber);
237  m_bpc_updown.clear(); m_bpc_updown.resize(bpcnumber);
238  m_bpc_udoffset.clear(); m_bpc_udoffset.resize(bpcnumber);
239  m_bpc_lroffset.clear(); m_bpc_lroffset.resize(bpcnumber);
240  m_bpc_invX.clear(); m_bpc_invX.resize(bpcnumber);
241  m_bpc_invY.clear(); m_bpc_invY.resize(bpcnumber);
242 
243  int pos;
244 
245  std::ifstream calibfile;
246  std::string filename = PathResolver::find_file (m_calib_filename, "DATAPATH");
247  calibfile.open(filename.c_str());
248  if(!calibfile.good()){
249  ATH_MSG_WARNING ( " Problem with file named "<< m_calib_filename << " in $DATAPATH" );
250  return StatusCode::FAILURE;
251  } else {
252  ATH_MSG_DEBUG ( " file " << filename << " opened" );
253  }
254  unsigned int runnumber;
255  calibfile >> runnumber;
256  pos = calibfile.tellg();
257  ATH_MSG_DEBUG ( " Run number "<< runnumber );
258  while((runnumber<m_runnumber)&&(!calibfile.eof()))
259  {
260  runnumber=0;
261  pos = calibfile.tellg();
262  // discard next lines
263  for(int j=0;j<bpcnumber+1;j++) calibfile.ignore(5000,'\n');
264  // check next runnumber
265  calibfile >> runnumber;
266  if(runnumber==0) {
267  ATH_MSG_DEBUG ( "empty line");
268  calibfile.clear();
269  break;
270  } // reached an empty line : exit.
271  ATH_MSG_DEBUG ( " Run number "<< runnumber );
272  }
273 
274  // Now we found the good set of constant (the ones following pos)
275  if(runnumber==m_runnumber) pos = calibfile.tellg();
276  ATH_MSG_DEBUG ( " Pos = "<< pos );
277  calibfile.seekg(pos);
278  ATH_MSG_DEBUG ( " Will use the following constants :" );
279  for(int j=0;j<bpcnumber;j++)
280  {
281  int bpcn;
282  calibfile >> bpcn;
283  calibfile >> m_bpc_calibX[j];
284  calibfile >> m_bpc_calibY[j];
285  calibfile >> m_bpc_leftright[j];
286  calibfile >> m_bpc_updown[j];
287  calibfile >> m_bpc_lroffset[j];
288  calibfile >> m_bpc_udoffset[j];
289  calibfile >> m_bpc_invX[j];
290  calibfile >> m_bpc_invY[j];
291  ATH_MSG_DEBUG ( bpcn << " "<<m_bpc_calibX[j]
292  << " "<< m_bpc_calibY[j]
293  << " "<< m_bpc_leftright[j]
294  << " "<< m_bpc_updown[j]
295  << " "<< m_bpc_lroffset[j]
296  << " "<< m_bpc_udoffset[j]
297  << " "<< m_bpc_invX[j]
298  << " "<< m_bpc_invY[j] );
299 
300  }
301 
302  calibfile.close();
303 
304  return StatusCode::SUCCESS;
305 
306 }

◆ initialize()

StatusCode TBBPCRec::initialize ( )
overridevirtual

Definition at line 54 of file TBBPCRec.cxx.

55 {
56  return StatusCode::SUCCESS;
57 }

◆ 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() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

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

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ 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.

◆ 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();
383  PBASE::renounce (h);
384  }

◆ 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  {
365  handlesArray.renounce();
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, PyAthena::Alg, and AthHistogramAlgorithm.

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 }

◆ 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) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_bpc_calibX

std::vector<float> TBBPCRec::m_bpc_calibX
private

Definition at line 56 of file TBBPCRec.h.

◆ m_bpc_calibY

std::vector<float> TBBPCRec::m_bpc_calibY
private

Definition at line 57 of file TBBPCRec.h.

◆ m_bpc_invX

std::vector<float> TBBPCRec::m_bpc_invX
private

Definition at line 63 of file TBBPCRec.h.

◆ m_bpc_invY

std::vector<float> TBBPCRec::m_bpc_invY
private

Definition at line 64 of file TBBPCRec.h.

◆ m_bpc_leftright

std::vector<float> TBBPCRec::m_bpc_leftright
private

Definition at line 58 of file TBBPCRec.h.

◆ m_bpc_lroffset

std::vector<float> TBBPCRec::m_bpc_lroffset
private

Definition at line 61 of file TBBPCRec.h.

◆ m_bpc_names

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

Definition at line 54 of file TBBPCRec.h.

◆ m_bpc_udoffset

std::vector<float> TBBPCRec::m_bpc_udoffset
private

Definition at line 60 of file TBBPCRec.h.

◆ m_bpc_updown

std::vector<float> TBBPCRec::m_bpc_updown
private

Definition at line 59 of file TBBPCRec.h.

◆ m_calib_filename

std::string TBBPCRec::m_calib_filename
private

Definition at line 46 of file TBBPCRec.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_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_rotation

std::vector<float> TBBPCRec::m_rotation
private

Definition at line 71 of file TBBPCRec.h.

◆ m_runnumber

unsigned int TBBPCRec::m_runnumber
private

Definition at line 48 of file TBBPCRec.h.

◆ m_SGkey

std::string TBBPCRec::m_SGkey
private

Definition at line 45 of file TBBPCRec.h.

◆ m_SGrecordkey

std::string TBBPCRec::m_SGrecordkey
private

Definition at line 45 of file TBBPCRec.h.

◆ m_tdccutlr

std::vector<float> TBBPCRec::m_tdccutlr
private

Definition at line 68 of file TBBPCRec.h.

◆ m_tdccutmax

std::vector<float> TBBPCRec::m_tdccutmax
private

Definition at line 67 of file TBBPCRec.h.

◆ m_tdccutmin

std::vector<float> TBBPCRec::m_tdccutmin
private

Definition at line 66 of file TBBPCRec.h.

◆ m_tdccutud

std::vector<float> TBBPCRec::m_tdccutud
private

Definition at line 69 of file TBBPCRec.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:
TBBPC::setXPulse
void setXPulse(signal_type theSignal)
Definition: TBBPC.cxx:69
TBBPCRec::m_bpc_lroffset
std::vector< float > m_bpc_lroffset
Definition: TBBPCRec.h:61
TBBPCRec::m_runnumber
unsigned int m_runnumber
Definition: TBBPCRec.h:48
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TBBPCRec::m_bpc_updown
std::vector< float > m_bpc_updown
Definition: TBBPCRec.h:59
TBBPCRaw
raw data class for BPC measurement
Definition: TBBPCRaw.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
TBBPCRec::m_tdccutmax
std::vector< float > m_tdccutmax
Definition: TBBPCRec.h:67
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TBBPC
Definition: TBBPC.h:23
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TBBPCRec::m_calib_filename
std::string m_calib_filename
Definition: TBBPCRec.h:46
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TBBPCRaw::tdcUp
@ tdcUp
Definition: TBBPCRaw.h:46
TBBPC::setYPulse
void setYPulse(signal_type theSignal)
Definition: TBBPC.cxx:74
TBBPCRaw::adcVertical
@ adcVertical
Definition: TBBPCRaw.h:49
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TBBPCRec::m_SGrecordkey
std::string m_SGrecordkey
Definition: TBBPCRec.h:45
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
TBBPCRec::m_bpc_calibY
std::vector< float > m_bpc_calibY
Definition: TBBPCRec.h:57
TBBPC::setXPulseOverflow
void setXPulseOverflow(bool overflow=true)
Definition: TBBPC.cxx:94
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TBBPCRec::m_bpc_leftright
std::vector< float > m_bpc_leftright
Definition: TBBPCRec.h:58
TBBPCRec::m_rotation
std::vector< float > m_rotation
Definition: TBBPCRec.h:71
TBBPCRec::m_bpc_calibX
std::vector< float > m_bpc_calibX
Definition: TBBPCRec.h:56
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TBBPCRec::m_bpc_udoffset
std::vector< float > m_bpc_udoffset
Definition: TBBPCRec.h:60
TBBPCRec::m_SGkey
std::string m_SGkey
Definition: TBBPCRec.h:45
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
TBBPCRec::m_tdccutud
std::vector< float > m_tdccutud
Definition: TBBPCRec.h:69
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TBBPCRaw::adcHorizontal
@ adcHorizontal
Definition: TBBPCRaw.h:48
TBBPCRec::m_bpc_names
std::vector< std::string > m_bpc_names
Definition: TBBPCRec.h:54
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TBBPCRaw::tdcDown
@ tdcDown
Definition: TBBPCRaw.h:47
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TBBPCRec::m_tdccutmin
std::vector< float > m_tdccutmin
Definition: TBBPCRec.h:66
TBBPC::setYPosOverflow
void setYPosOverflow(bool overflow=true)
Definition: TBBPC.cxx:89
TBBPCRaw::tdcLeft
@ tdcLeft
Definition: TBBPCRaw.h:44
DeMoScan.runnumber
runnumber
Definition: DeMoScan.py:266
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TBBPCRec::getnewcalib
StatusCode getnewcalib()
Definition: TBBPCRec.cxx:215
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TBBPC::setXPos
void setXPos(signal_type theSignal)
Definition: TBBPC.cxx:49
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
TBBPCRaw::tdcRight
@ tdcRight
Definition: TBBPCRaw.h:45
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TBBPCRec::m_bpc_invY
std::vector< float > m_bpc_invY
Definition: TBBPCRec.h:64
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TBBPCRec::m_tdccutlr
std::vector< float > m_tdccutlr
Definition: TBBPCRec.h:68
TBBPC::setYPulseOverflow
void setYPulseOverflow(bool overflow=true)
Definition: TBBPC.cxx:99
TBBPCRec::m_bpc_invX
std::vector< float > m_bpc_invX
Definition: TBBPCRec.h:63
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TBBPC::setYPos
void setYPos(signal_type theSignal)
Definition: TBBPC.cxx:54
TBBPC::setXPosOverflow
void setXPosOverflow(bool overflow=true)
Definition: TBBPC.cxx:84
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
fitman.k
k
Definition: fitman.py:528
TBBPCRawCont
Definition: TBBPCRawCont.h:17
TBBPCCont
Definition: TBBPCCont.h:17
ServiceHandle< ICondSvc >