CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
PixelDCSObjectReader.cc
Go to the documentation of this file.
1 
10 #include "TTree.h"
11 
17 
18 template <class Record>
19 class PixelDCSObjectReader : public edm::one::EDAnalyzer<edm::one::SharedResources> {
20  typedef typename Record::Object Object;
21 
22 public:
24  usesResource(TFileService::kSharedResource);
25  }
26 
27  void analyze(const edm::Event&, const edm::EventSetup&) override;
28 
29 private:
31 };
32 
33 template <class Record>
35  const Object* object = &setup.getData(esToken);
36 
38 
39  TTree* tree = fs->make<TTree>("tree", "");
40 
41  tree->Branch("object", &object);
42  tree->Fill();
43 }
44 
48 
static const std::string kSharedResource
Definition: TFileService.h:76
PixelDCSObjectReader(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
bool getData(T &iHolder) const
Definition: EventSetup.h:122
void analyze(const edm::Event &, const edm::EventSetup &) override
const edm::ESGetToken< Object, Record > esToken