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

#include <VP1CaloCells.h>

Inheritance diagram for VP1CC_TileCrack:
Collaboration diagram for VP1CC_TileCrack:

Public Member Functions

 VP1CC_TileCrack (const CaloCell *caloCell, const TileID *tile_id, const VP1CC_SeparatorMap *separators)
 
virtual ~VP1CC_TileCrack ()
 
virtual void build3DObjects (VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)
 
bool isInsideClipVolume (const VP1CC_GlobalCuts &globalCuts)
 
virtual void remove3DObjects (VP1CC_SoNode2CCMap *node2cc)
 
std::vector< std::string > ToString (const CaloCell_ID *calo_id, const std::string &extrainfos="")
 
int GetFragChannel (const TileHWID *tile_hw_id, bool up, int &frag, int &channel)
 
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)
 

Protected Attributes

SoGenericBoxm_hit
 
VP1ExtraSepLayerHelperm_helper
 
const TileIDm_tileID
 
const CaloCellm_caloCell
 

Detailed Description

Definition at line 350 of file VP1CaloCells.h.

Constructor & Destructor Documentation

◆ VP1CC_TileCrack()

VP1CC_TileCrack::VP1CC_TileCrack ( const CaloCell caloCell,
const TileID tile_id,
const VP1CC_SeparatorMap separators 
)

VP1CC_Tile has already dereferenced caloCell at this point, so it can't be zero anyway if(!caloCell) throw std::runtime_error("VP1CC_TileCrack: 0 pointer to CaloCell");

Definition at line 754 of file VP1CaloCells.cxx.

755  :VP1CC_Tile(caloCell,tile_id), m_hit(0){
761  if(!separators)
762  throw std::runtime_error("VP1CC_TileCrack: 0 pointer to VP1CC Separator Map");
763 
764  // define Separator type depending on Cell energy
765  VP1CC_SeparatorTypes mySeparatorType;
766 
767  if(caloCell->energy()<0)
768  mySeparatorType = VP1CC_SepTileNegativeDown;
769  else
770  mySeparatorType = VP1CC_SepTilePositiveDown;
771 
772  VP1CC_SeparatorMap::const_iterator it = separators->find(mySeparatorType);
773  if(it ==separators->end())
774  throw std::runtime_error("VP1CC_TileCrack: Missing separator in the map");
775 
776  m_helper = it->second;
777 
778  if(!m_helper)
779  throw std::runtime_error("VP1CC_TileCrack: 0 pointer to the separator");
780 }

◆ ~VP1CC_TileCrack()

VP1CC_TileCrack::~VP1CC_TileCrack ( )
virtual

Definition at line 782 of file VP1CaloCells.cxx.

783 {
784 }

Member Function Documentation

◆ build3DObjects()

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

Implements VP1CaloCell.

Definition at line 863 of file VP1CaloCells.cxx.

868 {
869  bool createNewHit = false;
870  if(!m_hit) {
871  m_hit = new SoGenericBox();
872  createNewHit = true;
873  }
874 
875  const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
876  double eta = ddElement->eta();
877  double deta = ddElement->deta()*0.5;
878  double phi = ddElement->phi();
879  double dphi = ddElement->dphi()*0.5;
880  double z = ddElement->z();
881  double dz = ddElement->dz()*0.5;
882  double energy = (useEt ? energyToTransverse(m_caloCell->energy()) : m_caloCell->energy());
883 
884  double radius = ddElement->r();
885  double minZ = std::fabs(z)-dz;
886  double radialDistance = sqrt(radius*radius + minZ*minZ);
887 
888  double depth = cellDepth(scale,energy);
889  depth = std::min(depth, std::fabs(globalCuts.clipRadius - radialDistance));
890  // std::cout<<"z "<<z<<"\t dz "<<dz<<"\t r "<<ddElement->r()<<"\t clipRadius"<<globalCuts.clipRadius<<"\t depth "<<depth<<"\t cellDepth "<<cellDepth(scale,energy)<<std::endl;
891 
892  // std::cout<<"VP1CC_TileCrack clipRadius: "<<globalCuts.clipRadius<<"\t radialDistance "<<radialDistance<<"\t depth "
893  // <<cellDepth(scale,energy)<<"\t cd1 "<<depth<<std::endl;
894 
895 
896  // double etaMin, double etaMax, double phiMin, double phiMax,
897  // double cellDepth, double cellDistance, double etasqueezefact, double phisqueezefact
898  m_hit->setParametersForEndCapEtaPhiCell( eta-deta,eta+deta,phi-dphi,phi+dphi,
899  depth,z-dz,0.9,0.9);
900  m_hit->drawEdgeLines = outline;
901 
902  if(createNewHit) {
903  (*node2cc)[m_hit] = this;
905  }
906 }

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

◆ GetFragChannel()

int VP1CC_TileCrack::GetFragChannel ( const TileHWID tile_hw_id,
bool  up,
int &  frag,
int &  channel 
)
virtual

Implements VP1CC_Tile.

Definition at line 844 of file VP1CaloCells.cxx.

848 {
849  HWIdentifier hwId;
850  IdContext context = tile_hw_id->channel_context();
851 
852  int result = tile_hw_id->get_id(m_caloCell->caloDDE()->onl1(),hwId,&context);
853 
854  if(result!=0)
855  return result;
856 
857  frag = tile_hw_id->frag(hwId);
858  channel = tile_hw_id->channel(hwId);
859 
860  return 0;
861 }

◆ getID()

Identifier VP1CaloCell::getID ( )
inherited

Definition at line 53 of file VP1CaloCells.cxx.

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

◆ isInsideClipVolume()

bool VP1CC_TileCrack::isInsideClipVolume ( const VP1CC_GlobalCuts globalCuts)
virtual

Reimplemented from VP1CaloCell.

Definition at line 908 of file VP1CaloCells.cxx.

908  {
909  const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
910  double z = ddElement->z();
911  double dz = ddElement->dz()*0.5;
912  double radius = ddElement->r();
913  double minZ = std::fabs(z)-dz;
914  double radialDistance = sqrt(radius*radius + minZ*minZ);
915 
916  if ( radialDistance > globalCuts.clipRadius ) return false;
917  return true;
918 }

◆ remove3DObjects()

void VP1CC_TileCrack::remove3DObjects ( VP1CC_SoNode2CCMap node2cc)
virtual

Implements VP1CaloCell.

Definition at line 921 of file VP1CaloCells.cxx.

922 {
923  if(m_hit) {
924  node2cc->erase(m_hit);
926  m_hit = 0;
927  }
928 }

◆ ToString()

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

Implements VP1CaloCell.

Definition at line 786 of file VP1CaloCells.cxx.

787 {
788  std::vector<std::string> result;
789  std::ostringstream msg, msg1;
790 
791  std::string stars("***");
792  result.push_back(stars);
793  result.push_back(std::string("TileCrack Calo Cell"));
794 
795  // Create cell name (string)
796  std::string cellName("EB");
797  if(calo_id->side(m_caloCell->ID()) > 0)
798  cellName += std::string("A");
799  else
800  cellName += std::string("C");
801 
802  // Module number
803  std::ostringstream modnum;
804  modnum << calo_id->module(m_caloCell->ID()) + 1;
805  cellName += (modnum.str() + std::string(" E"));
806 
807  switch(calo_id->tower(m_caloCell->ID()))
808  {
809  case 10:
810  {
811  cellName += std::string("1");
812  break;
813  }
814  case 11:
815  {
816  cellName += std::string("2");
817  break;
818  }
819  case 13:
820  {
821  cellName += std::string("3");
822  break;
823  }
824  case 15:
825  {
826  cellName += std::string("4");
827  break;
828  }
829  default:
830  break;
831  }
832 
833  msg << "Cell: " << cellName << " " << extrainfos;
834 
835  msg1 << " Energy = " << m_caloCell->energy() << " (Mev)"
836  << " Time = " << m_caloCell->time();
837  result.push_back(msg.str());
838  result.push_back(msg1.str());
839 
840  result.push_back(stars);
841  return result;
842 }

◆ 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_TileCrack::m_helper
protected

Definition at line 377 of file VP1CaloCells.h.

◆ m_hit

SoGenericBox* VP1CC_TileCrack::m_hit
protected

Definition at line 376 of file VP1CaloCells.h.

◆ m_tileID

const TileID* VP1CC_Tile::m_tileID
protectedinherited

Definition at line 307 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_TileCrack::m_helper
VP1ExtraSepLayerHelper * m_helper
Definition: VP1CaloCells.h:377
VP1CC_GlobalCuts::allowedEta
VP1Interval allowedEta
Definition: VP1CaloCells.h:57
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
CaloCell_Base_ID::tower
int tower(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:24
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
TileHWID::get_id
virtual int get_id(const IdentifierHash &hash_id, HWIdentifier &id, const IdContext *context=0) const
create compact HW ID from hash id (return == 0 for OK)
Definition: TileHWID.cxx:491
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
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
TileHWID::channel_context
IdContext channel_context(void) const
idContext for channels
Definition: TileHWID.cxx:478
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
TileHWID::frag
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition: TileHWID.h:181
CaloCell_Base_ID::module
int module(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
CaloCell::time
float time() const
get time (data member)
Definition: CaloCell.h:352
VP1CC_SepTileNegativeDown
@ VP1CC_SepTileNegativeDown
Definition: VP1CaloCells.h:103
HWIdentifier
Definition: HWIdentifier.h:13
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
TileHWID::channel
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition: TileHWID.h:189
CaloCell::energy
double energy() const
get energy (data member)
Definition: CaloCell.h:311
VP1CC_GlobalCuts::sideA
bool sideA
Definition: VP1CaloCells.h:55
CaloDetDescrElement::dz
float dz() const
cell dz
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:379
CaloDetDescrElement::onl1
IdentifierHash onl1() const
cell online identifier 1
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:404
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
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::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
VP1CC_SepTilePositiveDown
@ VP1CC_SepTilePositiveDown
Definition: VP1CaloCells.h:100
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
VP1CaloCell::m_caloCell
const CaloCell * m_caloCell
Definition: VP1CaloCells.h:204
SoGenericBox::drawEdgeLines
SoSFBool drawEdgeLines
Definition: SoGenericBox.h:33
PlotCalibFromCool.modnum
modnum
Definition: PlotCalibFromCool.py:238
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
VP1Interval
Definition: VP1Interval.h:23
CaloCell_Base_ID::side
int side(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
WriteCellNoiseToCool.cellName
cellName
Definition: WriteCellNoiseToCool.py:368
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
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
CaloDetDescrElement::r
float r() const
cell r
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:348
IdContext
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
Definition: IdContext.h:26
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
VP1CC_Tile::VP1CC_Tile
VP1CC_Tile(const CaloCell *caloCell, const TileID *tile_id)
Definition: VP1CaloCells.cxx:454
VP1CC_SeparatorTypes
VP1CC_SeparatorTypes
Definition: VP1CaloCells.h:90
VP1CC_TileCrack::m_hit
SoGenericBox * m_hit
Definition: VP1CaloCells.h:376
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