ATLAS Offline Software
Loading...
Searching...
No Matches
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_SeparatorTypes
@ VP1CC_SepTileNegativeDown
@ VP1CC_SepTilePositiveDown
double energy() const
get energy (data member)
Definition CaloCell.h:327
SoGenericBox * m_hit
VP1ExtraSepLayerHelper * m_helper
VP1CC_Tile(const CaloCell *caloCell, const TileID *tile_id)

◆ ~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;
904 m_helper->addNode(m_hit);
905 }
906}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define z
const CaloCell * m_caloCell
double energyToTransverse(const double &) const
double cellDepth(const QPair< bool, double > &scale, const double &energy)
std::string depth
tag string for intendation
Definition fastadd.cxx:46

◆ 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}
#define M_PI
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
QList< VP1Interval > allowedPhi
VP1Interval allowedEta
virtual bool isInsideClipVolume(const VP1CC_GlobalCuts &globalCuts)
bool contains(const double &x) const

◆ 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}
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition TileHWID.h:181
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
Definition TileHWID.h:189
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
IdContext channel_context() const
idContext for channels
Definition TileHWID.cxx:478

◆ 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);
925 m_helper->removeNode(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}
int side(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
int tower(const Identifier id) const
Tile field values (NOT_VALID == invalid request)
MsgStream & msg
Definition testRead.cxx:32

◆ 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}
virtual void remove3DObjects(VP1CC_SoNode2CCMap *node2cc)=0
bool cutPassed(const VP1CC_GlobalCuts &globalCuts)
virtual void build3DObjects(VP1CC_SoNode2CCMap *node2cc, bool useEt, const QPair< bool, double > &scale, bool outline, const VP1CC_GlobalCuts &)=0

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: