ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/MCProcessSelectionMod.h
Revision: 1.1
Committed: Tue Apr 12 14:10:04 2011 UTC (14 years ago) by bendavid
Content type: text/plain
Branch: MAIN
Log Message:
add MCProcessSelectionMod for filtering on mc process id

File Contents

# User Rev Content
1 bendavid 1.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 "MitAna/TreeMod/interface/BaseMod.h"
20     #include "MitAna/DataTree/interface/MCEventInfo.h"
21    
22     namespace mithep
23     {
24     class MCProcessSelectionMod : public BaseMod {
25     public:
26     MCProcessSelectionMod(const char *name="MCProcessSelectionMod", const char *title="Run selection module");
27     ~MCProcessSelectionMod();
28    
29     void AddProcess(Int_t i) { fAcceptedProcessIds.push_back(i); }
30     void ExcludeProcess(Int_t i) { fExcludedProcessIds.push_back(i); }
31     Int_t GetNEvents() const { return fNEvents; }
32     Int_t GetNAccepted() const { return fNAcceped; }
33     Int_t GetNFailed() const { return fNFailed; }
34     void SetAbortIfNotAccepted(Bool_t b) { fAbort = b; }
35     void SetDefaultAccept(Bool_t b) { fDefaultAccept = b; }
36    
37     protected:
38     void BeginRun();
39     virtual void OnAccepted() {/*could be implemented in derived classes*/}
40     virtual void OnFailed() {/*could be implemented in derived classes*/}
41     void Process();
42     void SlaveBegin();
43     void SlaveTerminate();
44    
45     TString fMCEventInfoName;//
46     Bool_t fAbort; //=true then abort (sub-)modules if not accepted
47     Bool_t fDefaultAccept; //=true then accept processes 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     std::vector<Int_t> fAcceptedProcessIds; //list of process ids accept
52     std::vector<Int_t> fExcludedProcessIds; //list of process ids to exclude
53     const MCEventInfo* fMCEventInfo; //!MC Event Info pointer
54    
55     ClassDef(MCProcessSelectionMod, 1) // L1 TAM module
56     };
57     }
58     #endif