ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/RunLumiSelectionMod.h
Revision: 1.4
Committed: Tue Jun 29 15:51:53 2010 UTC (14 years, 10 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: 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
Changes since 1.3: +6 -2 lines
Log Message:
Add machinery for processed lumi json files

File Contents

# Content
1 //--------------------------------------------------------------------------------------------------
2 // $Id: RunLumiSelectionMod.h,v 1.3 2010/05/29 18:10:15 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
41 protected:
42 void BeginRun();
43 virtual void OnAccepted() {/*could be implemented in derived classes*/}
44 virtual void OnFailed() {/*could be implemented in derived classes*/}
45 void Process();
46 void SlaveBegin();
47 void SlaveTerminate();
48
49 Bool_t fAbort; //=true then abort (sub-)modules if not accepted
50 Bool_t fAcceptMC; //=true then accept Monte Carlo unconditionally
51 Int_t fNEvents; //!number of processed events
52 Int_t fNAcceped; //!number of accepted events
53 Int_t fNFailed; //!number of failed events
54 RunLumiPairType fCurrentRunLumi; //!cached current run-lumi pair
55 Bool_t fAcceptCurrentRunLumi; //!cached decision for current run-lumi pair
56 RunLumiRangeMap fAcceptedRunsLumis; //!mapped run-lumi ranges to accept
57 RunLumiSet fRunLumiSet; //!
58 TGraph *fRunLumiGraph; //!
59
60 ClassDef(RunLumiSelectionMod, 1) // L1 TAM module
61 };
62 }
63 #endif