CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
FWTEventList Class Reference

#include <FWTEventList.h>

Inheritance diagram for FWTEventList:

Public Member Functions

void Add (const TEventList *list) override
 
void Enter (Long64_t entry) override
 
 FWTEventList ()
 
 FWTEventList (const char *name, const char *title="", Int_t initsize=0, Int_t delta=0)
 
 ~FWTEventList () override
 

Private Member Functions

 ClassDefOverride (FWTEventList, 0)
 
 FWTEventList (const FWTEventList &)
 
const FWTEventListoperator= (const FWTEventList &)
 

Detailed Description

Definition at line 12 of file FWTEventList.h.

Constructor & Destructor Documentation

◆ FWTEventList() [1/3]

FWTEventList::FWTEventList ( )
inline

Definition at line 14 of file FWTEventList.h.

14 : TEventList() {}

◆ FWTEventList() [2/3]

FWTEventList::FWTEventList ( const char *  name,
const char *  title = "",
Int_t  initsize = 0,
Int_t  delta = 0 
)
inline

Definition at line 15 of file FWTEventList.h.

16  : TEventList(name, title, initsize, delta) {}

◆ ~FWTEventList()

FWTEventList::~FWTEventList ( )
inlineoverride

Definition at line 18 of file FWTEventList.h.

18 {}

◆ FWTEventList() [3/3]

FWTEventList::FWTEventList ( const FWTEventList )
private

Member Function Documentation

◆ Add()

void FWTEventList::Add ( const TEventList *  list)
override

Definition at line 7 of file FWTEventList.cc.

7  {
8  // Merge contents of alist with this list.
9  //
10  // Both alist and this list are assumed to be sorted prior to this call
11 
12  Int_t i;
13  Int_t an = alist->GetN();
14  if (!an)
15  return;
16  Long64_t *alst = alist->GetList();
17  if (!fList) {
18  fList = new Long64_t[an];
19  for (i = 0; i < an; i++)
20  fList[i] = alst[i];
21  fN = an;
22  fSize = an;
23  return;
24  }
25  Int_t newsize = fN + an;
26  Long64_t *newlist = new Long64_t[newsize];
27  Int_t newpos, alpos;
28  newpos = alpos = 0;
29  for (i = 0; i < fN; i++) {
30  while (alpos < an && fList[i] > alst[alpos]) {
31  newlist[newpos] = alst[alpos];
32  newpos++;
33  alpos++;
34  }
35  if (alpos < an && fList[i] == alst[alpos])
36  alpos++;
37  newlist[newpos] = fList[i];
38  newpos++;
39  }
40  while (alpos < an) {
41  newlist[newpos] = alst[alpos];
42  newpos++;
43  alpos++;
44  }
45  delete[] fList;
46  fN = newpos;
47  fSize = newsize;
48  fList = newlist;
49 
50  TCut orig = GetTitle();
51  TCut added = alist->GetTitle();
52  TCut updated = orig || added;
53  SetTitle(updated.GetTitle());
54 }

References fileCollector2::fList, hcaldqm::quantity::fN, and mps_fire::i.

Referenced by FWFileEntry::updateFilters().

◆ ClassDefOverride()

FWTEventList::ClassDefOverride ( FWTEventList  ,
 
)
private

◆ Enter()

void FWTEventList::Enter ( Long64_t  entry)
override

Definition at line 57 of file FWTEventList.cc.

57  {
58  // Enter element entry into the list.
59 
60  if (!fList) {
61  fList = new Long64_t[fSize];
62  fList[0] = entry;
63  fN = 1;
64  return;
65  }
66  if (fN > 0 && entry == fList[fN - 1])
67  return;
68  if (fN >= fSize) {
69  Int_t newsize = TMath::Max(2 * fSize, fN + fDelta);
70  Resize(newsize - fSize);
71  }
72  if (fN == 0 || entry > fList[fN - 1]) {
73  fList[fN] = entry;
74  ++fN;
75  } else {
76  Int_t pos = TMath::BinarySearch(fN, fList, entry);
77  if (pos >= 0 && entry == fList[pos])
78  return;
79  ++pos;
80  memmove(&(fList[pos + 1]), &(fList[pos]), 8 * (fN - pos));
81  fList[pos] = entry;
82  ++fN;
83  }
84 }

References mps_splice::entry, hydjet2DefaultParameters_cff::fDelta, fileCollector2::fList, hcaldqm::quantity::fN, and Max().

Referenced by FWFileEntry::filterEventsWithCustomParser().

◆ operator=()

const FWTEventList& FWTEventList::operator= ( const FWTEventList )
private
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
mps_splice.entry
entry
Definition: mps_splice.py:68
pos
Definition: PixelAliasList.h:18
hydjet2DefaultParameters_cff.fDelta
fDelta
Definition: hydjet2DefaultParameters_cff.py:58
hcaldqm::quantity::fN
Definition: ValueQuantity.h:11
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
Max
T Max(T a, T b)
Definition: MathUtil.h:44
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
fileCollector2.fList
fList
Definition: fileCollector2.py:251