CMS 3D CMS Logo

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

#include <EcalLaser_weekly_Linearization.h>

Inheritance diagram for popcon::EcalLaser_weekly_Linearization:
popcon::PopConSourceHandler< EcalTPGLinearizationConst >

Public Member Functions

 EcalLaser_weekly_Linearization (edm::ParameterSet const &)
 
void getNewObjects () override
 
std::string id () const override
 
 ~EcalLaser_weekly_Linearization () override
 
- Public Member Functions inherited from popcon::PopConSourceHandler< EcalTPGLinearizationConst >
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< EcalTPGLinearizationConst >
typedef std::vector< Triplet > Container
 
typedef std::vector< std::pair< EcalTPGLinearizationConst *, cond::Time_t > > OldContainer
 
typedef PopConSourceHandler< EcalTPGLinearizationConstself
 
typedef cond::Summary Summary
 
typedef cond::Time_t Time_t
 
typedef EcalTPGLinearizationConst value_type
 
- Protected Member Functions inherited from popcon::PopConSourceHandler< EcalTPGLinearizationConst >
int add (value_type *payload, Summary *summary, Time_t time)
 
cond::persistency::SessiondbSession () const
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGLinearizationConst >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 45 of file EcalLaser_weekly_Linearization.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kEBChannels 
kEEChannels 
kGains 

Definition at line 54 of file EcalLaser_weekly_Linearization.h.

54 { kEBChannels = 61200, kEEChannels = 14648, kGains = 3 };

Constructor & Destructor Documentation

◆ ~EcalLaser_weekly_Linearization()

popcon::EcalLaser_weekly_Linearization::~EcalLaser_weekly_Linearization ( )
override

Definition at line 18 of file EcalLaser_weekly_Linearization.cc.

18  {
19  // do nothing
20 }

◆ EcalLaser_weekly_Linearization()

popcon::EcalLaser_weekly_Linearization::EcalLaser_weekly_Linearization ( edm::ParameterSet const &  ps)

Definition at line 13 of file EcalLaser_weekly_Linearization.cc.

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

References gather_cfg::cout.

Member Function Documentation

◆ getNewObjects()

void popcon::EcalLaser_weekly_Linearization::getNewObjects ( )
overridevirtual

Implements popcon::PopConSourceHandler< EcalTPGLinearizationConst >.

Definition at line 22 of file EcalLaser_weekly_Linearization.cc.

22  {
23  // int file[1] = {190708};
24 
25  int iIov = 0;
26 
27  std::cout << "------- Ecal -> getNewObjects\n";
28 
29  unsigned long long max_since = 1;
31 
32  // here popcon tells us which is the last since of the last object in the offline DB
33  max_since = tagInfo().lastInterval.since;
34  Tm max_since_tm(max_since);
35 
36  // const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap& laserRatiosMap =
37  // payload->getLaserMap();
38  // std::cout << "payload->getLaserMap(): OK " << std::endl;
39  // std::cout << "Its size is " << laserRatiosMap.size() << std::endl;
40  // const EcalLaserAPDPNRatios::EcalLaserTimeStampMap& laserTimeMap =
41  // payload->getTimeMap();
42  // std::cout << "payload->getTimeMap(): OK " << std::endl;
43  // std::cout << "Last Object in Offline DB has SINCE = " << max_since
44  // << " -> " << max_since_tm.cmsNanoSeconds()
45  // << " (" << max_since_tm << ")"
46  // << " and SIZE = " << tagInfo().size
47  // << std::endl;
48 
49  for (int week = 0; week < 1; week++) {
50  int fileIOV;
51  std::cout << " which input IOV do you want " << std::endl;
52  std::cin >> fileIOV;
53  std::ifstream fWeek;
54  std::ostringstream oss;
55  oss << fileIOV;
56  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_spikekill.txt";
57  /*
58  oss << file[week];
59  // std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv5_trans_" + oss.str() + "_";
60  std::string fname = "/afs/cern.ch/cms/ECAL/triggerTransp/TPG_beamv6_trans_" + oss.str() + "_";
61  oss.str("");
62  // if(week == 32) oss << 200000;
63  // else oss << file[week + 1] - 1;
64  oss << 200000;
65  fname += oss.str() + ".txt";
66  */
67  fWeek.open(fname.c_str());
68  if (!fWeek.is_open()) {
69  std::cout << "ERROR : can't open file '" << fname << std::endl;
70  break;
71  }
72  std::cout << " file " << fname << " opened" << std::endl;
73  // int rawId;
74  // float corrp;
76  for (int i = 0; i < 85; i++)
77  getline(fWeek, line);
78  char cryst[10];
79  uint32_t ped[kGains], mult[kGains], shift[kGains];
80  uint32_t id;
81 
83 
84  for (int iChannel = 0; iChannel < kEBChannels; iChannel++) {
85  getline(fWeek, line);
86  // std::cout << " line " << line << std::endl;
87  // fWeek >> cryst >> id;
88  sscanf(line.c_str(), "%s %u", cryst, &id);
89  // std::cout << cryst << " id " << id << std::endl;
90  // EBDetId ebId = DetId(id);
91  for (int gain = 0; gain < kGains; gain++) {
92  // fWeek >> std::hex >> ped[gain] >> mult[gain] >> shift[gain];
93  getline(fWeek, line);
94  // std::cout << " line g " << line << std::endl;
95  sscanf(line.c_str(), "%X %X %X", &ped[gain], &mult[gain], &shift[gain]);
96  // std::cout << " gain " << gain << " ped " << ped[gain] << " mult " << mult[gain] << " shift " << shift[gain]<< std::endl;
97  }
99  item.mult_x1 = mult[2];
100  item.mult_x6 = mult[1];
101  item.mult_x12 = mult[0];
102  item.shift_x1 = shift[2];
103  item.shift_x6 = shift[1];
104  item.shift_x12 = shift[0];
105 
106  linC->insert(std::make_pair(id, item));
107  // corr.p1=corr.p2=corr.p3 = corrp;
108  // corrSet->setValue((int)ebId, corr );
109  // cryst ="";
110  } // end loop over EB channels
111  getline(fWeek, line); // cmment before EE crystals
112  std::cout << " comment line " << line << std::endl;
113  for (int iChannel = 0; iChannel < kEEChannels; iChannel++) {
114  getline(fWeek, line);
115  // std::cout << " line " << line << std::endl;
116  sscanf(line.c_str(), "%s %u", cryst, &id);
117  // std::cout << cryst << " id " << id << std::endl;
118  // EEDetId eeId = DetId(id);
119  for (int gain = 0; gain < kGains; gain++) {
120  getline(fWeek, line);
121  // std::cout << " line g " << line << std::endl;
122  sscanf(line.c_str(), "%X %X %X", &ped[gain], &mult[gain], &shift[gain]);
123  // std::cout << " gain " << gain << " ped " << ped[gain] << " mult " << mult[gain] << " shift " << shift[gain]<< std::endl;
124 
125  } // corr.p1=corr.p2=corr.p3 = corrp;
126  // corrSet->setValue((int)eeId, corr );
128  item.mult_x1 = mult[2];
129  item.mult_x6 = mult[1];
130  item.mult_x12 = mult[0];
131  item.shift_x1 = shift[2];
132  item.shift_x6 = shift[1];
133  item.shift_x12 = shift[0];
134 
135  linC->insert(std::make_pair(id, item));
136  } // end loop over EE channels
137  fWeek.close();
138  // special tag for Stephanie
139  // m_to_transfer.push_back(std::make_pair((EcalTPGLinearizationConst*)linC, file[week]));
140  m_to_transfer.push_back(std::make_pair(linC, fileIOV));
141  // end special
142  iIov++;
143  } // end loop over week
144  std::cout << "Ecal -> end of getNewObjects -----------\n";
145 }

References gather_cfg::cout, alignmentValidation::fname, PedestalClient_cfi::gain, mps_fire::i, triggerObjects_cff::id, EcalCondObjectContainer< T >::insert(), B2GTnPMonitor_cfi::item, kEBChannels, kEEChannels, kGains, mps_splice::line, VarParsing::mult, jets_cff::payload, edm::shift, AlCaHLTBitMon_QueryRunRegistry::string, and dumpRecoGeometry_cfg::tagInfo.

◆ id()

std::string popcon::EcalLaser_weekly_Linearization::id ( ) const
inlineoverridevirtual

Implements popcon::PopConSourceHandler< EcalTPGLinearizationConst >.

Definition at line 51 of file EcalLaser_weekly_Linearization.h.

51 { return m_name; }

References m_name.

Member Data Documentation

◆ m_name

std::string popcon::EcalLaser_weekly_Linearization::m_name
private

Definition at line 56 of file EcalLaser_weekly_Linearization.h.

Referenced by id().

mps_fire.i
i
Definition: mps_fire.py:428
popcon::EcalLaser_weekly_Linearization::id
std::string id() const override
Definition: EcalLaser_weekly_Linearization.h:51
popcon::PopConSourceHandler< EcalTPGLinearizationConst >::m_to_transfer
OldContainer m_to_transfer
Definition: PopConSourceHandler.h:162
gather_cfg.cout
cout
Definition: gather_cfg.py:144
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
jets_cff.payload
payload
Definition: jets_cff.py:32
Tm
Definition: Tm.h:13
popcon::EcalLaser_weekly_Linearization::m_name
std::string m_name
Definition: EcalLaser_weekly_Linearization.h:56
popcon::PopConSourceHandler< EcalTPGLinearizationConst >::tagInfo
cond::TagInfo_t const & tagInfo() const
Definition: PopConSourceHandler.h:78
EcalCondObjectContainer::Item
T Item
Definition: EcalCondObjectContainer.h:15
popcon::EcalLaser_weekly_Linearization::kGains
Definition: EcalLaser_weekly_Linearization.h:54
cond::Iov_t::since
Time_t since
Definition: Types.h:53
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
cond::TagInfo_t::lastInterval
Iov_t lastInterval
Definition: Types.h:73
popcon::EcalLaser_weekly_Linearization::kEBChannels
Definition: EcalLaser_weekly_Linearization.h:54
EcalCondObjectContainer::insert
void insert(std::pair< uint32_t, Item > const &a)
Definition: EcalCondObjectContainer.h:38
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
reco::JetExtendedAssociation::Ref
edm::Ref< Container > Ref
Definition: JetExtendedAssociation.h:32
popcon::PopConSourceHandler< EcalTPGLinearizationConst >::lastPayload
Ref lastPayload() const
Definition: PopConSourceHandler.h:81
VarParsing.mult
mult
Definition: VarParsing.py:658
mps_splice.line
line
Definition: mps_splice.py:76
EcalTPGLinearizationConst
EcalTPGLinearizationConstMap EcalTPGLinearizationConst
Definition: EcalTPGLinearizationConst.h:23
popcon::EcalLaser_weekly_Linearization::kEEChannels
Definition: EcalLaser_weekly_Linearization.h:54