ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/RunSelectionMod.h
Revision: 1.1
Committed: Mon Jan 18 14:35:43 2010 UTC (15 years, 3 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_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, Mit_020a, Mit_020, Mit_020pre1, Mit_018, Mit_017, Mit_017pre3, Mit_017pre2, Mit_017pre1, Mit_016, Mit_015b, Mit_015a, Mit_015, Mit_014e, Mit_014d, Mit_014c, Mit_014b, Mit_014a, Mit_014, Mit_014pre3, Mit_014pre2, Mit_014pre1, Mit_013d, Mit_013c, Mit_013b, Mit_013a, Mit_013, Mit_013pre1, Mit_012i, HEAD
Branch point for: Mit_025c_branch
Log Message:
Add RunSelectionMod

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: RunSelectionMod.h,v 1.3 2009/12/02 20:27:42 loizides Exp $
3 //
4 // RunSelectionMod
5 //
6 // This module selects or excludes a list or runs/ranges. A list of accepted and excluded runs
7 // may be simultaneously provided, in which case both conditions are checked. Runs which are not
8 // covered by either list will be handled according to the fDefaultAccept switch (false by default
9 // such that runs not covered by either list will be rejected).
10 //
11 // Authors: J.Bendavid
12 //--------------------------------------------------------------------------------------------------
13
14 #ifndef MITANA_PHYSICSMOD_RUNSELECTIONMOD_H
15 #define MITANA_PHYSICSMOD_RUNSELECTIONMOD_H
16
17 #include <string>
18 #include <TString.h>
19 #include "MitAna/TreeMod/interface/BaseMod.h"
20
21 namespace mithep
22 {
23 class RunSelectionMod : public BaseMod {
24 public:
25 RunSelectionMod(const char *name="RunSelectionMod", const char *title="Run selection module");
26 ~RunSelectionMod();
27
28 void AddRun(UInt_t i) { fAcceptedRuns.push_back(UIntPair(i,i)); }
29 void AddRuns(UInt_t l, UInt_t u) { fAcceptedRuns.push_back(UIntPair(l,u)); }
30 void ExcludeRun(UInt_t i) { fExcludedRuns.push_back(UIntPair(i,i)); }
31 void ExcludeRuns(UInt_t l, UInt_t u) { fExcludedRuns.push_back(UIntPair(l,u)); }
32 Int_t GetNEvents() const { return fNEvents; }
33 Int_t GetNAccepted() const { return fNAcceped; }
34 Int_t GetNFailed() const { return fNFailed; }
35 void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
36 void SetDefaultAccept(Bool_t b) { fDefaultAccept = b; }
37
38 protected:
39 void BeginRun();
40 virtual void OnAccepted() {/*could be implemented in derived classes*/}
41 virtual void OnFailed() {/*could be implemented in derived classes*/}
42 void Process();
43 void SlaveBegin();
44 void SlaveTerminate();
45
46 Bool_t fAbort; //=true then abort (sub-)modules if not accepted
47 Bool_t fDefaultAccept; //=true then accept runs not explicitly included or excluded
48 Int_t fNEvents; //!number of processed events
49 Int_t fNAcceped; //!number of accepted events
50 Int_t fNFailed; //!number of failed events
51 Bool_t fAcceptCurrentRun; //!cached decision for current run
52 UIntBounds fAcceptedRuns; //list of run ranges to accept
53 UIntBounds fExcludedRuns; //list of run ranges to exclude
54
55 ClassDef(RunSelectionMod, 1) // L1 TAM module
56 };
57 }
58 #endif