26 constexpr
float M_PIF =
M_PI;
27 constexpr
int RoiVersion = 4;
36 throw std::runtime_error(
"Cannot set default z-width because a RoiDescriptor has already been created");
42 : m_phi(0), m_eta(0), m_zed(0),
43 m_phiMinus(0), m_phiPlus(0),
44 m_etaMinus(0), m_etaPlus(0),
45 m_zedMinus(-s_zedWidthDefault), m_zedPlus(s_zedWidthDefault),
46 m_dzdrMinus(0), m_dzdrPlus(0),
47 m_drdzMinus(0), m_drdzPlus(0),
48 m_zedOuterMinus(0), m_zedOuterPlus(0),
51 m_manageConstituents(true),
64 double phi_,
double phiMinus_,
double phiPlus_,
65 double zed_,
double zedMinus_,
double zedPlus_)
67 m_phiMinus(0), m_phiPlus(0),
68 m_etaMinus(0), m_etaPlus(0),
69 m_zedMinus(0), m_zedPlus(0),
70 m_dzdrMinus(0), m_dzdrPlus(0),
71 m_drdzMinus(0), m_drdzPlus(0),
72 m_zedOuterMinus(0), m_zedOuterPlus(0),
75 m_manageConstituents(true),
78 construct( eta_, etaMinus_, etaPlus_, phi_, phiMinus_, phiPlus_, zed_, zedMinus_, zedPlus_ );
83 double phiMinus_,
double phiPlus_ )
84 : m_phi(0), m_eta(0), m_zed(0),
85 m_phiMinus(0), m_phiPlus(0),
86 m_etaMinus(0), m_etaPlus(0),
87 m_zedMinus(0), m_zedPlus(0),
88 m_dzdrMinus(0), m_dzdrPlus(0),
89 m_drdzMinus(0), m_drdzPlus(0),
90 m_zedOuterMinus(0), m_zedOuterPlus(0),
93 m_manageConstituents(true),
96 double eta_ = 0.5*(etaMinus_+etaPlus_);
97 double phi_ = 0.5*(phiMinus_+phiPlus_);
99 if ( phiMinus_>phiPlus_ ) phi_ +=
M_PI;
108 m_phi(roi.
phi()), m_eta(roi.
eta()), m_zed(roi.zed()),
109 m_phiMinus(0), m_phiPlus(0),
110 m_etaMinus(0), m_etaPlus(0),
111 m_zedMinus(0), m_zedPlus(0),
112 m_dzdrMinus(0), m_dzdrPlus(0),
113 m_drdzMinus(0), m_drdzPlus(0),
114 m_zedOuterMinus(0), m_zedOuterPlus(0),
115 m_fullscan(roi.isFullscan()),
116 m_composite(roi.composite()),
117 m_manageConstituents(true),
129 if (
this==&roi )
return *
this;
136 if ( roi.
size()>0 ) {
161 double phi_,
double phiMinus_,
double phiPlus_,
162 double zed_,
double zedMinus_,
double zedPlus_)
170 if ( std::isnan(
m_eta) )
throw std::invalid_argument(
"RoiDescriptor: eta nan" );
171 if ( std::isnan(
m_phi) )
throw std::invalid_argument(
"RoiDescriptor: phi nan" );
172 if ( std::isnan(
m_zed) )
throw std::invalid_argument(
"RoiDescriptor: zed nan" );
178 if ( std::isnan(
m_etaPlus) )
throw std::invalid_argument(
"RoiDescriptor: etaPlus nan" );
179 if ( std::isnan(
m_etaMinus) )
throw std::invalid_argument(
"RoiDescriptor: etaMinus nan" );
185 if ( std::isnan(
m_zedPlus) )
throw std::invalid_argument(
"RoiDescriptor: zedPlus nan" );
186 if ( std::isnan(
m_zedMinus) )
throw std::invalid_argument(
"RoiDescriptor: zedMinus nan" );
193 if ( std::isnan(
m_phiPlus) )
throw std::invalid_argument(
"RoiDescriptor: phiPlus nan" );
211 if ( std::isnan(
m_phiMinus) )
throw std::invalid_argument(
"RoiDescriptor: phiMinus nan" );
228 const double maxR = 1100;
255 RoiDescriptor::operator std::string()
const {
256 std::stringstream
ss;
257 ss <<
" z: " << zed() <<
" (" << zedMinus() <<
" - " << zedPlus() <<
")"
258 <<
" eta: " <<
eta() <<
" (" << etaMinus() <<
" - " << etaPlus() <<
")"
259 <<
" phi: " <<
phi() <<
" (" << phiMinus() <<
" - " << phiPlus() <<
")"
260 << ( isFullscan() ?
" - fullscan":
"" );
262 ss <<
"\t : components: " <<
size() <<
"\n";
263 for (
unsigned i=0 ;
i<
size() ;
i++ )
ss <<
"\t\t" <<
i <<
" " << at(
i) <<
" " << *at(
i) <<
"\n";
269 return std::string(
d);
273 return m << std::string(
d);