CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
EcalMappingElectronicsHandler Class Reference

#include <EcalMappingElectronicsHandler.h>

Inheritance diagram for EcalMappingElectronicsHandler:
popcon::PopConSourceHandler< EcalMappingElectronics >

Public Member Functions

 EcalMappingElectronicsHandler (edm::ParameterSet const &)
 
virtual void getNewObjects ()
 
virtual std::string id () const
 
virtual ~EcalMappingElectronicsHandler ()
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (cond::DbSession dbSession, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (cond::DbSession session, cond::TagInfo const &tagInfo, cond::LogDBEntry const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo const & tagInfo () const
 
std::string const & userTextLog () const
 
virtual ~PopConSourceHandler ()
 

Private Attributes

std::string m_name
 
const EcalMappingElectronicsmyMap
 
long long since_
 
std::string txtFileSource_
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
typedef std::vector< TripletContainer
 
typedef std::vector< std::pair
< EcalMappingElectronics
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< EcalMappingElectronics
self
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalMappingElectronics value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
int add (value_type *payload, Summary *summary, Time_t time)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 36 of file EcalMappingElectronicsHandler.h.

Constructor & Destructor Documentation

EcalMappingElectronicsHandler::EcalMappingElectronicsHandler ( edm::ParameterSet const &  ps)

Definition at line 14 of file EcalMappingElectronicsHandler.cc.

References gather_cfg::cout.

14  :
15  txtFileSource_(ps.getUntrackedParameter<std::string>("txtFile")),
16  m_name(ps.getUntrackedParameter<std::string>("name","EcalMappingElectronicsHandler")),
17  since_(ps.getUntrackedParameter<long long>("since",1))
18 {
19  std::cout << "EcalMappingElectronics Source handler constructor\n" << std::endl;
20 }
tuple cout
Definition: gather_cfg.py:121
EcalMappingElectronicsHandler::~EcalMappingElectronicsHandler ( )
virtual

Definition at line 22 of file EcalMappingElectronicsHandler.cc.

23 {
24 }

Member Function Documentation

void EcalMappingElectronicsHandler::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalMappingElectronics >.

Definition at line 27 of file EcalMappingElectronicsHandler.cc.

References gather_cfg::cout, cond::rpcobgas::detid, EcalMappingElement::electronicsid, edm::hlt::Exception, f, edm::FileInPath::fullPath(), popcon::PopConSourceHandler< EcalMappingElectronics >::m_to_transfer, EcalElectronicsId::rawId(), EcalTriggerElectronicsId::rawId(), since_, EcalMappingElement::triggerid, txtFileSource_, and EEDetId::XYMODE.

28 {
29 
30  std::cout << "------- Ecal - > getNewObjects\n";
32  std::auto_ptr<EcalMappingElectronics> mapping = std::auto_ptr<EcalMappingElectronics>( new EcalMappingElectronics() );
33  //Filling map reading from file
34  edm::LogInfo("EcalMappingElectronicsHandler") << "Reading mapping from file " << edm::FileInPath(txtFileSource_).fullPath().c_str() ;
35 
36  std::ifstream f(edm::FileInPath(txtFileSource_).fullPath().c_str());
37  if (!f.good())
38  {
39  edm::LogError("EcalMappingElectronicsHandler") << "File not found";
40  throw cms::Exception("FileNotFound");
41  }
42 
43  // uint32_t detid, elecid, triggerid;
44 
45  int ix, iy, iz, CL;
46  // int dccid, towerid, stripid, xtalid;
47  // int tccid, tower, ipseudostrip, xtalinps;
48  int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
49  int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
50 
51  while ( ! f.eof())
52  {
53  // f >> detid >> elecid >> triggerid;
54  f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
55  pseudostrip_in_TCC >> pseudostrip_in_TT ;
56 
57  // if (!EEDetId::validDetId(ix,iy,iz))
58  // continue;
59 
60  EEDetId detid(ix,iy,iz,EEDetId::XYMODE);
61  // std::cout << " dcc tower ps_in_SC xtal_in_ps " << dccid << " " << towerid << " " << pseudostrip_in_SC << " " << xtal_in_pseudostrip << std::endl;
62  EcalElectronicsId elecid(dccid,towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
63  // std::cout << " tcc tt ps_in_TT xtal_in_ps " << tccid << " " << tower << " " << pseudostrip_in_TT << " " << xtal_in_pseudostrip << std::endl;
64  EcalTriggerElectronicsId triggerid(tccid, tower, pseudostrip_in_TT, xtal_in_pseudostrip);
65  EcalMappingElement aElement;
66  aElement.electronicsid = elecid.rawId();
67  aElement.triggerid = triggerid.rawId();
68  (*payload).setValue(detid, aElement);
69  }
70 
71  f.close();
72  edm::LogInfo("EcalMappingElectronicsHandler") << "Reading completed ready to insert in DB";
73  //Filling completed transferring to DB
74  m_to_transfer.push_back(std::make_pair(payload,since_));
75  // delete payload;
76 }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
static const int XYMODE
Definition: EEDetId.h:316
EcalMappingElectronicsMap EcalMappingElectronics
double f[11][100]
tuple cout
Definition: gather_cfg.py:121
std::string fullPath() const
Definition: FileInPath.cc:171
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
virtual std::string EcalMappingElectronicsHandler::id ( void  ) const
inlinevirtual

Member Data Documentation

std::string EcalMappingElectronicsHandler::m_name
private

Definition at line 49 of file EcalMappingElectronicsHandler.h.

Referenced by id().

const EcalMappingElectronics* EcalMappingElectronicsHandler::myMap
private

Definition at line 46 of file EcalMappingElectronicsHandler.h.

long long EcalMappingElectronicsHandler::since_
private

Definition at line 51 of file EcalMappingElectronicsHandler.h.

Referenced by getNewObjects().

std::string EcalMappingElectronicsHandler::txtFileSource_
private

Definition at line 48 of file EcalMappingElectronicsHandler.h.

Referenced by getNewObjects().