1 |
//--------------------------------------------------------------------------------------------------
|
2 |
// $Id: MCProcessSelectionMod.h,v 1.1 2010/01/18 14:35:43 bendavid Exp $
|
3 |
//
|
4 |
// MCProcessSelectionMod
|
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_MCPROCESSSELECTIONMOD_H
|
15 |
#define MITANA_PHYSICSMOD_MCPROCESSSELECTIONMOD_H
|
16 |
|
17 |
#include <string>
|
18 |
#include <TString.h>
|
19 |
#include <TH1F.h>
|
20 |
#include "MitAna/TreeMod/interface/BaseMod.h"
|
21 |
#include "MitAna/DataTree/interface/MCEventInfo.h"
|
22 |
|
23 |
namespace mithep
|
24 |
{
|
25 |
class MCProcessSelectionMod : public BaseMod {
|
26 |
public:
|
27 |
MCProcessSelectionMod(const char *name="MCProcessSelectionMod", const char *title="Run selection module");
|
28 |
~MCProcessSelectionMod();
|
29 |
|
30 |
void AddProcess(Int_t i) { fAcceptedProcessIds.push_back(i); }
|
31 |
void ExcludeProcess(Int_t i) { fExcludedProcessIds.push_back(i); }
|
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 |
TString fMCEventInfoName;//
|
47 |
Bool_t fAbort; //=true then abort (sub-)modules if not accepted
|
48 |
Bool_t fDefaultAccept; //=true then accept processes not explicitly included or excluded
|
49 |
Int_t fNEvents; //!number of processed events
|
50 |
Int_t fNAcceped; //!number of accepted events
|
51 |
Int_t fNFailed; //!number of failed events
|
52 |
std::vector<Int_t> fAcceptedProcessIds; //list of process ids accept
|
53 |
std::vector<Int_t> fExcludedProcessIds; //list of process ids to exclude
|
54 |
const MCEventInfo *fMCEventInfo; //!MC Event Info pointer
|
55 |
TH1F *hProcessId; //histogram of process id's
|
56 |
|
57 |
ClassDef(MCProcessSelectionMod, 1) // L1 TAM module
|
58 |
};
|
59 |
}
|
60 |
#endif
|