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

Describes the Region of Ineterest geometry It has basically 8 parameters. More...

#include <TIDARoiDescriptor.h>

Inheritance diagram for TIDARoiDescriptor:
Collaboration diagram for TIDARoiDescriptor:

Public Member Functions

 TIDARoiDescriptor (bool fullscan=false)
 default constructor
 TIDARoiDescriptor (double eta, double etaMinus, double etaPlus, double phi, double phiMinus, double phiPlus, double zed, double zedMinus, double zedPlus)
 constructor where phi,eta and zed are specified
 TIDARoiDescriptor (unsigned l1id, int id, double eta, double etaMinus, double etaPlus, double phi, double phiMinus, double phiPlus, double zed, double zedMinus, double zedPlus)
 constructor
 TIDARoiDescriptor (unsigned roiWord, unsigned l1id, int id, double eta, double etaMinus, double etaPlus, double phi, double phiMinus, double phiPlus, double zed, double zedMinus, double zedPlus)
 constructor
 TIDARoiDescriptor (const TIDARoiDescriptor &r)
 copy constructor
TIDARoiDescriptoroperator= (const TIDARoiDescriptor &r)
 assignment
virtual ~TIDARoiDescriptor ()
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

Describes the Region of Ineterest geometry It has basically 8 parameters.

  1. zed : z position at beamline of RoI
  2. zedMinus : z position at beamline as rear of RoI
  3. zedPlus : z position at beamline as front of RoI
  4. phi : azimuthal angle (radians) of centre of RoI at origin in range from [-pi, pi]
  5. phiMinus : most negative phi angle of RoI
  6. phiPlus : most positive phi angle of RoI
  7. eta : pseudo-rapidity of centre of RoI at origin
  8. etaPlus : pseudo-rapidity at zed + zed half-width
  9. etaMinus : pseudo-rapidity at zed - zed half-width
    Warning
    An attempt to cnstruct the objects of this calss with phi0 out of allowed range reasults in throwing exception

Definition at line 42 of file TIDARoiDescriptor.h.

Constructor & Destructor Documentation

◆ TIDARoiDescriptor() [1/5]

TIDARoiDescriptor::TIDARoiDescriptor ( bool fullscan = false)

default constructor

Definition at line 64 of file TIDARoiDescriptor.cxx.

65 : m_fullscan(fullscan),
66 m_l1Id(0), m_roiId(0), m_roiWord(0),
67 m_zedPlusR(0),
68 m_zedMinusR(0),
69 m_rPlusZed(0),
71{
72 if ( m_fullscan ) {
73 m_params = TIDARoiParameters( 0, -5, 5, 0, -M_PI, M_PI, 0, -225, 225 );
74
77 }
78}
#define M_PI
double m_rPlusZed
don't save - transient zMinus at radius R
double m_rMinusZed
don't save - transient zPlus at radius R
double m_zedMinusR
don't save - transient zPlus at radius R
TIDARoiParameters m_params
don't save
double m_zedPlusR
cached value -
double m_tanthetaPlus
don't save - transient zMinus at radius R
static double exitpoint(double tz0, double teta, double &zexit, double &rexit)
double m_tanthetaMinus
don't save - transient roi edge gradients

◆ TIDARoiDescriptor() [2/5]

TIDARoiDescriptor::TIDARoiDescriptor ( double eta,
double etaMinus,
double etaPlus,
double phi,
double phiMinus,
double phiPlus,
double zed,
double zedMinus,
double zedPlus )

constructor where phi,eta and zed are specified

Parameters
etaeta of RoI
phiphi of RoI
zedzed of RoI and limits fir each

Definition at line 81 of file TIDARoiDescriptor.cxx.

86 zed, zedMinus, zedPlus ),
87 m_fullscan(false),
88 m_l1Id(0), m_roiId(0), m_roiWord(0)
89{
90 // calculate z limits at radius maxRadius
91
94}
double etaMinus() const
double zedPlus() const
double etaPlus() const
double zedMinus() const
double phiPlus() const
double phiMinus() const

◆ TIDARoiDescriptor() [3/5]

TIDARoiDescriptor::TIDARoiDescriptor ( unsigned l1id,
int id,
double eta,
double etaMinus,
double etaPlus,
double phi,
double phiMinus,
double phiPlus,
double zed,
double zedMinus,
double zedPlus )

constructor

Parameters
l1idis event number asigned by LVL1 trigger
idRoI number within event (0,1,.....)
etaeta of RoI
phiphi of RoI
zedzed of RoI and limits fir each

◆ TIDARoiDescriptor() [4/5]

TIDARoiDescriptor::TIDARoiDescriptor ( unsigned roiWord,
unsigned l1id,
int id,
double eta,
double etaMinus,
double etaPlus,
double phi,
double phiMinus,
double phiPlus,
double zed,
double zedMinus,
double zedPlus )

constructor

Parameters
roiWordLVL1 trigger decision word
l1idis event number asigned by LVL1 trigger
idRoI number within event (0,1,.....)
etaeta of RoI
phiphi of RoI
zedzed of RoI and limits fir each

◆ TIDARoiDescriptor() [5/5]

TIDARoiDescriptor::TIDARoiDescriptor ( const TIDARoiDescriptor & r)

copy constructor

Parameters
TIDARoiDescriptor

Definition at line 131 of file TIDARoiDescriptor.cxx.

131 :
132 TObject(*this),
133 m_params(a.m_params),
134 m_fullscan(a.m_fullscan),
135 m_l1Id(a.m_l1Id), m_roiId(a.m_roiId), m_roiWord(a.m_roiWord),
136 m_rois(a.m_rois)
137{
140}
static Double_t a
std::vector< TIDARoiDescriptor > m_rois

◆ ~TIDARoiDescriptor()

TIDARoiDescriptor::~TIDARoiDescriptor ( )
virtual

Definition at line 160 of file TIDARoiDescriptor.cxx.

160{ }

Member Function Documentation

◆ at()

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

gets phi half-width

Definition at line 179 of file TIDARoiDescriptor.h.

◆ composite()

bool TIDARoiDescriptor::composite ( ) const
inline

composite RoI methods

Definition at line 174 of file TIDARoiDescriptor.h.

174{ return !m_rois.empty(); }

◆ eta()

double TIDARoiDescriptor::eta ( ) const
inline

Definition at line 134 of file TIDARoiDescriptor.h.

134{ return m_params.eta(); }

◆ etacheck()

double TIDARoiDescriptor::etacheck ( double eta)
protected

helper function to check if eta range was violated

Definition at line 187 of file TIDARoiDescriptor.cxx.

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

◆ etaHalfWidth()

double TIDARoiDescriptor::etaHalfWidth ( ) const
inline

gets eta half-width

Definition at line 188 of file TIDARoiDescriptor.h.

◆ etaMinus()

double TIDARoiDescriptor::etaMinus ( ) const
inline

Definition at line 137 of file TIDARoiDescriptor.h.

137{ return m_params.etaMinus(); }

◆ etaPlus()

double TIDARoiDescriptor::etaPlus ( ) const
inline

Definition at line 138 of file TIDARoiDescriptor.h.

138{ return m_params.etaPlus(); }

◆ exitpoint()

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

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
inline

Definition at line 170 of file TIDARoiDescriptor.h.

170{ return m_fullscan; }

◆ l1Id()

unsigned TIDARoiDescriptor::l1Id ( ) const
inline

Definition at line 163 of file TIDARoiDescriptor.h.

163{ return m_l1Id; }

◆ maxR()

double TIDARoiDescriptor::maxR ( ) const
inline

Definition at line 155 of file TIDARoiDescriptor.h.

155{ return maxRadius; }

◆ maxZ()

double TIDARoiDescriptor::maxZ ( ) const
inline

Definition at line 156 of file TIDARoiDescriptor.h.

156{ return maxZed; }

◆ operator std::string()

TIDARoiDescriptor::operator std::string ( ) const

Definition at line 163 of file TIDARoiDescriptor.cxx.

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

◆ operator!=()

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

Definition at line 209 of file TIDARoiDescriptor.h.

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

◆ operator=()

TIDARoiDescriptor & TIDARoiDescriptor::operator= ( const TIDARoiDescriptor & r)

assignment

Parameters
TIDARoiDescriptor

Definition at line 143 of file TIDARoiDescriptor.cxx.

144{
145 if (this != &a) {
146 TObject::operator= (a);
147 m_params = a.m_params;
148 m_fullscan = a.m_fullscan;
149 m_l1Id = a.m_l1Id;
150 m_roiId = a.m_roiId;
151 m_roiWord = a.m_roiWord;
152 m_rois = a.m_rois;
155 }
156 return *this;
157}

◆ operator==()

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

operators

Definition at line 200 of file TIDARoiDescriptor.h.

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

◆ operator[]()

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

Definition at line 178 of file TIDARoiDescriptor.h.

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

◆ params()

const TIDARoiParameters & TIDARoiDescriptor::params ( ) const
inlineprotected

access the internal parameter class

Definition at line 247 of file TIDARoiDescriptor.h.

247{ return m_params; };

◆ phi()

double TIDARoiDescriptor::phi ( ) const
inline

Definition at line 133 of file TIDARoiDescriptor.h.

133{ return m_params.phi(); }

◆ phicheck()

double TIDARoiDescriptor::phicheck ( double phi)
protected

helper function to check if phi range was violated

Definition at line 176 of file TIDARoiDescriptor.cxx.

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

◆ phiHalfWidth()

double TIDARoiDescriptor::phiHalfWidth ( ) const
inline

Definition at line 182 of file TIDARoiDescriptor.h.

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

◆ phiMinus()

double TIDARoiDescriptor::phiMinus ( ) const
inline

Definition at line 140 of file TIDARoiDescriptor.h.

140{ return m_params.phiMinus(); }

◆ phiPlus()

double TIDARoiDescriptor::phiPlus ( ) const
inline

Definition at line 141 of file TIDARoiDescriptor.h.

141{ return m_params.phiPlus(); }

◆ push_back() [1/2]

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

Definition at line 212 of file TIDARoiDescriptor.h.

212{ m_rois.push_back( roi ); }

◆ push_back() [2/2]

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

Definition at line 213 of file TIDARoiDescriptor.h.

213{ m_rois.push_back( *roi ); }

◆ reset()

void TIDARoiDescriptor::reset ( )
inlineprotected

internal parameters

resets all varaibles of RoI

Definition at line 252 of file TIDARoiDescriptor.h.

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

◆ rMinusZed()

double TIDARoiDescriptor::rMinusZed ( ) const
inline

Definition at line 153 of file TIDARoiDescriptor.h.

153{ return m_rMinusZed; }

◆ roiId()

unsigned TIDARoiDescriptor::roiId ( ) const
inline

identifier methods

Definition at line 162 of file TIDARoiDescriptor.h.

162{ return m_roiId; }

◆ roiWord()

unsigned TIDARoiDescriptor::roiWord ( ) const
inline

Definition at line 164 of file TIDARoiDescriptor.h.

164{ return m_roiWord; }

◆ rPlusZed()

double TIDARoiDescriptor::rPlusZed ( ) const
inline

Definition at line 152 of file TIDARoiDescriptor.h.

152{ return m_rPlusZed; }

◆ set_l1Id()

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

set event number

Definition at line 117 of file TIDARoiDescriptor.h.

◆ set_roiId()

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

set roiId

Definition at line 116 of file TIDARoiDescriptor.h.

◆ set_roiWord()

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

sets RoI word

Definition at line 118 of file TIDARoiDescriptor.h.

◆ size()

size_t TIDARoiDescriptor::size ( ) const
inline

Definition at line 176 of file TIDARoiDescriptor.h.

176{ return m_rois.size(); }

◆ version()

int TIDARoiDescriptor::version ( ) const
inline

Definition at line 166 of file TIDARoiDescriptor.h.

166{ return 4; }

◆ zed()

double TIDARoiDescriptor::zed ( ) const
inline

Definition at line 135 of file TIDARoiDescriptor.h.

135{ return m_params.zed(); }

◆ zedcheck()

double TIDARoiDescriptor::zedcheck ( double zed)
protected

helper function to check if zed range was violated

Definition at line 195 of file TIDARoiDescriptor.cxx.

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

◆ zedHalfWidth()

double TIDARoiDescriptor::zedHalfWidth ( ) const
inline

gets eta half-width

Definition at line 189 of file TIDARoiDescriptor.h.

◆ zedMinus()

double TIDARoiDescriptor::zedMinus ( ) const
inline

Definition at line 143 of file TIDARoiDescriptor.h.

143{ return m_params.zedMinus(); }

◆ zedMinusR()

double TIDARoiDescriptor::zedMinusR ( ) const
inline

Definition at line 150 of file TIDARoiDescriptor.h.

150{ return m_zedMinusR; }

◆ zedPlus()

double TIDARoiDescriptor::zedPlus ( ) const
inline

Definition at line 144 of file TIDARoiDescriptor.h.

144{ return m_params.zedPlus(); }

◆ zedPlusR()

double TIDARoiDescriptor::zedPlusR ( ) const
inline

full containment methods

Definition at line 149 of file TIDARoiDescriptor.h.

149{ return m_zedPlusR; }

Member Data Documentation

◆ m_cached

bool TIDARoiDescriptor::m_cached
protected

Definition at line 284 of file TIDARoiDescriptor.h.

◆ m_dphi

double TIDARoiDescriptor::m_dphi
protected

cache flag - these should be mutable

Definition at line 285 of file TIDARoiDescriptor.h.

◆ m_fullscan

bool TIDARoiDescriptor::m_fullscan
protected

Definition at line 276 of file TIDARoiDescriptor.h.

◆ m_l1Id

unsigned int TIDARoiDescriptor::m_l1Id
protected

Definition at line 278 of file TIDARoiDescriptor.h.

◆ m_params

TIDARoiParameters TIDARoiDescriptor::m_params
protected

don't save

Definition at line 274 of file TIDARoiDescriptor.h.

◆ m_rMinusZed

double TIDARoiDescriptor::m_rMinusZed
protected

don't save - transient zPlus at radius R

Definition at line 291 of file TIDARoiDescriptor.h.

◆ m_roiId

unsigned int TIDARoiDescriptor::m_roiId
protected

Definition at line 279 of file TIDARoiDescriptor.h.

◆ m_rois

std::vector<TIDARoiDescriptor> TIDARoiDescriptor::m_rois
protected

Definition at line 282 of file TIDARoiDescriptor.h.

◆ m_roiWord

unsigned int TIDARoiDescriptor::m_roiWord
protected

Definition at line 280 of file TIDARoiDescriptor.h.

◆ m_rPlusZed

double TIDARoiDescriptor::m_rPlusZed
protected

don't save - transient zMinus at radius R

Definition at line 290 of file TIDARoiDescriptor.h.

◆ m_tanthetaMinus

double TIDARoiDescriptor::m_tanthetaMinus
protected

don't save - transient roi edge gradients

Definition at line 294 of file TIDARoiDescriptor.h.

◆ m_tanthetaPlus

double TIDARoiDescriptor::m_tanthetaPlus
protected

don't save - transient zMinus at radius R

Definition at line 293 of file TIDARoiDescriptor.h.

◆ m_zedMinusR

double TIDARoiDescriptor::m_zedMinusR
protected

don't save - transient zPlus at radius R

Definition at line 288 of file TIDARoiDescriptor.h.

◆ m_zedPlusR

double TIDARoiDescriptor::m_zedPlusR
protected

cached value -

Definition at line 287 of file TIDARoiDescriptor.h.

◆ maxRadius

const double TIDARoiDescriptor::maxRadius = 1000
staticprotected

Definition at line 269 of file TIDARoiDescriptor.h.

◆ maxZed

const double TIDARoiDescriptor::maxZed = 2700
staticprotected

don't save

Definition at line 270 of file TIDARoiDescriptor.h.


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