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
|