ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/RunLumiSelectionMod.h
Revision: 1.3
Committed: Sat May 29 18:10:15 2010 UTC (14 years, 11 months ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_014b, Mit_014a, Mit_014
Changes since 1.2: +4 -4 lines
Log Message:
Refactor lumi selection code a bit

File Contents

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