Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
bands Class Reference
Collaboration diagram for bands:

Public Member Functions

 bands ()
 
 bands (const bands &b)=default
 
bandsoperator= (const bands &b)=default
 
 bands (const std::vector< double > &limits, const std::vector< std::string > &labels)
 
void range (const std::string &chain, TH1F *h)
 
void range (size_t i, TH1F *h)
 

Private Attributes

std::vector< double > m_limits
 
std::vector< std::string > m_labels
 

Detailed Description

Definition at line 222 of file comparitor.cxx.

Constructor & Destructor Documentation

◆ bands() [1/3]

bands::bands ( )
inline

Definition at line 226 of file comparitor.cxx.

226 { }

◆ bands() [2/3]

bands::bands ( const bands b)
default

◆ bands() [3/3]

bands::bands ( const std::vector< double > &  limits,
const std::vector< std::string > &  labels 
)
inline

Definition at line 231 of file comparitor.cxx.

232  : m_limits(limits), m_labels(labels)
233  { }

Member Function Documentation

◆ operator=()

bands& bands::operator= ( const bands b)
default

◆ range() [1/2]

void bands::range ( const std::string &  chain,
TH1F *  h 
)
inline

Definition at line 235 of file comparitor.cxx.

235  {
236  for ( size_t i=0 ; i<m_labels.size() ; i++ ) {
237  if ( chain.find(m_labels[i])!=std::string::npos ) return range( i, h );
238  }
239  return range( m_labels.size(), h );
240  }

◆ range() [2/2]

void bands::range ( size_t  i,
TH1F *  h 
)
inline

Definition at line 243 of file comparitor.cxx.

243  {
244 
245  double minx = h->GetBinLowEdge(1);
246  double maxx = h->GetBinLowEdge(h->GetNbinsX()+1);
247 
248  if ( i>=m_limits.size() ) { maxx+=1; minx=maxx; }
249  else if ( (i+1)==m_limits.size() ) minx=m_limits[i];
250  else {
251  minx = m_limits[i];
252  maxx = m_limits[i+1];
253  }
254 
255 
256  for ( int j=1 ; j<=h->GetNbinsX() ; j++ ) {
257 
258  std::cout << "range: " << j << "\tminx: " << minx << "\t" << maxx << std::endl;
259  if ( ! ( h->GetBinCenter(j)>=minx && h->GetBinCenter(j)<maxx ) ) {
260  h->SetBinContent(j,0);
261  h->SetBinError(j,0);
262  }
263  }
264  }

Member Data Documentation

◆ m_labels

std::vector<std::string> bands::m_labels
private

Definition at line 270 of file comparitor.cxx.

◆ m_limits

std::vector<double> bands::m_limits
private

Definition at line 269 of file comparitor.cxx.


The documentation for this class was generated from the following file:
bands::m_labels
std::vector< std::string > m_labels
Definition: comparitor.cxx:270
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
lumiFormat.i
int i
Definition: lumiFormat.py:85
bands::m_limits
std::vector< double > m_limits
Definition: comparitor.cxx:269
bands::range
void range(const std::string &chain, TH1F *h)
Definition: comparitor.cxx:235
h