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

Describes the Region of Interest 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)
 copy assignment
TIDARoiDescriptoroperator= (TIDARoiDescriptor &&r) noexcept
 move 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 Interest 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 construct the objects of this class with phi0 out of allowed range results 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 );
77 } else {
78 m_tanthetaPlus = 0.0;
79 m_tanthetaMinus = 0.0;
80 }
81}
#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 for each

Definition at line 84 of file TIDARoiDescriptor.cxx.

89 zed, zedMinus, zedPlus ),
90 m_fullscan(false),
91 m_l1Id(0), m_roiId(0), m_roiWord(0),
92 m_cached(false), m_dphi(0)
93{
94 // calculate z limits at radius maxRadius
95
98}
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 for 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 for each

◆ TIDARoiDescriptor() [5/5]

TIDARoiDescriptor::TIDARoiDescriptor ( const TIDARoiDescriptor & r)

copy constructor

Parameters
TIDARoiDescriptor

Definition at line 136 of file TIDARoiDescriptor.cxx.

136 :
137 TObject(*this),
138 m_params(a.m_params),
139 m_fullscan(a.m_fullscan),
140 m_l1Id(a.m_l1Id), m_roiId(a.m_roiId), m_roiWord(a.m_roiWord),
141 m_rois(a.m_rois),
142 m_cached(false), m_dphi(0)
143{
146}
static Double_t a
std::vector< TIDARoiDescriptor > m_rois

◆ ~TIDARoiDescriptor()

TIDARoiDescriptor::~TIDARoiDescriptor ( )
virtual

Definition at line 190 of file TIDARoiDescriptor.cxx.

190{ }

Member Function Documentation

◆ at()

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

gets phi half-width

Definition at line 183 of file TIDARoiDescriptor.h.

◆ composite()

bool TIDARoiDescriptor::composite ( ) const
inline

composite RoI methods

Definition at line 178 of file TIDARoiDescriptor.h.

178{ return !m_rois.empty(); }

◆ eta()

double TIDARoiDescriptor::eta ( ) const
inline

Definition at line 138 of file TIDARoiDescriptor.h.

138{ return m_params.eta(); }

◆ etacheck()

double TIDARoiDescriptor::etacheck ( double eta)
protected

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
inline

gets eta half-width

Definition at line 192 of file TIDARoiDescriptor.h.

◆ etaMinus()

double TIDARoiDescriptor::etaMinus ( ) const
inline

Definition at line 141 of file TIDARoiDescriptor.h.

141{ return m_params.etaMinus(); }

◆ etaPlus()

double TIDARoiDescriptor::etaPlus ( ) const
inline

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

174{ return m_fullscan; }

◆ l1Id()

unsigned TIDARoiDescriptor::l1Id ( ) const
inline

Definition at line 167 of file TIDARoiDescriptor.h.

167{ return m_l1Id; }

◆ maxR()

double TIDARoiDescriptor::maxR ( ) const
inline

Definition at line 159 of file TIDARoiDescriptor.h.

159{ return maxRadius; }

◆ maxZ()

double TIDARoiDescriptor::maxZ ( ) const
inline

Definition at line 160 of file TIDARoiDescriptor.h.

160{ return maxZed; }

◆ operator std::string()

TIDARoiDescriptor::operator std::string ( ) const

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

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

◆ operator=() [1/2]

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

copy assignment

Parameters
TIDARoiDescriptor

Definition at line 149 of file TIDARoiDescriptor.cxx.

150{
151 if (this != &a) {
152 TObject::operator= (a);
153 m_params = a.m_params;
154 m_fullscan = a.m_fullscan;
155 m_l1Id = a.m_l1Id;
156 m_roiId = a.m_roiId;
157 m_roiWord = a.m_roiWord;
158 m_rois = a.m_rois;
159 m_cached = a.m_cached;
160 m_dphi = a.m_dphi;
163 }
164 return *this;
165}

◆ operator=() [2/2]

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

move assignment

Parameters
TIDARoiDescriptor

Definition at line 167 of file TIDARoiDescriptor.cxx.

167 {
168 if (this != &a) {
169 TObject::operator=(a); // TObject may not have a move assignment
170 m_params = std::move(a.m_params);
171 m_fullscan = a.m_fullscan;
172 m_l1Id = a.m_l1Id;
173 m_roiId = a.m_roiId;
174 m_roiWord = a.m_roiWord;
175 m_rois = std::move(a.m_rois);
176 m_cached = a.m_cached;
177 m_dphi = a.m_dphi;
178 m_zedPlusR = a.m_zedPlusR;
179 m_zedMinusR = a.m_zedMinusR;
180 m_rPlusZed = a.m_rPlusZed;
181 m_rMinusZed = a.m_rMinusZed;
182 m_tanthetaPlus = a.m_tanthetaPlus;
183 m_tanthetaMinus = a.m_tanthetaMinus;
184 }
185 return *this;
186}

◆ operator==()

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

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
inline

Definition at line 182 of file TIDARoiDescriptor.h.

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

◆ params()

const TIDARoiParameters & TIDARoiDescriptor::params ( ) const
inlineprotected

access the internal parameter class

Definition at line 250 of file TIDARoiDescriptor.h.

250{ return m_params; };

◆ phi()

double TIDARoiDescriptor::phi ( ) const
inline

Definition at line 137 of file TIDARoiDescriptor.h.

137{ return m_params.phi(); }

◆ phicheck()

double TIDARoiDescriptor::phicheck ( double phi)
protected

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
inline

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

◆ phiMinus()

double TIDARoiDescriptor::phiMinus ( ) const
inline

Definition at line 144 of file TIDARoiDescriptor.h.

144{ return m_params.phiMinus(); }

◆ phiPlus()

double TIDARoiDescriptor::phiPlus ( ) const
inline

Definition at line 145 of file TIDARoiDescriptor.h.

145{ return m_params.phiPlus(); }

◆ push_back() [1/2]

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

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

Definition at line 216 of file TIDARoiDescriptor.h.

216{ m_rois.push_back( *roi ); }

◆ reset()

void TIDARoiDescriptor::reset ( )
inlineprotected

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
inline

Definition at line 157 of file TIDARoiDescriptor.h.

157{ return m_rMinusZed; }

◆ roiId()

unsigned TIDARoiDescriptor::roiId ( ) const
inline

identifier methods

Definition at line 166 of file TIDARoiDescriptor.h.

166{ return m_roiId; }

◆ roiWord()

unsigned TIDARoiDescriptor::roiWord ( ) const
inline

Definition at line 168 of file TIDARoiDescriptor.h.

168{ return m_roiWord; }

◆ rPlusZed()

double TIDARoiDescriptor::rPlusZed ( ) const
inline

Definition at line 156 of file TIDARoiDescriptor.h.

156{ return m_rPlusZed; }

◆ set_l1Id()

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

set event number

Definition at line 121 of file TIDARoiDescriptor.h.

◆ set_roiId()

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

set roiId

Definition at line 120 of file TIDARoiDescriptor.h.

◆ set_roiWord()

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

sets RoI word

Definition at line 122 of file TIDARoiDescriptor.h.

◆ size()

size_t TIDARoiDescriptor::size ( ) const
inline

Definition at line 180 of file TIDARoiDescriptor.h.

180{ return m_rois.size(); }

◆ version()

int TIDARoiDescriptor::version ( ) const
inline

Definition at line 170 of file TIDARoiDescriptor.h.

170{ return 4; }

◆ zed()

double TIDARoiDescriptor::zed ( ) const
inline

Definition at line 139 of file TIDARoiDescriptor.h.

139{ return m_params.zed(); }

◆ zedcheck()

double TIDARoiDescriptor::zedcheck ( double zed)
protected

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
inline

gets eta half-width

Definition at line 193 of file TIDARoiDescriptor.h.

◆ zedMinus()

double TIDARoiDescriptor::zedMinus ( ) const
inline

Definition at line 147 of file TIDARoiDescriptor.h.

147{ return m_params.zedMinus(); }

◆ zedMinusR()

double TIDARoiDescriptor::zedMinusR ( ) const
inline

Definition at line 154 of file TIDARoiDescriptor.h.

154{ return m_zedMinusR; }

◆ zedPlus()

double TIDARoiDescriptor::zedPlus ( ) const
inline

Definition at line 148 of file TIDARoiDescriptor.h.

148{ return m_params.zedPlus(); }

◆ zedPlusR()

double TIDARoiDescriptor::zedPlusR ( ) const
inline

full containment methods

Definition at line 153 of file TIDARoiDescriptor.h.

153{ return m_zedPlusR; }

Member Data Documentation

◆ m_cached

bool TIDARoiDescriptor::m_cached
protected

Definition at line 287 of file TIDARoiDescriptor.h.

◆ m_dphi

double TIDARoiDescriptor::m_dphi
protected

cache flag - these should be mutable

Definition at line 288 of file TIDARoiDescriptor.h.

◆ m_fullscan

bool TIDARoiDescriptor::m_fullscan
protected

Definition at line 279 of file TIDARoiDescriptor.h.

◆ m_l1Id

unsigned int TIDARoiDescriptor::m_l1Id
protected

Definition at line 281 of file TIDARoiDescriptor.h.

◆ m_params

TIDARoiParameters TIDARoiDescriptor::m_params
protected

don't save

Definition at line 277 of file TIDARoiDescriptor.h.

◆ m_rMinusZed

double TIDARoiDescriptor::m_rMinusZed
protected

don't save - transient zPlus at radius R

Definition at line 294 of file TIDARoiDescriptor.h.

◆ m_roiId

unsigned int TIDARoiDescriptor::m_roiId
protected

Definition at line 282 of file TIDARoiDescriptor.h.

◆ m_rois

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

Definition at line 285 of file TIDARoiDescriptor.h.

◆ m_roiWord

unsigned int TIDARoiDescriptor::m_roiWord
protected

Definition at line 283 of file TIDARoiDescriptor.h.

◆ m_rPlusZed

double TIDARoiDescriptor::m_rPlusZed
protected

don't save - transient zMinus at radius R

Definition at line 293 of file TIDARoiDescriptor.h.

◆ m_tanthetaMinus

double TIDARoiDescriptor::m_tanthetaMinus
protected

don't save - transient roi edge gradients

Definition at line 297 of file TIDARoiDescriptor.h.

◆ m_tanthetaPlus

double TIDARoiDescriptor::m_tanthetaPlus
protected

don't save - transient zMinus at radius R

Definition at line 296 of file TIDARoiDescriptor.h.

◆ m_zedMinusR

double TIDARoiDescriptor::m_zedMinusR
protected

don't save - transient zPlus at radius R

Definition at line 291 of file TIDARoiDescriptor.h.

◆ m_zedPlusR

double TIDARoiDescriptor::m_zedPlusR
protected

cached value -

Definition at line 290 of file TIDARoiDescriptor.h.

◆ maxRadius

const double TIDARoiDescriptor::maxRadius = 1000
staticprotected

Definition at line 272 of file TIDARoiDescriptor.h.

◆ maxZed

const double TIDARoiDescriptor::maxZed = 2700
staticprotected

don't save

Definition at line 273 of file TIDARoiDescriptor.h.


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