ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/RunLumiSelectionMod.h
Revision: 1.5
Committed: Wed Jul 27 21:26:42 2011 UTC (13 years, 9 months ago) by sixie
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, HEAD
Branch point for: Mit_025c_branch
Changes since 1.4: +4 -2 lines
Log Message:
add option to accept all events

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: RunLumiSelectionMod.h,v 1.4 2010/06/29 15:51:53 bendavid Exp $
3 //
4 // RunLumiSelectionMod
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_RUNLUMISELECTIONMOD_H
15 #define MITANA_PHYSICSMOD_RUNLUMISELECTIONMOD_H
16
17 #include <string>
18 #include <TString.h>
19 #include <TGraph.h>
20 #include "MitAna/TreeMod/interface/BaseMod.h"
21 #include "MitAna/DataCont/interface/RunLumiRangeMap.h"
22 #include "MitAna/DataCont/interface/RunLumiSet.h"
23
24 namespace mithep
25 {
26 class RunLumiSelectionMod : public BaseMod {
27 typedef RunLumiRangeMap::RunLumiPairType RunLumiPairType;
28
29
30 public:
31 RunLumiSelectionMod(const char *name="RunLumiSelectionMod", const char *title="Run selection module");
32 ~RunLumiSelectionMod();
33
34 void AddJSONFile(const std::string &filepath);
35 Int_t GetNEvents() const { return fNEvents; }
36 Int_t GetNAccepted() const { return fNAcceped; }
37 Int_t GetNFailed() const { return fNFailed; }
38 void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
39 void SetAcceptMC(Bool_t b) { fAcceptMC = b; }
40 void SetAcceptAll(Bool_t b) { fAcceptAll = b; }
41
42 protected:
43 void BeginRun();
44 virtual void OnAccepted() {/*could be implemented in derived classes*/}
45 virtual void OnFailed() {/*could be implemented in derived classes*/}
46 void Process();
47 void SlaveBegin();
48 void SlaveTerminate();
49
50 Bool_t fAbort; //=true then abort (sub-)modules if not accepted
51 Bool_t fAcceptMC; //=true then accept Monte Carlo unconditionally
52 Bool_t fAcceptAll; //=true then accept all events unconditionally
53 Int_t fNEvents; //!number of processed events
54 Int_t fNAcceped; //!number of accepted events
55 Int_t fNFailed; //!number of failed events
56 RunLumiPairType fCurrentRunLumi; //!cached current run-lumi pair
57 Bool_t fAcceptCurrentRunLumi; //!cached decision for current run-lumi pair
58 RunLumiRangeMap fAcceptedRunsLumis; //!mapped run-lumi ranges to accept
59 RunLumiSet fRunLumiSet; //!
60 TGraph *fRunLumiGraph; //!
61
62 ClassDef(RunLumiSelectionMod, 1) // L1 TAM module
63 };
64 }
65 #endif