ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/DataTree/interface/TriggerMask.h
Revision: 1.2
Committed: Sun May 15 20:40:11 2011 UTC (13 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_021, Mit_021pre2, HEAD
Branch point for: Mit_025c_branch
Changes since 1.1: +32 -11 lines
Log Message:
support more than 256 hlt paths

File Contents

# User Rev Content
1 loizides 1.1 //--------------------------------------------------------------------------------------------------
2 bendavid 1.2 // $Id: TriggerMask.h,v 1.1 2009/03/08 12:10:42 loizides Exp $
3 loizides 1.1 //
4     // TriggerMask
5     //
6     // A class to hold the trigger mask.
7     //
8     // Authors: C.Loizides
9     //--------------------------------------------------------------------------------------------------
10    
11     #ifndef MITANA_DATATREE_TRIGGERMASK_H
12     #define MITANA_DATATREE_TRIGGERMASK_H
13    
14     #include "MitAna/DataTree/interface/DataBase.h"
15     #include "MitAna/DataTree/interface/Types.h"
16 bendavid 1.2 #include "MitAna/DataCont/interface/CacheFlag.h"
17 loizides 1.1
18     namespace mithep
19     {
20     class TriggerMask : public DataBase
21     {
22     public:
23 bendavid 1.2 TriggerMask() : fFilledLargeMask(kFALSE) {}
24     TriggerMask(const BitMask1024 &mask) : fMasknew(mask), fFilledLargeMask(kTRUE) {}
25 loizides 1.1
26 bendavid 1.2 Bool_t At(UInt_t n) const { return TestBit(n); }
27     const BitMask1024 &Get() const;
28 loizides 1.1 EObjType ObjType() const { return kTriggerMask; }
29 bendavid 1.2 void Print(Option_t *opt="") const { Get().Print(opt); }
30     void SetBits(const BitMask1024 &m) { fFilledLargeMask=kTRUE; fMasknew.SetBits(m); }
31     UInt_t Size() const { return fFilledLargeMask ? fMasknew.Size() : fMask.Size(); }
32     UInt_t MaxSize() const { return fMasknew.Size(); }
33     Bool_t TestBit(UInt_t n) const { return fFilledLargeMask ? fMasknew.TestBit(n) : fMask.TestBit(n); }
34 loizides 1.1
35     protected:
36 bendavid 1.2 BitMask256 fMask; //trigger mask
37     mutable BitMask1024 fMasknew; //larger trigger mask
38     Bool_t fFilledLargeMask; //bool switch, was large mask filled originally
39 loizides 1.1
40 bendavid 1.2 ClassDef(TriggerMask, 2) // Trigger mask
41 loizides 1.1 };
42     }
43 bendavid 1.2
44     //--------------------------------------------------------------------------------------------------
45     inline const mithep::BitMask1024 &mithep::TriggerMask::Get() const
46     {
47     //printf("get bitmask, fUseLargeMask = %i, fFilledLargeMask = %i\n",fUseLargeMask.IsValid(),fFilledLargeMask);
48    
49     // Return bitmask, filling new bitmask from old one if necessary
50     if (fFilledLargeMask) return fMasknew;
51    
52     fMasknew.Clear();
53     for (UInt_t i=0; i<fMask.Size(); ++i) {
54     fMasknew.SetBit(i,fMask.TestBit(i));
55     }
56    
57     return fMasknew;
58    
59     }
60 loizides 1.1 #endif