CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FWTEventList Class Reference

#include <FWTEventList.h>

Inheritance diagram for FWTEventList:

Public Member Functions

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

Private Member Functions

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

Detailed Description

Definition at line 12 of file FWTEventList.h.

Constructor & Destructor Documentation

FWTEventList::FWTEventList ( )
inline

Definition at line 15 of file FWTEventList.h.

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

Definition at line 16 of file FWTEventList.h.

16  :
17  TEventList(name, title, initsize, delta) {}
dbl * delta
Definition: mlp_gen.cc:36
virtual FWTEventList::~FWTEventList ( )
inlinevirtual

Definition at line 19 of file FWTEventList.h.

19 {}
FWTEventList::FWTEventList ( const FWTEventList )
private

Member Function Documentation

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

Definition at line 7 of file FWTEventList.cc.

References fileCollector2::fList, and i.

Referenced by FWFileEntry::updateFilters().

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

Definition at line 55 of file FWTEventList.cc.

References fileCollector2::fList, and Max().

Referenced by FWFileEntry::filterEventsWithCustomParser().

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