CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalElectronicsMappingBuilder.cc
Go to the documentation of this file.
1 
2 // user include files
7 
8 #include <iostream>
9 #include <fstream>
10 
11 
12 #include <vector>
13 
18 
19 
20 
21 using namespace edm;
22 
23 
24 //
25 // constructors and destructor
26 //
28  Mapping_ ( 0 )
29 {
30  //the following line is needed to tell the framework what
31  // data is being produced
32  // setWhatProduced(this);
34  //now do what ever other initialization is needed
35 }
36 
37 
39 {
40 }
41 
42 //
43 // member functions
44 //
45 
47 {
48 
50  fRecord.get (item);
51  Mapping_ = item.product () ;
52 }
53 
54 
55 // ------------ method called to produce the data ------------
57 // EcalElectronicsMappingBuilder::produce(const IdealGeometryRecord& iRecord)
59 {
60  using namespace edm::es;
61  std::auto_ptr<EcalElectronicsMapping> prod(new EcalElectronicsMapping());
62  const std::vector<EcalMappingElement>& ee = Mapping_ -> endcapItems();
63  FillFromDatabase(ee,*prod);
64  return prod;
65 
66 }
67 
68 void EcalElectronicsMappingBuilder::FillFromDatabase(const std::vector<EcalMappingElement>& ee,
69  EcalElectronicsMapping& theMap)
70 {
71  // std::cout << " --- Reading the EE mapping from Database --- " << std::endl;
72  for (unsigned int i=0; i < ee.size(); i++)
73  {
74  if (ee[i].electronicsid == 0)
75  continue;
76  if (ee[i].triggerid == 0)
77  continue;
78  theMap.assign(EEDetId::unhashIndex(i).rawId(),ee[i].electronicsid,ee[i].triggerid);
79  }
80  return;
81 }
82 
83 
84 
85 
86 
void DBCallback(const EcalMappingElectronicsRcd &fRecord)
int i
Definition: DBlmapReader.cc:9
ReturnType produce(const EcalMappingRcd &)
depends_on::OneHolder< T, TDependsOnRecord > dependsOn(void(T::*iT)(const TDependsOnRecord &))
EcalElectronicsMappingBuilder(const edm::ParameterSet &)
std::auto_ptr< EcalElectronicsMapping > ReturnType
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:99
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
void assign(const DetId &cell, const EcalElectronicsId &, const EcalTriggerElectronicsId &tower)
set the association between a DetId and a tower
void get(HolderT &iHolder) const
void FillFromDatabase(const std::vector< EcalMappingElement > &ee, EcalElectronicsMapping &theMap)
T const * product() const
Definition: ESHandle.h:62
const EcalMappingElectronics * Mapping_