ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
lumiList Class Reference

#include <lumiList.h>

Inheritance diagram for lumiList:
Collaboration diagram for lumiList:

Public Types

typedef std::map< int, grl_runfull_type
 full map type More...
 
typedef std::map< int, grl_run >::iterator iterator
 iterators over the full map More...
 
typedef std::map< int, grl_run >::const_iterator const_iterator
 

Public Member Functions

 lumiList (bool b=true)
 
 ~lumiList ()
 
void setterse (bool b)
 
void addRange (int run, int start, int stop)
 add a lumi block range for a given run More...
 
bool inRange (int run, int lb)
 is this run, lumiblock in any of the ranges? if the run is not in the list, it is assumed that all events from that run are required
More...
 
void sort ()
 sort the runs by the number of good lumi blocks More...
 

Public Attributes

keys
 STL member. More...
 
elements
 STL member. More...
 

Private Attributes

bool m_terse
 

Detailed Description

Definition at line 27 of file lumiList.h.

Member Typedef Documentation

◆ const_iterator

typedef std::map< int, grl_run >::const_iterator lumiList::const_iterator

Definition at line 37 of file lumiList.h.

◆ full_type

typedef std::map< int, grl_run > lumiList::full_type

full map type

Definition at line 32 of file lumiList.h.

◆ iterator

typedef std::map< int, grl_run >::iterator lumiList::iterator

iterators over the full map

Definition at line 35 of file lumiList.h.

Constructor & Destructor Documentation

◆ lumiList()

lumiList::lumiList ( bool  b = true)
inline

Definition at line 41 of file lumiList.h.

41 : m_terse(b) { }

◆ ~lumiList()

lumiList::~lumiList ( )
inline

Definition at line 43 of file lumiList.h.

43 { }

Member Function Documentation

◆ addRange()

void lumiList::addRange ( int  run,
int  start,
int  stop 
)
inline

add a lumi block range for a given run

Definition at line 48 of file lumiList.h.

48  {
49 
50  iterator it = find(run);
51 
52  if ( it == end() ) {
53  std::pair< iterator, bool > in = insert( std::pair<int, grl_run >( run, grl_run( run ) ) );
54  it = in.first;
55  }
56 
57  it->second.add_range( start, stop );
58 
59  if ( !m_terse ) std::cout << "lumiList::addRange() run " << run << ";\t" << start << " - " << stop << std::endl;
60  }

◆ inRange()

bool lumiList::inRange ( int  run,
int  lb 
)
inline

is this run, lumiblock in any of the ranges? if the run is not in the list, it is assumed that all events from that run are required

Definition at line 67 of file lumiList.h.

67  {
68 
69  iterator itr = find(run);
70 
71  if ( itr == end() ) return true;
72  else {
73  grl_run& v = itr->second;
74  for ( unsigned i=0 ; i<v.size() ; i++ ) {
75  if ( lb>=v[i].first && lb<=v[i].second ) return true;
76  }
77  }
78  return false;
79  }

◆ setterse()

void lumiList::setterse ( bool  b)
inline

Definition at line 45 of file lumiList.h.

45 { m_terse=b; }

◆ sort()

void lumiList::sort ( )
inline

sort the runs by the number of good lumi blocks

sort the vector

print out

Definition at line 83 of file lumiList.h.

83  {
84 
85  std::cout << "lumiList::sort() sorting ..." << std::endl;
86 
87  std::vector< const grl_run* > vec;
88 
89  const_iterator itr = begin();
90 
91  while ( itr!=end() ) {
92  vec.push_back( &(itr->second) );
93  ++itr;
94  }
95 
97  std::sort(vec.begin(), vec.end(), grl_run::comparison );
98 
100 
101  double total = 0;
102  for ( unsigned i=vec.size() ; i-- ; ) total += vec[i]->lbsize();
103 
104 
105  double integral = 0;
106  for ( unsigned i=0 ; i<vec.size() ; i++ ) {
107 
108  integral += vec[i]->lbsize();
109 
110  std::cout << i
111  << "\t" << int(100*(i+1.0)/vec.size())
112  << "\t" << int(integral/total*1000)*0.1
113  << "\t" << *vec[i] << "\tfraction: " << vec[i]->lbsize()/total << std::endl;
114 
115  }
116  }

Member Data Documentation

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.

◆ m_terse

bool lumiList::m_terse
private

Definition at line 120 of file lumiList.h.


The documentation for this class was generated from the following file:
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
integral
double integral(TH1 *h)
Definition: computils.cxx:57
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
lumiList::const_iterator
std::map< int, grl_run >::const_iterator const_iterator
Definition: lumiList.h:37
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
python.BunchSpacingUtils.lb
lb
Definition: BunchSpacingUtils.py:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
grl_run::comparison
static bool comparison(const grl_run *r1, const grl_run *r2)
Definition: grl_run.h:55
run
Definition: run.py:1
lumiList::iterator
std::map< int, grl_run >::iterator iterator
iterators over the full map
Definition: lumiList.h:35
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
lumiList::m_terse
bool m_terse
Definition: lumiList.h:120
python.PyAthena.v
v
Definition: PyAthena.py:157
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
DeMoScan.first
bool first
Definition: DeMoScan.py:534
grl_run
Definition: grl_run.h:26