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 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 ()
 
std::string id () const
 
 ~EcalLaser_weekly_Linearization ()
 
- 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 const &logDBEntry)
 
Ref lastPayload () const
 
cond::LogDBEntry const & logDBEntry () const
 
std::pair< Container const
*, std::string const > 
operator() (const cond::persistency::Session &session, cond::TagInfo_t const &tagInfo, cond::LogDBEntry 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< TripletContainer
 
typedef std::vector< std::pair
< EcalTPGLinearizationConst
*, cond::Time_t > > 
OldContainer
 
typedef PopConSourceHandler
< EcalTPGLinearizationConst
self
 
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)
 
- Protected Attributes inherited from popcon::PopConSourceHandler< EcalTPGLinearizationConst >
OldContainer m_to_transfer
 
std::string m_userTextLog
 

Detailed Description

Definition at line 49 of file EcalLaser_weekly_Linearization.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

popcon::EcalLaser_weekly_Linearization::~EcalLaser_weekly_Linearization ( )

Definition at line 18 of file EcalLaser_weekly_Linearization.cc.

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

Definition at line 13 of file EcalLaser_weekly_Linearization.cc.

References gather_cfg::cout.

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

Member Function Documentation

void popcon::EcalLaser_weekly_Linearization::getNewObjects ( )
virtual

Implements popcon::PopConSourceHandler< EcalTPGLinearizationConst >.

Definition at line 22 of file EcalLaser_weekly_Linearization.cc.

References gather_cfg::cout, alignmentValidation::fname, i, EcalCondObjectContainer< T >::insert(), geometryCSVtoXML::line, VarParsing::mult, EcalTPGLinearizationConstant::mult_x1, EcalTPGLinearizationConstant::mult_x12, EcalTPGLinearizationConstant::mult_x6, edm::shift, EcalTPGLinearizationConstant::shift_x1, EcalTPGLinearizationConstant::shift_x12, EcalTPGLinearizationConstant::shift_x6, AlCaHLTBitMon_QueryRunRegistry::string, dumpRecoGeometry_cfg::tagInfo, and create_public_lumi_plots::week.

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

Member Data Documentation

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

Definition at line 62 of file EcalLaser_weekly_Linearization.h.

Referenced by id().