CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
popcon::EcalTPGLinPed Class Reference

#include <EcalTPGLinPed.h>

Inheritance diagram for popcon::EcalTPGLinPed:
popcon::PopConSourceHandler< EcalTPGPedestals >

Public Member Functions

 EcalTPGLinPed (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalTPGLinPed () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGPedestals >
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 Types

enum  { kEBChannels = 61200, kEEChannels = 14648, kGains = 3 }
 

Private Attributes

std::string m_name
 

Additional Inherited Members

- Public Types inherited from popcon::PopConSourceHandler< EcalTPGPedestals >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGPedestals *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGPedestalsself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGPedestals value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGPedestals >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGPedestals >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 51 of file EcalTPGLinPed.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
kEBChannels 
kEEChannels 
kGains 

Definition at line 61 of file EcalTPGLinPed.h.

Constructor & Destructor Documentation

popcon::EcalTPGLinPed::~EcalTPGLinPed ( )
override

Definition at line 18 of file EcalTPGLinPed.cc.

18  {
19  // do nothing
20 }
popcon::EcalTPGLinPed::EcalTPGLinPed ( edm::ParameterSet const &  )

Definition at line 13 of file EcalTPGLinPed.cc.

References gather_cfg::cout.

14  : m_name(ps.getUntrackedParameter<std::string>("name","EcalTPGLinPedHandler")) {
15  std::cout << "EcalTPGLinPed constructor\n" << std::endl;
16 }

Member Function Documentation

void popcon::EcalTPGLinPed::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGPedestals >.

Definition at line 22 of file EcalTPGLinPed.cc.

References gather_cfg::cout, alignmentValidation::fname, muonCSCDigis_cfi::gain, mps_fire::i, id(), EcalCondObjectContainer< T >::insert(), kEBChannels, kEEChannels, kGains, cond::TagInfo_t::lastInterval, popcon::PopConSourceHandler< EcalTPGPedestals >::lastPayload(), geometryCSVtoXML::line, popcon::PopConSourceHandler< EcalTPGPedestals >::m_to_transfer, EcalTPGPedestal::mean_x1, EcalTPGPedestal::mean_x12, EcalTPGPedestal::mean_x6, EcalTPGLinearizationConstant::mult_x1, jets_cff::payload, edm::shift, AlCaHLTBitMon_QueryRunRegistry::string, and popcon::PopConSourceHandler< EcalTPGPedestals >::tagInfo().

22  {
23  std::cout << "------- Ecal -> getNewObjects\n";
24 
25  unsigned long long max_since = 1;
27 
28  // here popcon tells us which is the last since of the last object in the offline DB
29  max_since=tagInfo().lastInterval.first;
30  Tm max_since_tm(max_since);
31 
34  int fileIOV;
35  std::cout << "LinPed which input IOV do you want " << std::endl;
36  std::cin >> fileIOV;
37  std::ifstream fLin;
38  std::ostringstream oss;
39  oss << fileIOV;
40  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
41  fLin.open(fname.c_str());
42  if(!fLin.is_open()) {
43  std::cout << "ERROR : can't open file '" << fname << std::endl;
44  return;
45  }
46  std::cout << " file " << fname << " opened" << std::endl;
48  for(int i = 0; i < 85; i++) getline (fLin, line);
49  char cryst[10];
50  uint32_t ped[kGains], mult[kGains], shift[kGains];
51  uint32_t id;
52  for (int iChannel = 0; iChannel < kEBChannels; iChannel++) {
53  getline (fLin, line);
54  sscanf(line.c_str(), "%s %u", cryst, &id);
55  for (int gain = 0; gain < kGains; gain++) {
56  getline (fLin, line);
57  sscanf(line.c_str(), "%X %X %X", &ped[gain], &mult[gain], &shift[gain]);
58  }
60  item.mult_x1 = mult[2];
61  item.mult_x6 = mult[1];
62  item.mult_x12 = mult[0];
63  item.shift_x1 = shift[2];
64  item.shift_x6 = shift[1];
65  item.shift_x12 = shift[0];
66 
67  EcalTPGPedestals::Item itemPed;
68  itemPed.mean_x1 = ped[2];
69  itemPed.mean_x6 = ped[1];
70  itemPed.mean_x12 = ped[0];
71 
72  linC->insert(std::make_pair(id, item));
73  peds->insert(std::make_pair(id, itemPed));
74  } // end loop over EB channels
75  getline (fLin, line); // comment before EE crystals
76  std::cout << " comment line " << line << std::endl;
77  for (int iChannel = 0; iChannel < kEEChannels; iChannel++) {
78  getline (fLin, line);
79  // std::cout << " line " << line << std::endl;
80  sscanf(line.c_str(), "%s %u", cryst, &id);
81  // std::cout << cryst << " id " << id << std::endl;
82  for (int gain =0; gain < kGains; gain++) {
83  getline (fLin, line);
84  // std::cout << " line g " << line << std::endl;
85  sscanf(line.c_str(), "%X %X %X", &ped[gain], &mult[gain], &shift[gain]);
86  // std::cout << " gain " << gain << " ped " << ped[gain] << " mult " << mult[gain] << " shift " << shift[gain]<< std::endl;
87 
88  }
90  item.mult_x1 = mult[2];
91  item.mult_x6 = mult[1];
92  item.mult_x12 = mult[0];
93  item.shift_x1 = shift[2];
94  item.shift_x6 = shift[1];
95  item.shift_x12 = shift[0];
96 
97  EcalTPGPedestals::Item itemPed;
98  itemPed.mean_x1 = ped[2];
99  itemPed.mean_x6 = ped[1];
100  itemPed.mean_x12 = ped[0];
101 
102  linC->insert(std::make_pair(id, item));
103  peds->insert(std::make_pair(id, itemPed));
104  } // end loop over EE channels
105  fLin.close();
106  // for the time beeing just transfer pedestal
107  // m_to_transfer.push_back(std::make_pair((EcalTPGLinearizationConst*)linC, fileIOV));
108  m_to_transfer.push_back(std::make_pair((EcalTPGPedestals*)peds, fileIOV));
109 
110  std::cout << "Ecal -> end of getNewObjects -----------\n";
111 }
cond::ValidityInterval lastInterval
Definition: Types.h:75
void insert(std::pair< uint32_t, Item > const &a)
std::string id() const override
Definition: EcalTPGLinPed.h:58
string fname
main script
static unsigned int const shift
EcalTPGPedestalsMap EcalTPGPedestals
Definition: Tm.h:13
EcalTPGLinearizationConstMap EcalTPGLinearizationConst
std::string popcon::EcalTPGLinPed::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< EcalTPGPedestals >.

Definition at line 58 of file EcalTPGLinPed.h.

Referenced by getNewObjects().

58 { return m_name;}

Member Data Documentation

std::string popcon::EcalTPGLinPed::m_name
private

Definition at line 62 of file EcalTPGLinPed.h.