CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackingOfflineDQM.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TrackingMonitorClient
4 // Class: TrackingOfflineDQM
5 //
13 //
14 // Original Author: Samvel Khalatyan (ksamdev at gmail dot com)
15 // Created: Wed Oct 5 16:42:34 CET 2006
16 // $Id: TrackingOfflineDQM.cc,v 1.42 2013/01/02 17:41:51 wmtan Exp $
17 //
18 //
19 
21 
22 
27 
29 
31 
34 
36 
37 //Run Info
41 // Cabling
44 
45 #include <iostream>
46 #include <iomanip>
47 #include <stdio.h>
48 #include <string>
49 #include <sstream>
50 #include <math.h>
51 
52 
61  configPar_(pSet)
62 {
63 
64  // Action Executor
66 
67  // get back-end interface
69 
70  usedWithEDMtoMEConverter_= configPar_.getUntrackedParameter<bool>("UsedWithEDMtoMEConverter",false);
73  globalStatusFilling_ = configPar_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
74 
75 }
82 
83 }
92 
93  edm::LogInfo("BeginJobDone") << "TrackingOfflineDQM::beginJob done";
94 }
105  // std::cout << "[TrackingOfflineDQM::beginRun] .. starting" << std::endl;
106  edm::LogInfo ("BeginRun") <<"TrackingOfflineDQM:: Begining of Run";
107 
108  int nFEDs = 0;
109  int nPixelFEDs = 0;
111  if( eSetup.find( recordKey ) != 0) {
112 
113  edm::ESHandle<RunInfo> sumFED;
114  eSetup.get<RunInfoRcd>().get(sumFED);
115  if ( sumFED.isValid() ) {
116 
117  const int siStripFedIdMin = FEDNumbering::MINSiStripFEDID;
118  const int siStripFedIdMax = FEDNumbering::MAXSiStripFEDID;
119  const int siPixelFedIdMin = FEDNumbering::MINSiPixelFEDID;
120  const int siPixelFedIdMax = FEDNumbering::MAXSiPixelFEDID;
121 
122  std::vector<int> FedsInIds= sumFED->m_fed_in;
123  for ( auto fedID : FedsInIds ) {
124  if ( fedID >= siPixelFedIdMin && fedID <= siPixelFedIdMax ) {
125  ++nPixelFEDs;
126  ++nFEDs;
127  }
128  if ( fedID >= siStripFedIdMin && fedID <= siStripFedIdMax )
129  ++nFEDs;
130  }
131  }
132  }
134  allpixelFEDsFound_ = (nPixelFEDs == siPixelFedN);
135  trackerFEDsFound_ = (nFEDs > 0);
136  std::cout << "[TrackingOfflineDQM::beginRun] nPixelFEDs: " << nPixelFEDs << " ==> " << allpixelFEDsFound_ << std::endl;
137  std::cout << "[TrackingOfflineDQM::beginRun] nFEDs: " << nFEDs << " ==> " << trackerFEDsFound_ << std::endl;
138 
139  if (globalStatusFilling_ > 0) {
141  // std::cout << "[TrackingOfflineDQM::beginRun] done actionExecutor_->createStatus" << std::endl;
142  }
143 
144  // std::cout << "[TrackingOfflineDQM::beginRun] DONE" << std::endl;
145 }
158 }
166 
167  // std::cout << "[TrackingOfflineDQM::endLuminosityBlock] .. starting" << std::endl;
168 
169  edm::LogInfo("TrackingOfflineDQM") << "TrackingOfflineDQM::endLuminosityBlock";
170 
171  if (globalStatusFilling_ > 0) {
173 
176  }
177 }
185 
186  // std::cout << "[TrackingOfflineDQM::endRun] .. starting" << std::endl;
187 
188  edm::LogInfo("TrackingOfflineDQM") << "TrackingOfflineDQM::endRun";
189 
190  if (globalStatusFilling_ > 0) {
192 
193  if ( !trackerFEDsFound_ ) {
195  return;
196  } else {
198  }
199  }
200 
201  // std::cout << "[TrackingOfflineDQM::endRun] DONE" << std::endl;
202 
203 }
211 
212  // std::cout << "[TrackingOfflineDQM::endJob] .. starting" << std::endl;
213 
214  edm::LogInfo("TrackingOfflineDQM") << "TrackingOfflineDQM::endJob";
215 
217  // Save Output file
218  dqmStore_->cd();
219  dqmStore_->save(outputFileName_, "","","");
220  }
221 
222  // std::cout << "[TrackingOfflineDQM::endJob] DONE" << std::endl;
223 
224 }
232  if (inputFileName_.size() == 0) return false;
233  edm::LogInfo("TrackingOfflineDQM") << "TrackingOfflineDQM::openInputFile: Accessing root File" << inputFileName_;
234  dqmStore_->open(inputFileName_, false);
235  return true;
236 }
237 
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
BeginRun.
std::string inputFileName_
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFileName_
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:632
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void createLSStatus(DQMStore *dqm_store)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
Definition: EventSetup.cc:90
virtual ~TrackingOfflineDQM()
Destructor.
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
EndRun.
void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
Analyze.
void beginJob()
BeginJob.
TrackingActionExecutor * actionExecutor_
TrackingOfflineDQM(const edm::ParameterSet &ps)
Constructor.
void fillStatusAtLumi(DQMStore *dqm_store)
void createGlobalStatus(DQMStore *dqm_store)
const T & get() const
Definition: EventSetup.h:55
void fillGlobalStatus(DQMStore *dqm_store)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
Definition: DQMStore.cc:2485
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup)
End Of Luminosity.
bool open(const std::string &filename, bool overwrite=false, const std::string &path="", const std::string &prepend="", OpenRunDirs stripdirs=KeepRunDirs, bool fileMustExist=true)
Definition: DQMStore.cc:2840
tuple cout
Definition: gather_cfg.py:121
bool isValid() const
Definition: ESHandle.h:37
edm::ParameterSet configPar_
Definition: Run.h:41
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
Definition: HCTypeTag.cc:125
bool openInputFile()
Open Input File.