ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitAna/PhysicsMod/interface/MCProcessSelectionMod.h
Revision: 1.2
Committed: Tue Apr 12 15:18:28 2011 UTC (14 years ago) by bendavid
Content type: text/plain
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_025c_branch2, Mit_025c_branch1, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_025c_branch0, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, Mit_025c, Mit_025b, Mit_025a, Mit_025, Mit_025pre2, Mit_024b, Mit_025pre1, Mit_024a, Mit_024, Mit_023, Mit_022a, Mit_022, Mit_020d, TMit_020d, Mit_020c, Mit_021, Mit_021pre2, Mit_021pre1, Mit_020b, HEAD
Branch point for: Mit_025c_branch
Changes since 1.1: +3 -1 lines
Log Message:
add process id histogram

File Contents

# Content
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