CMS 3D CMS Logo

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

#include <EcalPedestalHistory.h>

Inheritance diagram for EcalPedestalHistory:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

enum  { kChannels = 75848, kEBChannels = 61200, kEEChannels = 14648 }
 
enum  { kGains = 3, kFirstGainId = 1 }
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 EcalPedestalHistory (const edm::ParameterSet &)
 
void endJob () override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 ~EcalPedestalHistory () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

EcalCondDBInterfaceeconn
 

Private Attributes

unsigned int cnt_evt_
 
std::string ECALType_
 
unsigned int m_firstRun
 
std::string m_gentag
 
unsigned int m_lastRun
 
std::string m_location
 
std::string m_locationsource
 
std::string m_name
 
std::string m_pass
 
std::string m_sid
 
std::string m_user
 
std::vector< int > maskedChannels_
 
std::vector< int > maskedEEChannels_
 
int runnumber_
 
std::string runType_
 
unsigned int startevent_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 44 of file EcalPedestalHistory.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kChannels 
kEBChannels 
kEEChannels 

Definition at line 55 of file EcalPedestalHistory.h.

◆ anonymous enum

anonymous enum
Enumerator
kGains 
kFirstGainId 

Definition at line 56 of file EcalPedestalHistory.h.

Constructor & Destructor Documentation

◆ EcalPedestalHistory()

EcalPedestalHistory::EcalPedestalHistory ( const edm::ParameterSet iConfig)
explicit

Definition at line 51 of file EcalPedestalHistory.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

51  {
52  //====================================================================
53  //now do what ever initialization is needed
54  // EBDigiCollection_ = iConfig.getParameter<edm::InputTag>("EBDigiCollection");
55  runnumber_ = iConfig.getUntrackedParameter<int>("runnumber", -1);
56  ECALType_ = iConfig.getParameter<std::string>("ECALType");
57  runType_ = iConfig.getParameter<std::string>("runType");
58  startevent_ = iConfig.getUntrackedParameter<unsigned int>("startevent", 1);
59 
60  std::cout << "EcalPedestals Source handler constructor\n" << std::endl;
61  m_firstRun = static_cast<unsigned int>(atoi(iConfig.getParameter<std::string>("firstRun").c_str()));
62  m_lastRun = static_cast<unsigned int>(atoi(iConfig.getParameter<std::string>("lastRun").c_str()));
63  m_sid = iConfig.getParameter<std::string>("OnlineDBSID");
64  m_user = iConfig.getParameter<std::string>("OnlineDBUser");
65  m_pass = iConfig.getParameter<std::string>("OnlineDBPassword");
66  m_locationsource = iConfig.getParameter<std::string>("LocationSource");
67  m_location = iConfig.getParameter<std::string>("Location");
68  m_gentag = iConfig.getParameter<std::string>("GenTag");
69  std::cout << m_sid << "/" << m_user << "/" << m_pass << "/" << m_location << "/" << m_gentag << std::endl;
70 
71  vector<int> listDefaults;
72  listDefaults.push_back(-1);
73 
74  cnt_evt_ = 0;
75  // cout << "Exiting constructor" << endl;
76 } //constructor
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
T getUntrackedParameter(std::string const &, T const &) const

◆ ~EcalPedestalHistory()

EcalPedestalHistory::~EcalPedestalHistory ( )
override

Definition at line 79 of file EcalPedestalHistory.cc.

References gather_cfg::cout.

79  {
80  //========================================================================
81  cout << "ANALYSIS FINISHED" << endl;
82 } //destructor

Member Function Documentation

◆ analyze()

void EcalPedestalHistory::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 376 of file EcalPedestalHistory.cc.

References gather_cfg::cout, kEBChannels, and kEEChannels.

376  {
377  //========================================================================
378 
379  if (cnt_evt_ == 0) {
380  if (ECALType_ == "EB" || ECALType_ == "EA") {
381  cout << " Barrel data : nb channels " << kEBChannels << endl;
382  } else if (ECALType_ == "EE" || ECALType_ == "EA") {
383  cout << " End cap data : nb channels " << kEEChannels << endl;
384  } else {
385  cout << " strange ECALtype : " << ECALType_ << " abort " << endl;
386  return;
387  }
388  /*
389  int NbOfmaskedChannels = maskedChannels_.size();
390  cout << " Nb masked EB channels " << NbOfmaskedChannels << endl;
391  for (vector<int>::iterator iter = maskedChannels_.begin(); iter != maskedChannels_.end(); ++iter)
392  cout<< " : masked channel " << *(iter) << endl;
393  NbOfmaskedChannels = maskedEEChannels_.size();
394  cout << " Nb masked EE channels " << NbOfmaskedChannels << endl;
395  for (vector<int>::iterator iter = maskedEEChannels_.begin(); iter != maskedEEChannels_.end(); ++iter)
396  cout<< " : masked channel " << *(iter) << endl;
397  */
398  }
399  cnt_evt_++;
400 
401 } //analyze

◆ beginJob()

void EcalPedestalHistory::beginJob ( )
overridevirtual

========================================================================

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 360 of file EcalPedestalHistory.cc.

360  {
362 
363 } //beginJob

◆ beginRun()

void EcalPedestalHistory::beginRun ( edm::Run const &  ,
edm::EventSetup const &  c 
)
override

========================================================================

Definition at line 85 of file EcalPedestalHistory.cc.

References gather_cfg::cout, test_db_connect::econn, Exception, f, EcalLogicID::getID1(), EcalLogicID::getID2(), EcalLogicID::getID3(), EcalLogicID::getName(), MonPedestalsDat::getPedMeanG1(), MonPedestalsDat::getPedMeanG12(), MonPedestalsDat::getPedMeanG6(), MonPedestalsDat::getPedRMSG1(), MonPedestalsDat::getPedRMSG12(), MonPedestalsDat::getPedRMSG6(), MonRunList::getRuns(), EBDetId::hashedIndex(), EEDetId::hashedIndex(), EBDetId::ieta(), EBDetId::iphi(), EEDetId::ix(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::ix(), EEDetId::iy(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::endcap::iy(), kChannels, kEBChannels, kEEChannels, Mean, test_db_connect::my_locdef, test_db_connect::my_rundef, AlCaHLTBitMon_ParallelJobs::p, mps_fire::result, RMS, RunTag::setGeneralTag(), MonRunTag::setGeneralTag(), RunTag::setLocationDef(), MonVersionDef::setMonitoringVersion(), MonRunList::setMonRunTag(), MonRunTag::setMonVersionDef(), MonRunList::setRunTag(), RunTag::setRunTypeDef(), EBDetId::SMCRYSTALMODE, EBDetId::unhashIndex(), EEDetId::unhashIndex(), EEDetId::validDetId(), and EEDetId::zside().

85  {
87 
88  cout << "Entering beginRun" << endl;
89  /* do not use any tag...
90  edm::ESHandle<EcalChannelStatus> pChannelStatus;
91  c.get<EcalChannelStatusRcd>().get(pChannelStatus);
92  const EcalChannelStatus* chStatus = pChannelStatus.product();
93  EcalChannelStatusMap::const_iterator chit;
94  for (int iChannel = 0; iChannel < kEBChannels; iChannel++) {
95  EBDetId id = EBDetId::unhashIndex(iChannel);
96  chit = chStatus->getMap().find(id.rawId());
97  if( chit != chStatus->getMap().end() ) {
98  EcalChannelStatusCode ch_code = (*chit);
99  uint16_t statusCode = ch_code.getStatusCode() & 31;
100  if(statusCode == 1 || (statusCode > 7 && statusCode < 12))
101  maskedChannels_.push_back(iChannel);
102  }
103  }
104  for (int iChannel = 0; iChannel < kEEChannels; iChannel++) {
105  EEDetId id = EEDetId::unhashIndex(iChannel);
106  chit = chStatus->getMap().find(id.rawId());
107  if( chit != chStatus->getMap().end() ) {
108  EcalChannelStatusCode ch_code = (*chit);
109  uint16_t statusCode = ch_code.getStatusCode() & 31;
110  if(statusCode == 1 || (statusCode > 7 && statusCode < 12))
111  maskedEEChannels_.push_back(iChannel);
112  }
113  }
114  */
115  TH1F** hMean = new TH1F*[15];
116  TH1F** hRMS = new TH1F*[15];
117  TFile f("PedHist.root", "RECREATE");
118 
119  typedef struct {
120  int iChannel;
121  int ix;
122  int iy;
123  int iz;
124  } Chan_t;
125  Chan_t Chan;
126  Chan.iChannel = -1;
127  Chan.ix = -1;
128  Chan.iy = -1;
129  Chan.iz = -1;
130 
131  TTree* tPedChan = new TTree("PedChan", "Channels"); // Output tree for channels
132  tPedChan->Branch("Channels", &Chan.iChannel, "iChannel/I");
133  tPedChan->Branch("x", &Chan.ix, "ix/I");
134  tPedChan->Branch("y", &Chan.iy, "iy/I");
135  tPedChan->Branch("z", &Chan.iz, "iz/I");
136  for (int iChannel = 0; iChannel < kEBChannels; iChannel++) {
137  Chan.iChannel = iChannel;
138  EBDetId myEBDetId = EBDetId::unhashIndex(iChannel);
139  Chan.ix = myEBDetId.ieta(); // -85:-1,1:85
140  Chan.iy = myEBDetId.iphi(); // 1:360
141  Chan.iz = 0;
142  if (iChannel % 10000 == 0)
143  cout << " EB channel " << iChannel << " eta " << Chan.ix << " phi " << Chan.iy << endl;
144  tPedChan->Fill();
145  }
146  for (int iChannel = 0; iChannel < kEEChannels; iChannel++) {
147  Chan.iChannel = iChannel;
148  EEDetId myEEDetId = EEDetId::unhashIndex(iChannel);
149  Chan.ix = myEEDetId.ix();
150  Chan.iy = myEEDetId.iy();
151  Chan.iz = myEEDetId.zside();
152  if (iChannel % 1000 == 0)
153  cout << " EE channel " << iChannel << " x " << Chan.ix << " y " << Chan.iy << " z " << Chan.iz << endl;
154  tPedChan->Fill();
155  }
156  tPedChan->Write();
157  tPedChan->Print();
158 
159  typedef struct {
160  int Run;
161  double Mean[kChannels];
162  double RMS[kChannels];
163  } Ped_t;
164  Ped_t PedVal;
165  PedVal.Run = -1; // initialization
166  for (int iChannel = 0; iChannel < kChannels; iChannel++) {
167  PedVal.Mean[iChannel] = -1.;
168  PedVal.RMS[iChannel] = -1.;
169  }
170  TTree* tPedHist = new TTree("PedHist", "Pedestal History"); // Output tree for pedestal mean/rms
171  tPedHist->Branch("Pedestals", &PedVal.Run, "Run/I");
172  tPedHist->Branch("Mean", PedVal.Mean, "Mean[75848]/D");
173  tPedHist->Branch("RMS", PedVal.RMS, "RMS[75848]/D");
174 
175  // here we retrieve all the runs after the last from online DB
176  std::cout << "Retrieving run list from ONLINE DB ... " << std::endl;
178  std::cout << "Connection done" << std::endl;
179  if (!econn) {
180  std::cout << " Problem with OMDS: connection parameters " << m_sid << "/" << m_user << "/" << m_pass << std::endl;
181  throw cms::Exception("OMDS not available");
182  }
183 
184  // these are the online conditions DB classes
185  RunList my_runlist;
186  RunTag my_runtag;
189 
190  my_locdef.setLocation(m_location);
191  my_rundef.setRunType("PEDESTAL");
192  my_runtag.setLocationDef(my_locdef);
193  my_runtag.setRunTypeDef(my_rundef);
194  my_runtag.setGeneralTag(m_gentag);
195 
196  // here we retrieve the Monitoring run records
197  MonVersionDef monverdef;
198  monverdef.setMonitoringVersion("test01");
199  MonRunTag mon_tag;
200  // mon_tag.setGeneralTag("CMSSW");
201  mon_tag.setGeneralTag("CMSSW-offline-private");
202  mon_tag.setMonVersionDef(monverdef);
203  MonRunList mon_list;
204  mon_list.setMonRunTag(mon_tag);
205  mon_list.setRunTag(my_runtag);
206  // mon_list=econn->fetchMonRunList(my_runtag, mon_tag);
207  unsigned int min_run = 0, max_since = 0;
208  if (m_firstRun < max_since) {
209  min_run = max_since + 1; // we have to add 1 to the last transferred one
210  } else {
211  min_run = m_firstRun;
212  }
213 
214  unsigned int max_run = m_lastRun;
215  mon_list = econn->fetchMonRunList(my_runtag, mon_tag, min_run, max_run);
216 
217  std::vector<MonRunIOV> mon_run_vec = mon_list.getRuns();
218  int mon_runs = mon_run_vec.size();
219  std::cout << "number of Mon runs is : " << mon_runs << std::endl;
220 
221  if (mon_runs > 0) {
222  int NbChan = 0;
223  for (int iChannel = 0; iChannel < kEBChannels; iChannel++) {
224  if (iChannel % 10000 == 1) {
225  hMean[NbChan] = new TH1F(Form("Mean_%i", NbChan), Form("Mean EB %i", iChannel), mon_runs, 0., mon_runs);
226  hRMS[NbChan] = new TH1F(Form("RMS_%i", NbChan), Form("RMS EB %i", iChannel), mon_runs, 0., mon_runs);
227  NbChan++;
228  }
229  }
230  for (int iChannel = 0; iChannel < kEEChannels; iChannel++) {
231  if (iChannel % 2000 == 1) {
232  hMean[NbChan] = new TH1F(Form("Mean_%i", NbChan), Form("Mean EE %i", iChannel), mon_runs, 0., mon_runs);
233  hRMS[NbChan] = new TH1F(Form("RMS_%i", NbChan), Form("RMS EE %i", iChannel), mon_runs, 0., mon_runs);
234  NbChan++;
235  }
236  }
237 
238  // int krmax = std::min(mon_runs, 30);
239  int krmax = mon_runs;
240  for (int kr = 0; kr < krmax; kr++) {
241  std::cout << "-kr------: " << kr << std::endl;
242 
243  unsigned int irun = static_cast<unsigned int>(mon_run_vec[kr].getRunIOV().getRunNumber());
244  std::cout << "retrieve the data for run number: " << irun << std::endl;
245  if (mon_run_vec[kr].getSubRunNumber() <= 1) {
246  // retrieve the data for a given run
247  RunIOV runiov_prime = mon_run_vec[kr].getRunIOV();
248  // retrieve the pedestals from OMDS for this run
249  std::map<EcalLogicID, MonPedestalsDat> dataset_mon;
250  econn->fetchDataSet(&dataset_mon, &mon_run_vec[kr]);
251  std::cout << "OMDS record for run " << irun << " is made of " << dataset_mon.size() << std::endl;
252  int nEB = 0, nEE = 0;
253  typedef std::map<EcalLogicID, MonPedestalsDat>::const_iterator CImon;
254  EcalLogicID ecid_xt;
255  MonPedestalsDat rd_ped;
256 
257  // this to validate ...
258  int nbad = 0;
259  for (CImon p = dataset_mon.begin(); p != dataset_mon.end(); p++) {
260  ecid_xt = p->first;
261  rd_ped = p->second;
262  int sm_num = ecid_xt.getID1();
263  int xt_num = ecid_xt.getID2();
264  int yt_num = ecid_xt.getID3();
265 
266  //checkPedestal
267  bool result = true;
268  if (rd_ped.getPedRMSG12() > 3 || rd_ped.getPedRMSG12() <= 0 || rd_ped.getPedRMSG6() > 2 ||
269  rd_ped.getPedRMSG12() <= 0 || rd_ped.getPedRMSG1() > 1 || rd_ped.getPedRMSG1() <= 0 ||
270  rd_ped.getPedMeanG12() > 300 || rd_ped.getPedMeanG12() <= 100 || rd_ped.getPedMeanG6() > 300 ||
271  rd_ped.getPedMeanG6() <= 100 || rd_ped.getPedMeanG1() > 300 || rd_ped.getPedMeanG6() <= 100)
272  result = false;
273 
274  // here we check and count how many bad channels we have
275  if (!result) {
276  nbad++;
277  if (nbad < 10)
278  std::cout << "BAD LIST: channel " << sm_num << "/" << xt_num << "/" << yt_num << "ped/rms "
279  << rd_ped.getPedMeanG12() << "/" << rd_ped.getPedRMSG12() << std::endl;
280  }
281  if (ecid_xt.getName() == "EB_crystal_number") {
282  nEB++;
283  } else {
284  nEE++;
285  }
286  } // end loop over pedestal data
287  // ok or bad? A bad run is for more than 5% bad channels
288 
289  // if(nbad<(dataset_mon.size()*0.1)){
290  if (nbad < (dataset_mon.size() * 0.05) &&
291  (nEB > 10200 || nEE > 2460)) { // this is good run, fill histo and tree
292  PedVal.Run = irun;
293  int NbChan = 0;
294  for (CImon p = dataset_mon.begin(); p != dataset_mon.end(); p++) {
295  ecid_xt = p->first;
296  rd_ped = p->second;
297  int sm_num = ecid_xt.getID1();
298  int xt_num = ecid_xt.getID2();
299  int yt_num = ecid_xt.getID3();
300 
301  if (ecid_xt.getName() == "EB_crystal_number") { // Barrel
302  EBDetId ebdetid(sm_num, xt_num, EBDetId::SMCRYSTALMODE);
303  int iChannel = ebdetid.hashedIndex();
304  if (iChannel < 0 || iChannel > 61200)
305  cout << " SM " << sm_num << " Chan in SM " << xt_num << " IChannel " << iChannel << endl;
306  if (iChannel % 10000 == 1) {
307  hMean[NbChan]->Fill(kr, rd_ped.getPedMeanG12());
308  hRMS[NbChan]->Fill(kr, rd_ped.getPedRMSG12());
309  NbChan++;
310  }
311  PedVal.Mean[iChannel] = rd_ped.getPedMeanG12();
312  PedVal.RMS[iChannel] = rd_ped.getPedRMSG12();
313  if (iChannel % 10000 == 0)
314  cout << " channel " << iChannel << " mean " << PedVal.Mean[iChannel] << " RMS " << PedVal.RMS[iChannel]
315  << endl;
316  } else { // Endcaps
317  if (EEDetId::validDetId(xt_num, yt_num, sm_num)) {
318  EEDetId eedetid(xt_num, yt_num, sm_num);
319  int iChannel = eedetid.hashedIndex();
320  if (iChannel < 0 || iChannel > 14648)
321  cout << " x " << sm_num << " y " << xt_num << " z " << yt_num << " IChannel " << iChannel << endl;
322  if (iChannel % 2000 == 1) {
323  hMean[NbChan]->Fill(kr, rd_ped.getPedMeanG12());
324  hRMS[NbChan]->Fill(kr, rd_ped.getPedRMSG12());
325  NbChan++;
326  }
327  int iChanEE = kEBChannels + iChannel;
328  // cout << " channel EE " << iChanEE << endl;
329  PedVal.Mean[iChanEE] = rd_ped.getPedMeanG12();
330  PedVal.RMS[iChanEE] = rd_ped.getPedRMSG12();
331  } // valid ee Id
332  } // Endcaps
333  } // loop over channels
334  tPedHist->Fill();
335  cout << " We got a good run " << irun << endl;
336  } // good run
337  } // mon_run_vec
338  } // loop over all runs
339  } // number of runs > 0
340  cout << "Exiting beginRun" << endl;
341  for (int NbChan = 0; NbChan < 15; NbChan++) {
342  if (hMean[NbChan]->GetEntries() > 0.) { // save only when filled!
343  hMean[NbChan]->Write();
344  hRMS[NbChan]->Write();
345  }
346  }
347  tPedHist->Write();
348  tPedHist->Print();
349  f.Close();
350 
351 } //beginRun
void setRunTypeDef(const RunTypeDef &runTypeDef)
Definition: RunTag.cc:42
int getID1() const
Definition: EcalLogicID.cc:30
std::string getName() const
Definition: EcalLogicID.cc:26
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
Definition: RunTag.h:13
int getID2() const
Definition: EcalLogicID.cc:32
int ix() const
Definition: EEDetId.h:77
float getPedRMSG6() const
MonRunList fetchMonRunList(const RunTag &tag, const MonRunTag &monruntag) noexcept(false)
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
void setGeneralTag(std::string tag)
Definition: MonRunTag.cc:21
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
float getPedRMSG1() const
void setRunTag(const RunTag &tag)
Definition: MonRunList.cc:18
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
float getPedMeanG1() const
float getPedMeanG6() const
double f[11][100]
void setMonVersionDef(const MonVersionDef &ver)
Definition: MonRunTag.cc:30
float getPedRMSG12() const
void setLocationDef(const LocationDef &locDef)
Definition: RunTag.cc:33
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
std::vector< MonRunIOV > getRuns()
Definition: MonRunList.cc:32
int zside() const
Definition: EEDetId.h:71
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
void setMonRunTag(const MonRunTag &tag)
Definition: MonRunList.cc:23
float getPedMeanG12() const
void setMonitoringVersion(std::string ver)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
int getID3() const
Definition: EcalLogicID.cc:34
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
void setGeneralTag(std::string tag)
Definition: RunTag.cc:24
static const int SMCRYSTALMODE
Definition: EBDetId.h:159
Definition: RunIOV.h:13
int iy() const
Definition: EEDetId.h:83
EcalCondDBInterface * econn

◆ endJob()

void EcalPedestalHistory::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 366 of file EcalPedestalHistory.cc.

366  {
367  //========================================================================
368 
369 } //endJob

◆ endRun()

void EcalPedestalHistory::endRun ( edm::Run const &  ,
edm::EventSetup const &  c 
)
override

Definition at line 354 of file EcalPedestalHistory.cc.

354  {
355  //========================================================================
356 
357 } //endRun

Member Data Documentation

◆ cnt_evt_

unsigned int EcalPedestalHistory::cnt_evt_
private

Definition at line 60 of file EcalPedestalHistory.h.

◆ ECALType_

std::string EcalPedestalHistory::ECALType_
private

Definition at line 61 of file EcalPedestalHistory.h.

◆ econn

EcalCondDBInterface* EcalPedestalHistory::econn

Definition at line 53 of file EcalPedestalHistory.h.

◆ m_firstRun

unsigned int EcalPedestalHistory::m_firstRun
private

Definition at line 66 of file EcalPedestalHistory.h.

◆ m_gentag

std::string EcalPedestalHistory::m_gentag
private

Definition at line 69 of file EcalPedestalHistory.h.

◆ m_lastRun

unsigned int EcalPedestalHistory::m_lastRun
private

Definition at line 67 of file EcalPedestalHistory.h.

◆ m_location

std::string EcalPedestalHistory::m_location
private

Definition at line 68 of file EcalPedestalHistory.h.

◆ m_locationsource

std::string EcalPedestalHistory::m_locationsource
private

Definition at line 73 of file EcalPedestalHistory.h.

◆ m_name

std::string EcalPedestalHistory::m_name
private

Definition at line 74 of file EcalPedestalHistory.h.

◆ m_pass

std::string EcalPedestalHistory::m_pass
private

Definition at line 72 of file EcalPedestalHistory.h.

◆ m_sid

std::string EcalPedestalHistory::m_sid
private

Definition at line 70 of file EcalPedestalHistory.h.

◆ m_user

std::string EcalPedestalHistory::m_user
private

Definition at line 71 of file EcalPedestalHistory.h.

◆ maskedChannels_

std::vector<int> EcalPedestalHistory::maskedChannels_
private

Definition at line 64 of file EcalPedestalHistory.h.

◆ maskedEEChannels_

std::vector<int> EcalPedestalHistory::maskedEEChannels_
private

Definition at line 65 of file EcalPedestalHistory.h.

◆ runnumber_

int EcalPedestalHistory::runnumber_
private

Definition at line 59 of file EcalPedestalHistory.h.

◆ runType_

std::string EcalPedestalHistory::runType_
private

Definition at line 62 of file EcalPedestalHistory.h.

◆ startevent_

unsigned int EcalPedestalHistory::startevent_
private

Definition at line 63 of file EcalPedestalHistory.h.