CMS 3D CMS Logo

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 &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalMappingElectronicsHandler () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
void convertFromOld ()
 
SummarydummySummary (typename OldContainer::value_type const &) const
 
void initialize (const cond::persistency::Session &dbSession, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry_t const & logDBEntry () const
 
std::pair< Container const *, std::string const > operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry_t const &logDBEntry) const
 
 PopConSourceHandler ()
 
Container const & returnData ()
 
void sort ()
 
cond::TagInfo_t 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< Triplet > Container
 
typedef std::vector< std::pair< EcalMappingElectronics *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalMappingElectronicsself
 
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)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalMappingElectronics >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 32 of file EcalMappingElectronicsHandler.h.

Constructor & Destructor Documentation

◆ EcalMappingElectronicsHandler()

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

Definition at line 15 of file EcalMappingElectronicsHandler.cc.

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

References gather_cfg::cout.

◆ ~EcalMappingElectronicsHandler()

EcalMappingElectronicsHandler::~EcalMappingElectronicsHandler ( )
override

Definition at line 22 of file EcalMappingElectronicsHandler.cc.

22 {}

Member Function Documentation

◆ getNewObjects()

void EcalMappingElectronicsHandler::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalMappingElectronics >.

Definition at line 24 of file EcalMappingElectronicsHandler.cc.

24  {
25  std::cout << "------- Ecal - > getNewObjects\n";
27  std::unique_ptr<EcalMappingElectronics> mapping = std::make_unique<EcalMappingElectronics>();
28  //Filling map reading from file
29  edm::LogInfo("EcalMappingElectronicsHandler")
30  << "Reading mapping from file " << edm::FileInPath(txtFileSource_).fullPath().c_str();
31 
32  std::ifstream f(edm::FileInPath(txtFileSource_).fullPath().c_str());
33  if (!f.good()) {
34  edm::LogError("EcalMappingElectronicsHandler") << "File not found";
35  throw cms::Exception("FileNotFound");
36  }
37 
38  // uint32_t detid, elecid, triggerid;
39 
40  int ix, iy, iz, CL;
41  // int dccid, towerid, stripid, xtalid;
42  // int tccid, tower, ipseudostrip, xtalinps;
43  int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
44  int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
45 
46  while (!f.eof()) {
47  // f >> detid >> elecid >> triggerid;
48  f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
49  pseudostrip_in_TCC >> pseudostrip_in_TT;
50 
51  // if (!EEDetId::validDetId(ix,iy,iz))
52  // continue;
53 
54  EEDetId detid(ix, iy, iz, EEDetId::XYMODE);
55  // std::cout << " dcc tower ps_in_SC xtal_in_ps " << dccid << " " << towerid << " " << pseudostrip_in_SC << " " << xtal_in_pseudostrip << std::endl;
56  EcalElectronicsId elecid(dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
57  // std::cout << " tcc tt ps_in_TT xtal_in_ps " << tccid << " " << tower << " " << pseudostrip_in_TT << " " << xtal_in_pseudostrip << std::endl;
58  EcalTriggerElectronicsId triggerid(tccid, tower, pseudostrip_in_TT, xtal_in_pseudostrip);
59  EcalMappingElement aElement;
60  aElement.electronicsid = elecid.rawId();
61  aElement.triggerid = triggerid.rawId();
62  (*payload).setValue(detid, aElement);
63  }
64 
65  f.close();
66  edm::LogInfo("EcalMappingElectronicsHandler") << "Reading completed ready to insert in DB";
67  //Filling completed transferring to DB
68  m_to_transfer.push_back(std::make_pair(payload, since_));
69  // delete payload;
70 }

References L1DTConfigBti_cff::CL, gather_cfg::cout, EcalMappingElement::electronicsid, Exception, f, contentValuesFiles::fullPath, edm::FileInPath::fullPath(), popcon::PopConSourceHandler< EcalMappingElectronics >::m_to_transfer, taus_updatedMVAIds_cff::mapping, jets_cff::payload, EcalTriggerElectronicsId::rawId(), EcalElectronicsId::rawId(), since_, hgcalTowerProducer_cfi::tower, EcalMappingElement::triggerid, txtFileSource_, and EEDetId::XYMODE.

◆ id()

std::string EcalMappingElectronicsHandler::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< EcalMappingElectronics >.

Definition at line 37 of file EcalMappingElectronicsHandler.h.

37 { return m_name; }

References m_name.

Member Data Documentation

◆ m_name

std::string EcalMappingElectronicsHandler::m_name
private

Definition at line 43 of file EcalMappingElectronicsHandler.h.

Referenced by id().

◆ myMap

const EcalMappingElectronics* EcalMappingElectronicsHandler::myMap
private

Definition at line 40 of file EcalMappingElectronicsHandler.h.

◆ since_

long long EcalMappingElectronicsHandler::since_
private

Definition at line 45 of file EcalMappingElectronicsHandler.h.

Referenced by getNewObjects().

◆ txtFileSource_

std::string EcalMappingElectronicsHandler::txtFileSource_
private

Definition at line 42 of file EcalMappingElectronicsHandler.h.

Referenced by getNewObjects().

EcalMappingElectronicsHandler::since_
long long since_
Definition: EcalMappingElectronicsHandler.h:45
popcon::PopConSourceHandler< EcalMappingElectronics >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
EcalTriggerElectronicsId
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
Definition: EcalTriggerElectronicsId.h:18
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
L1DTConfigBti_cff.CL
CL
Definition: L1DTConfigBti_cff.py:39
edm::FileInPath
Definition: FileInPath.h:64
EcalMappingElement::triggerid
uint32_t triggerid
Definition: EcalMappingElectronics.h:15
EcalMappingElectronics
EcalMappingElectronicsMap EcalMappingElectronics
Definition: EcalMappingElectronics.h:22
jets_cff.payload
payload
Definition: jets_cff.py:32
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalMappingElement::electronicsid
uint32_t electronicsid
Definition: EcalMappingElectronics.h:14
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
EcalMappingElectronicsHandler::txtFileSource_
std::string txtFileSource_
Definition: EcalMappingElectronicsHandler.h:42
EEDetId::XYMODE
static const int XYMODE
Definition: EEDetId.h:335
Exception
Definition: hltDiff.cc:246
EcalMappingElectronicsHandler::m_name
std::string m_name
Definition: EcalMappingElectronicsHandler.h:43
EcalMappingElement
Definition: EcalMappingElectronics.h:12
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163