CMS 3D CMS Logo

BPHAnalyzerTokenWrapper.h
Go to the documentation of this file.
1 #ifndef HeavyFlavorAnalysis_RecoDecay_BPHAnalyzerTokenWrapper_h
2 #define HeavyFlavorAnalysis_RecoDecay_BPHAnalyzerTokenWrapper_h
3 
13 //----------------------
14 // Base Class Headers --
15 //----------------------
16 
17 
18 //------------------------------------
19 // Collaborating Class Declarations --
20 //------------------------------------
27 
28 //---------------
29 // C++ Headers --
30 //---------------
31 #include <string>
32 
33 // ---------------------
34 // -- Class Interface --
35 // ---------------------
36 
38  public:
39  typedef edm:: one::EDAnalyzer<> one_analyzer;
40  typedef edm:: one::EDProducer<> one_producer;
43 };
44 
45 template<class Obj>
47  public:
48  typedef typename edm::EDGetTokenT<Obj> type;
49  bool get( const edm::Event& ev,
51  return ev.getByToken( token, obj );
52  }
53  type token;
54 };
55 
56 template<class T>
57 class BPHAnalyzerWrapper: public T {
58  protected:
59  template<class Obj>
61  const std::string& label ) {
62  edm::InputTag tag( label );
63  tw.token = this->template consumes<Obj>( tag );
64  return;
65  }
66  template<class Obj>
68  const edm::InputTag& tag ) {
69  tw.token = this->template consumes<Obj>( tag );
70  return;
71  }
72 };
73 
74 #endif
75 
edm::one::EDAnalyzer one_analyzer
void consume(BPHTokenWrapper< Obj > &tw, const edm::InputTag &tag)
edm::one::EDProducer one_producer
edm::EDGetTokenT< Obj > type
void consume(BPHTokenWrapper< Obj > &tw, const std::string &label)
bool ev
edm::stream::EDProducer stream_producer
edm::stream::EDAnalyzer stream_analyzer
long double T