ATLAS Offline Software
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 220 of file comparitor.cxx.

Constructor & Destructor Documentation

◆ bands() [1/3]

bands::bands ( )
inline

Definition at line 224 of file comparitor.cxx.

224 { }

◆ 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 229 of file comparitor.cxx.

230  : m_limits(limits), m_labels(labels)
231  { }

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 233 of file comparitor.cxx.

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

◆ range() [2/2]

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

Definition at line 241 of file comparitor.cxx.

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

Member Data Documentation

◆ m_labels

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

Definition at line 268 of file comparitor.cxx.

◆ m_limits

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

Definition at line 267 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:268
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:267
bands::range
void range(const std::string &chain, TH1F *h)
Definition: comparitor.cxx:233
h