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

#include <TileL2Builder.h>

Inheritance diagram for TileL2Builder:
Collaboration diagram for TileL2Builder:

Public Member Functions

 TileL2Builder (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~TileL2Builder () override
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode process (int fragmin, int fragmax, TileL2Container *l2Container) const
 
virtual StatusCode process (int fragmin, int fragmax, TileL2Container *l2Container, const EventContext &ctx) const
 
int indexToId (int i) const
 Return collection ID for a given index
More...
 
int idToIndex (int id) const
 
void MaskBad (int partition, float *E, int *gain, bool *bad) const
 function which does bad channel masking: if one channel of a cell is bad, energy from second channel is taken if both channels are bad, zero energy is assigned to both channels More...
 
void MTagLB (int partition, int drawer, float *EMeV, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
 Muon tagging function for LB superdrawers as processed at the ROD DSPs. More...
 
void MTagLB (int partition, int drawer, float *EMeV, int *gain, bool *bad, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
 
void MTagEB (int partition, int drawer, float *EMeV, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
 Muon tagging function for EB superdrawers as processed at the ROD DSPs. More...
 
void MTagEB (int partition, int drawer, float *EMeV, int *gain, bool *bad, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
 
void SumE (int partition, int drawer, float *E, std::vector< float > &sumE) const
 SumE function for one superdrawer as processed at the ROD DSPs. More...
 
void SumE (int partition, int drawer, int unit, float *E, int *gain, std::vector< float > &sumE) const
 
void SumE (int partition, int drawer, int unit, float *E, int *gain, bool *bad, std::vector< float > &sumE) const
 
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 sysInitialize () override
 Perform system initialization for an algorithm. 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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

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

Protected Attributes

SG::ReadHandleKey< TileRawChannelContainerm_rawChannelContainerKey
 TileRawChannelContainer in event store. More...
 
float m_noiseThreshold
 
int m_noiseType
 
const TileHWIDm_tileHWID
 Pointer to TileHWID. More...
 
SG::ReadCondHandleKey< TileEMScalem_emScaleKey
 Name of TileEMScale in condition store. More...
 
SG::ReadCondHandleKey< TileBadChannelsm_badChannelsKey
 Name of TileBadChannels in condition store. More...
 
TileFragHash m_hashFunc
 
float m_sinTh [4][48]
 
float m_sinThRound [4][48]
 
float m_cosTh [4][48]
 
float m_cosThRound [4][48]
 
bool m_connected [4][48]
 
int m_channelPairs [4][48]
 

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

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 44 of file TileL2Builder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TileL2Builder()

TileL2Builder::TileL2Builder ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 52 of file TileL2Builder.cxx.

55  , m_noiseThreshold(100.0) // 100 MeV universal cut for now
56  , m_noiseType(9999) // this huge value means that noise cut is taken from JO
57  , m_tileHWID(nullptr)
58 {
59 
60  declareInterface<TileL2Builder>(this);
61 
62  declareProperty("NoiseThreshold", m_noiseThreshold); // use channels only above noise cut
63  declareProperty("Noise", m_noiseType); // choose between electronic or total noise
64 }

◆ ~TileL2Builder()

TileL2Builder::~TileL2Builder ( )
overridevirtual

Definition at line 66 of file TileL2Builder.cxx.

66  {
67 }

Member Function Documentation

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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< AlgTool > >::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; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::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

◆ finalize()

StatusCode TileL2Builder::finalize ( )
overridevirtual

Definition at line 284 of file TileL2Builder.cxx.

284  {
285 
286  ATH_MSG_INFO( "Finalizing" );
287 
288  return StatusCode::SUCCESS;
289 }

◆ idToIndex()

int TileL2Builder::idToIndex ( int  id) const
inline

Definition at line 66 of file TileL2Builder.h.

66  {
67  return m_hashFunc(id);
68  }

◆ indexToId()

int TileL2Builder::indexToId ( int  i) const
inline

Return collection ID for a given index

Definition at line 62 of file TileL2Builder.h.

62  {
63  return m_hashFunc.identifier(i);
64  }

◆ initialize()

StatusCode TileL2Builder::initialize ( )
overridevirtual

Definition at line 69 of file TileL2Builder.cxx.

69  {
70 
72 
75 
76  // Initialize
78 
79  const TileID* tileID = nullptr;
80  ATH_CHECK( detStore()->retrieve(tileID) );
81 
82  const TileTBID* tileTBID = nullptr;
83  ATH_CHECK( detStore()->retrieve(tileTBID) );
84 
85  // retrieve Tile detector manager and TileID helper from det store
86  const TileDetDescrManager* tileMgr = nullptr;
87  ATH_CHECK( detStore()->retrieve(tileMgr) );
88 
89  ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name());
90  ATH_CHECK( cablingSvc.retrieve());
91 
92  const TileCablingService* cabling = cablingSvc->cablingService();
93  if (!cabling) {
94  ATH_MSG_ERROR( "Unable to retrieve TileCablingService" );
95  return StatusCode::FAILURE;
96  }
97 
98  for (int ros = 0; ros < 4; ++ros) {
99  for (int ch = 0; ch < 48; ++ch) {
100  m_channelPairs[ros][ch] = ch;
101  m_connected[ros][ch] = true;
102  }
103  }
104 
105  int drawer = 0;
106  for (int ros = 1; ros < 5; ++ros) {
107  int ros1 = ros - 1;
108  for (int ch = 0; ch < 48; ++ch) {
110  Identifier cell_id = cabling->h2s_cell_id(ch_id);
111 
112  if (cell_id.is_valid()
113  && !tileTBID->is_tiletb(cell_id)
114  && tileID->sample(cell_id) != TileID::SAMP_E) {
115 
116  m_sinTh[ros1][ch] = tileMgr->get_cell_element(cell_id)->sinTh();
117  m_sinThRound[ros1][ch] = round(m_sinTh[ros1][ch] * 32768) / 32768.; // set 15 bit presision a-la DSP
118  m_cosTh[ros1][ch] = fabs(tileMgr->get_cell_element(cell_id)->cosTh()); // Always positive !!!
119  m_cosThRound[ros1][ch] = round(m_cosTh[ros1][ch] * 32768) / 32768.; // set 15 bit presision a-la DSP
120 
121  Identifier pmt1_id = tileID->pmt_id(cell_id, 0);
122  Identifier pmt2_id = tileID->pmt_id(cell_id, 1);
123  HWIdentifier ch1_id = cabling->s2h_channel_id(pmt1_id);
124  HWIdentifier ch2_id = cabling->s2h_channel_id(pmt2_id);
125  int ch1 = m_tileHWID->channel(ch1_id);
126  int ch2 = m_tileHWID->channel(ch2_id);
127  if (ch1 != ch && ch2 != ch) {
128  ATH_MSG_ERROR( "wrong cabling! ch=" << ch
129  << " ch1=" << ch1
130  << " ch2=" << ch2 );
131 
132  } else {
133  m_channelPairs[ros1][ch1] = ch2;
134  m_channelPairs[ros1][ch2] = ch1;
135  }
136 
137  ATH_MSG_VERBOSE( "ros=" << ros
138  << " ch=" << ch
139  << " tower=" << tileID->tower(cell_id)
140  << " sample=" << tileID->sample(cell_id)
141  << " sinTh=" << m_sinThRound[ros1][ch]
142  << " cosTh=" << m_cosThRound[ros1][ch]
143  << " channels in a cell: " << ch1 << " " << ch2 );
144 
145  } else {
146  m_sinTh[ros1][ch] = 0.0;
147  m_sinThRound[ros1][ch] = 0;
148  m_cosTh[ros1][ch] = 0.0;
149  m_cosThRound[ros1][ch] = 0;
150  m_connected[ros1][ch] = false;
151  ATH_MSG_VERBOSE( "ros=" << ros
152  << " ch=" << ch
153  << " sinTh=" << m_sinThRound[ros1][ch]
154  << " cosTh=" << m_cosThRound[ros1][ch] );
155  }
156  }
157  }
158 
160 
161  ATH_MSG_INFO( "TileL2Builder initialization completed" );
162 
163  return StatusCode::SUCCESS;
164 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ interfaceID()

const InterfaceID & TileL2Builder::interfaceID ( )
static

Definition at line 48 of file TileL2Builder.cxx.

48  {
49  return IID_ITileL2Builder;
50 }

◆ MaskBad()

void TileL2Builder::MaskBad ( int  partition,
float *  E,
int *  gain,
bool *  bad 
) const

function which does bad channel masking: if one channel of a cell is bad, energy from second channel is taken if both channels are bad, zero energy is assigned to both channels

Parameters
partitionpartition (1=LBA, 2=LBC, 3=EBA, 4=EBC)
Eenergy for all channels - on return it will contain corrected values
gaingain for all channels - on return it will contain corrected values
badbad flag for all channels

Definition at line 754 of file TileL2Builder.cxx.

754  {
755  for (int i = 0; i < 48; ++i) {
756  if (bad[i]) {
757  int j = m_channelPairs[ros - 1][i];
758  if (bad[j]) { // both bad or i=j (i.e. single channel)
759  E[i] = E[j] = 0.0;
760  gain[i] = gain[j] = -1;
761  } else {
762  E[i] = E[j]; // copy from second channel
763  gain[i] = gain[j];
764  }
765  }
766  }
767  return;
768 }

◆ msg() [1/2]

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::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< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

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

◆ MTagEB() [1/2]

void TileL2Builder::MTagEB ( int  partition,
int  drawer,
float *  EMeV,
int *  gain,
bool *  bad,
std::vector< float > &  EtaMuons,
std::vector< float > &  EMuons0,
std::vector< float > &  EMuons1,
std::vector< float > &  EMuons2,
std::vector< unsigned int > &  qf,
std::vector< unsigned int > &  extraWord 
) const
inline

Definition at line 139 of file TileL2Builder.h.

149  {
150  MaskBad(partition, EMeV, gain, bad);
151  MTagEB(partition, drawer, EMeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
152  }

◆ MTagEB() [2/2]

void TileL2Builder::MTagEB ( int  partition,
int  drawer,
float *  EMeV,
std::vector< float > &  EtaMuons,
std::vector< float > &  EMuons0,
std::vector< float > &  EMuons1,
std::vector< float > &  EMuons2,
std::vector< unsigned int > &  qf,
std::vector< unsigned int > &  extraWord 
) const

Muon tagging function for EB superdrawers as processed at the ROD DSPs.

Parameters
EMeVCalibrated energy (in MeV) for all channels
EtaMuonsMuons eta coordinate
EMuons0Energy (in MeV) deposited by the muons in A cells
EMuons1Energy (in MeV) deposited by the muons in B cells
EMuons2Energy (in MeV) deposited by the muons in D cells
qfQuality factor
extraWordEncoded 32-bit words with muon info

Definition at line 475 of file TileL2Builder.cxx.

483  {
484 
485  // Maximum number of muons tagged per superdrawer
486  int cut = 4;
487 
488  // Energy thresholds (MeV)
489  int Eth_low = 150;
490  int Eth_EB_A[4] = { 810, 1140, 1230, 1380 };
491  int Eth_EB_BC[5] = { 1050, 1380, 1440, 1500, 1680 };
492  int Eth_EB_D[2] = { 2100, 2370 };
493 
494  // Eta cells
495  float eta_EB_A[4] = { 1.15, 1.25, 1.35, 1.45 }; // A12, A13, A14, A15
496  float eta_EB_BC[5] = { 1.05, 1.15, 1.25, 1.35, 1.45 }; // B11, B12, B13, B14, B15
497  float eta_EB_D[2] = { 1.00, 1.20 }; // D5, D6
498 
499  // D cells to B cells in EB
500  int cell32[2 * 6] = {
501  3, 0, 1, 2, 0, 0, // D5 -> B11, B12, B13
502  5, 0, 1, 2, 3, 4 // D6 -> B11, B12, B13, B14, B15
503  };
504 
505  // B cells to A cells in EB
506  int cell21[5 * 4] = {
507  1, 0, 0, 0, // B11 -> A12
508  2, 0, 1, 0, // B12 -> A12, A13
509  3, 0, 1, 2, // B13 -> A12, A13, A14
510  3, 1, 2, 3, // B14 -> A13, A14, A15
511  2, 2, 3, 0 // B15 -> A14, A15
512  };
513 
514  drawer = drawer % 2;
515 
516  int NMuons = 0;
517  int quality;
518  int pattern = 0;
519 
520  int k2, ks, ksto2, k1, ksto1;
521  int cand = 0;
522 
523  unsigned int cquality[4] = { 0 };
524  unsigned int flquality[4] = { 0 };
525  unsigned int aquality[4] = { 0 };
526 
527  int eta[4] = { 0 };
528  int splited[4] = { 0 };
529  int found[4] = { 0 };
530 
531  float E_A[4];
532  float E_BC[5];
533  float E_D[2];
534 
535  /* A cells */
536 
537  E_A[0] = E[6] + E[7]; // A12
538  E_A[1] = E[10] + E[11]; // A13
539  E_A[2] = E[20] + E[21]; // A14
540  E_A[3] = E[31] + E[32]; // A15
541 
542  /* B cells */
543 
544  E_BC[0] = E[8] + E[9]; // B11
545  E_BC[1] = E[14] + E[15]; // B12
546  E_BC[2] = E[22] + E[23]; // B13
547  E_BC[3] = E[30] + E[35]; // B14
548  E_BC[4] = E[36] + E[39]; // B15
549 
550  /* D cells */
551 
552  E_D[0] = E[16] + E[17]; // D5
553  E_D[1] = E[37] + E[38]; // D6
554 
555  /* Define candidates */
556 
557  for (int i = 0; i < 2; i++) { // loop over D cells
558  if (E_D[i] >= Eth_low) {
559  eta[cand] = i;
560  splited[cand] = -1;
561  cquality[cand] = E_D[i] < Eth_EB_D[i] ? 0 : 1;
562  cand++;
563  }
564  }
565 
566  /* Repair for muons splitted */
567 
568  if (cand > 4) std::abort();
569  for (int i = 0; i < cand; i++) {
570  for (int j = 0; j < i; j++) {
571  if ((cquality[i] + cquality[j]) == 0) {
572  if (abs(eta[i] - eta[j]) <= 1
573  && (E_D[eta[i]] + E_D[eta[j]])
574  < (Eth_EB_D[eta[i]] > Eth_EB_D[eta[j]] ? Eth_EB_D[eta[i]] : Eth_EB_D[eta[j]])) {
575 
576  splited[i] = j;
577  }
578  } else if ((cquality[i] + cquality[j]) == 1) {
579  if (abs(eta[i] - eta[j]) <= 1) {
580  splited[i] = j;
581  }
582  }
583  }
584  }
585 
586  /* Loop on the candidates */
587 
588  for (int i = 0;
589  (i < cand && splited[i] < 0) || ((i < cand && splited[i] >= 0) && found[splited[i]] == 0);
590  i++) {
591 
592  found[i] = 0;
593 
594  ksto2 = cell32[6 * eta[i]];
595 
596  for (ks = 1; ks <= ksto2 && found[i] != 1; ks++) {
597 
598  // eta position BC cell with a muon candidate
599  k2 = cell32[6 * eta[i] + ks];
600 
601  // Lower threshold BC cells
602  if (E_BC[k2] > Eth_low) {
603 
604  flquality[i] = (E_BC[k2] < Eth_EB_BC[k2] ? 0 : 1);
605  ksto1 = cell21[4 * k2 + 0];
606 
607  for (int kp = 1; kp <= ksto1 && found[i] != 1; kp++) {
608  k1 = cell21[4 * k2 + kp];
609  if (E_A[k1] > Eth_low) {
610  aquality[i] = (E_A[k1] < Eth_EB_A[k1] ? 0 : 1);
611  quality = cquality[i] + flquality[i] + aquality[i];
612  if (quality <= 1) {
613  found[i] = 1;
614 
615  // energy deposited by the muon (A cell)
616  EMuons0.push_back(E_A[k1]);
617 
618  // energy deposited by the muon (B cell)
619  EMuons1.push_back(E_BC[k2]);
620 
621  // energy deposited by the muon (D cell)
622  EMuons2.push_back(E_D[eta[i]]);
623 
624  // quality factor
625  qf.push_back(cquality[i] + flquality[i] + aquality[i]);
626 
627  // EBC partition
628  if (partition == 3)
629  EtaMuons.push_back((eta_EB_D[eta[i]] + eta_EB_BC[k2] + eta_EB_A[k1]) * (1. / 3));
630 
631  // EBA partition
632  if (partition == 4)
633  EtaMuons.push_back(-(eta_EB_D[eta[i]] + eta_EB_BC[k2] + eta_EB_A[k1]) * (1. / 3));
634 
635  if (eta[i] == 0 && k2 == 0 && k1 == 0) pattern = 0; // D5, B11, A12
636  if (eta[i] == 0 && k2 == 1 && k1 == 0) pattern = 1; // D5, B12, A12
637  if (eta[i] == 0 && k2 == 1 && k1 == 1) pattern = 2; // D5, B12, A13
638  if (eta[i] == 0 && k2 == 2 && k1 == 0) pattern = 3; // D5, B13, A12
639  if (eta[i] == 0 && k2 == 2 && k1 == 1) pattern = 4; // D5, B13, A13
640  if (eta[i] == 0 && k2 == 2 && k1 == 2) pattern = 5; // D5, B13, A14
641  if (eta[i] == 1 && k2 == 0 && k1 == 0) pattern = 6; // D6, B11, A12
642  if (eta[i] == 1 && k2 == 1 && k1 == 0) pattern = 7; // D6, B12; A12
643  if (eta[i] == 1 && k2 == 1 && k1 == 1) pattern = 8; // D6, B12; A13
644  if (eta[i] == 1 && k2 == 2 && k1 == 0) pattern = 9; // D6, B13, A12
645  if (eta[i] == 1 && k2 == 2 && k1 == 1) pattern = 10; // D6, B13, A13
646  if (eta[i] == 1 && k2 == 2 && k1 == 2) pattern = 11; // D6, B13, A14
647  if (eta[i] == 1 && k2 == 3 && k1 == 1) pattern = 12; // D6, B14, A13
648  if (eta[i] == 1 && k2 == 3 && k1 == 2) pattern = 13; // D6, B14, A14
649  if (eta[i] == 1 && k2 == 3 && k1 == 3) pattern = 14; // D6, B14, A15
650  if (eta[i] == 1 && k2 == 4 && k1 == 2) pattern = 15; // D6, B15, A14
651  if (eta[i] == 1 && k2 == 4 && k1 == 3) pattern = 16; // D6, B15, A15
652 
653  // Words with encoded muon information for one superdrawer
654  unsigned int uquality = quality;
655  extraWord.push_back( (uquality << 31)
656  | (drawer << 30)
657  | (pattern << 25)
658  | ((int) (2 * E_D[eta[i]])));
659 
660  extraWord.push_back((((int) (2 * E_BC[k2])) << 16) | ((int) (2 * E_A[k1])));
661 
662  NMuons++;
663 
664  }
665  }
666  }
667  }
668  }
669  if (NMuons >= cut) break;
670  }
671 }

◆ MTagLB() [1/2]

void TileL2Builder::MTagLB ( int  partition,
int  drawer,
float *  EMeV,
int *  gain,
bool *  bad,
std::vector< float > &  EtaMuons,
std::vector< float > &  EMuons0,
std::vector< float > &  EMuons1,
std::vector< float > &  EMuons2,
std::vector< unsigned int > &  qf,
std::vector< unsigned int > &  extraWord 
) const
inline

Definition at line 104 of file TileL2Builder.h.

114  {
115  MaskBad(partition, EMeV, gain, bad);
116  MTagLB(partition, drawer, EMeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
117  }

◆ MTagLB() [2/2]

void TileL2Builder::MTagLB ( int  partition,
int  drawer,
float *  EMeV,
std::vector< float > &  EtaMuons,
std::vector< float > &  EMuons0,
std::vector< float > &  EMuons1,
std::vector< float > &  EMuons2,
std::vector< unsigned int > &  qf,
std::vector< unsigned int > &  extraWord 
) const

Muon tagging function for LB superdrawers as processed at the ROD DSPs.

Parameters
EMeVCalibrated energy (in MeV) for all channels
EtaMuonsMuons eta coordinate
EMuons0Energy (in MeV) deposited by the muons in A cells
EMuons1Energy (in MeV) deposited by the muons in BC cells
EMuons2Energy (in MeV) deposited by the muons in D cells
qfQuality factor
extraWordEncoded 32-bit words with muon info

Definition at line 291 of file TileL2Builder.cxx.

299  {
300 
301  // Maximum number of muons tagged per superdrawer
302  int cut = 4;
303 
304  // Energy thresholds (MeV)
305  int Eth_low = 150;
306  int Eth_LB_A[8] = { 1350, 960, 870, 750, 840, 840, 930, 840 };
307  int Eth_LB_BC[8] = { 2550, 1980, 1770, 1890, 1860, 1800, 1890, 1860 };
308  int Eth_LB_D[4] = { 1590, 1110, 1050, 1050 };
309 
310  // Eta cells
311  float eta_LB_A[8] = { 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75 }; // A1, A2, A3, A4, A5, A6, A7, A8
312  float eta_LB_BC[8] = { 0.05, 0.15, 0.25, 0.35, 0.45, 0.55, 0.65, 0.75 }; // BC1, BC2, BC3, BC4, BC5, BC6, BC7, BC8
313  float eta_LB_D[4] = { 0.00, 0.20, 0.40, 0.60 }; // D0, D1, D2, D3
314 
315  // D cells to BC cells in LB
316  int cell32[4 * 4] = {
317  1, 0, 0, 0, // D0 -> BC1
318  2, 1, 2, 0, // D1 -> BC2, BC3
319  3, 3, 4, 5, // D2 -> BC4, BC5, BC6
320  3, 5, 6, 7 // D3 -> BC6, BC7, BC8
321  };
322 
323  drawer = drawer % 2;
324 
325  int NMuons = 0;
326  int quality;
327  int pattern = 0;
328 
329  int k2, ks, ksto2;
330  int cand = 0;
331 
332  unsigned int cquality[4] = { 0 };
333  unsigned int flquality[4] = { 0 };
334  unsigned int aquality[4] = { 0 };
335 
336  int eta[4] = { 0 };
337  int splited[4] = { 0 };
338  int found[4] = { 0 };
339 
340  float E_A[8];
341  float E_BC[8];
342  float E_D[4];
343 
344  /* A cells */
345 
346  E_A[0] = E[1] + E[4]; // A1
347  E_A[1] = E[5] + E[8]; // A2
348  E_A[2] = E[9] + E[10]; // A3
349  E_A[3] = E[15] + E[18]; // A4
350  E_A[4] = E[19] + E[20]; // A5
351  E_A[5] = E[23] + E[26]; // A6
352  E_A[6] = E[29] + E[32]; // A7
353  E_A[7] = E[35] + E[38]; // A8
354 
355  /* BC cells */
356 
357  E_BC[0] = E[2] + E[3]; // BC1
358  E_BC[1] = E[6] + E[7]; // BC2
359  E_BC[2] = E[11] + E[12]; // BC3
360  E_BC[3] = E[16] + E[17]; // BC4
361  E_BC[4] = E[21] + E[22]; // BC5
362  E_BC[5] = E[28] + E[27]; // BC6
363  E_BC[6] = E[34] + E[33]; // BC7
364  E_BC[7] = E[40] + E[39]; // BC8
365 
366  /* D cells */
367 
368  E_D[0] = E[0] * 2; // D0
369  E_D[1] = E[13] + E[14]; // D1
370  E_D[2] = E[24] + E[25]; // D2
371  E_D[3] = E[41] + E[44]; // D3
372 
373  /* Define candidates */
374 
375  for (int i = 0; i < 4; i++) { // loop over D cells
376  if (E_D[i] >= Eth_low) {
377  eta[cand] = i;
378  splited[cand] = -1;
379  cquality[cand] = E_D[i] < Eth_LB_D[i] ? 0 : 1;
380  cand++;
381  }
382  }
383 
384  /* Repair for muons splitted */
385 
386  if (cand > 4) std::abort();
387  for (int i = 0; i < cand; i++) {
388  for (int j = 0; j < i; j++) {
389  if ((cquality[i] + cquality[j]) == 0) {
390  if (abs(eta[i] - eta[j]) <= 1
391  && (E_D[eta[i]] + E_D[eta[j]])
392  < (Eth_LB_D[eta[i]] > Eth_LB_D[eta[j]] ? Eth_LB_D[eta[i]] : Eth_LB_D[eta[j]])) {
393 
394  splited[i] = j;
395 
396  }
397  } else if ((cquality[i] + cquality[j]) == 1) {
398 
399  if (abs(eta[i] - eta[j]) <= 1) {
400 
401  splited[i] = j;
402 
403  }
404  }
405  }
406  }
407 
408  /* Loop on the candidates */
409 
410  for (int i = 0;
411  (i < cand && splited[i] < 0) || ((i < cand && splited[i] >= 0) && found[splited[i]] == 0);
412  i++) {
413 
414  found[i] = 0;
415  ksto2 = cell32[4 * eta[i]];
416 
417  for (ks = 1; ks <= ksto2 && found[i] != 1; ks++) {
418 
419  // eta position BC cell with a muon candidate
420  k2 = cell32[4 * eta[i] + ks];
421 
422  // Lower threshold BC cells
423  if (E_BC[k2] > Eth_low) {
424  flquality[i] = (E_BC[k2] < Eth_LB_BC[k2] ? 0 : 1);
425  if (found[i] != 1 && E_A[k2] > Eth_low) {
426  aquality[i] = (E_A[k2] < Eth_LB_A[k2] ? 0 : 1);
427  quality = cquality[i] + flquality[i] + aquality[i];
428  if (quality <= 1) {
429  found[i] = 1;
430 
431  // energy deposited by the muon (A cell)
432  EMuons0.push_back(E_A[k2]);
433 
434  // energy deposited by the muon (BC cell)
435  EMuons1.push_back(E_BC[k2]);
436 
437  // energy deposited by the muon (D cell)
438  EMuons2.push_back(E_D[eta[i]]);
439 
440  // quality factor
441  qf.push_back(cquality[i] + flquality[i] + aquality[i]);
442 
443  // LBC partition
444  if (partition == 1)
445  EtaMuons.push_back((eta_LB_D[eta[i]] + eta_LB_BC[k2] + eta_LB_A[k2]) * (1. / 3));
446 
447  // LBA partition
448  if (partition == 2)
449  EtaMuons.push_back(-(eta_LB_D[eta[i]] + eta_LB_BC[k2] + eta_LB_A[k2]) * (1. / 3));
450 
451  if (eta[i] == 0 && k2 == 0) pattern = 0; // D0, BC1, A1
452  if (eta[i] == 1 && k2 == 1) pattern = 1; // D1, BC2, A2
453  if (eta[i] == 1 && k2 == 2) pattern = 2; // D1, BC3, A3
454  if (eta[i] == 2 && k2 == 3) pattern = 3; // D2, BC4, A4
455  if (eta[i] == 2 && k2 == 4) pattern = 4; // D2, BC5, A5
456  if (eta[i] == 2 && k2 == 5) pattern = 5; // D2, BC6, A6
457  if (eta[i] == 3 && k2 == 5) pattern = 6; // D3, BC6, A6
458  if (eta[i] == 3 && k2 == 6) pattern = 7; // D3, BC7, A7
459  if (eta[i] == 3 && k2 == 7) pattern = 8; // D3, BC8, A8
460 
461  // Words with encoded muon information for one superdrawer
462  unsigned int uquality = quality;
463  extraWord.push_back( (uquality << 31) | (drawer << 30) | (pattern << 25) | ((int) (2 * E_D[eta[i]])));
464  extraWord.push_back((((int) (2 * E_BC[k2])) << 16) | ((int) (2 * E_A[k2])));
465 
466  NMuons++;
467  }
468  }
469  }
470  }
471  if (NMuons >= cut) break;
472  }
473 }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::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.

◆ process() [1/2]

StatusCode TileL2Builder::process ( int  fragmin,
int  fragmax,
TileL2Container l2Container 
) const
virtual

Definition at line 166 of file TileL2Builder.cxx.

166  {
167  const EventContext& ctx{Gaudi::Hive::currentContext()};
168  return process(fragmin, fragmax, l2Container, ctx);
169 };

◆ process() [2/2]

StatusCode TileL2Builder::process ( int  fragmin,
int  fragmax,
TileL2Container l2Container,
const EventContext &  ctx 
) const
virtual

Definition at line 171 of file TileL2Builder.cxx.

171  {
172 
174  ATH_CHECK( emScale.isValid() );
175 
177  ATH_CHECK( badChannels.isValid() );
178 
179  // Get TileRawChannels
181  ATH_CHECK( rawChannelContainer.isValid() );
182 
183  std::vector<unsigned int> extraWord;
184  std::vector<float> EtaMuons;
185  std::vector<float> EMuons0;
186  std::vector<float> EMuons1;
187  std::vector<float> EMuons2;
188  std::vector<unsigned int> qf;
189 
190  float E_MeV[48];
191  bool bad[48];
192  int gain[48];
193 
194  TileRawChannelUnit::UNIT rChUnit = rawChannelContainer->get_unit();
195  bool dspCont = (rChUnit >= TileRawChannelUnit::OnlineOffset);
196  bool recalibrate = (rChUnit != TileRawChannelUnit::MegaElectronVolts
198 
199  // iterate over all collections in a container
200  for (const TileRawChannelCollection* rawChannelCollection : *rawChannelContainer) {
201 
202  HWIdentifier drawer_id = m_tileHWID->drawer_id(rawChannelCollection->identify());
203  int ros = m_tileHWID->ros(drawer_id);
204  int drawer = m_tileHWID->drawer(drawer_id);
205  int fragId = m_tileHWID->frag(ros, drawer);
206  int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
207 
208  if ((fragId >= fragmin) && (fragId <= fragmax)) {
209 
210  ATH_MSG_VERBOSE( "Unpacking frag 0x" << MSG::hex << fragId << MSG::dec );
211 
212  memset(E_MeV, 0, sizeof(E_MeV));
213  memset(bad, 0, sizeof(bad));
214  memset(gain, -1, sizeof(gain));
215 
216  // iterate over all raw channels in a collection
217  for (const TileRawChannel* rawChannel : *rawChannelCollection) {
218  HWIdentifier adc_id = rawChannel->adc_HWID();
219  int channel = m_tileHWID->channel(adc_id);
220  int adc = m_tileHWID->adc(adc_id);
221  float ampl = rawChannel->amplitude();
222  if (recalibrate) {
223  E_MeV[channel] = emScale->calibrateChannel(drawerIdx, channel, adc, ampl, rChUnit
225  } else {
226  E_MeV[channel] = ampl; // no conversion since energy is in MeV already
227  }
228  if (dspCont) {
229  bad[channel] = rawChannel->quality() > 15.99;
230  } else {
231  bad[channel] = badChannels->getAdcStatus(adc_id).isBad();
232  }
233  gain[channel] = adc;
234  }
235 
236  // bad channel masking
237  MaskBad(ros, E_MeV, gain, bad);
238 
239  // MET
240  std::vector<float> sumE(3);
242  (*l2Container)[m_hashFunc(fragId)]->setEt(std::move(sumE));
243 
244  // MTag
245 
246  EtaMuons.clear();
247  EMuons0.clear();
248  EMuons1.clear();
249  EMuons2.clear();
250  qf.clear();
251  extraWord.clear();
252 
253  switch (ros) {
255  MTagLB(ros, drawer, E_MeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
256  break;
258  MTagLB(ros, drawer, E_MeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
259  break;
261  MTagEB(ros, drawer, E_MeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
262  break;
264  MTagEB(ros, drawer, E_MeV, EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
265  break;
266  default:
267  ATH_MSG_ERROR( "incorrect ros value " << ros );
268  break;
269  }
270 
271  if (EtaMuons.size())
272  (*l2Container)[m_hashFunc(fragId)]->setMu(EtaMuons, EMuons0, EMuons1, EMuons2, qf, extraWord);
273 
274  } // end loop over collections
275 
276  }
277 
278  // Execution completed
279  ATH_MSG_DEBUG( "TileL2Builder execution completed" );
280 
281  return StatusCode::SUCCESS;
282 }

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

◆ SumE() [1/3]

void TileL2Builder::SumE ( int  partition,
int  drawer,
float *  E,
std::vector< float > &  sumE 
) const

SumE function for one superdrawer as processed at the ROD DSPs.

Parameters
partitionpartition (1=LBA, 2=LBC, 3=EBA, 4=EBC)
drawerdrawer number (0-63)
unitenergy units (0=ADC counts, 3=MeV) for proper rounding a-la DSP
Eenergy for all channels in some units
gaingain for all channels
badbad flag for all channels
sumEsumEt, sumEz and sumE for the drawer in one vector

Definition at line 721 of file TileL2Builder.cxx.

721  {
722  if (ros < 1 || ros > 4) {
723  sumE[0] = sumE[1] = sumE[2] = 0.0;
724  return;
725  }
726 
727  int ros1 = ros - 1;
728  const float* wt = m_sinTh[ros1];
729  const float* wz = m_cosTh[ros1];
730  const bool* connected = m_connected[ros1];
731  float Et = 0.0;
732  float Ez = 0.0;
733  float Es = 0.0;
734 
735  for (int i = 0; i < 48; ++i) {
736  if (*connected++) {
737  float e = (*E); // assuming that E is in MeV
738  if (e > m_noiseThreshold) { // for the moment only fixed noise cut implemented
739  Et += e * (*wt);
740  Ez += e * (*wz);
741  Es += e;
742  }
743  }
744  ++E;
745  ++wt;
746  ++wz;
747  }
748 
749  sumE[0] = Et;
750  sumE[1] = Ez;
751  sumE[2] = Es;
752 }

◆ SumE() [2/3]

void TileL2Builder::SumE ( int  partition,
int  drawer,
int  unit,
float *  E,
int *  gain,
bool *  bad,
std::vector< float > &  sumE 
) const
inline

Definition at line 166 of file TileL2Builder.h.

172  {
173  MaskBad(partition, E, gain, bad);
174  SumE(partition, drawer, unit, E, gain, sumE);
175  }

◆ SumE() [3/3]

void TileL2Builder::SumE ( int  partition,
int  drawer,
int  unit,
float *  E,
int *  gain,
std::vector< float > &  sumE 
) const

Definition at line 673 of file TileL2Builder.cxx.

674  {
675  // precision in DSP - 1/16 ADC counts or 1/2048 pC and CspC or 1/2 MeV
676  static const float AMPLITUDE_FACTOR_HG[4] = { 16.0, 32.0 * 64, 32.0 * 64., 2.0 };
677  static const float AMPLITUDE_FACTOR_LG[4] = { 16.0, 32.0, 32.0, 2.0 / 64.0 };
678 
679  if (ros < 1 || ros > 4) {
680  sumE[0] = sumE[1] = sumE[2] = 0.0;
681  return;
682  }
683 
684  unit &= 3; // keep last 2 bits, remove online offset
685  const float scaleHG = AMPLITUDE_FACTOR_HG[unit];
686  const float scaleLG = AMPLITUDE_FACTOR_LG[unit];
687  int ros1 = ros - 1;
688  const float* wt = m_sinThRound[ros1];
689  const float* wz = m_cosThRound[ros1];
690  const bool* connected = m_connected[ros1];
691 
692  float Et = 0.0;
693  float Ez = 0.0;
694  float Es = 0.0;
695 
696  // for the moment only fixed noise cut implemented
697  // and it works correctly only if energy is in MeV
698  float cut = m_noiseThreshold * scaleHG;
699 
700  for (int i = 0; i < 48; ++i) {
701  if (*connected++) {
702  float e = (*gain) ? round((*E) * scaleHG) : round((*E) * scaleLG) * 64.;
703  if (e > cut) {
704  Et += round((*wt) * e);
705  Ez += round((*wz) * e);
706  Es += round(e);
707  }
708  }
709  ++E;
710  ++gain;
711  ++wt;
712  ++wz;
713  }
714 
715  const float inv_scaleHG = 1. / scaleHG;
716  sumE[0] = Et * inv_scaleHG;
717  sumE[1] = Ez * inv_scaleHG;
718  sumE[2] = Es * inv_scaleHG;
719 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::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< AlgTool > >::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_badChannelsKey

SG::ReadCondHandleKey<TileBadChannels> TileL2Builder::m_badChannelsKey
protected
Initial value:
{this,
"TileBadChannels", "TileBadChannels", "Input Tile bad channel status"}

Name of TileBadChannels in condition store.

Definition at line 201 of file TileL2Builder.h.

◆ m_channelPairs

int TileL2Builder::m_channelPairs[4][48]
protected

Definition at line 212 of file TileL2Builder.h.

◆ m_connected

bool TileL2Builder::m_connected[4][48]
protected

Definition at line 211 of file TileL2Builder.h.

◆ m_cosTh

float TileL2Builder::m_cosTh[4][48]
protected

Definition at line 209 of file TileL2Builder.h.

◆ m_cosThRound

float TileL2Builder::m_cosThRound[4][48]
protected

Definition at line 210 of file TileL2Builder.h.

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_emScaleKey

SG::ReadCondHandleKey<TileEMScale> TileL2Builder::m_emScaleKey
protected
Initial value:
{this,
"TileEMScale", "TileEMScale", "Input Tile EMS calibration constants"}

Name of TileEMScale in condition store.

Definition at line 195 of file TileL2Builder.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_hashFunc

TileFragHash TileL2Builder::m_hashFunc
protected

Definition at line 205 of file TileL2Builder.h.

◆ m_noiseThreshold

float TileL2Builder::m_noiseThreshold
protected

Definition at line 186 of file TileL2Builder.h.

◆ m_noiseType

int TileL2Builder::m_noiseType
protected

Definition at line 187 of file TileL2Builder.h.

◆ m_rawChannelContainerKey

SG::ReadHandleKey<TileRawChannelContainer> TileL2Builder::m_rawChannelContainerKey
protected
Initial value:
{this,"TileRawChannelContainer",
"TileRawChannelCnt",
"Input Tile raw channel container key"}

TileRawChannelContainer in event store.

Definition at line 181 of file TileL2Builder.h.

◆ m_sinTh

float TileL2Builder::m_sinTh[4][48]
protected

Definition at line 207 of file TileL2Builder.h.

◆ m_sinThRound

float TileL2Builder::m_sinThRound[4][48]
protected

Definition at line 208 of file TileL2Builder.h.

◆ m_tileHWID

const TileHWID* TileL2Builder::m_tileHWID
protected

Pointer to TileHWID.

Definition at line 190 of file TileL2Builder.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
bad
@ bad
Definition: SUSYToolsTester.cxx:95
mergePhysValFiles.pattern
pattern
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:26
sendEI_SPB.ch
ch
Definition: sendEI_SPB.py:35
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
TileL2Builder::m_hashFunc
TileFragHash m_hashFunc
Definition: TileL2Builder.h:205
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileTBID::is_tiletb
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Definition: TileTBID.cxx:86
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TileL2Builder::MTagEB
void MTagEB(int partition, int drawer, float *EMeV, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
Muon tagging function for EB superdrawers as processed at the ROD DSPs.
Definition: TileL2Builder.cxx:475
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
MuonGM::round
float round(const float toRound, const unsigned int decimals)
Definition: Mdt.cxx:27
TileL2Builder::process
virtual StatusCode process(int fragmin, int fragmax, TileL2Container *l2Container) const
Definition: TileL2Builder.cxx:166
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
Tile_Base_ID::sample
int sample(const Identifier &id) const
Definition: Tile_Base_ID.cxx:171
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TileL2Builder::m_sinThRound
float m_sinThRound[4][48]
Definition: TileL2Builder.h:208
TileHWID::frag
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition: TileHWID.h:181
TileL2Builder::m_cosThRound
float m_cosThRound[4][48]
Definition: TileL2Builder.h:210
TileL2Builder::MTagLB
void MTagLB(int partition, int drawer, float *EMeV, std::vector< float > &EtaMuons, std::vector< float > &EMuons0, std::vector< float > &EMuons1, std::vector< float > &EMuons2, std::vector< unsigned int > &qf, std::vector< unsigned int > &extraWord) const
Muon tagging function for LB superdrawers as processed at the ROD DSPs.
Definition: TileL2Builder.cxx:291
Tile_Base_ID::tower
int tower(const Identifier &id) const
Definition: Tile_Base_ID.cxx:165
TileL2Builder::MaskBad
void MaskBad(int partition, float *E, int *gain, bool *bad) const
function which does bad channel masking: if one channel of a cell is bad, energy from second channel ...
Definition: TileL2Builder.cxx:754
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Tile_Base_ID::SAMP_E
@ SAMP_E
Definition: Tile_Base_ID.h:55
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HWIdentifier
Definition: HWIdentifier.h:13
Identifier::is_valid
bool is_valid() const
Check if id is in a valid state.
TileL2Builder::m_rawChannelContainerKey
SG::ReadHandleKey< TileRawChannelContainer > m_rawChannelContainerKey
TileRawChannelContainer in event store.
Definition: TileL2Builder.h:181
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
TileL2Builder::SumE
void SumE(int partition, int drawer, float *E, std::vector< float > &sumE) const
SumE function for one superdrawer as processed at the ROD DSPs.
Definition: TileL2Builder.cxx:721
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TileHWID::ros
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
Definition: TileHWID.h:167
TileL2Builder::m_connected
bool m_connected[4][48]
Definition: TileL2Builder.h:211
TileL2Builder::m_badChannelsKey
SG::ReadCondHandleKey< TileBadChannels > m_badChannelsKey
Name of TileBadChannels in condition store.
Definition: TileL2Builder.h:201
TileHWID::adc
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
Definition: TileHWID.h:193
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileL2Builder::m_cosTh
float m_cosTh[4][48]
Definition: TileL2Builder.h:209
TileL2Builder::m_noiseType
int m_noiseType
Definition: TileL2Builder.h:187
lumiFormat.i
int i
Definition: lumiFormat.py:92
TileDetDescrManager
Definition: TileDetDescrManager.h:33
TileID
Helper class for TileCal offline identifiers.
Definition: TileID.h:68
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TileRawChannelUnit::OnlineOffset
@ OnlineOffset
Definition: TileRawChannelUnit.h:25
TileRawChannelUnit::MegaElectronVolts
@ MegaElectronVolts
Definition: TileRawChannelUnit.h:20
TileRawChannel
Definition: TileRawChannel.h:35
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
TileHWID::EXTBAR_NEG
@ EXTBAR_NEG
Definition: TileHWID.h:71
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileL2Builder::m_noiseThreshold
float m_noiseThreshold
Definition: TileL2Builder.h:186
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileCablingService
Definition: TileCablingService.h:23
TileRawChannelUnit::UNIT
UNIT
Definition: TileRawChannelUnit.h:16
TileFragHash::initialize
void initialize(const TileHWID *tileHWID, TYPE type=Default)
Definition: TileFragHash.cxx:23
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
TileDetDescrManager::get_cell_element
CaloDetDescrElement * get_cell_element(unsigned int cell_hash) const
Definition: TileDetDescrManager.h:156
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
TileL2Builder::m_tileHWID
const TileHWID * m_tileHWID
Pointer to TileHWID.
Definition: TileL2Builder.h:190
TileHWID::drawer_id
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
Definition: TileHWID.cxx:186
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
TileHWID::channel_id
HWIdentifier channel_id(int ros, int drawer, int channel) const
channel HWIdentifer
Definition: TileHWID.cxx:198
TileRawChannelCollection
Definition: TileRawChannelCollection.h:12
TileHWID::BARREL_NEG
@ BARREL_NEG
Definition: TileHWID.h:69
TileHWID::EXTBAR_POS
@ EXTBAR_POS
Definition: TileHWID.h:70
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TileL2Builder::m_sinTh
float m_sinTh[4][48]
Definition: TileL2Builder.h:207
TileHWID::BARREL_POS
@ BARREL_POS
Definition: TileHWID.h:68
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
h
TileL2Builder::m_emScaleKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
Name of TileEMScale in condition store.
Definition: TileL2Builder.h:195
TileHWID::drawer
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
Definition: TileHWID.h:171
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
Tile_Base_ID::pmt_id
Identifier pmt_id(const Identifier &any_id) const
Definition: Tile_Base_ID.cxx:640
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:20
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CaloDetDescrElement::cosTh
float cosTh() const
for fast px py pz computation
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:385
StateLessPT_NewConfig.partition
partition
Definition: StateLessPT_NewConfig.py:49
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
TileTBID
Helper class for TileCal offline identifiers of ancillary testbeam detectors and MBTS.
Definition: Calorimeter/CaloIdentifier/CaloIdentifier/TileTBID.h:65
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
TileFragHash::identifier
ID identifier(int i) const
reverse conversion
Definition: TileFragHash.cxx:67
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
TileAANtupleConfig.rawChannelContainer
rawChannelContainer
Definition: TileAANtupleConfig.py:120
CaloDetDescrElement::sinTh
float sinTh() const
for algorithm working in transverse Energy
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:383
TileL2Builder::m_channelPairs
int m_channelPairs[4][48]
Definition: TileL2Builder.h:212
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
TileRawChannelUnit::OnlineMegaElectronVolts
@ OnlineMegaElectronVolts
Definition: TileRawChannelUnit.h:24
ServiceHandle< TileCablingSvc >