ATLAS Offline Software
Loading...
Searching...
No Matches
VP1CC_LArEMB Class Reference

#include <VP1CaloCells.h>

Inheritance diagram for VP1CC_LArEMB:
Collaboration diagram for VP1CC_LArEMB:

Public Member Functions

 VP1CC_LArEMB (const CaloCell *caloCell, const VP1CC_SeparatorMap *separators)
virtual ~VP1CC_LArEMB ()
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 229 of file VP1CaloCells.h.

Constructor & Destructor Documentation

◆ VP1CC_LArEMB()

VP1CC_LArEMB::VP1CC_LArEMB ( const CaloCell * caloCell,
const VP1CC_SeparatorMap * separators )

Definition at line 137 of file VP1CaloCells.cxx.

138 :
139 VP1CC_LAr(caloCell)
140{
141 // define Separator type depending on Cell energy
142 if(!separators)
143 throw std::runtime_error("VP1CC_LArEMB: 0 pointer to VP1CC Separator Map");
144
145 VP1CC_SeparatorTypes mySeparatorType;
146 if(caloCell->energy()<0)
147 mySeparatorType = VP1CC_SepLArEMBNeg;
148 else
149 mySeparatorType = VP1CC_SepLArEMBPos;
150
151 // get SoSeparator from the map
152 VP1CC_SeparatorMap::const_iterator it = separators->find(mySeparatorType);
153 if(it ==separators->end())
154 throw std::runtime_error("VP1CC_LArEMB: Missing separator helper in the map");
155
156 m_helper = it->second;
157
158 if(!m_helper)
159 throw std::runtime_error("VP1CC_LArEMB: 0 pointer to separator helper");
160}
VP1CC_SeparatorTypes
@ VP1CC_SepLArEMBPos
@ VP1CC_SepLArEMBNeg
double energy() const
get energy (data member)
Definition CaloCell.h:327
VP1ExtraSepLayerHelper * m_helper
VP1CC_LAr(const CaloCell *caloCell)

◆ ~VP1CC_LArEMB()

VP1CC_LArEMB::~VP1CC_LArEMB ( )
virtual

Definition at line 162 of file VP1CaloCells.cxx.

163{
164}

Member Function Documentation

◆ build3DObjects()

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

Implements VP1CaloCell.

Definition at line 166 of file VP1CaloCells.cxx.

171{
172 bool createNewHit = false;
173 if(!m_hit){
174 m_hit = new SoGenericBox();
175 createNewHit = true;
176 }
177
178 // Build new Hit object
179 const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
180
181 // auxiliary variables
182 double eta = ddElement->eta();
183 double deta = ddElement->deta()*0.5;
184 double phi = ddElement->phi();
185 double dphi = ddElement->dphi()*0.5;
186 double radius = ddElement->r();
187 double energy = (useEt ? energyToTransverse(m_caloCell->energy()) : m_caloCell->energy());
188
189 double z = std::fabs(ddElement->z());
190 double radialDistance = sqrt(radius*radius + z*z);
191
192 double depth = cellDepth(scale,energy);
193 depth = std::min(depth, std::fabs(globalCuts.clipRadius - radialDistance ) ) ;
194
195 // std::cout<<"z "<<ddElement->z()<<"\t radialDistance "<<radialDistance<<"\t clipRadius "<<globalCuts.clipRadius<<"\t depth "<<depth<<std::endl;
196
197 m_hit->setParametersForBarrelEtaPhiCell( eta-deta,eta+deta,phi-dphi,phi+dphi,
198 depth, radius, 0.9, 0.9 );
199 m_hit->drawEdgeLines = outline;
200
201 if(createNewHit) {
202 m_helper->addNode(m_hit);
203 (*node2cc)[m_hit] = this;
204 }
205}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define z
SoGenericBox * m_hit
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}

◆ 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_TileBarEc, and VP1CC_TileCrack.

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);
131 m_helper->removeNode(m_hit);
132 m_hit = 0;
133 }
134}

◆ ToString()

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

Implements VP1CaloCell.

Definition at line 207 of file VP1CaloCells.cxx.

208{
209 std::vector<std::string> result;
210 const CaloDetDescrElement* ddElement = m_caloCell->caloDDE();
211 std::ostringstream msg, msg1, msg2, msg3;
212
213 std::string stars("***");
214 result.push_back(stars);
215
216 msg << "LAr EMB. ID = " << m_caloCell->ID().getString() << " " << extrainfos;
217
218 msg1 << " Eta = " << ddElement->eta()
219 << " Phi = " << ddElement->phi();
220
221 msg2 << "Energy = " << m_caloCell->energy() << " (Mev)"
222 << " Gain " << m_caloCell->gain();
223
224 msg3 << "Time = " << m_caloCell->time()
225 << " Quality = " << m_caloCell->quality()
226 << " Provenance = " << m_caloCell->provenance();
227
228 result.push_back(msg.str());
229 result.push_back(msg1.str());
230 result.push_back(msg2.str());
231 result.push_back(msg3.str());
232
233 result.push_back(stars);
234 return result;
235}
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_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: