CMS 3D CMS Logo

ByMultiplicityEventFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiStripTools
4 // Class: ByMultiplicityEventFilter
5 //
13 //
14 // Original Author: Andrea Venturi
15 // Created: Tue Oct 21 20:55:22 CEST 2008
16 //
17 //
18 
19 
20 // system include files
21 #include <memory>
22 #include <string>
23 
24 // user include files
27 
30 
32 
33 
35 
39 
41 
43 
44 
45 //
46 // class declaration
47 //
48 
49 template <class T>
51  public:
53  ~ByMultiplicityEventFilter() override;
54 
55 
56  private:
57  bool filter(edm::Event&, const edm::EventSetup&) override;
58 
59  // ----------member data ---------------------------
60 
64 
65 };
66 
67 //
68 // constants, enums and typedefs
69 //
70 
71 //
72 // static data member definitions
73 //
74 
75 //
76 // constructors and destructor
77 //
78 template <class T>
80  m_multiplicities(iConfig.getParameter<edm::ParameterSet>("multiplicityConfig"),consumesCollector()),
81  m_selector(iConfig.getParameter<std::string>("cut")),
82  m_taggedMode(iConfig.getUntrackedParameter<bool>("taggedMode", false)),
83  m_forcedValue(iConfig.getUntrackedParameter<bool>("forcedValue", true))
84 
85 
86 {
87  //now do what ever initialization is needed
88  produces<bool>();
89 
90 }
91 
92 template <class T>
94 {
95 
96  // do anything here that needs to be done at desctruction time
97  // (e.g. close files, deallocate resources etc.)
98 
99 }
100 
101 
102 //
103 // member functions
104 //
105 
106 // ------------ method called on each new Event ------------
107 template <class T>
108 bool
110 {
111  using namespace edm;
112 
113  m_multiplicities.getEvent(iEvent,iSetup);
114 
116  iEvent.put(std::unique_ptr<bool>(new bool(value)));
117 
118  if(m_taggedMode) return m_forcedValue;
119  return value;
120 
121 }
122 
123 //define this as a plug-in
124 /*
125 typedef ByMultiplicityEventFilter<SingleMultiplicity<edm::DetSetVector<SiStripDigi> > > BySiStripDigiMultiplicityEventFilter;
126 typedef ByMultiplicityEventFilter<SingleMultiplicity<edmNew::DetSetVector<SiStripCluster> > > BySiStripClusterMultiplicityEventFilter;
127 typedef ByMultiplicityEventFilter<SingleMultiplicity<edmNew::DetSetVector<SiPixelCluster> > > BySiPixelClusterMultiplicityEventFilter;
128 typedef ByMultiplicityEventFilter<MultiplicityPair<edmNew::DetSetVector<SiPixelCluster>,edmNew::DetSetVector<SiStripCluster> > > BySiPixelClusterVsSiStripClusterMultiplicityEventFilter;
129 */
136 
ByMultiplicityEventFilter< SiPixelClusterSiStripClusterMultiplicityPair > BySiPixelClusterVsSiStripClusterMultiplicityEventFilter
ByMultiplicityEventFilter< ClusterSummarySingleMultiplicity > ByClusterSummarySingleMultiplicityEventFilter
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
ByMultiplicityEventFilter< ClusterSummaryMultiplicityPair > ByClusterSummaryMultiplicityPairEventFilter
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool filter(edm::Event &, const edm::EventSetup &) override
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Definition: value.py:1
ByMultiplicityEventFilter< SingleSiStripClusterMultiplicity > BySiStripClusterMultiplicityEventFilter
ByMultiplicityEventFilter(const edm::ParameterSet &)
StringCutObjectSelector< T > m_selector
ByMultiplicityEventFilter< SingleSiPixelClusterMultiplicity > BySiPixelClusterMultiplicityEventFilter
HLT enums.
ByMultiplicityEventFilter< SingleSiStripDigiMultiplicity > BySiStripDigiMultiplicityEventFilter
long double T