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 40 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_cached(false), m_dphi(0),
68 m_zedPlusR(0),
69 m_zedMinusR(0),
70 m_rPlusZed(0),
72{
73 if ( m_fullscan ) {
74 m_params = TIDARoiParameters( 0, -5, 5, 0, -M_PI, M_PI, 0, -225, 225 );
75
78 }
79}
#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
double m_dphi
cache flag - these should be mutable

◆ 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 82 of file TIDARoiDescriptor.cxx.

87 zed, zedMinus, zedPlus ),
88 m_fullscan(false),
89 m_l1Id(0), m_roiId(0), m_roiWord(0)
90{
91 // calculate z limits at radius maxRadius
92
95}
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 132 of file TIDARoiDescriptor.cxx.

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

◆ ~TIDARoiDescriptor()

TIDARoiDescriptor::~TIDARoiDescriptor ( )
virtual

Definition at line 161 of file TIDARoiDescriptor.cxx.

161{ }

Member Function Documentation

◆ at()

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

gets phi half-width

Definition at line 177 of file TIDARoiDescriptor.h.

◆ composite()

bool TIDARoiDescriptor::composite ( ) const
inline

composite RoI methods

Definition at line 172 of file TIDARoiDescriptor.h.

172{ return !m_rois.empty(); }

◆ eta()

double TIDARoiDescriptor::eta ( ) const
inline

Definition at line 132 of file TIDARoiDescriptor.h.

132{ return m_params.eta(); }

◆ etacheck()

double TIDARoiDescriptor::etacheck ( double eta)
protected

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
inline

gets eta half-width

Definition at line 186 of file TIDARoiDescriptor.h.

◆ etaMinus()

double TIDARoiDescriptor::etaMinus ( ) const
inline

Definition at line 135 of file TIDARoiDescriptor.h.

135{ return m_params.etaMinus(); }

◆ etaPlus()

double TIDARoiDescriptor::etaPlus ( ) const
inline

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

168{ return m_fullscan; }

◆ l1Id()

unsigned TIDARoiDescriptor::l1Id ( ) const
inline

Definition at line 161 of file TIDARoiDescriptor.h.

161{ return m_l1Id; }

◆ maxR()

double TIDARoiDescriptor::maxR ( ) const
inline

Definition at line 153 of file TIDARoiDescriptor.h.

153{ return maxRadius; }

◆ maxZ()

double TIDARoiDescriptor::maxZ ( ) const
inline

Definition at line 154 of file TIDARoiDescriptor.h.

154{ return maxZed; }

◆ operator std::string()

TIDARoiDescriptor::operator std::string ( ) const

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

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

◆ operator=()

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

assignment

Parameters
TIDARoiDescriptor

Definition at line 144 of file TIDARoiDescriptor.cxx.

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

◆ operator==()

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

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
inline

Definition at line 176 of file TIDARoiDescriptor.h.

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

◆ params()

const TIDARoiParameters & TIDARoiDescriptor::params ( ) const
inlineprotected

access the internal parameter class

Definition at line 244 of file TIDARoiDescriptor.h.

244{ return m_params; };

◆ phi()

double TIDARoiDescriptor::phi ( ) const
inline

Definition at line 131 of file TIDARoiDescriptor.h.

131{ return m_params.phi(); }

◆ phicheck()

double TIDARoiDescriptor::phicheck ( double phi)
protected

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
inline

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 }
const TIDARoiParameters & params() const
access the internal parameter class
float phiPlus() const
float phiMinus() const

◆ phiMinus()

double TIDARoiDescriptor::phiMinus ( ) const
inline

Definition at line 138 of file TIDARoiDescriptor.h.

138{ return m_params.phiMinus(); }

◆ phiPlus()

double TIDARoiDescriptor::phiPlus ( ) const
inline

Definition at line 139 of file TIDARoiDescriptor.h.

139{ return m_params.phiPlus(); }

◆ push_back() [1/2]

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

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)
inline

Definition at line 210 of file TIDARoiDescriptor.h.

210{ m_rois.push_back( *roi ); }

◆ reset()

void TIDARoiDescriptor::reset ( )
inlineprotected

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
inline

Definition at line 151 of file TIDARoiDescriptor.h.

151{ return m_rMinusZed; }

◆ roiId()

unsigned TIDARoiDescriptor::roiId ( ) const
inline

identifier methods

Definition at line 160 of file TIDARoiDescriptor.h.

160{ return m_roiId; }

◆ roiWord()

unsigned TIDARoiDescriptor::roiWord ( ) const
inline

Definition at line 162 of file TIDARoiDescriptor.h.

162{ return m_roiWord; }

◆ rPlusZed()

double TIDARoiDescriptor::rPlusZed ( ) const
inline

Definition at line 150 of file TIDARoiDescriptor.h.

150{ return m_rPlusZed; }

◆ set_l1Id()

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

set event number

Definition at line 115 of file TIDARoiDescriptor.h.

◆ set_roiId()

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

set roiId

Definition at line 114 of file TIDARoiDescriptor.h.

◆ set_roiWord()

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

sets RoI word

Definition at line 116 of file TIDARoiDescriptor.h.

◆ size()

size_t TIDARoiDescriptor::size ( ) const
inline

Definition at line 174 of file TIDARoiDescriptor.h.

174{ return m_rois.size(); }

◆ version()

int TIDARoiDescriptor::version ( ) const
inline

Definition at line 164 of file TIDARoiDescriptor.h.

164{ return 4; }

◆ zed()

double TIDARoiDescriptor::zed ( ) const
inline

Definition at line 133 of file TIDARoiDescriptor.h.

133{ return m_params.zed(); }

◆ zedcheck()

double TIDARoiDescriptor::zedcheck ( double zed)
protected

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
inline

gets eta half-width

Definition at line 187 of file TIDARoiDescriptor.h.

◆ zedMinus()

double TIDARoiDescriptor::zedMinus ( ) const
inline

Definition at line 141 of file TIDARoiDescriptor.h.

141{ return m_params.zedMinus(); }

◆ zedMinusR()

double TIDARoiDescriptor::zedMinusR ( ) const
inline

Definition at line 148 of file TIDARoiDescriptor.h.

148{ return m_zedMinusR; }

◆ zedPlus()

double TIDARoiDescriptor::zedPlus ( ) const
inline

Definition at line 142 of file TIDARoiDescriptor.h.

142{ return m_params.zedPlus(); }

◆ zedPlusR()

double TIDARoiDescriptor::zedPlusR ( ) const
inline

full containment methods

Definition at line 147 of file TIDARoiDescriptor.h.

147{ return m_zedPlusR; }

Member Data Documentation

◆ m_cached

bool TIDARoiDescriptor::m_cached
protected

Definition at line 281 of file TIDARoiDescriptor.h.

◆ m_dphi

double TIDARoiDescriptor::m_dphi
protected

cache flag - these should be mutable

Definition at line 282 of file TIDARoiDescriptor.h.

◆ m_fullscan

bool TIDARoiDescriptor::m_fullscan
protected

Definition at line 273 of file TIDARoiDescriptor.h.

◆ m_l1Id

unsigned int TIDARoiDescriptor::m_l1Id
protected

Definition at line 275 of file TIDARoiDescriptor.h.

◆ m_params

TIDARoiParameters TIDARoiDescriptor::m_params
protected

don't save

Definition at line 271 of file TIDARoiDescriptor.h.

◆ m_rMinusZed

double TIDARoiDescriptor::m_rMinusZed
protected

don't save - transient zPlus at radius R

Definition at line 288 of file TIDARoiDescriptor.h.

◆ m_roiId

unsigned int TIDARoiDescriptor::m_roiId
protected

Definition at line 276 of file TIDARoiDescriptor.h.

◆ m_rois

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

Definition at line 279 of file TIDARoiDescriptor.h.

◆ m_roiWord

unsigned int TIDARoiDescriptor::m_roiWord
protected

Definition at line 277 of file TIDARoiDescriptor.h.

◆ m_rPlusZed

double TIDARoiDescriptor::m_rPlusZed
protected

don't save - transient zMinus at radius R

Definition at line 287 of file TIDARoiDescriptor.h.

◆ m_tanthetaMinus

double TIDARoiDescriptor::m_tanthetaMinus
protected

don't save - transient roi edge gradients

Definition at line 291 of file TIDARoiDescriptor.h.

◆ m_tanthetaPlus

double TIDARoiDescriptor::m_tanthetaPlus
protected

don't save - transient zMinus at radius R

Definition at line 290 of file TIDARoiDescriptor.h.

◆ m_zedMinusR

double TIDARoiDescriptor::m_zedMinusR
protected

don't save - transient zPlus at radius R

Definition at line 285 of file TIDARoiDescriptor.h.

◆ m_zedPlusR

double TIDARoiDescriptor::m_zedPlusR
protected

cached value -

Definition at line 284 of file TIDARoiDescriptor.h.

◆ maxRadius

const double TIDARoiDescriptor::maxRadius = 1000
staticprotected

Definition at line 266 of file TIDARoiDescriptor.h.

◆ maxZed

const double TIDARoiDescriptor::maxZed = 2700
staticprotected

don't save

Definition at line 267 of file TIDARoiDescriptor.h.


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