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 183 of file TIDARoiDescriptor.h.

◆ composite()

bool TIDARoiDescriptor::composite ( ) const
inlineinherited

composite RoI methods

Definition at line 178 of file TIDARoiDescriptor.h.

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

◆ eta()

double TIDARoiDescriptor::eta ( ) const
inlineinherited

Definition at line 138 of file TIDARoiDescriptor.h.

138{ 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 217 of file TIDARoiDescriptor.cxx.

217 {
218 if ( !(eta > -100 && eta < 100) ) { // check also for nan
219 std::cerr << "TIDARoiDescriptor constructed with eta outside range -100 < eta <100 EtaRange" << std::endl;
220 }
221 return eta;
222}

◆ etaHalfWidth()

double TIDARoiDescriptor::etaHalfWidth ( ) const
inlineinherited

gets eta half-width

Definition at line 192 of file TIDARoiDescriptor.h.

◆ etaMinus()

double TIDARoiDescriptor::etaMinus ( ) const
inlineinherited

Definition at line 141 of file TIDARoiDescriptor.h.

141{ return m_params.etaMinus(); }

◆ etaPlus()

double TIDARoiDescriptor::etaPlus ( ) const
inlineinherited

Definition at line 142 of file TIDARoiDescriptor.h.

142{ 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 174 of file TIDARoiDescriptor.h.

174{ return m_fullscan; }

◆ l1Id()

unsigned TIDARoiDescriptor::l1Id ( ) const
inlineinherited

Definition at line 167 of file TIDARoiDescriptor.h.

167{ return m_l1Id; }

◆ maxR()

double TIDARoiDescriptor::maxR ( ) const
inlineinherited

Definition at line 159 of file TIDARoiDescriptor.h.

159{ return maxRadius; }

◆ maxZ()

double TIDARoiDescriptor::maxZ ( ) const
inlineinherited

Definition at line 160 of file TIDARoiDescriptor.h.

160{ return maxZed; }

◆ operator std::string()

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

Definition at line 193 of file TIDARoiDescriptor.cxx.

193 {
194 std::stringstream s;
195 s << " z: " << zed() << " (" << zedMinus() << " - " << zedPlus() << ")"
196 << " eta: " << eta() << " (" << etaMinus() << " - " << etaPlus() << ")"
197 << " phi: " << phi() << " (" << phiMinus() << " - " << phiPlus() << ")";
198 if ( m_fullscan ) s << " (fullscan)";
199 s << " RoIid: " << roiId() << " RoIword: " << roiWord() << " (size " << size() << ")";
200 for ( unsigned i=0 ; i<size() ; i++ ) s << "\n\t\t" << i << ": " << (std::string)*at(i);
201 return s.str();
202}
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 213 of file TIDARoiDescriptor.h.

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

◆ operator==()

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

operators

Definition at line 204 of file TIDARoiDescriptor.h.

204 {
205 if ( roiWord() != b.roiWord() ) return false;
206 double epsilon=0.001; // arbitrary , but seems to be reasonable
207 if ( std::fabs( phi() - b.phi()) > epsilon ) return false;
208 if ( std::fabs( eta() - b.eta()) > epsilon ) return false;
209 if ( std::fabs( zed() - b.zed()) > epsilon ) return false;
210 return true;
211 }

◆ operator[]()

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

Definition at line 182 of file TIDARoiDescriptor.h.

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

◆ params()

const TIDARoiParameters & TIDARoiDescriptor::params ( ) const
inlineprotectedinherited

access the internal parameter class

Definition at line 250 of file TIDARoiDescriptor.h.

250{ return m_params; };

◆ phi()

double TIDARoiDescriptor::phi ( ) const
inlineinherited

Definition at line 137 of file TIDARoiDescriptor.h.

137{ return m_params.phi(); }

◆ phicheck()

double TIDARoiDescriptor::phicheck ( double phi)
protectedinherited

helper function to check if phi range was violated

Definition at line 206 of file TIDARoiDescriptor.cxx.

206 {
207 if ( !(phi > -M_PIF && phi < M_PIF ) ) { // use ! of range rather than range to also catch nan etc
208 if ( phi < -M_PIF ) phi += M_2PI;
209 else phi -= M_2PI;
210 // std::cerr << "TIDARoiDescriptor constructed with phi smaller than -PI (allowed range -PI / +PI) PhiRange" << std::endl;
211 // std::cerr << "TIDARoiDescriptor constructed with phi greater than PI (allowed range -PI / +PI) PhiRange" << std::endl;
212 }
213 return phi;
214}
#define M_2PI
static const float M_PIF

◆ phiHalfWidth()

double TIDARoiDescriptor::phiHalfWidth ( ) const
inlineinherited

Definition at line 186 of file TIDARoiDescriptor.h.

186 {
187 double dphi = 0.5*(params().phiPlus()-params().phiMinus());
188 if ( params().phiMinus()>params().phiPlus() ) dphi += M_PI;
189 return dphi;
190 }
#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 144 of file TIDARoiDescriptor.h.

144{ return m_params.phiMinus(); }

◆ phiPlus()

double TIDARoiDescriptor::phiPlus ( ) const
inlineinherited

Definition at line 145 of file TIDARoiDescriptor.h.

145{ return m_params.phiPlus(); }

◆ push_back() [1/2]

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

Definition at line 215 of file TIDARoiDescriptor.h.

215{ m_rois.push_back( roi ); }

◆ push_back() [2/2]

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

Definition at line 216 of file TIDARoiDescriptor.h.

216{ m_rois.push_back( *roi ); }

◆ reset()

void TIDARoiDescriptor::reset ( )
inlineprotectedinherited

internal parameters

resets all variables of RoI

Definition at line 255 of file TIDARoiDescriptor.h.

255 {
256 m_params = TIDARoiParameters();
257 // m_phi=0.0; m_eta=0.0; m_zed=0.0;
258 // m_phiHalfWidth=0.1; m_etaHalfWidth=0.1; m_zedHalfWidth=168;
259 // m_etaPlus=m_eta; m_etaMinus=m_eta;
260 m_l1Id=0;
261 m_roiId=0;
262 m_roiWord=0;
263 m_rois.clear();
264 }

◆ rMinusZed()

double TIDARoiDescriptor::rMinusZed ( ) const
inlineinherited

Definition at line 157 of file TIDARoiDescriptor.h.

157{ 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 166 of file TIDARoiDescriptor.h.

166{ return m_roiId; }

◆ roiWord()

unsigned TIDARoiDescriptor::roiWord ( ) const
inlineinherited

Definition at line 168 of file TIDARoiDescriptor.h.

168{ return m_roiWord; }

◆ rPlusZed()

double TIDARoiDescriptor::rPlusZed ( ) const
inlineinherited

Definition at line 156 of file TIDARoiDescriptor.h.

156{ 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 121 of file TIDARoiDescriptor.h.

◆ set_roiId()

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

set roiId

Definition at line 120 of file TIDARoiDescriptor.h.

◆ set_roiWord()

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

sets RoI word

Definition at line 122 of file TIDARoiDescriptor.h.

◆ size()

size_t TIDARoiDescriptor::size ( ) const
inlineinherited

Definition at line 180 of file TIDARoiDescriptor.h.

180{ return m_rois.size(); }

◆ version()

int TIDARoiDescriptor::version ( ) const
inlineinherited

Definition at line 170 of file TIDARoiDescriptor.h.

170{ return 4; }

◆ zed()

double TIDARoiDescriptor::zed ( ) const
inlineinherited

Definition at line 139 of file TIDARoiDescriptor.h.

139{ return m_params.zed(); }

◆ zedcheck()

double TIDARoiDescriptor::zedcheck ( double zed)
protectedinherited

helper function to check if zed range was violated

Definition at line 225 of file TIDARoiDescriptor.cxx.

225 {
226 if ( !(zed > -100000 && zed < 100000 ) ) { // check also for nan
227 std::cerr << "TIDARoiDescriptor constructed with eta outside range -100000 < sed <100000 ZedRange" << std::endl;
228 }
229 return zed;
230}

◆ zedHalfWidth()

double TIDARoiDescriptor::zedHalfWidth ( ) const
inlineinherited

gets eta half-width

Definition at line 193 of file TIDARoiDescriptor.h.

◆ zedMinus()

double TIDARoiDescriptor::zedMinus ( ) const
inlineinherited

Definition at line 147 of file TIDARoiDescriptor.h.

147{ return m_params.zedMinus(); }

◆ zedMinusR()

double TIDARoiDescriptor::zedMinusR ( ) const
inlineinherited

Definition at line 154 of file TIDARoiDescriptor.h.

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

◆ zedPlus()

double TIDARoiDescriptor::zedPlus ( ) const
inlineinherited

Definition at line 148 of file TIDARoiDescriptor.h.

148{ return m_params.zedPlus(); }

◆ zedPlusR()

double TIDARoiDescriptor::zedPlusR ( ) const
inlineinherited

full containment methods

Definition at line 153 of file TIDARoiDescriptor.h.

153{ return m_zedPlusR; }
double m_zedPlusR
cached value -

Member Data Documentation

◆ m_cached

bool TIDARoiDescriptor::m_cached
protectedinherited

Definition at line 287 of file TIDARoiDescriptor.h.

◆ m_dphi

double TIDARoiDescriptor::m_dphi
protectedinherited

cache flag - these should be mutable

Definition at line 288 of file TIDARoiDescriptor.h.

◆ m_fullscan

bool TIDARoiDescriptor::m_fullscan
protectedinherited

Definition at line 279 of file TIDARoiDescriptor.h.

◆ m_l1Id

unsigned int TIDARoiDescriptor::m_l1Id
protectedinherited

Definition at line 281 of file TIDARoiDescriptor.h.

◆ m_params

TIDARoiParameters TIDARoiDescriptor::m_params
protectedinherited

don't save

Definition at line 277 of file TIDARoiDescriptor.h.

◆ m_rMinusZed

double TIDARoiDescriptor::m_rMinusZed
protectedinherited

don't save - transient zPlus at radius R

Definition at line 294 of file TIDARoiDescriptor.h.

◆ m_roiId

unsigned int TIDARoiDescriptor::m_roiId
protectedinherited

Definition at line 282 of file TIDARoiDescriptor.h.

◆ m_rois

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

Definition at line 285 of file TIDARoiDescriptor.h.

◆ m_roiWord

unsigned int TIDARoiDescriptor::m_roiWord
protectedinherited

Definition at line 283 of file TIDARoiDescriptor.h.

◆ m_rPlusZed

double TIDARoiDescriptor::m_rPlusZed
protectedinherited

don't save - transient zMinus at radius R

Definition at line 293 of file TIDARoiDescriptor.h.

◆ m_tanthetaMinus

double TIDARoiDescriptor::m_tanthetaMinus
protectedinherited

don't save - transient roi edge gradients

Definition at line 297 of file TIDARoiDescriptor.h.

◆ m_tanthetaPlus

double TIDARoiDescriptor::m_tanthetaPlus
protectedinherited

don't save - transient zMinus at radius R

Definition at line 296 of file TIDARoiDescriptor.h.

◆ m_zedMinusR

double TIDARoiDescriptor::m_zedMinusR
protectedinherited

don't save - transient zPlus at radius R

Definition at line 291 of file TIDARoiDescriptor.h.

◆ m_zedPlusR

double TIDARoiDescriptor::m_zedPlusR
protectedinherited

cached value -

Definition at line 290 of file TIDARoiDescriptor.h.

◆ maxRadius

const double TIDARoiDescriptor::maxRadius = 1000
staticprotectedinherited

Definition at line 272 of file TIDARoiDescriptor.h.

◆ maxZed

const double TIDARoiDescriptor::maxZed = 2700
staticprotectedinherited

don't save

Definition at line 273 of file TIDARoiDescriptor.h.


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