ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes | List of all members
D3PD::LArSCHitFillerTool Class Reference

Block filler tool for EM samplings from a CaloCluster. More...

#include <LArSCHitFillerTool.h>

Inheritance diagram for D3PD::LArSCHitFillerTool:
Collaboration diagram for D3PD::LArSCHitFillerTool:

Public Member Functions

 LArSCHitFillerTool (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor. More...
 
virtual StatusCode initialize ()
 Book variables for this block. More...
 
virtual StatusCode book ()
 Book variables for this block. More...
 
virtual StatusCode fill (const LArHitContainer &p)
 Fill one block — type-safe version. More...
 
virtual StatusCode configureD3PD (IAddVariable *tree, const std::type_info &ti)
 Configure during initialization: type-check. More...
 
StatusCode configureD3PD (IAddVariable *tree)
 Configure the parent tree. More...
 
virtual StatusCode fillUntyped (const void *p, bool again=false)
 Fill one block. More...
 
virtual StatusCode fillAgain (const LArHitContainer &p)
 Fill one block, after AGAIN has been returned (type-safe). More...
 
 BlockFillerToolImpl (const std::string &type, const std::string &name, const IInterface *parent)
 Standard Gaudi tool constructor. More...
 
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple. More...
 
template<class T >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring="")
 Make the template implementation from IAddVariable visible. More...
 
template<class T , class U >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval)
 Make the template implementation from IAddVariable visible. More...
 
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)=0
 Make the template implementation from IAddVariable visible. More...
 
template<class T >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring="")
 Add a variable to the tuple. More...
 
template<class T , class U >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval)
 Add a variable to the tuple. More...
 
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
 Add a variable to the tuple. More...
 
template<class T >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple. More...
 
template<class T , class U >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple. More...
 
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)=0
 Add a variable to the tuple. More...
 
template<class T >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple. More...
 
template<class T , class U >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple. More...
 

Protected Member Functions

StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::type_info &fill_ti)
 Configure during initialization: type-check. More...
 
StatusCode configureImpl (IAddVariable *tree, const std::type_info &ti, const std::vector< const std::type_info * > &tis, size_t &which)
 Configure during initialization: type-check. More...
 
StatusCode convert (void const *&p) const
 Do type conversion. More...
 

Protected Attributes

ObjectMetadata m_metadata
 Metadata about the variables created by this object. More...
 

Private Attributes

const LArEM_IDm_emid
 
const LArFCAL_IDm_fcalid
 
const LArHEC_IDm_hecid
 
const TileIDm_tileid
 
const LArOnlineIDm_onlineHelper
 
const ILArfSamplm_dd_fSampl
 
int * m_nSC
 parameters More...
 
std::vector< double > * m_E
 
std::vector< double > * m_eta
 
std::vector< double > * m_phi
 
std::vector< double > * m_Eoff
 
std::vector< double > * m_Et
 
std::vector< double > * m_fsampl
 
std::vector< int > * m_calo
 
std::vector< int > * m_region
 
std::vector< int > * m_sampling
 
std::vector< int > * m_ieta
 
std::vector< int > * m_jphi
 
std::vector< unsigned int > * m_offlId
 
std::vector< float > m_etaCut
 
std::vector< float > m_phiCut
 
std::vector< unsigned int > m_caloNums
 
std::vector< unsigned int > m_caloLayers
 
bool m_caloEtaSelection
 
bool m_caloPhiSelection
 
bool m_caloLayerSelection
 
bool m_caloSelection
 
ToolHandle< ICaloSuperCellIDToolm_scidtool
 Property: Offline / supercell mapping tool. More...
 
SG::ReadCondHandleKey< CaloSuperCellDetDescrManagerm_caloSuperCellMgrKey
 
const CaloCell_SuperCell_IDm_sc_idHelper
 idHlper More...
 
std::string m_prefix
 Property: the variable prefix for this block. More...
 
std::string m_suffix
 Property: the variable prefix for this block. More...
 
std::string m_blockName
 Property: the name of this block. More...
 
TypeConverter m_converter
 Helper to do type conversions. More...
 
IAddVariablem_tree
 Reference to the block name. More...
 

Static Private Attributes

static const std::string s_emptyString
 Used to provide a default value for blockName. More...
 

Detailed Description

Block filler tool for EM samplings from a CaloCluster.

Definition at line 48 of file LArSCHitFillerTool.h.

Constructor & Destructor Documentation

◆ LArSCHitFillerTool()

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

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 35 of file LArSCHitFillerTool.cxx.

39  : BlockFillerTool<LArHitContainer> (type, name, parent),
40  m_dd_fSampl (nullptr),
41  m_caloEtaSelection( false ),
42  m_caloPhiSelection( false ),
43  m_caloLayerSelection( false ),
44  m_caloSelection( false ),
45  m_scidtool ("CaloSuperCellIDTool")
46  {
47 
48  declareProperty( "CaloEtaCut", m_etaCut );
49  declareProperty( "CaloPhiCut", m_phiCut );
50  declareProperty( "CaloLayers", m_caloLayers );
51  declareProperty( "CaloDetectors", m_caloNums );
52  // 1=EMB; 2=EMEC Outer Wheel; 3=EMEC Inner Wheel; 4=HEC; 5=FCAL
53 
54  declareProperty ("SCIDTool", m_scidtool,
55  "Offline / supercell mapping tool.");
56 
57  LArSCHitFillerTool::book().ignore(); // Avoid coverity warnings.
58 }

Member Function Documentation

◆ addDimensionedVariable() [1/6]

StatusCode D3PD::AddVariable::addDimensionedVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  dim,
const std::string &  docstring = "",
const void *  defval = 0 
)
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Implements D3PD::IAddVariable.

Definition at line 123 of file AddVariable.cxx.

129 {
130  if (!m_tree) {
131  // Called from constructor --- just initialize pointer.
132  ptr = 0;
133  return StatusCode::SUCCESS;
134  }
135 
137  ti, ptr, dim,
138  docstring, defval ) );
140  ti, ptr, dim,
141  docstring, defval);
142 }

◆ addDimensionedVariable() [2/6]

virtual StatusCode D3PD::IAddVariable::addDimensionedVariable
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( class T  ,
class U   
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [4/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [5/6]

template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( class T  )
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [6/6]

template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [1/6]

StatusCode D3PD::AddVariable::addVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  docstring = "",
const void *  defval = 0 
)
virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Implements D3PD::IAddVariable.

Definition at line 85 of file AddVariable.cxx.

90 {
91  if (!m_tree) {
92  // Called from constructor --- just initialize pointer.
93  ptr = 0;
94  return StatusCode::SUCCESS;
95  }
96 
98  ti, ptr, docstring, defval ) );
100  ti, ptr, docstring, defval);
101 }

◆ addVariable() [2/6]

virtual StatusCode D3PD::IAddVariable::addVariable
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [3/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable ( class T  ,
class U   
)
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [4/6]

template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [5/6]

template<class T >
StatusCode D3PD::IAddVariable::addVariable ( class T  )
inherited

Make the template implementation from IAddVariable visible.

◆ addVariable() [6/6]

template<class T >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ BlockFillerToolImpl()

D3PD::BlockFillerToolImpl::BlockFillerToolImpl
inherited

Standard Gaudi tool constructor.

Parameters
typeThe name of the tool type.
nameThe tool name.
parentThe tool's Gaudi parent.

Definition at line 73 of file BlockFillerToolImpl.cxx.

30  : base_class (type, name, parent),
32 {
33  declareProperty ("Prefix", m_prefix = "",
34  "Tuple variable prefix for this block.");
35  declareProperty ("Suffix", m_suffix = "",
36  "Tuple variable suffix for this block.");
37  declareProperty ("BlockName", m_blockName = this->name(),
38  "The name of this block.");
39 }

◆ book()

StatusCode D3PD::LArSCHitFillerTool::book ( )
virtual

Book variables for this block.

Implements D3PD::BlockFillerTool< LArHitContainer >.

Definition at line 152 of file LArSCHitFillerTool.cxx.

153 {
154  CHECK( addVariable ("nSC", m_nSC ));
155  CHECK( addVariable ("E", m_E));
156  CHECK( addVariable ("eta", m_eta));
157  CHECK( addVariable ("phi", m_phi));
158  CHECK( addVariable ("Eoff", m_Eoff));
159  CHECK( addVariable ("Et", m_Et));
160  CHECK( addVariable ("fsampl", m_fsampl));
161  CHECK( addVariable ("calo", m_calo));
162  CHECK( addVariable ("region", m_region));
163  CHECK( addVariable ("sampling", m_sampling));
164  CHECK( addVariable ("ieta", m_ieta));
165  CHECK( addVariable ("jphi", m_jphi));
166  //CHECK( addVariable ("hid", m_hashid));
167  CHECK( addVariable ("IdCells", m_offlId));
168 
169  return StatusCode::SUCCESS;
170 }

◆ configureD3PD() [1/2]

StatusCode D3PD::AddVariable::configureD3PD ( IAddVariable tree)
inherited

Configure the parent tree.

Parameters
treeThe parent IAddVariable instance.

Definition at line 61 of file AddVariable.cxx.

62 {
63  m_tree = tree;
64  m_metadata.clear();
65  return StatusCode::SUCCESS;
66 }

◆ configureD3PD() [2/2]

virtual StatusCode D3PD::BlockFillerTool< LArHitContainer >::configureD3PD ( IAddVariable tree,
const std::type_info &  ti 
)
virtualinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.

configureD3PD should check that the type of the object coming as input is compatible with what it expects, and raise an error otherwise.

◆ configureImpl() [1/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable tree,
const std::type_info &  ti,
const std::type_info &  fill_ti 
)
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
fill_tiis the type of object that the user code will expect.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

Definition at line 55 of file BlockFillerToolImpl.cxx.

58 {
60  CHECK( m_converter.init (ti, fill_ti) );
61 
62  return StatusCode::SUCCESS;
63 }

◆ configureImpl() [2/2]

StatusCode D3PD::BlockFillerToolImpl::configureImpl ( IAddVariable tree,
const std::type_info &  ti,
const std::vector< const std::type_info * > &  tis,
size_t &  which 
)
protectedinherited

Configure during initialization: type-check.

Parameters
treeOur parent for tuple making.
tiGives the type of the object being passed to fillUntyped.
tisList of possible input types that we can accept.
[out]whichIndex of the accepted type.

This is the common implementation for the configureD3PD method of IBlockFillerTool. It checks that the type of the object coming as input is compatible with what the user code is expecting, and raises an error otherwise.

This version allows for one of a set of types to match. If successful, WHICH is set to the index (0-based) of the matching type.

Definition at line 83 of file BlockFillerToolImpl.cxx.

87 {
89  CHECK( m_converter.init (ti, tis, which) );
90  return StatusCode::SUCCESS;
91 }

◆ convert()

StatusCode D3PD::BlockFillerToolImpl::convert ( void const *&  p) const
protectedinherited

Do type conversion.

Parameters
p[in,out]Pointer to convert.

On entry, p is a pointer to an object of the type that was passed into configureImpl as ti. Convert the pointer to point to an object of the type that was given as fill_ti. If the conversion fails, the pointer is set to 0 (and FAILURE is returned).

Definition at line 105 of file BlockFillerToolImpl.cxx.

106 {
108  if (!p) {
109  REPORT_MESSAGE (MSG::ERROR)
110  << "Pointer conversion from " << m_converter.srcName() << " to "
111  << m_converter.dstName() << "failed.";
112  return StatusCode::FAILURE;
113  }
114  return StatusCode::SUCCESS;
115 }

◆ fill()

StatusCode D3PD::LArSCHitFillerTool::fill ( const LArHitContainer p)
virtual

Fill one block — type-safe version.

Parameters
pThe input object.

This is called once per object. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

Implements D3PD::BlockFillerTool< LArHitContainer >.

Definition at line 181 of file LArSCHitFillerTool.cxx.

181  {
182 
183  std::map<int, double> sc_E;
184 
185  typedef LArHitContainer CONTAINER;
186  CONTAINER::const_iterator f_hit = p.begin();
187  CONTAINER::const_iterator l_hit = p.end();
188  for( ; f_hit != l_hit; ++f_hit ) {
189  const LArHit* hit = ( *f_hit );
190  const Identifier cell_id = hit->cellID();
191  Identifier sc_offl_id = m_scidtool->offlineToSuperCellID (cell_id);
192  int hashId = m_sc_idHelper->calo_cell_hash( sc_offl_id) ;
193  if (hashId < 999999)
194  sc_E[hashId] += hit->energy();
195  }
196 
197 
198  int nSC = 0;
199 
200  std::map<int, double>::const_iterator it = sc_E.begin();
201  std::map<int, double>::const_iterator it_e = sc_E.end();
202 
203  SG::ReadCondHandle<CaloSuperCellDetDescrManager> caloSuperCellMgrHandle{m_caloSuperCellMgrKey,Gaudi::Hive::currentContext()};
204  const CaloSuperCellDetDescrManager* sc_dd_mgr = *caloSuperCellMgrHandle;
205 
206  for ( ; it!=it_e ; ++it ) {
207  int hashId = (*it).first;
208  Identifier offlId = m_sc_idHelper->cell_id(hashId) ;
209  float fsampl = m_dd_fSampl->FSAMPL(offlId);
210  double E = (*it).second;
211 
212  // int pn = m_sc_idHelper->pos_neg(offlId);
213  int calo = m_sc_idHelper->sub_calo(hashId);
214  int region = m_sc_idHelper->region(offlId);
215  unsigned int lay = m_sc_idHelper->sampling(offlId);
216  int ieta = m_sc_idHelper->eta(offlId);
217  int jphi = m_sc_idHelper->phi(offlId);
218  float feta = sc_dd_mgr->get_element(offlId)->eta();
219  float fphi = sc_dd_mgr->get_element(offlId)->phi();
220  int lardet = calo;
221 
222  if (m_caloSelection) {
223  std::vector< unsigned int >::const_iterator theFound =
224  std::find( m_caloNums.begin(), m_caloNums.end(), lardet );
225  if( theFound == m_caloNums.end() ) continue;
226  }
227  if ( m_caloEtaSelection ) {
228  if (feta<m_etaCut[0] || feta>m_etaCut[1]) continue;
229  }
230  if ( m_caloPhiSelection ) {
231  if (fphi<m_phiCut[0] || fphi>m_phiCut[1]) continue;
232  }
233  if ( m_caloLayerSelection ) {
234  bool tmp=false;
235  for( unsigned int j=0; j<m_caloLayers.size(); j++) {
236  if (m_caloLayers[j]==lay) tmp=true;
237  }
238  if (!tmp) continue;
239  }
240  nSC++;
241  m_E->push_back( E );
242  m_calo->push_back( calo );
243  m_region->push_back( region );
244  m_sampling->push_back( lay );
245  m_ieta->push_back( ieta );
246  m_jphi->push_back( jphi );
247  m_offlId->push_back( offlId.get_identifier32().get_compact() );
248  m_eta->push_back( feta );
249  m_phi->push_back( fphi );
250  double offEnergy = E;
251  if ( fsampl>0. ) {
252  offEnergy /= fsampl;
253  } else {
254  offEnergy = 0;
255  }
256  m_Eoff->push_back( offEnergy );
257  m_Et->push_back( offEnergy/cosh( feta ) );
258  m_fsampl->push_back( fsampl );
259  }
260  *m_nSC = nSC;
261 
262  return StatusCode::SUCCESS;
263 
264 }

◆ fillAgain()

virtual StatusCode D3PD::BlockFillerTool< LArHitContainer >::fillAgain ( const LArHitContainer p)
virtualinherited

Fill one block, after AGAIN has been returned (type-safe).

Parameters
pThe input object.

Once fill returns AGAIN, the parent should call fillAgain with the same arguments. This continues until fillAgain returns something other than AGAIN.

By default, this just calls fill().

◆ fillUntyped()

virtual StatusCode D3PD::BlockFillerTool< LArHitContainer >::fillUntyped ( const void *  p,
bool  again = false 
)
virtualinherited

Fill one block.

Parameters
pThe input object.
againSet if this is a subsequent call requested by an AGAIN return

This is called once per object. The type of the object at which p points is given by the ti argument to configureD3PD. The caller is responsible for arranging that all the pointers for booked variables are set appropriately upon entry.

If the return status is the special code AGAIN (defined above), then this filler tool wants to make multiple entries. The parent should set up to capture a new ‘row’ and run through the list of block filler tools again, but for this tool call fillAgainUntyped instead of fillUntyped. This should be repeated as long as fillAgainUntyped returns AGAIN.

Once fillUntyped returns AGAIN, the parent should call fillUntyped with the same p argument and again set to true. This continues until fillUntyped returns something other than AGAIN.

Not all parents may support this. In that case, returning AGAIN will be treated as an error.

◆ initialize()

StatusCode D3PD::LArSCHitFillerTool::initialize ( )
virtual

Book variables for this block.

Definition at line 61 of file LArSCHitFillerTool.cxx.

62 {
63  ServiceHandle<StoreGateSvc> detStore("DetectorStore", name());
64  CHECK( detStore.retrieve() ) ;
65  CHECK( m_scidtool.retrieve() );
67  CHECK( detStore->retrieve (m_sc_idHelper) );
68 
69  CHECK ( detStore->retrieve(m_emid) );
70  CHECK ( detStore->retrieve(m_fcalid) );
71  CHECK ( detStore->retrieve(m_hecid) );
72  CHECK ( detStore->retrieve(m_tileid) );
73  CHECK ( detStore->retrieve(m_onlineHelper));
74 
75  CHECK ( detStore->retrieve(m_dd_fSampl));
76 
77  const unsigned int nSubCalo = static_cast< int >( CaloCell_ID::NSUBCALO );
78 
79  //check calo number specified
80  m_caloSelection = false;
81  if( m_caloNums.size() == 0 ) {
82  ATH_MSG_INFO( " *** LArSCHitFillerTool: No calorimeter selection" );
83  // return StatusCode::SUCCESS;
84  } else if( m_caloNums.size() > nSubCalo ) {
86  << " More than " << nSubCalo << " calo specified. "
87  << "Must be wrong. Stop.";
88  return StatusCode::FAILURE;
89  } else {
90  m_caloSelection = true;
91  for( unsigned int index = 0; index < m_caloNums.size(); ++index ) {
92  if( m_caloNums[ index ]>= nSubCalo ) {
94  << "Invalid calo specification:"
95  << m_caloNums[index] << "Stop.";
96  return StatusCode::FAILURE;
97  } else {
98  ATH_MSG_INFO( "*** LArSCHitFillerTool: Select calorimeter " << m_caloNums[ index ] );
99  }
100  }
101  }
102 
103  m_caloEtaSelection = false;
104  if ( m_etaCut.size() >0 ) {
105  if ( m_etaCut.size()== 2 && m_etaCut[0]<m_etaCut[1] ) {
106  REPORT_MESSAGE( MSG::INFO ) << "*** LArSCHitFillerTool: Eta Selection specified: " << m_etaCut[0] << ", " << m_etaCut[1];
107  m_caloEtaSelection=true;
108  } else {
109  REPORT_MESSAGE( MSG::FATAL ) << " *** LArSCHitFillerTool: Invalid Eta Cut Range specified: Abort!";
110  return StatusCode::FAILURE;
111  }
112  }
113 
114  m_caloPhiSelection = false;
115  if ( m_phiCut.size() >0 ) {
116  if ( m_phiCut.size() == 2 && m_phiCut[0]<m_phiCut[1] ) {
117  REPORT_MESSAGE( MSG::INFO ) << "*** LArSCHitFillerTool: Phi Selection specified: " << m_phiCut[0] << ", " << m_phiCut[1];
118  m_caloPhiSelection = true;
119  } else {
120  REPORT_MESSAGE( MSG::FATAL ) << " *** LArSCHitFillerTool: Invalid Phi Cut Range specified: Abort!";
121  return StatusCode::FAILURE;
122  }
123  }
124 
125  m_caloLayerSelection = false;
126  if ( m_caloLayers.size()>0 ) {
127  if ( m_caloLayers.size()>28 ) {
128  REPORT_MESSAGE( MSG::FATAL ) << " *** LArSCHitFillerTool: Invalid No. of Calo Layer selection: " << m_caloLayers.size() << " Abort!";
129  return StatusCode::FAILURE;
130  }
131  for( unsigned int j=0; j<m_caloLayers.size(); j++) {
132  if (m_caloLayers[j]>27 ) {
133  REPORT_MESSAGE( MSG::FATAL ) << " *** LArSCHitFillerTool: Invalid Calo Layer selection: " << m_caloLayers[j] << " Abort!";
134  return StatusCode::FAILURE;
135  }
136  }
137  m_caloLayerSelection = true;
138  }
139 
140 
141  ATH_MSG_INFO( " *** LArSCHitFillerTool: caloEtaSelection " << m_caloEtaSelection );
142  ATH_MSG_INFO( " *** LArSCHitFillerTool: caloPhiSelection " << m_caloPhiSelection );
143  ATH_MSG_INFO( " *** LArSCHitFillerTool: caloLayerSelection " << m_caloLayerSelection );
144 
145  ATH_MSG_INFO( " *** LArSCHitFillerTool: completed" );
146  return StatusCode::SUCCESS;
147 }

Member Data Documentation

◆ m_blockName

std::string D3PD::BlockFillerToolImpl::m_blockName
privateinherited

Property: the name of this block.

Definition at line 118 of file BlockFillerToolImpl.h.

◆ m_calo

std::vector<int>* D3PD::LArSCHitFillerTool::m_calo
private

Definition at line 87 of file LArSCHitFillerTool.h.

◆ m_caloEtaSelection

bool D3PD::LArSCHitFillerTool::m_caloEtaSelection
private

Definition at line 99 of file LArSCHitFillerTool.h.

◆ m_caloLayers

std::vector< unsigned int > D3PD::LArSCHitFillerTool::m_caloLayers
private

Definition at line 97 of file LArSCHitFillerTool.h.

◆ m_caloLayerSelection

bool D3PD::LArSCHitFillerTool::m_caloLayerSelection
private

Definition at line 101 of file LArSCHitFillerTool.h.

◆ m_caloNums

std::vector< unsigned int > D3PD::LArSCHitFillerTool::m_caloNums
private

Definition at line 96 of file LArSCHitFillerTool.h.

◆ m_caloPhiSelection

bool D3PD::LArSCHitFillerTool::m_caloPhiSelection
private

Definition at line 100 of file LArSCHitFillerTool.h.

◆ m_caloSelection

bool D3PD::LArSCHitFillerTool::m_caloSelection
private

Definition at line 102 of file LArSCHitFillerTool.h.

◆ m_caloSuperCellMgrKey

SG::ReadCondHandleKey<CaloSuperCellDetDescrManager> D3PD::LArSCHitFillerTool::m_caloSuperCellMgrKey
private
Initial value:
{
this,"CaloSuperCellDetDescrManager","CaloSuperCellDetDescrManager","SG key of the resulting CaloSuperCellDetDescrManager" }

Definition at line 108 of file LArSCHitFillerTool.h.

◆ m_converter

TypeConverter D3PD::BlockFillerToolImpl::m_converter
privateinherited

Helper to do type conversions.

Definition at line 121 of file BlockFillerToolImpl.h.

◆ m_dd_fSampl

const ILArfSampl* D3PD::LArSCHitFillerTool::m_dd_fSampl
private

Definition at line 76 of file LArSCHitFillerTool.h.

◆ m_E

std::vector<double>* D3PD::LArSCHitFillerTool::m_E
private

Definition at line 80 of file LArSCHitFillerTool.h.

◆ m_emid

const LArEM_ID* D3PD::LArSCHitFillerTool::m_emid
private

Definition at line 71 of file LArSCHitFillerTool.h.

◆ m_Eoff

std::vector<double>* D3PD::LArSCHitFillerTool::m_Eoff
private

Definition at line 83 of file LArSCHitFillerTool.h.

◆ m_Et

std::vector<double>* D3PD::LArSCHitFillerTool::m_Et
private

Definition at line 84 of file LArSCHitFillerTool.h.

◆ m_eta

std::vector<double>* D3PD::LArSCHitFillerTool::m_eta
private

Definition at line 81 of file LArSCHitFillerTool.h.

◆ m_etaCut

std::vector<float> D3PD::LArSCHitFillerTool::m_etaCut
private

Definition at line 94 of file LArSCHitFillerTool.h.

◆ m_fcalid

const LArFCAL_ID* D3PD::LArSCHitFillerTool::m_fcalid
private

Definition at line 72 of file LArSCHitFillerTool.h.

◆ m_fsampl

std::vector<double>* D3PD::LArSCHitFillerTool::m_fsampl
private

Definition at line 85 of file LArSCHitFillerTool.h.

◆ m_hecid

const LArHEC_ID* D3PD::LArSCHitFillerTool::m_hecid
private

Definition at line 73 of file LArSCHitFillerTool.h.

◆ m_ieta

std::vector<int>* D3PD::LArSCHitFillerTool::m_ieta
private

Definition at line 90 of file LArSCHitFillerTool.h.

◆ m_jphi

std::vector<int>* D3PD::LArSCHitFillerTool::m_jphi
private

Definition at line 91 of file LArSCHitFillerTool.h.

◆ m_metadata

ObjectMetadata D3PD::AddVariable::m_metadata
protectedinherited

Metadata about the variables created by this object.

Definition at line 129 of file AddVariable.h.

◆ m_nSC

int* D3PD::LArSCHitFillerTool::m_nSC
private

parameters

Definition at line 79 of file LArSCHitFillerTool.h.

◆ m_offlId

std::vector<unsigned int>* D3PD::LArSCHitFillerTool::m_offlId
private

Definition at line 92 of file LArSCHitFillerTool.h.

◆ m_onlineHelper

const LArOnlineID* D3PD::LArSCHitFillerTool::m_onlineHelper
private

Definition at line 75 of file LArSCHitFillerTool.h.

◆ m_phi

std::vector<double>* D3PD::LArSCHitFillerTool::m_phi
private

Definition at line 82 of file LArSCHitFillerTool.h.

◆ m_phiCut

std::vector<float> D3PD::LArSCHitFillerTool::m_phiCut
private

Definition at line 95 of file LArSCHitFillerTool.h.

◆ m_prefix

std::string D3PD::BlockFillerToolImpl::m_prefix
privateinherited

Property: the variable prefix for this block.

Definition at line 112 of file BlockFillerToolImpl.h.

◆ m_region

std::vector<int>* D3PD::LArSCHitFillerTool::m_region
private

Definition at line 88 of file LArSCHitFillerTool.h.

◆ m_sampling

std::vector<int>* D3PD::LArSCHitFillerTool::m_sampling
private

Definition at line 89 of file LArSCHitFillerTool.h.

◆ m_sc_idHelper

const CaloCell_SuperCell_ID* D3PD::LArSCHitFillerTool::m_sc_idHelper
private

idHlper

Definition at line 112 of file LArSCHitFillerTool.h.

◆ m_scidtool

ToolHandle<ICaloSuperCellIDTool> D3PD::LArSCHitFillerTool::m_scidtool
private

Property: Offline / supercell mapping tool.

Definition at line 106 of file LArSCHitFillerTool.h.

◆ m_suffix

std::string D3PD::BlockFillerToolImpl::m_suffix
privateinherited

Property: the variable prefix for this block.

Definition at line 115 of file BlockFillerToolImpl.h.

◆ m_tileid

const TileID* D3PD::LArSCHitFillerTool::m_tileid
private

Definition at line 74 of file LArSCHitFillerTool.h.

◆ m_tree

IAddVariable* D3PD::AddVariable::m_tree
privateinherited

Reference to the block name.

The parent IAddVariable instance.

Definition at line 143 of file AddVariable.h.

◆ s_emptyString

const std::string D3PD::AddVariable::s_emptyString
staticprivateinherited

Used to provide a default value for blockName.

Definition at line 41 of file AddVariable.h.


The documentation for this class was generated from the following files:
D3PD::LArSCHitFillerTool::book
virtual StatusCode book()
Book variables for this block.
Definition: LArSCHitFillerTool.cxx:152
D3PD::ObjectMetadata::addDimensionedVariable
virtual StatusCode addDimensionedVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)
The object doesn't support dimensioned variables at the moment, like most of the D3PDMaker code doesn...
Definition: ObjectMetadata.cxx:157
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
CaloCell_Base_ID::region
int region(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
D3PD::LArSCHitFillerTool::m_jphi
std::vector< int > * m_jphi
Definition: LArSCHitFillerTool.h:91
index
Definition: index.py:1
D3PD::LArSCHitFillerTool::m_scidtool
ToolHandle< ICaloSuperCellIDTool > m_scidtool
Property: Offline / supercell mapping tool.
Definition: LArSCHitFillerTool.h:106
D3PD::TypeConverter::dstName
std::string dstName() const
Return the name of the destination type, or an empty string.
Definition: TypeConverter.cxx:151
D3PD::AddVariable::configureD3PD
StatusCode configureD3PD(IAddVariable *tree)
Configure the parent tree.
Definition: AddVariable.cxx:61
D3PD::AddVariable::AddVariable
AddVariable(const std::string &prefix, const std::string &blockName=s_emptyString)
Constructor.
Definition: AddVariable.cxx:29
D3PD::AddVariable::m_suffix
const std::string & m_suffix
Reference to the variable suffix.
Definition: AddVariable.h:137
tree
TChain * tree
Definition: tile_monitor.h:30
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
skel.it
it
Definition: skel.GENtoEVGEN.py:396
D3PD::LArSCHitFillerTool::m_eta
std::vector< double > * m_eta
Definition: LArSCHitFillerTool.h:81
D3PD::AddVariable::m_prefix
const std::string & m_prefix
Reference to the variable prefix.
Definition: AddVariable.h:134
Identifier::get_identifier32
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
D3PD::LArSCHitFillerTool::m_E
std::vector< double > * m_E
Definition: LArSCHitFillerTool.h:80
D3PD::LArSCHitFillerTool::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArSCHitFillerTool.h:75
LArHit::energy
double energy() const
Definition: LArHit.h:113
LArHitContainer
Hit collection.
Definition: LArHitContainer.h:26
D3PD::BlockFillerToolImpl::m_suffix
std::string m_suffix
Property: the variable prefix for this block.
Definition: BlockFillerToolImpl.h:115
D3PD::AddVariable::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Add a variable to the tuple.
Definition: AddVariable.cxx:85
D3PD::LArSCHitFillerTool::m_dd_fSampl
const ILArfSampl * m_dd_fSampl
Definition: LArSCHitFillerTool.h:76
D3PD::LArSCHitFillerTool::m_region
std::vector< int > * m_region
Definition: LArSCHitFillerTool.h:88
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
D3PD::LArSCHitFillerTool::m_nSC
int * m_nSC
parameters
Definition: LArSCHitFillerTool.h:79
Identifier32::get_compact
value_type get_compact() const
Get the compact id.
Definition: Identifier32.h:44
D3PD::AddVariable::m_tree
IAddVariable * m_tree
Reference to the block name.
Definition: AddVariable.h:143
D3PD::LArSCHitFillerTool::m_fsampl
std::vector< double > * m_fsampl
Definition: LArSCHitFillerTool.h:85
D3PD::TypeConverter::init
StatusCode init(const std::type_info &src_ti, const std::type_info &dst_ti)
Initialize the converter.
Definition: TypeConverter.cxx:51
D3PD::LArSCHitFillerTool::m_caloSelection
bool m_caloSelection
Definition: LArSCHitFillerTool.h:102
CaloSuperCellDetDescrManager
Definition: CaloDetDescrManager.h:490
D3PD::TypeConverter::srcName
std::string srcName() const
Return the name of the source type, or an empty string.
Definition: TypeConverter.cxx:141
D3PD::AddVariable::m_metadata
ObjectMetadata m_metadata
Metadata about the variables created by this object.
Definition: AddVariable.h:129
D3PD::LArSCHitFillerTool::m_emid
const LArEM_ID * m_emid
Definition: LArSCHitFillerTool.h:71
D3PD::LArSCHitFillerTool::m_phiCut
std::vector< float > m_phiCut
Definition: LArSCHitFillerTool.h:95
D3PD::TypeConverter::convertUntyped
const void * convertUntyped(const void *p) const
Convert pointer.
Definition: TypeConverter.cxx:116
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
D3PD::LArSCHitFillerTool::m_Et
std::vector< double > * m_Et
Definition: LArSCHitFillerTool.h:84
D3PD::LArSCHitFillerTool::m_calo
std::vector< int > * m_calo
Definition: LArSCHitFillerTool.h:87
CaloCell_Base_ID::sampling
int sampling(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
ILArfSampl::FSAMPL
virtual const float & FSAMPL(const HWIdentifier &id) const =0
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CaloCell_Base_ID::eta
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloCell_Base_ID::sub_calo
int sub_calo(const Identifier id) const
returns an int taken from SUBCALO enum and describing the subCalo to which the Id belongs.
D3PD::LArSCHitFillerTool::m_ieta
std::vector< int > * m_ieta
Definition: LArSCHitFillerTool.h:90
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
D3PD::LArSCHitFillerTool::m_caloLayers
std::vector< unsigned int > m_caloLayers
Definition: LArSCHitFillerTool.h:97
D3PD::ObjectMetadata::clear
void clear()
Function clearing the object.
Definition: ObjectMetadata.cxx:352
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
python.Utils.unixtools.which
def which(filename, env=os.environ)
UNIX-style which ---------------------------------------------------------—.
Definition: unixtools.py:39
D3PD::LArSCHitFillerTool::m_caloPhiSelection
bool m_caloPhiSelection
Definition: LArSCHitFillerTool.h:100
D3PD::LArSCHitFillerTool::m_caloNums
std::vector< unsigned int > m_caloNums
Definition: LArSCHitFillerTool.h:96
D3PD::BlockFillerToolImpl::m_converter
TypeConverter m_converter
Helper to do type conversions.
Definition: BlockFillerToolImpl.h:121
D3PD::BlockFillerToolImpl::m_blockName
std::string m_blockName
Property: the name of this block.
Definition: BlockFillerToolImpl.h:118
LArHit::cellID
Identifier cellID() const
Definition: LArHit.h:108
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
D3PD::LArSCHitFillerTool::m_sc_idHelper
const CaloCell_SuperCell_ID * m_sc_idHelper
idHlper
Definition: LArSCHitFillerTool.h:112
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
D3PD::ObjectMetadata::addVariable
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
This function can be used to save the metadata about a D3PD variable.
Definition: ObjectMetadata.cxx:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
D3PD::LArSCHitFillerTool::m_caloEtaSelection
bool m_caloEtaSelection
Definition: LArSCHitFillerTool.h:99
LArHit
Class to store hit energy and time in LAr cell from G4 simulation.
Definition: LArHit.h:25
CaloCell_Base_ID::phi
int phi(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
CaloCell_Base_ID::cell_id
Identifier cell_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy, const int eta, const int phi) const
Make a cell (== channel) ID from constituting fields and subCalo index; for (Mini)FCAL,...
D3PD::LArSCHitFillerTool::m_fcalid
const LArFCAL_ID * m_fcalid
Definition: LArSCHitFillerTool.h:72
D3PD::LArSCHitFillerTool::m_caloSuperCellMgrKey
SG::ReadCondHandleKey< CaloSuperCellDetDescrManager > m_caloSuperCellMgrKey
Definition: LArSCHitFillerTool.h:108
D3PD::LArSCHitFillerTool::m_etaCut
std::vector< float > m_etaCut
Definition: LArSCHitFillerTool.h:94
REPORT_MESSAGE
#define REPORT_MESSAGE(LVL)
Report a message.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:365
DeMoScan.index
string index
Definition: DeMoScan.py:364
D3PD::LArSCHitFillerTool::m_phi
std::vector< double > * m_phi
Definition: LArSCHitFillerTool.h:82
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
D3PD::IAddVariable::addVariable
StatusCode addVariable(const std::string &name, T *&ptr, const std::string &docstring="")
Add a variable to the tuple.
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
D3PD::IAddVariable::addDimensionedVariable
StatusCode addDimensionedVariable(const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
Add a variable to the tuple.
CaloCell_Base_ID::NSUBCALO
@ NSUBCALO
Definition: CaloCell_Base_ID.h:46
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
D3PD::BlockFillerToolImpl::m_prefix
std::string m_prefix
Property: the variable prefix for this block.
Definition: BlockFillerToolImpl.h:112
D3PD::LArSCHitFillerTool::m_Eoff
std::vector< double > * m_Eoff
Definition: LArSCHitFillerTool.h:83
D3PD::LArSCHitFillerTool::m_hecid
const LArHEC_ID * m_hecid
Definition: LArSCHitFillerTool.h:73
D3PD::LArSCHitFillerTool::m_tileid
const TileID * m_tileid
Definition: LArSCHitFillerTool.h:74
D3PD::LArSCHitFillerTool::m_caloLayerSelection
bool m_caloLayerSelection
Definition: LArSCHitFillerTool.h:101
D3PD::LArSCHitFillerTool::m_sampling
std::vector< int > * m_sampling
Definition: LArSCHitFillerTool.h:89
D3PD::LArSCHitFillerTool::m_offlId
std::vector< unsigned int > * m_offlId
Definition: LArSCHitFillerTool.h:92
ServiceHandle< StoreGateSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14