1 |
bendavid |
1.1 |
//--------------------------------------------------------------------------------------------------
|
2 |
|
|
// $Id: RunLumiSelectionMod.h,v 1.1 2010/01/18 14:35:43 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 "MitAna/TreeMod/interface/BaseMod.h"
|
20 |
|
|
|
21 |
|
|
namespace mithep
|
22 |
|
|
{
|
23 |
|
|
class RunLumiSelectionMod : public BaseMod {
|
24 |
|
|
public:
|
25 |
|
|
RunLumiSelectionMod(const char *name="RunLumiSelectionMod", const char *title="Run selection module");
|
26 |
|
|
~RunLumiSelectionMod();
|
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(RunLumiSelectionMod, 1) // L1 TAM module
|
56 |
|
|
};
|
57 |
|
|
}
|
58 |
|
|
#endif
|