#include <TGoodRun.h>
Definition at line 22 of file TGoodRun.h.
◆ TGoodRun() [1/3]
| Root::TGoodRun::TGoodRun |
( |
| ) |
|
◆ TGoodRun() [2/3]
| Root::TGoodRun::TGoodRun |
( |
const Int_t & | runnr | ) |
|
Definition at line 22 of file TGoodRun.cxx.
23 : std::vector<TLumiBlockRange>()
24 , TObject()
26{
27}
◆ ~TGoodRun()
| Root::TGoodRun::~TGoodRun |
( |
| ) |
|
|
virtual |
◆ TGoodRun() [3/3]
Definition at line 35 of file TGoodRun.cxx.
36 : std::vector<TLumiBlockRange>(other)
37 , TObject(other)
39{
40}
◆ AddLB()
| void Root::TGoodRun::AddLB |
( |
const Int_t & | lumiblocknr | ) |
|
Definition at line 264 of file TGoodRun.cxx.
265{
266 if ( lumiblocknr<0 ) return;
267 if ( this->
HasLB(lumiblocknr) )
return;
268
269
270 std::vector< TLumiBlockRange >::iterator eitr = this->
Find(lumiblocknr-1);
271 if (eitr!=this->
end()) {
272 eitr->SetEnd(lumiblocknr);
274 return;
275 }
276
277 std::vector< TLumiBlockRange >::iterator bitr = this->
Find(lumiblocknr+1);
278 if (bitr!=this->
end()) {
279 bitr->SetBegin(lumiblocknr);
281 return;
282 }
283
284 this->
push_back(Root::TLumiBlockRange(lumiblocknr,lumiblocknr));
286 return;
287}
std::vector< Root::TLumiBlockRange >::iterator Find(const Int_t &lumiblocknr)
Bool_t HasLB(const Int_t &lumiblocknr) const
◆ Compress()
| void Root::TGoodRun::Compress |
( |
| ) |
|
Definition at line 200 of file TGoodRun.cxx.
201{
202
203
204
206
207 std::vector<TLumiBlockRange>::iterator itr,
cbegin,
cend;
208 int fbegin(-1), tbegin(-1),
tend(-1), lbegin(-1), lend(-1);
209
210 for (itr=this->
begin(); itr!=this->
end();) {
213
214
216
217
218
219 bool go_on(true);
220 for (++itr; itr!=this->
end() && go_on; ++itr) {
221 tbegin =
cend->Begin();
223 lbegin = itr->Begin();
224 lend = itr->End();
225 if ( lbegin>=tbegin && lend>=tend ) {
226 if (tend+1<lbegin) { go_on=false; }
228 }
229 }
230
231
233
234 if (cbegin!=cend) {
235
237
239
240 itr = this->
erase(cbegin,itr);
241
242 this->
insert(itr,Root::TLumiBlockRange(fbegin,lend));
243 }
244 }
245}
const_iterator cend() const
Iterator at the end of the map.
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
const_iterator cbegin() const
Iterator at the start of the map.
virtual void erase() override final
Free all allocated elements and release memory back to the system.
◆ Find() [1/2]
Definition at line 149 of file TGoodRun.cxx.
150{
151 std::vector<TLumiBlockRange>::iterator itr = this->
begin();
152
153 Bool_t pass(kFALSE);
154 for (; itr!=this->
end(); ++itr) {
155 pass = itr->Contains(lumiblocknr) ;
156 if (pass) break;
157 }
158
159 return itr;
160}
◆ Find() [2/2]
Definition at line 164 of file TGoodRun.cxx.
165{
166 std::vector<TLumiBlockRange>::const_iterator itr = this->
begin();
167
168 Bool_t pass(kFALSE);
169 for (; itr!=this->
end(); ++itr) {
170 pass = itr->Contains(lumiblocknr) ;
171 if (pass) break;
172 }
173
174 return itr;
175}
◆ GetOverlapWith()
Definition at line 57 of file TGoodRun.cxx.
58{
60
61 Root::TGoodRun overlaprun(runnr);
62 if (runnr==-1) return overlaprun;
63
64 std::vector<Root::TLumiBlockRange>::const_iterator itr1 = this->
begin();
65 std::vector<Root::TLumiBlockRange>::const_iterator itr2 =
other.begin();
66
67 for (; itr1!=this->
end(); ++itr1) {
68 for (itr2=
other.begin(); itr2!=
other.end(); ++itr2) {
69 const Root::TLumiBlockRange lbr = itr1->GetOverlapWith(*itr2) ;
70 if (!lbr.
IsEmpty()) overlaprun.push_back(lbr);
71 }
72 }
73
74 return overlaprun;
75}
Int_t GetRunNumber() const
◆ GetPartNotIn()
Definition at line 108 of file TGoodRun.cxx.
109{
110 Root::TGoodRun notinother(*this);
111
113
115 std::vector<Root::TLumiBlockRange>::const_iterator itro,itrt,lbvecitr;
116
117 for (itro=
other.begin(); itro!=
other.end(); ++itro) {
118 tmprun.clear();
119 for (itrt=notinother.begin(); itrt!=notinother.end(); ++itrt) {
120 std::vector<Root::TLumiBlockRange> lbvec = itrt->GetPartNotIn(*itro);
121 for (lbvecitr=lbvec.begin(); lbvecitr!=lbvec.end(); ++lbvecitr)
122 tmprun.push_back(*lbvecitr);
123 }
124 notinother=tmprun;
125 }
126 }
127
128 return notinother;
129}
◆ GetPartOnlyIn()
◆ GetRunNumber()
| Int_t Root::TGoodRun::GetRunNumber |
( |
| ) |
const |
|
inline |
◆ GetSumWith()
Definition at line 79 of file TGoodRun.cxx.
80{
82
83 Root::TGoodRun sumrun(runnr);
84 if (runnr==-1) return sumrun;
85
89
90 std::vector<Root::TLumiBlockRange>::const_iterator itr;
91 for (itr=overlap.begin(); itr!=overlap.end(); ++itr) sumrun.push_back(*itr);
92 for (itr=onlyinother.begin(); itr!=onlyinother.end(); ++itr) sumrun.push_back(*itr);
93 for (itr=notinother.begin(); itr!=notinother.end(); ++itr) sumrun.push_back(*itr);
94 sumrun.Sort();
95
96 return sumrun;
97}
const Root::TGoodRun GetPartNotIn(const TGoodRun &other) const
const Root::TGoodRun GetOverlapWith(const TGoodRun &other) const
const Root::TGoodRun GetPartOnlyIn(const TGoodRun &other) const
◆ HasLB()
| Bool_t Root::TGoodRun::HasLB |
( |
const Int_t & | lumiblocknr | ) |
const |
Definition at line 133 of file TGoodRun.cxx.
134{
135 std::vector<TLumiBlockRange>::const_iterator itr = this->
begin();
136 std::vector<TLumiBlockRange>::const_iterator
end = this->
end();
137
138 Bool_t pass(kFALSE);
139 for (; itr!=
end; ++itr) {
140 pass = pass || itr->Contains(lumiblocknr) ;
141 if (pass) break;
142 }
143
144 return pass;
145}
◆ IsEmpty()
| Bool_t Root::TGoodRun::IsEmpty |
( |
| ) |
const |
Definition at line 249 of file TGoodRun.cxx.
250{
252 if (this->
empty())
return kTRUE;
253
254 Bool_t isEmpty(kTRUE);
255 std::vector< TLumiBlockRange >::const_iterator litr = this->
begin();
256 for (; litr!=this->
end() && isEmpty; ++litr)
257 isEmpty = isEmpty && litr->IsEmpty();
258
259 return isEmpty;
260}
static const Attributes_t empty
◆ operator=()
Definition at line 44 of file TGoodRun.cxx.
45{
46 if (&other==this) {
47 return *this ;
48 }
49 std::vector<TLumiBlockRange>::operator=(other);
51
52 return *this ;
53}
◆ SetRunNumber()
| void Root::TGoodRun::SetRunNumber |
( |
const Int_t & | runnr | ) |
|
|
inline |
◆ Sort()
| void Root::TGoodRun::Sort |
( |
| ) |
|
Definition at line 193 of file TGoodRun.cxx.
194{
196}
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
◆ Summary()
| void Root::TGoodRun::Summary |
( |
| ) |
const |
Definition at line 179 of file TGoodRun.cxx.
180{
181 Root::TMsgLogger m_logger("TGoodRun");
183
184 std::vector<TLumiBlockRange>::const_iterator itr = this->
begin();
185 std::vector<TLumiBlockRange>::const_iterator
end = this->
end();
186
187 for (; itr!=
end; ++itr)
188 itr->Summary() ;
189}
◆ elements
| T std::vector< T >::elements |
|
inherited |
◆ m_runnr
| Int_t Root::TGoodRun::m_runnr |
|
private |
The documentation for this class was generated from the following files: