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

#include <TIDARoiDescriptorBuilder.h>

Inheritance diagram for TIDARoiDescriptorBuilder:
Collaboration diagram for TIDARoiDescriptorBuilder:

Public Member Functions

 TIDARoiDescriptorBuilder (const IRoiDescriptor &r)
 ~TIDARoiDescriptorBuilder ()
void set_roiId (const unsigned int id)
 set roiId
void set_l1Id (const unsigned int l1id)
 set event number
void set_roiWord (const unsigned int roiWord)
 sets RoI word
double phi () const
double eta () const
double zed () const
double etaMinus () const
double etaPlus () const
double phiMinus () const
double phiPlus () const
double zedMinus () const
double zedPlus () const
double zedPlusR () const
 full containment methods
double zedMinusR () const
double rPlusZed () const
double rMinusZed () const
double maxR () const
double maxZ () const
unsigned roiId () const
 identifier methods
unsigned l1Id () const
unsigned roiWord () const
int version () const
 operator std::string () const
bool isFullscan () const
bool composite () const
 composite RoI methods
size_t size () const
const TIDARoiDescriptoroperator[] (int i) const
const TIDARoiDescriptorat (int i) const
 gets phi half-width
double phiHalfWidth () const
double etaHalfWidth () const
 gets eta half-width
double zedHalfWidth () const
 gets eta half-width
bool operator== (const TIDARoiDescriptor &b) const
 operators
bool operator!= (const TIDARoiDescriptor &b) const
void push_back (const TIDARoiDescriptor &roi)
void push_back (const TIDARoiDescriptor *roi)

Static Public Member Functions

static double exitpoint (double tz0, double teta, double &zexit, double &rexit)

Protected Member Functions

const TIDARoiParametersparams () const
 access the internal parameter class
void reset ()
 internal parameters
double phicheck (double phi)
 helper function to check if phi range was violated
double etacheck (double eta)
 helper function to check if eta range was violated
double zedcheck (double zed)
 helper function to check if zed range was violated

Protected Attributes

TIDARoiParameters m_params
 don't save
bool m_fullscan
unsigned int m_l1Id
unsigned int m_roiId
unsigned int m_roiWord
std::vector< TIDARoiDescriptorm_rois
bool m_cached
double m_dphi
 cache flag - these should be mutable
double m_zedPlusR
 cached value -
double m_zedMinusR
 don't save - transient zPlus at radius R
double m_rPlusZed
 don't save - transient zMinus at radius R
double m_rMinusZed
 don't save - transient zPlus at radius R
double m_tanthetaPlus
 don't save - transient zMinus at radius R
double m_tanthetaMinus
 don't save - transient roi edge gradients

Static Protected Attributes

static const double maxRadius = 1000
static const double maxZed = 2700
 don't save

Detailed Description

Definition at line 21 of file TIDARoiDescriptorBuilder.h.

Constructor & Destructor Documentation

◆ TIDARoiDescriptorBuilder()

TIDARoiDescriptorBuilder::TIDARoiDescriptorBuilder ( const IRoiDescriptor & r)
inline

Definition at line 25 of file TIDARoiDescriptorBuilder.h.

25 :
26 TIDARoiDescriptor( r.roiWord(), r.l1Id(), r.roiId(),
27 r.eta(), r.etaMinus(), r.etaPlus(),
28 r.phi(), r.phiMinus(), r.phiPlus(),
29 r.zed(), r.zedMinus(), r.zedPlus() )
30 {
31
32 this->m_fullscan = r.isFullscan();
33
34 if ( r.size()>0 ) {
35 for ( unsigned i=0 ; i<r.size() ; i++ ) {
36 const IRoiDescriptor* _r = r.at(i);
37 this->push_back( TIDARoiDescriptor( _r->eta(), _r->etaMinus(), _r->etaPlus(),
38 _r->phi(), _r->phiMinus(), _r->phiPlus(),
39 _r->zed(), _r->zedMinus(), _r->zedPlus() ) );
40 }
41 }
42 }
virtual double eta() const =0
virtual double phiPlus() const =0
extreme phi values
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
virtual double phiMinus() const =0
virtual double phi() const =0
Methods to retrieve data members.
virtual double zedMinus() const =0
virtual double zed() const =0
virtual double etaMinus() const =0
virtual double etaPlus() const =0
void push_back(const TIDARoiDescriptor &roi)
TIDARoiDescriptor(bool fullscan=false)
default constructor
int r
Definition globals.cxx:22

◆ ~TIDARoiDescriptorBuilder()

TIDARoiDescriptorBuilder::~TIDARoiDescriptorBuilder ( )
inline

Definition at line 44 of file TIDARoiDescriptorBuilder.h.

44{ }

Member Function Documentation

◆ at()

const TIDARoiDescriptor * TIDARoiDescriptor::at ( int i) const
inlineinherited

gets phi half-width

Definition at line 177 of file TIDARoiDescriptor.h.

◆ composite()

bool TIDARoiDescriptor::composite ( ) const
inlineinherited

composite RoI methods

Definition at line 172 of file TIDARoiDescriptor.h.

172{ return !m_rois.empty(); }
std::vector< TIDARoiDescriptor > m_rois

◆ eta()

double TIDARoiDescriptor::eta ( ) const
inlineinherited

Definition at line 132 of file TIDARoiDescriptor.h.

132{ return m_params.eta(); }
TIDARoiParameters m_params
don't save

◆ etacheck()

double TIDARoiDescriptor::etacheck ( double eta)
protectedinherited

helper function to check if eta range was violated

Definition at line 188 of file TIDARoiDescriptor.cxx.

188 {
189 if ( !(eta > -100 && eta < 100) ) { // check also for nan
190 std::cerr << "TIDARoiDescriptor constructed with eta outside range -100 < eta <100 EtaRange" << std::endl;
191 }
192 return eta;
193}

◆ etaHalfWidth()

double TIDARoiDescriptor::etaHalfWidth ( ) const
inlineinherited

gets eta half-width

Definition at line 186 of file TIDARoiDescriptor.h.

◆ etaMinus()

double TIDARoiDescriptor::etaMinus ( ) const
inlineinherited

Definition at line 135 of file TIDARoiDescriptor.h.

135{ return m_params.etaMinus(); }

◆ etaPlus()

double TIDARoiDescriptor::etaPlus ( ) const
inlineinherited

Definition at line 136 of file TIDARoiDescriptor.h.

136{ return m_params.etaPlus(); }

◆ exitpoint()

double TIDARoiDescriptor::exitpoint ( double tz0,
double teta,
double & zexit,
double & rexit )
staticinherited

do we need protection against eta=0 ?

leaves through the barrel side or front face?

through the barrel edge actually need to calculate the z exit coordinate
for proper containment rather than spurious
"eta containment"

Definition at line 32 of file TIDARoiDescriptor.cxx.

32 {
33
34 if ( teta<0 ) zexit = -maxZed;
35 else if ( teta>0 ) zexit = maxZed;
36 else {
37 zexit = tz0;
38 rexit = maxRadius;
39 return 1e16; // don't really want to use nan
40 }
41
43
44 double tantheta = std::tan( 2*std::atan( std::exp( -teta ) ) );
45
46 rexit = (zexit-tz0) * tantheta;
47
49 if ( std::fabs(rexit)>maxRadius ) {
54 zexit = maxRadius / tantheta + tz0;
55 rexit = maxRadius;
56
57 }
58
59 return tantheta;
60}
static const double maxZed
don't save
static const double maxRadius

◆ isFullscan()

bool TIDARoiDescriptor::isFullscan ( ) const
inlineinherited

Definition at line 168 of file TIDARoiDescriptor.h.

168{ return m_fullscan; }

◆ l1Id()

unsigned TIDARoiDescriptor::l1Id ( ) const
inlineinherited

Definition at line 161 of file TIDARoiDescriptor.h.

161{ return m_l1Id; }

◆ maxR()

double TIDARoiDescriptor::maxR ( ) const
inlineinherited

Definition at line 153 of file TIDARoiDescriptor.h.

153{ return maxRadius; }

◆ maxZ()

double TIDARoiDescriptor::maxZ ( ) const
inlineinherited

Definition at line 154 of file TIDARoiDescriptor.h.

154{ return maxZed; }

◆ operator std::string()

TIDARoiDescriptor::operator std::string ( ) const
inherited

Definition at line 164 of file TIDARoiDescriptor.cxx.

164 {
165 std::stringstream s;
166 s << " z: " << zed() << " (" << zedMinus() << " - " << zedPlus() << ")"
167 << " eta: " << eta() << " (" << etaMinus() << " - " << etaPlus() << ")"
168 << " phi: " << phi() << " (" << phiMinus() << " - " << phiPlus() << ")";
169 if ( m_fullscan ) s << " (fullscan)";
170 s << " RoIid: " << roiId() << " RoIword: " << roiWord() << " (size " << size() << ")";
171 for ( unsigned i=0 ; i<size() ; i++ ) s << "\n\t\t" << i << ": " << (std::string)*at(i);
172 return s.str();
173}
unsigned roiWord() const
double etaMinus() const
const TIDARoiDescriptor * at(int i) const
gets phi half-width
double zedPlus() const
double etaPlus() const
double zedMinus() const
double phiPlus() const
unsigned roiId() const
identifier methods
double phiMinus() const

◆ operator!=()

bool TIDARoiDescriptor::operator!= ( const TIDARoiDescriptor & b) const
inlineinherited

Definition at line 207 of file TIDARoiDescriptor.h.

207{ return !((*this)==b); }

◆ operator==()

bool TIDARoiDescriptor::operator== ( const TIDARoiDescriptor & b) const
inlineinherited

operators

Definition at line 198 of file TIDARoiDescriptor.h.

198 {
199 if ( roiWord() != b.roiWord() ) return false;
200 double epsilon=0.001; // arbitrary , but seems to be reasonable
201 if ( std::fabs( phi() - b.phi()) > epsilon ) return false;
202 if ( std::fabs( eta() - b.eta()) > epsilon ) return false;
203 if ( std::fabs( zed() - b.zed()) > epsilon ) return false;
204 return true;
205 }

◆ operator[]()

const TIDARoiDescriptor * TIDARoiDescriptor::operator[] ( int i) const
inlineinherited

Definition at line 176 of file TIDARoiDescriptor.h.

176{ return &m_rois.at(i); }

◆ params()

const TIDARoiParameters & TIDARoiDescriptor::params ( ) const
inlineprotectedinherited

access the internal parameter class

Definition at line 244 of file TIDARoiDescriptor.h.

244{ return m_params; };

◆ phi()

double TIDARoiDescriptor::phi ( ) const
inlineinherited

Definition at line 131 of file TIDARoiDescriptor.h.

131{ return m_params.phi(); }

◆ phicheck()

double TIDARoiDescriptor::phicheck ( double phi)
protectedinherited

helper function to check if phi range was violated

Definition at line 177 of file TIDARoiDescriptor.cxx.

177 {
178 if ( !(phi > -M_PIF && phi < M_PIF ) ) { // use ! of range rather than range to also catch nan etc
179 if ( phi < -M_PIF ) phi += M_2PI;
180 else phi -= M_2PI;
181 // std::cerr << "TIDARoiDescriptor constructed with phi smaller than -PI (allowed range -PI / +PI) PhiRange" << std::endl;
182 // std::cerr << "TIDARoiDescriptor constructed with phi greater than PI (allowed range -PI / +PI) PhiRange" << std::endl;
183 }
184 return phi;
185}
#define M_2PI
static const float M_PIF

◆ phiHalfWidth()

double TIDARoiDescriptor::phiHalfWidth ( ) const
inlineinherited

Definition at line 180 of file TIDARoiDescriptor.h.

180 {
181 double dphi = 0.5*(params().phiPlus()-params().phiMinus());
182 if ( params().phiMinus()>params().phiPlus() ) dphi += M_PI;
183 return dphi;
184 }
#define M_PI
const TIDARoiParameters & params() const
access the internal parameter class
float phiPlus() const
float phiMinus() const

◆ phiMinus()

double TIDARoiDescriptor::phiMinus ( ) const
inlineinherited

Definition at line 138 of file TIDARoiDescriptor.h.

138{ return m_params.phiMinus(); }

◆ phiPlus()

double TIDARoiDescriptor::phiPlus ( ) const
inlineinherited

Definition at line 139 of file TIDARoiDescriptor.h.

139{ return m_params.phiPlus(); }

◆ push_back() [1/2]

void TIDARoiDescriptor::push_back ( const TIDARoiDescriptor & roi)
inlineinherited

Definition at line 209 of file TIDARoiDescriptor.h.

209{ m_rois.push_back( roi ); }

◆ push_back() [2/2]

void TIDARoiDescriptor::push_back ( const TIDARoiDescriptor * roi)
inlineinherited

Definition at line 210 of file TIDARoiDescriptor.h.

210{ m_rois.push_back( *roi ); }

◆ reset()

void TIDARoiDescriptor::reset ( )
inlineprotectedinherited

internal parameters

resets all variables of RoI

Definition at line 249 of file TIDARoiDescriptor.h.

249 {
250 m_params = TIDARoiParameters();
251 // m_phi=0.0; m_eta=0.0; m_zed=0.0;
252 // m_phiHalfWidth=0.1; m_etaHalfWidth=0.1; m_zedHalfWidth=168;
253 // m_etaPlus=m_eta; m_etaMinus=m_eta;
254 m_l1Id=0;
255 m_roiId=0;
256 m_roiWord=0;
257 m_rois.clear();
258 }

◆ rMinusZed()

double TIDARoiDescriptor::rMinusZed ( ) const
inlineinherited

Definition at line 151 of file TIDARoiDescriptor.h.

151{ return m_rMinusZed; }
double m_rMinusZed
don't save - transient zPlus at radius R

◆ roiId()

unsigned TIDARoiDescriptor::roiId ( ) const
inlineinherited

identifier methods

Definition at line 160 of file TIDARoiDescriptor.h.

160{ return m_roiId; }

◆ roiWord()

unsigned TIDARoiDescriptor::roiWord ( ) const
inlineinherited

Definition at line 162 of file TIDARoiDescriptor.h.

162{ return m_roiWord; }

◆ rPlusZed()

double TIDARoiDescriptor::rPlusZed ( ) const
inlineinherited

Definition at line 150 of file TIDARoiDescriptor.h.

150{ return m_rPlusZed; }
double m_rPlusZed
don't save - transient zMinus at radius R

◆ set_l1Id()

void TIDARoiDescriptor::set_l1Id ( const unsigned int l1id)
inlineinherited

set event number

Definition at line 115 of file TIDARoiDescriptor.h.

◆ set_roiId()

void TIDARoiDescriptor::set_roiId ( const unsigned int id)
inlineinherited

set roiId

Definition at line 114 of file TIDARoiDescriptor.h.

◆ set_roiWord()

void TIDARoiDescriptor::set_roiWord ( const unsigned int roiWord)
inlineinherited

sets RoI word

Definition at line 116 of file TIDARoiDescriptor.h.

◆ size()

size_t TIDARoiDescriptor::size ( ) const
inlineinherited

Definition at line 174 of file TIDARoiDescriptor.h.

174{ return m_rois.size(); }

◆ version()

int TIDARoiDescriptor::version ( ) const
inlineinherited

Definition at line 164 of file TIDARoiDescriptor.h.

164{ return 4; }

◆ zed()

double TIDARoiDescriptor::zed ( ) const
inlineinherited

Definition at line 133 of file TIDARoiDescriptor.h.

133{ return m_params.zed(); }

◆ zedcheck()

double TIDARoiDescriptor::zedcheck ( double zed)
protectedinherited

helper function to check if zed range was violated

Definition at line 196 of file TIDARoiDescriptor.cxx.

196 {
197 if ( !(zed > -100000 && zed < 100000 ) ) { // check also for nan
198 std::cerr << "TIDARoiDescriptor constructed with eta outside range -100000 < sed <100000 ZedRange" << std::endl;
199 }
200 return zed;
201}

◆ zedHalfWidth()

double TIDARoiDescriptor::zedHalfWidth ( ) const
inlineinherited

gets eta half-width

Definition at line 187 of file TIDARoiDescriptor.h.

◆ zedMinus()

double TIDARoiDescriptor::zedMinus ( ) const
inlineinherited

Definition at line 141 of file TIDARoiDescriptor.h.

141{ return m_params.zedMinus(); }

◆ zedMinusR()

double TIDARoiDescriptor::zedMinusR ( ) const
inlineinherited

Definition at line 148 of file TIDARoiDescriptor.h.

148{ return m_zedMinusR; }
double m_zedMinusR
don't save - transient zPlus at radius R

◆ zedPlus()

double TIDARoiDescriptor::zedPlus ( ) const
inlineinherited

Definition at line 142 of file TIDARoiDescriptor.h.

142{ return m_params.zedPlus(); }

◆ zedPlusR()

double TIDARoiDescriptor::zedPlusR ( ) const
inlineinherited

full containment methods

Definition at line 147 of file TIDARoiDescriptor.h.

147{ return m_zedPlusR; }
double m_zedPlusR
cached value -

Member Data Documentation

◆ m_cached

bool TIDARoiDescriptor::m_cached
protectedinherited

Definition at line 281 of file TIDARoiDescriptor.h.

◆ m_dphi

double TIDARoiDescriptor::m_dphi
protectedinherited

cache flag - these should be mutable

Definition at line 282 of file TIDARoiDescriptor.h.

◆ m_fullscan

bool TIDARoiDescriptor::m_fullscan
protectedinherited

Definition at line 273 of file TIDARoiDescriptor.h.

◆ m_l1Id

unsigned int TIDARoiDescriptor::m_l1Id
protectedinherited

Definition at line 275 of file TIDARoiDescriptor.h.

◆ m_params

TIDARoiParameters TIDARoiDescriptor::m_params
protectedinherited

don't save

Definition at line 271 of file TIDARoiDescriptor.h.

◆ m_rMinusZed

double TIDARoiDescriptor::m_rMinusZed
protectedinherited

don't save - transient zPlus at radius R

Definition at line 288 of file TIDARoiDescriptor.h.

◆ m_roiId

unsigned int TIDARoiDescriptor::m_roiId
protectedinherited

Definition at line 276 of file TIDARoiDescriptor.h.

◆ m_rois

std::vector<TIDARoiDescriptor> TIDARoiDescriptor::m_rois
protectedinherited

Definition at line 279 of file TIDARoiDescriptor.h.

◆ m_roiWord

unsigned int TIDARoiDescriptor::m_roiWord
protectedinherited

Definition at line 277 of file TIDARoiDescriptor.h.

◆ m_rPlusZed

double TIDARoiDescriptor::m_rPlusZed
protectedinherited

don't save - transient zMinus at radius R

Definition at line 287 of file TIDARoiDescriptor.h.

◆ m_tanthetaMinus

double TIDARoiDescriptor::m_tanthetaMinus
protectedinherited

don't save - transient roi edge gradients

Definition at line 291 of file TIDARoiDescriptor.h.

◆ m_tanthetaPlus

double TIDARoiDescriptor::m_tanthetaPlus
protectedinherited

don't save - transient zMinus at radius R

Definition at line 290 of file TIDARoiDescriptor.h.

◆ m_zedMinusR

double TIDARoiDescriptor::m_zedMinusR
protectedinherited

don't save - transient zPlus at radius R

Definition at line 285 of file TIDARoiDescriptor.h.

◆ m_zedPlusR

double TIDARoiDescriptor::m_zedPlusR
protectedinherited

cached value -

Definition at line 284 of file TIDARoiDescriptor.h.

◆ maxRadius

const double TIDARoiDescriptor::maxRadius = 1000
staticprotectedinherited

Definition at line 266 of file TIDARoiDescriptor.h.

◆ maxZed

const double TIDARoiDescriptor::maxZed = 2700
staticprotectedinherited

don't save

Definition at line 267 of file TIDARoiDescriptor.h.


The documentation for this class was generated from the following file: