CMS 3D CMS Logo

DTKeyedConfigDBDump.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2010/05/14 11:43:08 $
5  * $Revision: 1.2 $
6  * \author Paolo Ronchese INFN Padova
7  *
8  */
9 
10 //-----------------------
11 // This Class' Header --
12 //-----------------------
14 
15 //-------------------------------
16 // Collaborating Class Headers --
17 //-------------------------------
23 
24 //---------------
25 // C++ Headers --
26 //---------------
27 #include <iostream>
28 #include <memory>
29 
30 //-------------------
31 // Initializations --
32 //-------------------
33 
34 
35 //----------------
36 // Constructors --
37 //----------------
39 }
40 
41 //--------------
42 // Destructor --
43 //--------------
45 }
46 
47 //--------------
48 // Operations --
49 //--------------
51 
52  return;
53 
54 }
55 
56 
58  const edm::EventSetup& c ) {
60  recordKey(edm::eventsetup::EventSetupRecordKey::TypeTag::findType("DTKeyedConfigListRcd"));
62  //record not found
63  std::cout <<"Record \"DTKeyedConfigListRcd "<<"\" does not exist "<<std::endl;
64  }
66  std::cout<<"got eshandle"<<std::endl;
67  c.get<DTKeyedConfigListRcd>().get(klh);
68  std::cout<<"got context"<<std::endl;
69  cond::persistency::KeyList const & kl= *klh.product();
71  std::vector<unsigned long long> nkeys;
72  nkeys.push_back( 999999999 );
73  std::cout << "now load" << std::endl;
74  kp->load( nkeys );
75  std::cout << "now get" << std::endl;
76  std::shared_ptr<DTKeyedConfig> pkc = kp->get<DTKeyedConfig>(0);
77  std::cout << "now check" << std::endl;
78  if ( pkc.get() ) std::cout << pkc->getId() << " "
79  << *( pkc->dataBegin() ) << std::endl;
80  else std::cout << "not found" << std::endl;
81  std::cout << std::endl;
82  std::vector<unsigned long long> nvoid;
83  kp->load( nvoid );
84  return;
85 }
86 
88 
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
int kp
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
DTKeyedConfigDBDump(const edm::ParameterSet &ps)
const T & get() const
Definition: EventSetup.h:55
heterocontainer::HCTypeTag TypeTag
std::shared_ptr< T > get(size_t n) const
Definition: KeyList.h:40
void load(const std::vector< unsigned long long > &keys)
Definition: KeyList.cc:14
T const * product() const
Definition: ESHandle.h:86