ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
VP1CC_LArEMECHEC Class Reference

#include <VP1CaloCells.h>

Inheritance diagram for VP1CC_LArEMECHEC:
Collaboration diagram for VP1CC_LArEMECHEC:

Public Member Functions

 VP1CC_LArEMECHEC (const CaloCell *caloCell, const CaloCell_ID *calo_id, const VP1CC_SeparatorMap *separators)
 
virtual ~VP1CC_LArEMECHEC ()
 
virtual void build3DObjects (VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
 
std::vector< std::string > ToString (const CaloCell_ID *calo_id, const std::string &extrainfos="")
 
virtual void remove3DObjects (VP1CC_SoNode2CCMap *node2cc)
 
double energyToTransverse (const double &) const
 
bool cutPassed (const VP1CC_GlobalCuts &globalCuts)
 
const CaloCellgetCaloCell ()
 
Identifier getID ()
 
void updateScene (VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &globalCuts)
 
double cellDepth (const QPair< bool, double > &scale, const double &energy)
 
virtual bool isInsideClipVolume (const VP1CC_GlobalCuts &globalCuts)
 

Protected Attributes

SoGenericBoxm_hit
 
VP1ExtraSepLayerHelperm_helper
 
const CaloCellm_caloCell
 

Detailed Description

Definition at line 249 of file VP1CaloCells.h.

Constructor & Destructor Documentation

◆ VP1CC_LArEMECHEC()

VP1CC_LArEMECHEC::VP1CC_LArEMECHEC ( const CaloCell caloCell,
const CaloCell_ID calo_id,
const VP1CC_SeparatorMap separators 
)

Definition at line 238 of file VP1CaloCells.cxx.

240  :
241  VP1CC_LAr(caloCell)
242 {
243  if(!separators)
244  throw std::runtime_error("VP1CC_LArEMECHEC: 0 pointer to VP1CC Separator Map");
245 
246  bool isEMEC = false;
247  if(calo_id->is_em_endcap(caloCell->ID()))
248  isEMEC = true;
249  else if(calo_id->is_hec(caloCell->ID()))
250  isEMEC = false;
251  else
252  throw std::runtime_error("VP1CC_LArEMECHEC: Calo Cell is neither EMEC nor HEC!");
253 
254  // define Separator type depending on Cell energy
255  VP1CC_SeparatorTypes mySeparatorType;
256  if(caloCell->energy()<0) {
257  if(isEMEC)
258  mySeparatorType = VP1CC_SepLArEMECNeg;
259  else
260  mySeparatorType = VP1CC_SepLArHECNeg;
261  } else {
262  if(isEMEC)
263  mySeparatorType = VP1CC_SepLArEMECPos;
264  else
265  mySeparatorType = VP1CC_SepLArHECPos;
266  }
267 
268  // get SoSeparator from the map
269  VP1CC_SeparatorMap::const_iterator it = separators->find(mySeparatorType);
270  if(it ==separators->end())
271  throw std::runtime_error("VP1CC_LArEMECHEC: Missing separator in the map");
272 
273  m_helper = it->second;
274 
275  if(!m_helper)
276  throw std::runtime_error("VP1CC_LArEMECHEC: 0 pointer to the separator helper");
277 }

◆ ~VP1CC_LArEMECHEC()

VP1CC_LArEMECHEC::~VP1CC_LArEMECHEC ( )
virtual

Definition at line 279 of file VP1CaloCells.cxx.

280 {
281 }

Member Function Documentation

◆ build3DObjects()

void VP1CC_LArEMECHEC::build3DObjects ( VP1CC_SoNode2CCMap node2cc,
bool  useEt,
const QPair< bool, double > &  scale,
bool  outline,
const VP1CC_GlobalCuts globalCuts 
)
virtual

Implements VP1CaloCell.

Definition at line 318 of file VP1CaloCells.cxx.

323 {
324  bool createNewHit = false;
325  if(!m_hit){
326  m_hit = new SoGenericBox();
327  createNewHit = true;
328  }
329 
330  // Build new Hit object
331  const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
332 
333  // auxiliary variables
334  double eta = ddElement->eta();
335  double deta = ddElement->deta()*0.5;
336  double phi = ddElement->phi();
337  double dphi = ddElement->dphi()*0.5;
338  double z = ddElement->z();
339  double energy = (useEt ? energyToTransverse(m_caloCell->energy()) : m_caloCell->energy());
340 
341  double depth = cellDepth(scale,energy);
342  depth = std::min(depth, std::fabs(globalCuts.clipRadius - z));
343 
344  m_hit->setParametersForEndCapEtaPhiCell( eta-deta,eta+deta,phi-dphi,phi+dphi,
345  depth, z, 0.9, 0.9 );
346  m_hit->drawEdgeLines = outline;
347 
348  if(createNewHit) {
350  (*node2cc)[m_hit] = this;
351  }
352 }

◆ cellDepth()

double VP1CaloCell::cellDepth ( const QPair< bool, double > &  scale,
const double &  energy 
)
inlineinherited

Definition at line 189 of file VP1CaloCells.h.

190  { return std::max(1.0*Gaudi::Units::mm,scale.second*(scale.first?log(1+fabs(energy)):fabs(energy))); }

◆ cutPassed()

bool VP1CaloCell::cutPassed ( const VP1CC_GlobalCuts globalCuts)
inherited

Definition at line 63 of file VP1CaloCells.cxx.

64 {
65  // only do this if it's something significant
66  if (globalCuts.clipRadius<10e8){
67  if (!isInsideClipVolume(globalCuts)) return false;
68  // double radius = sqrt(m_caloCell->x()*m_caloCell->x() + m_caloCell->y()*m_caloCell->y() + m_caloCell->z()*m_caloCell->z());
69 
70  }
71 
72  // Check side and Eta cut
73  bool passed = (m_caloCell->eta()>=0 && globalCuts.sideA)
74  || (m_caloCell->eta()<0 && globalCuts.sideC);
75  passed = passed && globalCuts.allowedEta.contains(m_caloCell->eta());
76  if(!passed) return false;
77  // Check Phi Cut
78  passed = false;
79  for(const VP1Interval& i : globalCuts.allowedPhi){
80  if(i.contains(m_caloCell->phi())
81  ||i.contains(m_caloCell->phi()+2*M_PI)
82  ||i.contains(m_caloCell->phi()-2*M_PI)) {
83  passed = true;
84  break;
85  }
86  }
87  return passed;
88 }

◆ energyToTransverse()

double VP1CaloCell::energyToTransverse ( const double &  e) const
inherited

Definition at line 58 of file VP1CaloCells.cxx.

59 {
60  return m_caloCell->sinTh()*e;
61 }

◆ getCaloCell()

const CaloCell * VP1CaloCell::getCaloCell ( )
inherited

Definition at line 48 of file VP1CaloCells.cxx.

49 {
50  return m_caloCell;
51 }

◆ getID()

Identifier VP1CaloCell::getID ( )
inherited

Definition at line 53 of file VP1CaloCells.cxx.

54 {
55  return m_caloCell->ID();
56 }

◆ isInsideClipVolume()

bool VP1CaloCell::isInsideClipVolume ( const VP1CC_GlobalCuts globalCuts)
virtualinherited

Reimplemented in VP1CC_TileCrack, and VP1CC_TileBarEc.

Definition at line 90 of file VP1CaloCells.cxx.

90  {
91  const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
92  double radius = ddElement->r();
93  double z = ddElement->z();
94  double radialDistance = sqrt(radius*radius + z*z);
95  if (radialDistance < globalCuts.clipRadius ) return true;
96  return false;
97 }

◆ remove3DObjects()

void VP1CC_LAr::remove3DObjects ( VP1CC_SoNode2CCMap node2cc)
virtualinherited

Implements VP1CaloCell.

Definition at line 127 of file VP1CaloCells.cxx.

128 {
129  if(m_hit) {
130  node2cc->erase(m_hit);
132  m_hit = 0;
133  }
134 }

◆ ToString()

std::vector< std::string > VP1CC_LArEMECHEC::ToString ( const CaloCell_ID calo_id,
const std::string &  extrainfos = "" 
)
virtual

Implements VP1CaloCell.

Definition at line 283 of file VP1CaloCells.cxx.

284 {
285  std::vector<std::string> result;
286  const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
287 
288  std::ostringstream msg, msg1, msg2, msg3;
289 
290  std::string stars("***");
291  result.push_back(stars);
292 
293  if(calo_id->is_em_endcap(m_caloCell->ID()))
294  msg << "LAr EMEC. ID = " << m_caloCell->ID().getString();
295  else
296  msg << "LAr HEC. ID = " << m_caloCell->ID().getString();
297  msg << " " << extrainfos;
298 
299  msg1 << " Eta = " << ddElement->eta()
300  << " Phi = " << ddElement->phi();
301 
302  msg2 << "Energy = " << m_caloCell->energy() << " (Mev)"
303  << " Gain " << m_caloCell->gain();
304 
305  msg3 << "Time = " << m_caloCell->time()
306  << " Quality = " << m_caloCell->quality()
307  << " Provenance = " << m_caloCell->provenance();
308 
309  result.push_back(msg.str());
310  result.push_back(msg1.str());
311  result.push_back(msg2.str());
312  result.push_back(msg3.str());
313 
314  result.push_back(stars);
315  return result;
316 }

◆ updateScene()

void VP1CaloCell::updateScene ( VP1CC_SoNode2CCMap node2cc,
bool  useEt,
const QPair< bool, double > &  scale,
bool  outline,
const VP1CC_GlobalCuts globalCuts 
)
inherited

Definition at line 99 of file VP1CaloCells.cxx.

104 {
105  if(cutPassed(globalCuts))
106  build3DObjects(node2cc,useEt,scale,outline, globalCuts);
107  else
108  remove3DObjects(node2cc);
109 }

Member Data Documentation

◆ m_caloCell

const CaloCell* VP1CaloCell::m_caloCell
protectedinherited

Definition at line 204 of file VP1CaloCells.h.

◆ m_helper

VP1ExtraSepLayerHelper* VP1CC_LAr::m_helper
protectedinherited

Definition at line 221 of file VP1CaloCells.h.

◆ m_hit

SoGenericBox* VP1CC_LAr::m_hit
protectedinherited

Definition at line 220 of file VP1CaloCells.h.


The documentation for this class was generated from the following files:
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
VP1CC_GlobalCuts::allowedEta
VP1Interval allowedEta
Definition: VP1CaloCells.h:57
VP1CC_LAr::VP1CC_LAr
VP1CC_LAr(const CaloCell *caloCell)
Definition: VP1CaloCells.cxx:112
VP1CaloCell::build3DObjects
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)=0
egammaParameters::depth
@ depth
pointing depth of the shower as calculated in egammaqgcld
Definition: egammaParamDefs.h:276
CaloCell::phi
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition: CaloCell.h:359
VP1ExtraSepLayerHelper::removeNode
void removeNode(SoNode *)
Definition: VP1ExtraSepLayerHelper.cxx:95
get_generator_info.result
result
Definition: get_generator_info.py:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
VP1CC_LAr::m_hit
SoGenericBox * m_hit
Definition: VP1CaloCells.h:220
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
CaloCell_Base_ID::is_em_endcap
bool is_em_endcap(const Identifier id) const
test if the id belongs to the EM Endcap
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
SoGenericBox::setParametersForEndCapEtaPhiCell
void setParametersForEndCapEtaPhiCell(double etaMin, double etaMax, double phiMin, double phiMax, double cellDepth, double cellDistance, double etasqueezefact=1.0, double phisqueezefact=1.0)
Definition: SoGenericBox.cxx:266
skel.it
it
Definition: skel.GENtoEVGEN.py:396
M_PI
#define M_PI
Definition: ActiveFraction.h:11
VP1CC_GlobalCuts::allowedPhi
QList< VP1Interval > allowedPhi
Definition: VP1CaloCells.h:58
VP1CaloCell::isInsideClipVolume
virtual bool isInsideClipVolume(const VP1CC_GlobalCuts &globalCuts)
Definition: VP1CaloCells.cxx:90
CaloCell::provenance
uint16_t provenance() const
get provenance (data member)
Definition: CaloCell.h:338
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
CaloCell_Base_ID::is_hec
bool is_hec(const Identifier id) const
test if the id belongs to the HEC
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
VP1CC_GlobalCuts::sideA
bool sideA
Definition: VP1CaloCells.h:55
VP1CC_LAr::m_helper
VP1ExtraSepLayerHelper * m_helper
Definition: VP1CaloCells.h:221
VP1CaloCell::remove3DObjects
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)=0
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
VP1CaloCell::energyToTransverse
double energyToTransverse(const double &) const
Definition: VP1CaloCells.cxx:58
VP1CC_GlobalCuts::clipRadius
double clipRadius
Definition: VP1CaloCells.h:59
CaloCell::quality
uint16_t quality() const
get quality (data member)
Definition: CaloCell.h:332
VP1CaloCell::cellDepth
double cellDepth(const QPair< bool, double > &scale, const double &energy)
Definition: VP1CaloCells.h:189
VP1Interval::contains
bool contains(const double &x) const
VP1CaloCell::cutPassed
bool cutPassed(const VP1CC_GlobalCuts &globalCuts)
Definition: VP1CaloCells.cxx:63
CaloCell::gain
CaloGain::CaloGain gain() const
get gain (data member )
Definition: CaloCell.h:345
CaloCell::ID
Identifier ID() const
get ID (from cached data member) non-virtual and inline for fast access
Definition: CaloCell.h:279
VP1ExtraSepLayerHelper::addNode
void addNode(SoNode *)
Definition: VP1ExtraSepLayerHelper.cxx:54
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
VP1CC_SepLArHECNeg
@ VP1CC_SepLArHECNeg
Definition: VP1CaloCells.h:97
VP1CC_SepLArEMECNeg
@ VP1CC_SepLArEMECNeg
Definition: VP1CaloCells.h:96
VP1CaloCell::m_caloCell
const CaloCell * m_caloCell
Definition: VP1CaloCells.h:204
SoGenericBox::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoGenericBox.h:33
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
Identifier::getString
std::string getString() const
Provide a string form of the identifier - hexadecimal.
Definition: Identifier.cxx:25
VP1Interval
Definition: VP1Interval.h:23
VP1CC_GlobalCuts::sideC
bool sideC
Definition: VP1CaloCells.h:56
CaloDetDescrElement::z
float z() const
cell z
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:367
SoGenericBox
Definition: SoGenericBox.h:26
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
VP1CC_SepLArEMECPos
@ VP1CC_SepLArEMECPos
Definition: VP1CaloCells.h:92
ITkPixelChargeCalibration.separators
separators
Definition: ITkPixelChargeCalibration.py:99
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
VP1CC_SepLArHECPos
@ VP1CC_SepLArHECPos
Definition: VP1CaloCells.h:93
CaloDetDescrElement::r
float r() const
cell r
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:348
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
VP1CC_SeparatorTypes
VP1CC_SeparatorTypes
Definition: VP1CaloCells.h:90
CaloCell::sinTh
virtual double sinTh() const override final
get sin(theta) (through CaloDetDescrElement)
Definition: CaloCell.h:373
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366