CaloHitCreator.cxx
Go to the documentation of this file.
1 #include "CaloHitCreator.h"
2 
3 #include <algorithm>
4 #include <cmath>
5 #include <limits>
6 #include <exception>
7 
8 #include "CoreUtils/ServiceUtil.h"
10 
11 namespace gar {
12  namespace gar_pandora {
13 
14  CaloHitCreator::CaloHitCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation)
15  : m_settings(settings),
16  m_pandora(*pPandora),
17  m_rotation(*pRotation),
18  m_eCalBarrelLayerThickness(0.f),
19  m_eCalEndCapLayerThickness(0.f),
20  artCalorimeterHitVector(0)
21  {
22  fGeo = gar::providerFrom<geo::GeometryGAr>();
23  std::string fEncoding = fGeo->GetECALCellIDEncoding();
24  m_fieldDecoder = new gar::geo::BitFieldCoder( fEncoding );
25  m_origin[0] = fGeo->GetOriginX();
26  m_origin[1] = fGeo->GetOriginY();
27  m_origin[2] = fGeo->GetOriginZ();
28 
29  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &barrelLayers = (fGeo->GetECALLayeredCalorimeterData()[gar::geo::LayeredCalorimeterData::BarrelLayout].get())->layers;
30 
31  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &endcapLayers = (fGeo->GetECALLayeredCalorimeterData()[gar::geo::LayeredCalorimeterData::EndcapLayout].get())->layers;
32 
33  ///Take thicknesses from last layer (was like that before with gear)
34  m_eCalEndCapLayerThickness = (endcapLayers.back().inner_thickness + endcapLayers.back().outer_thickness) * CLHEP::cm;
35  m_eCalBarrelLayerThickness = (barrelLayers.back().inner_thickness + barrelLayers.back().outer_thickness) * CLHEP::cm;
36 
37  if ( (m_eCalEndCapLayerThickness < std::numeric_limits<float>::epsilon()) || (m_eCalBarrelLayerThickness < std::numeric_limits<float>::epsilon()) )
38  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
39  }
40 
41  //------------------------------------------------------------------------------------------------------------------------------------------
42 
44  {
45  if ( m_fieldDecoder ) delete m_fieldDecoder;
46  }
47 
48  //------------------------------------------------------------------------------------------------------------------------------------------
49 
50  pandora::StatusCode CaloHitCreator::CreateCaloHits(const art::Event &pEvent)
51  {
52  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->CollectECALCaloHits(pEvent, m_settings.m_CaloHitCollection, m_settings.m_CaloHitInstanceName, artCalorimeterHitVector));
53  PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, this->CreateECalCaloHits());
54 
55  return pandora::STATUS_CODE_SUCCESS;
56  }
57 
58  //------------------------------------------------------------------------------------------------------------------------------------------
59 
60  pandora::StatusCode CaloHitCreator::CreateECalCaloHits() const
61  {
62  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &barrelLayers = (fGeo->GetECALLayeredCalorimeterData()[gar::geo::LayeredCalorimeterData::BarrelLayout].get())->layers;
63 
64  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &endcapLayers = (fGeo->GetECALLayeredCalorimeterData()[gar::geo::LayeredCalorimeterData::EndcapLayout].get())->layers;
65 
66  for (CalorimeterHitVector::const_iterator iter = artCalorimeterHitVector.begin(), iterEnd = artCalorimeterHitVector.end(); iter != iterEnd; ++iter)
67  {
68  try
69  {
70  art::Ptr<gar::rec::CaloHit> artPtrCaloHit = *iter;
71  const gar::rec::CaloHit *pCaloHit = artPtrCaloHit.get();
72 
73  if (nullptr == pCaloHit)
74  throw;
75 
76  PandoraApi::CaloHit::Parameters caloHitParameters;
77  caloHitParameters.m_hitType = pandora::ECAL;
78  caloHitParameters.m_isDigital = false;
79  caloHitParameters.m_layer = m_fieldDecoder->get(pCaloHit->CellID(), "layer");
80  caloHitParameters.m_isInOuterSamplingLayer = (this->GetNLayersFromEdge(pCaloHit) <= m_settings.m_nOuterSamplingLayers);
81  this->GetCommonCaloHitProperties(pCaloHit, caloHitParameters);
82 
83  float absorberCorrection(1.);
84 
85  //Need to use X instead of Z
86  if (std::fabs( (pCaloHit->Position()[0] - m_origin[0]) * CLHEP::cm) < m_settings.m_eCalBarrelOuterZ)
87  {
88  this->GetBarrelCaloHitProperties(pCaloHit, barrelLayers, m_settings.m_eCalBarrelInnerSymmetry, caloHitParameters, m_settings.m_eCalBarrelNormalVector, absorberCorrection);
89  caloHitParameters.m_hadronicEnergy = m_settings.m_eCalToHadGeVBarrel * pCaloHit->Energy();
90  }
91  else
92  {
93  this->GetEndCapCaloHitProperties(pCaloHit, endcapLayers, caloHitParameters, absorberCorrection);
94  caloHitParameters.m_hadronicEnergy = m_settings.m_eCalToHadGeVEndCap * pCaloHit->Energy();
95  }
96 
97  caloHitParameters.m_mipEquivalentEnergy = pCaloHit->Energy() * m_settings.m_eCalToMip * absorberCorrection;
98 
99  if (caloHitParameters.m_mipEquivalentEnergy.Get() < m_settings.m_eCalMipThreshold)
100  continue;
101 
102  caloHitParameters.m_electromagneticEnergy = m_settings.m_eCalToEMGeV * pCaloHit->Energy();
103 
104  //Check if the hit is inside the calo... could be SSA reco problems....
105  const float rCoordinate( std::sqrt( (pCaloHit->Position()[1] - m_origin[1]) * (pCaloHit->Position()[1] - m_origin[1]) + (pCaloHit->Position()[2] - m_origin[2]) * (pCaloHit->Position()[2] - m_origin[2]) ) * CLHEP::cm );
106  if( rCoordinate > m_settings.m_eCalBarrelOuterR )
107  {
108  MF_LOG_WARNING("CaloHitCreator::CreateECalCaloHits")
109  << " Position x: " << pCaloHit->Position()[0] * CLHEP::cm
110  << " y: " << pCaloHit->Position()[1] * CLHEP::cm
111  << " z: " << pCaloHit->Position()[2] * CLHEP::cm
112  << " rCoordinate " << rCoordinate << " > " << " m_settings.m_eCalBarrelOuterR " << m_settings.m_eCalBarrelOuterR
113  << " caloHitParameters.m_hitType = " << caloHitParameters.m_hitType.Get()
114  << " caloHitParameters.m_isDigital = " << caloHitParameters.m_isDigital.Get()
115  << " caloHitParameters.m_layer = " << caloHitParameters.m_layer.Get()
116  << " caloHitParameters.m_isInOuterSamplingLayer = " << caloHitParameters.m_isInOuterSamplingLayer.Get()
117  << " caloHitParameters.m_cellGeometry = " << caloHitParameters.m_cellGeometry.Get()
118  << " caloHitParameters.m_expectedDirection = " << caloHitParameters.m_expectedDirection.Get()
119  << " caloHitParameters.m_inputEnergy = " << caloHitParameters.m_inputEnergy.Get()
120  << " caloHitParameters.m_time = " << caloHitParameters.m_time.Get()
121  << " caloHitParameters.m_cellSize0 = " << caloHitParameters.m_cellSize0.Get()
122  << " caloHitParameters.m_cellSize1 = " << caloHitParameters.m_cellSize1.Get()
123  << " caloHitParameters.m_cellThickness = " << caloHitParameters.m_cellThickness.Get()
124  << " caloHitParameters.m_nCellRadiationLengths = " << caloHitParameters.m_nCellRadiationLengths.Get()
125  << " caloHitParameters.m_nCellInteractionLengths = " << caloHitParameters.m_nCellInteractionLengths.Get()
126  << " caloHitParameters.m_hadronicEnergy = " << caloHitParameters.m_hadronicEnergy.Get()
127  << " caloHitParameters.m_mipEquivalentEnergy = " << caloHitParameters.m_mipEquivalentEnergy.Get()
128  << " caloHitParameters.m_electromagneticEnergy = " << caloHitParameters.m_electromagneticEnergy.Get();
129  continue;
130  }
131 
132  PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::CaloHit::Create(m_pandora, caloHitParameters));
133  }
134  catch (pandora::StatusCodeException &statusCodeException)
135  {
136  MF_LOG_ERROR("CaloHitCreator::CreateECalCaloHits()")
137  << "Failed to extract ecal calo hit: " << statusCodeException.ToString();
138  }
139  catch (std::exception &exception)
140  {
141  MF_LOG_WARNING("CaloHitCreator::CreateECalCaloHits()")
142  << "Failed to extract ecal calo hit: " << exception.what();
143  }
144  }
145 
146  return pandora::STATUS_CODE_SUCCESS;
147  }
148 
149  //------------------------------------------------------------------------------------------------------------------------------------------
150 
151  void CaloHitCreator::GetCommonCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const
152  {
153  const float *pCaloHitPosition(pCaloHit->Position());
154  //Inverse X and Z for pandora to cope with the change in beam axis
155  const pandora::CartesianVector positionVector( (pCaloHitPosition[0] - m_origin[0]) * CLHEP::cm, (pCaloHitPosition[1] - m_origin[1]) * CLHEP::cm, (pCaloHitPosition[2] - m_origin[2]) * CLHEP::cm);
156  const pandora::CartesianVector newPositionVector = m_rotation.MakeRotation(positionVector);
157 
158  caloHitParameters.m_cellGeometry = pandora::RECTANGULAR;
159  caloHitParameters.m_positionVector = newPositionVector;
160  caloHitParameters.m_expectedDirection = newPositionVector.GetUnitVector();
161  caloHitParameters.m_pParentAddress = (void*)pCaloHit;
162  caloHitParameters.m_inputEnergy = pCaloHit->Energy();
163  caloHitParameters.m_time = pCaloHit->Time().first;
164  }
165 
166  //------------------------------------------------------------------------------------------------------------------------------------------
167 
168  void CaloHitCreator::GetEndCapCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &layers, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const
169  {
170  caloHitParameters.m_hitRegion = pandora::ENDCAP;
171 
172  const int physicalLayer(std::min(static_cast<int>(caloHitParameters.m_layer.Get()), static_cast<int>(layers.size()-1)));
173  caloHitParameters.m_cellSize0 = layers[physicalLayer].cellSize0 * CLHEP::cm;
174  caloHitParameters.m_cellSize1 = layers[physicalLayer].cellSize1 * CLHEP::cm;
175 
176  double thickness = (layers[physicalLayer].inner_thickness+layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
177  double nRadLengths = layers[physicalLayer].inner_nRadiationLengths;
178  double nIntLengths = layers[physicalLayer].inner_nInteractionLengths;
179  double layerAbsorberThickness = (layers[physicalLayer].inner_thickness-layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
180 
181  if(physicalLayer>0){
182  thickness += (layers[physicalLayer-1].outer_thickness -layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
183  nRadLengths += layers[physicalLayer-1].outer_nRadiationLengths;
184  nIntLengths += layers[physicalLayer-1].outer_nInteractionLengths;
185  layerAbsorberThickness += (layers[physicalLayer-1].outer_thickness -layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
186  }
187 
188  caloHitParameters.m_cellThickness = thickness;
189  caloHitParameters.m_nCellRadiationLengths = nRadLengths;
190  caloHitParameters.m_nCellInteractionLengths = nIntLengths;
191 
192  if (caloHitParameters.m_nCellRadiationLengths.Get() < std::numeric_limits<float>::epsilon() || caloHitParameters.m_nCellInteractionLengths.Get() < std::numeric_limits<float>::epsilon())
193  {
194  MF_LOG_ERROR("CaloHitCreator::GetEndcapCaloHitProperties")
195  << "Calo hit has 0 radiation length or interaction length: not creating a Pandora calo hit.";
196  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
197  }
198 
199  absorberCorrection = 1.;
200  for (unsigned int i = 0, iMax = layers.size(); i < iMax; ++i)
201  {
202  float absorberThickness((layers[i].inner_thickness - layers[i].sensitive_thickness/2.0 ) * CLHEP::cm);
203 
204  if (i>0)
205  absorberThickness += (layers[i-1].outer_thickness - layers[i-1].sensitive_thickness/2.0) * CLHEP::cm;
206 
207  if (absorberThickness < std::numeric_limits<float>::epsilon())
208  continue;
209 
210  if (layerAbsorberThickness > std::numeric_limits<float>::epsilon())
211  absorberCorrection = absorberThickness / layerAbsorberThickness;
212 
213  break;
214  }
215 
216  caloHitParameters.m_cellNormalVector = (pCaloHit->Position()[0] * CLHEP::cm > 0) ? pandora::CartesianVector(1, 0, 0) : pandora::CartesianVector(-1, 0, 0);
217  }
218 
219  //------------------------------------------------------------------------------------------------------------------------------------------
220 
222  const std::vector<gar::geo::LayeredCalorimeterStruct::Layer> &layers, unsigned int barrelSymmetryOrder, PandoraApi::CaloHit::Parameters &caloHitParameters, FloatVector const& /* normalVector */, float &absorberCorrection ) const
223  {
224  caloHitParameters.m_hitRegion = pandora::BARREL;
225 
226  const int physicalLayer(std::min(static_cast<int>(caloHitParameters.m_layer.Get()), static_cast<int>(layers.size()-1)));
227  caloHitParameters.m_cellSize0 = layers[physicalLayer].cellSize0 * CLHEP::cm;
228  caloHitParameters.m_cellSize1 = layers[physicalLayer].cellSize1 * CLHEP::cm;
229 
230  double thickness = (layers[physicalLayer].inner_thickness+layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
231  double nRadLengths = layers[physicalLayer].inner_nRadiationLengths;
232  double nIntLengths = layers[physicalLayer].inner_nInteractionLengths;
233 
234  double layerAbsorberThickness = (layers[physicalLayer].inner_thickness-layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
235  if(physicalLayer>0){
236  thickness += (layers[physicalLayer-1].outer_thickness -layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
237  nRadLengths += layers[physicalLayer-1].outer_nRadiationLengths;
238  nIntLengths += layers[physicalLayer-1].outer_nInteractionLengths;
239  layerAbsorberThickness += (layers[physicalLayer-1].outer_thickness -layers[physicalLayer].sensitive_thickness/2.0) * CLHEP::cm;
240  }
241 
242  caloHitParameters.m_cellThickness = thickness;
243  caloHitParameters.m_nCellRadiationLengths = nRadLengths;
244  caloHitParameters.m_nCellInteractionLengths = nIntLengths;
245 
246  if (caloHitParameters.m_nCellRadiationLengths.Get() < std::numeric_limits<float>::epsilon() || caloHitParameters.m_nCellInteractionLengths.Get() < std::numeric_limits<float>::epsilon())
247  {
248  MF_LOG_ERROR("CaloHitCreator::GetBarrelCaloHitProperties")
249  << "Calo hit has 0 radiation length or interaction length: not creating a Pandora calo hit.";
250  throw pandora::StatusCodeException(pandora::STATUS_CODE_INVALID_PARAMETER);
251  }
252 
253  absorberCorrection = 1.;
254  for (unsigned int i = 0, iMax = layers.size(); i < iMax; ++i)
255  {
256  float absorberThickness((layers[i].inner_thickness - layers[i].sensitive_thickness/2.0 ) * CLHEP::cm);
257 
258  if (i>0)
259  absorberThickness += (layers[i-1].outer_thickness - layers[i-1].sensitive_thickness/2.0) * CLHEP::cm;
260 
261  if (absorberThickness < std::numeric_limits<float>::epsilon())
262  continue;
263 
264  if (layerAbsorberThickness > std::numeric_limits<float>::epsilon())
265  absorberCorrection = absorberThickness / layerAbsorberThickness;
266 
267  break;
268  }
269 
270  if (barrelSymmetryOrder > 2)
271  {
272  const double phi = atan2( pCaloHit->Position()[2], pCaloHit->Position()[1] );
273 
274  MF_LOG_DEBUG( "CaloHitCreator::GetBarrelCaloHitProperties" )
275  << "This hit does not have any cellIDs set, will use phi-direction for normal vector "
276  << " phi:" << std::setw(15) << phi*180/M_PI;
277 
278  caloHitParameters.m_cellNormalVector = pandora::CartesianVector(0, std::cos(phi), std::sin(phi));
279  }
280  else
281  {
282  const float *pCaloHitPosition( pCaloHit->Position() );
283  const float phi = std::atan2( pCaloHitPosition[2], pCaloHitPosition[1] );
284  caloHitParameters.m_cellNormalVector = pandora::CartesianVector(0, std::cos(phi), std::sin(phi));
285  }
286  }
287 
288  //------------------------------------------------------------------------------------------------------------------------------------------
289 
290  int CaloHitCreator::GetNLayersFromEdge(const gar::rec::CaloHit *const pCaloHit) const
291  {
292  // Calo hit coordinate calculations
293  const float barrelMaximumRadius(this->GetMaximumRadius(pCaloHit, m_settings.m_eCalBarrelOuterSymmetry, m_settings.m_eCalBarrelOuterPhi0));
295  const float caloHitAbsZ(std::fabs(pCaloHit->Position()[0]) * CLHEP::cm);
296 
297  // Distance from radial outer
298  float radialDistanceToEdge(std::numeric_limits<float>::max());
299 
300  if (caloHitAbsZ < m_settings.m_eCalBarrelOuterZ)
301  {
302  radialDistanceToEdge = (m_settings.m_eCalBarrelOuterR - barrelMaximumRadius) / m_eCalBarrelLayerThickness;
303  }
304  else
305  {
306  radialDistanceToEdge = (m_settings.m_eCalEndCapOuterR - endCapMaximumRadius) / m_eCalEndCapLayerThickness;
307  }
308 
309  // Distance from rear of endcap outer
310  float rearDistanceToEdge(std::numeric_limits<float>::max());
311 
312  if (caloHitAbsZ >= m_settings.m_eCalBarrelOuterZ)
313  {
314  rearDistanceToEdge = (m_settings.m_eCalEndCapOuterZ - caloHitAbsZ) / m_eCalEndCapLayerThickness;
315  }
316  else
317  {
318  const float rearDistance((m_settings.m_eCalBarrelOuterZ - caloHitAbsZ) / m_eCalBarrelLayerThickness);
319 
320  if (rearDistance < m_settings.m_layersFromEdgeMaxRearDistance)
321  {
322  const float overlapDistance((m_settings.m_eCalEndCapOuterR - endCapMaximumRadius) / m_eCalEndCapLayerThickness);
323  rearDistanceToEdge = std::max(rearDistance, overlapDistance);
324  }
325  }
326 
327  return static_cast<int>(std::min(radialDistanceToEdge, rearDistanceToEdge));
328  }
329 
330  //------------------------------------------------------------------------------------------------------------------------------------------
331 
332  float CaloHitCreator::GetMaximumRadius(const gar::rec::CaloHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const
333  {
334  const float *pCaloHitPosition(pCaloHit->Position());
335 
336  if (symmetryOrder <= 2)
337  return std::sqrt((pCaloHitPosition[1] * pCaloHitPosition[1]) + (pCaloHitPosition[2] * pCaloHitPosition[2]) * CLHEP::cm);
338 
339  float maximumRadius(0.f);
340  const float twoPi(2.f * M_PI);
341 
342  for (unsigned int i = 0; i < symmetryOrder; ++i)
343  {
344  const float phi = phi0 + i * twoPi / static_cast<float>(symmetryOrder);
345  float radius = pCaloHitPosition[2] * std::cos(phi) + pCaloHitPosition[1] * std::sin(phi);
346 
347  if (radius > maximumRadius)
348  maximumRadius = radius;
349  }
350 
351  return maximumRadius * CLHEP::cm;
352  }
353 
354  //------------------------------------------------------------------------------------------------------------------------------------------
355 
356  pandora::StatusCode CaloHitCreator::CollectECALCaloHits(const art::Event &pEvent, const std::string &label, const std::string &instanceName, CalorimeterHitVector &ecalCaloHitVector)
357  {
358  art::InputTag itag(label, instanceName);
359  auto theHits = pEvent.getHandle< RawCalorimeterHitVector >(itag);
360  if (!theHits)
361  {
362  MF_LOG_WARNING("CaloHitCreator::CreateECalCaloHits") << " Failed to find ecal hits for label " << label << std::endl;
363  return pandora::STATUS_CODE_NOT_FOUND;
364  }
365 
366  MF_LOG_DEBUG("CaloHitCreator::CreateECalCaloHits") << " Found: " << theHits->size() << " Hits " << std::endl;
367 
368  for (unsigned int i = 0; i < theHits->size(); ++i)
369  {
370  const art::Ptr<gar::rec::CaloHit> hit(theHits, i);
371  ecalCaloHitVector.push_back(hit);
372  }
373 
374  return pandora::STATUS_CODE_SUCCESS;
375  }
376 
377  //------------------------------------------------------------------------------------------------------------------------------------------
378 
380  : m_CaloHitCollection( "" ),
381  m_CaloHitInstanceName( "" ),
382  m_eCalToMip(1.f),
383  m_eCalMipThreshold(0.f),
384  m_eCalToEMGeV(1.f),
385  m_eCalToHadGeVBarrel(1.f),
386  m_eCalToHadGeVEndCap(1.f),
387  m_maxECalHitHadronicEnergy(10000.f),
388  m_nOuterSamplingLayers(3),
389  m_layersFromEdgeMaxRearDistance(250.f),
390  m_eCalBarrelOuterR(0.f),
391  m_eCalBarrelOuterZ(0.f),
392  m_eCalBarrelInnerPhi0(0.f),
393  m_eCalBarrelOuterPhi0(0.f),
394  m_eCalBarrelInnerSymmetry(0.f),
395  m_eCalBarrelOuterSymmetry(8),
396  m_eCalBarrelNormalVector({0.0, 0.0, 1.0}),
397  m_eCalEndCapOuterR(0.f),
398  m_eCalEndCapOuterZ(0.f),
399  m_eCalEndCapInnerSymmetryOrder(0),
400  m_eCalEndCapInnerPhiCoordinate(0.f)
401  {
402  }
403  }
404 }
static constexpr double cm
Definition: Units.h:68
float m_eCalToHadGeVEndCap
The calibration from deposited ECal endcap energy to hadronic energy.
std::vector< art::Ptr< gar::rec::CaloHit > > CalorimeterHitVector
std::string m_CaloHitCollection
The calorimeter hit collection.
std::vector< float > FloatVector
float m_eCalMipThreshold
Threshold for creating calo hits in the ECal, units mip.
void GetBarrelCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector< gar::geo::LayeredCalorimeterStruct::Layer > &layers, unsigned int barrelSymmetryOrder, PandoraApi::CaloHit::Parameters &caloHitParameters, FloatVector const &normalVector, float &absorberCorrection) const
raw::CellID_t CellID() const
Definition: CaloHit.h:72
float m_eCalEndCapOuterR
ECal endcap outer r coordinate.
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::string string
Definition: nybbler.cc:12
CaloHitCreator(const Settings &settings, const pandora::Pandora *const pPandora, const RotationTransformation *const pRotation)
std::pair< float, float > Time() const
Definition: CaloHit.h:71
float GetOriginX() const
Definition: GeometryCore.h:548
float m_eCalEndCapOuterZ
ECal endcap outer z coordinate.
std::vector< gar::rec::CaloHit > RawCalorimeterHitVector
float m_eCalToEMGeV
The calibration from deposited ECal energy to EM energy.
#define MF_LOG_ERROR(category)
gar::geo::BitFieldCoder const * m_fieldDecoder
int m_nOuterSamplingLayers
Number of layers from edge for hit to be flagged as an outer layer hit.
intermediate_table::const_iterator const_iterator
float GetMaximumRadius(const gar::rec::CaloHit *const pCaloHit, const unsigned int symmetryOrder, const float phi0) const
float GetOriginZ() const
Definition: GeometryCore.h:552
float m_eCalToHadGeVBarrel
The calibration from deposited ECal barrel energy to hadronic energy.
pandora::StatusCode CreateCaloHits(const art::Event &pEvent)
float m_eCalBarrelOuterZ
ECal barrel outer z coordinate.
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
float m_eCalBarrelOuterPhi0
ECal barrel outer phi0 coordinate.
std::string m_CaloHitInstanceName
The calorimeter hit instance name.
float Energy() const
Definition: CaloHit.h:69
int GetNLayersFromEdge(const gar::rec::CaloHit *const pCaloHit) const
float m_eCalBarrelOuterR
ECal barrel outer r coordinate.
const geo::GeometryCore * fGeo
float GetOriginY() const
Definition: GeometryCore.h:550
const Settings m_settings
The calo hit creator settings.
static int max(int a, int b)
CalorimeterHitVector artCalorimeterHitVector
FloatVector m_eCalBarrelNormalVector
ECal barrel normal vector.
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
void GetEndCapCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, const std::vector< gar::geo::LayeredCalorimeterStruct::Layer > &layers, PandoraApi::CaloHit::Parameters &caloHitParameters, float &absorberCorrection) const
const RotationTransformation & m_rotation
#define M_PI
Definition: includeROOT.h:54
const pandora::CartesianVector MakeRotation(const pandora::CartesianVector &initialVec) const
General GArSoft Utilities.
long64 get(long64 bitfield, size_t index) const
const float * Position() const
Definition: CaloHit.h:70
unsigned int m_eCalEndCapInnerSymmetryOrder
ECal endcap inner symmetry.
unsigned int m_eCalBarrelOuterSymmetry
ECal barrel outer symmetry order.
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
float m_eCalToMip
The calibration from deposited ECal energy to mip.
const pandora::Pandora & m_pandora
Reference to the pandora object to create calo hits.
const std::string GetECALCellIDEncoding() const
#define MF_LOG_DEBUG(id)
void GetCommonCaloHitProperties(const gar::rec::CaloHit *const pCaloHit, PandoraApi::CaloHit::Parameters &caloHitParameters) const
#define MF_LOG_WARNING(category)
T const * get() const
Definition: Ptr.h:149
pandora::StatusCode CollectECALCaloHits(const art::Event &pEvent, const std::string &label, const std::string &instanceName, CalorimeterHitVector &ecalCaloHitVector)
float m_layersFromEdgeMaxRearDistance
Maximum number of layers from candidate outer layer hit to rear of detector.
unsigned int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
float m_eCalBarrelLayerThickness
ECal barrel layer thickness.
float m_eCalEndCapLayerThickness
ECal endcap layer thickness.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr< gar::geo::LayeredCalorimeterData > > GetECALLayeredCalorimeterData() const
Definition: GeometryCore.h:628
pandora::StatusCode CreateECalCaloHits() const
float m_eCalEndCapInnerPhiCoordinate
ECal endcap inner phi.