CMS 3D CMS Logo

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

#include <BeamMonitor.h>

Inheritance diagram for BeamMonitor:
edm::EDAnalyzer

Public Member Functions

 BeamMonitor (const edm::ParameterSet &)
 
 ~BeamMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 
void endJob (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &r, const edm::EventSetup &c)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

void FitAndFill (const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
 
const char * formatFitTime (const std::time_t &)
 
void RestartFitting ()
 
void scrollTH1 (TH1 *, std::time_t)
 
bool testScroll (std::time_t &, std::time_t &)
 

Private Attributes

int beginLumiOfBSFit_
 
int beginLumiOfPVFit_
 
edm::InputTag bsSrc_
 
int countEvt_
 
int countGapLumi_
 
int countLumi_
 
MonitorElementcutFlowTable
 
DQMStoredbe_
 
bool debug_
 
double deltaSigCut_
 
int endLumiOfBSFit_
 
int endLumiOfPVFit_
 
int firstAverageFit_
 
int fitNLumi_
 
int fitPVNLumi_
 
MonitorElementfitResults
 
int frun
 
edm::TimeValue_t ftimestamp
 
MonitorElementh_d0_phi0
 
MonitorElementh_nTrk_lumi
 
MonitorElementh_nVtx
 
MonitorElementh_nVtx_st
 
MonitorElementh_PVx [2]
 
MonitorElementh_PVxz
 
MonitorElementh_PVy [2]
 
MonitorElementh_PVyz
 
MonitorElementh_PVz [2]
 
MonitorElementh_sigmaX0
 
MonitorElementh_sigmaY0
 
MonitorElementh_sigmaZ0
 
MonitorElementh_trk_z0
 
MonitorElementh_trkPt
 
MonitorElementh_trkVz
 
MonitorElementh_vx_dz
 
MonitorElementh_vx_vy
 
MonitorElementh_vy_dz
 
MonitorElementh_x0
 
MonitorElementh_y0
 
MonitorElementh_z0
 
edm::InputTag hltSrc_
 
std::map< TString,
MonitorElement * > 
hs
 
int intervalInSec_
 
std::vector< std::string > jetTrigger_
 
int lastlumi_
 
int lastNZbin
 
std::map< int, int > mapBeginBSLS
 
std::map< int, std::time_t > mapBeginBSTime
 
std::map< int, int > mapBeginPVLS
 
std::map< int, std::time_t > mapBeginPVTime
 
std::map< int, std::size_t > mapLSBSTrkSize
 
std::map< int, TH1F > mapLSCF
 
std::map< int, size_t > mapLSPVStoreSize
 
std::map< int, std::vector< int > > mapNPV
 
std::map< int, std::vector
< float > > 
mapPVx
 
std::map< int, std::vector
< float > > 
mapPVy
 
std::map< int, std::vector
< float > > 
mapPVz
 
double maxZ_
 
unsigned int min_Ntrks_
 
unsigned int minNrVertices_
 
double minVtxNdf_
 
double minVtxWgt_
 
std::string monitorName_
 
int nextlumi_
 
int nFitElements_
 
int nFits_
 
unsigned int nthBSTrk_
 
bool onlineMode_
 
edm::ParameterSet parameters_
 
reco::BeamSpot preBS
 
bool processed_
 
MonitorElementpvResults
 
edm::InputTag pvSrc_
 
reco::BeamSpot refBS
 
std::time_t refBStime [2]
 
std::time_t refPVtime [2]
 
std::time_t refTime
 
MonitorElementreportSummary
 
Float_t reportSummary_
 
MonitorElementreportSummaryContents [3]
 
MonitorElementreportSummaryMap
 
int resetFitNLumi_
 
bool resetHistos_
 
int resetPVNLumi_
 
bool StartAverage_
 
std::time_t startTime
 
Float_t summaryContent_ [3]
 
Float_t summarySum_
 
BeamFittertheBeamFitter
 
std::time_t tmpTime
 
edm::InputTag tracksLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 30 of file BeamMonitor.h.

Constructor & Destructor Documentation

BeamMonitor::BeamMonitor ( const edm::ParameterSet ps)

Definition at line 77 of file BeamMonitor.cc.

References beginLumiOfBSFit_, beginLumiOfPVFit_, bsSrc_, dbe_, debug_, deltaSigCut_, endLumiOfBSFit_, endLumiOfPVFit_, fitNLumi_, fitPVNLumi_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltSrc_, intervalInSec_, jetTrigger_, lastlumi_, maxZ_, min_Ntrks_, minNrVertices_, minVtxNdf_, minVtxWgt_, monitorName_, nextlumi_, nFits_, onlineMode_, cppFunctionSkipper::operator, parameters_, processed_, pvSrc_, refBStime, refPVtime, resetFitNLumi_, BeamFitter::resetLSRange(), BeamFitter::resetPVFitter(), resetPVNLumi_, BeamFitter::resetRefTime(), BeamFitter::resetTrkVector(), theBeamFitter, and tracksLabel_.

77  :
79 
80  parameters_ = ps;
81  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName");
84  hltSrc_ = parameters_.getParameter<InputTag>("hltResults");
85  intervalInSec_ = parameters_.getUntrackedParameter<int>("timeInterval",920);//40 LS X 23"
86  fitNLumi_ = parameters_.getUntrackedParameter<int>("fitEveryNLumi",-1);
87  resetFitNLumi_ = parameters_.getUntrackedParameter<int>("resetEveryNLumi",-1);
88  fitPVNLumi_ = parameters_.getUntrackedParameter<int>("fitPVEveryNLumi",-1);
89  resetPVNLumi_ = parameters_.getUntrackedParameter<int>("resetPVEveryNLumi",-1);
90  deltaSigCut_ = parameters_.getUntrackedParameter<double>("deltaSignificanceCut",15);
91  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
92  onlineMode_ = parameters_.getUntrackedParameter<bool>("OnlineMode");
93  jetTrigger_ = parameters_.getUntrackedParameter<std::vector<std::string> >("jetTrigger");
94  tracksLabel_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<InputTag>("TrackCollection");
95  min_Ntrks_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumInputTracks");
96  maxZ_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumZ");
97  minNrVertices_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minNrVerticesForFit");
98  minVtxNdf_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexNdf");
99  minVtxWgt_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexMeanWeight");
100 
102 
103  if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ;
104 
110 
111  if (fitNLumi_ <= 0) fitNLumi_ = 1;
113  refBStime[0] = refBStime[1] = refPVtime[0] = refPVtime[1] = 0;
114  maxZ_ = std::fabs(maxZ_);
115  lastlumi_ = 0;
116  nextlumi_ = 0;
117  processed_ = false;
118 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minNrVertices_
Definition: BeamMonitor.h:98
int nFitElements_
Definition: BeamMonitor.h:93
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
int endLumiOfPVFit_
Definition: BeamMonitor.h:87
int resetFitNLumi_
Definition: BeamMonitor.h:72
double minVtxWgt_
Definition: BeamMonitor.h:100
double minVtxNdf_
Definition: BeamMonitor.h:99
bool processed_
Definition: BeamMonitor.h:107
void resetTrkVector()
Definition: BeamFitter.h:48
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:77
int fitPVNLumi_
Definition: BeamMonitor.h:71
edm::InputTag bsSrc_
Definition: BeamMonitor.h:65
int intervalInSec_
Definition: BeamMonitor.h:74
int countGapLumi_
Definition: BeamMonitor.h:105
int endLumiOfBSFit_
Definition: BeamMonitor.h:85
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
void resetLSRange()
Definition: BeamFitter.h:50
DQMStore * dbe_
Definition: BeamMonitor.h:79
double maxZ_
Definition: BeamMonitor.h:97
edm::InputTag hltSrc_
Definition: BeamMonitor.h:68
edm::InputTag pvSrc_
Definition: BeamMonitor.h:67
bool StartAverage_
Definition: BeamMonitor.h:103
int beginLumiOfPVFit_
Definition: BeamMonitor.h:86
int resetPVNLumi_
Definition: BeamMonitor.h:73
edm::ParameterSet parameters_
Definition: BeamMonitor.h:63
void resetPVFitter()
Definition: BeamFitter.h:64
unsigned int nthBSTrk_
Definition: BeamMonitor.h:92
unsigned int min_Ntrks_
Definition: BeamMonitor.h:96
bool resetHistos_
Definition: BeamMonitor.h:102
double deltaSigCut_
Definition: BeamMonitor.h:95
int firstAverageFit_
Definition: BeamMonitor.h:104
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80
int beginLumiOfBSFit_
Definition: BeamMonitor.h:84
std::string monitorName_
Definition: BeamMonitor.h:64
edm::InputTag tracksLabel_
Definition: BeamMonitor.h:66
int countLumi_
Definition: BeamMonitor.h:83
bool onlineMode_
Definition: BeamMonitor.h:76
void resetRefTime()
Definition: BeamFitter.h:51
BeamMonitor::~BeamMonitor ( )

Definition at line 121 of file BeamMonitor.cc.

References theBeamFitter.

121  {
122  delete theBeamFitter;
123 }
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80

Member Function Documentation

void BeamMonitor::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

Implements edm::EDAnalyzer.

Definition at line 544 of file BeamMonitor.cc.

References DQMStore::book1D(), bsSrc_, countEvt_, countLumi_, cutFlowTable, dbe_, MonitorElement::Fill(), newFWLiteAna::found, edm::Event::getByLabel(), BeamFitter::getCutFlow(), MonitorElement::getName(), MonitorElement::getTH1(), h_nVtx, h_nVtx_st, h_PVx, h_PVxz, h_PVy, h_PVyz, h_PVz, h_trkPt, h_trkVz, hltSrc_, i, jetTrigger_, edm::EventBase::luminosityBlock(), mapNPV, mapPVx, mapPVy, mapPVz, minVtxNdf_, minVtxWgt_, monitorName_, n, nextlumi_, onlineMode_, processed_, edm::Handle< T >::product(), pvSrc_, BeamFitter::readEvent(), refBS, resetFitNLumi_, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), StartAverage_, lumiQTWidget::t, theBeamFitter, testEve_cfg::tracks, tracksLabel_, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), edm::Event::triggerNames(), patRefSel_triggerSelection_cff::triggerResults, and trigNames.

545  {
546  const int nthlumi = iEvent.luminosityBlock();
547  if (onlineMode_ && (nthlumi < nextlumi_)) {
548  edm::LogInfo("BeamMonitor") << "analyze:: Spilt event from previous lumi section!" << std::endl;
549  return;
550  }
551  if (onlineMode_ && (nthlumi > nextlumi_)) {
552  edm::LogInfo("BeamMonitor") << "analyze:: Spilt event from next lumi section!!!" << std::endl;
553  return;
554  }
555 
556  countEvt_++;
557  theBeamFitter->readEvent(iEvent); //Remember when track fitter read the event in the same place the PVFitter read the events !!!!!!!!!
558 
559  Handle<reco::BeamSpot> recoBeamSpotHandle;
560  iEvent.getByLabel(bsSrc_,recoBeamSpotHandle);
561  refBS = *recoBeamSpotHandle;
562 
564 
565  //------Cut Flow Table filled every event!--------------------------------------
566  std::string cutFlowTableName = cutFlowTable->getName();
567  // Make a copy of the cut flow table from the beam fitter.
568  TH1F * tmphisto =
569  static_cast<TH1F*>((theBeamFitter->getCutFlow())->Clone("tmphisto"));
570  cutFlowTable->getTH1()->SetBins(
571  tmphisto->GetNbinsX(),
572  tmphisto->GetXaxis()->GetXmin(),
573  tmphisto->GetXaxis()->GetXmax());
574  // Update the bin labels
575  if (countEvt_ == 1) // SetLabel just once
576  for(int n=0; n < tmphisto->GetNbinsX(); n++)
577  cutFlowTable->setBinLabel(n+1,tmphisto->GetXaxis()->GetBinLabel(n+1),1);
578  cutFlowTable = dbe_->book1D(cutFlowTableName, tmphisto);
579 
580  //----Reco tracks -------------------------------------
582  iEvent.getByLabel(tracksLabel_, TrackCollection);
583  const reco::TrackCollection *tracks = TrackCollection.product();
584  for ( reco::TrackCollection::const_iterator track = tracks->begin();
585  track != tracks->end(); ++track ) {
586  h_trkPt->Fill(track->pt()); //no need to change here for average bs
587  h_trkVz->Fill(track->vz());
588  }
589 
590  //-------HLT Trigger --------------------------------
592  bool JetTrigPass= false;
593  if(iEvent.getByLabel(hltSrc_, triggerResults)){
594  const edm::TriggerNames & trigNames = iEvent.triggerNames(*triggerResults);
595  for (unsigned int i=0; i< triggerResults->size(); i++){
596  std::string trigName = trigNames.triggerName(i);
597 
598  if(JetTrigPass) continue;
599 
600  for(size_t t=0; t <jetTrigger_.size(); ++t){
601 
602  if(JetTrigPass) continue;
603 
604  string string_search (jetTrigger_[t]);
605  size_t found = trigName.find(string_search);
606 
607  if(found != string::npos){
608  int thisTrigger_ = trigNames.triggerIndex(trigName);
609  if(triggerResults->accept(thisTrigger_))JetTrigPass = true;
610  }//if trigger found
611  }//for(t=0;..)
612  }//for(i=0; ..)
613  }//if trigger colleciton exist)
614 
615  //------ Primary Vertices-------
617 
618  if (iEvent.getByLabel(pvSrc_, PVCollection )) {
619  int nPVcount = 0;
620  int nPVcount_ST =0; //For Single Trigger(hence ST)
621 
622  for (reco::VertexCollection::const_iterator pv = PVCollection->begin(); pv != PVCollection->end(); ++pv) {
623  //--- vertex selection
624  if (pv->isFake() || pv->tracksSize()==0) continue;
625  nPVcount++; // count non fake pv:
626 
627  if(JetTrigPass)nPVcount_ST++; //non-fake pv with a specific trigger
628 
629  if (pv->ndof() < minVtxNdf_ || (pv->ndof()+3.)/pv->tracksSize() < 2*minVtxWgt_) continue;
630 
631  //Fill this map to store xyx for pv so that later we can remove the first one for run aver
632  mapPVx[countLumi_].push_back(pv->x());
633  mapPVy[countLumi_].push_back(pv->y());
634  mapPVz[countLumi_].push_back(pv->z());
635 
636  if(!StartAverage_){//for first N LS
637  h_PVx[0]->Fill(pv->x());
638  h_PVy[0]->Fill(pv->y());
639  h_PVz[0]->Fill(pv->z());
640  h_PVxz->Fill(pv->z(),pv->x());
641  h_PVyz->Fill(pv->z(),pv->y());
642  }//for first N LiS
643  else{
644  h_PVxz->Fill(pv->z(),pv->x());
645  h_PVyz->Fill(pv->z(),pv->y());}
646 
647  }//loop over pvs
648 
649 
650  h_nVtx->Fill(nPVcount*1.); //no need to change it for average BS
651 
652  mapNPV[countLumi_].push_back((nPVcount_ST));
653 
654  if(!StartAverage_){ h_nVtx_st->Fill(nPVcount_ST*1.);}
655 
656  }//if pv collection is availaable
657 
658 
659  if(StartAverage_)
660  {
661  map<int, std::vector<float> >::iterator itpvx=mapPVx.begin();
662  map<int, std::vector<float> >::iterator itpvy=mapPVy.begin();
663  map<int, std::vector<float> >::iterator itpvz=mapPVz.begin();
664 
665  map<int, std::vector<int> >::iterator itbspvinfo=mapNPV.begin();
666 
667  if( (int)mapPVx.size() > resetFitNLumi_){ //sometimes the events is not there but LS is there!
668  mapPVx.erase(itpvx);
669  mapPVy.erase(itpvy);
670  mapPVz.erase(itpvz);
671  mapNPV.erase(itbspvinfo);
672  }//loop over Last N lumi collected
673 
674  }//StartAverage==true
675 
676  processed_ = true;
677 }
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
int resetFitNLumi_
Definition: BeamMonitor.h:72
MonitorElement * h_nVtx
Definition: BeamMonitor.h:131
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
double minVtxWgt_
Definition: BeamMonitor.h:100
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:160
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:135
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:142
MonitorElement * h_PVxz
Definition: BeamMonitor.h:136
double minVtxNdf_
Definition: BeamMonitor.h:99
bool processed_
Definition: BeamMonitor.h:107
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:77
void readEvent(const edm::Event &iEvent)
Definition: BeamFitter.cc:223
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:142
void Fill(long long x)
edm::InputTag bsSrc_
Definition: BeamMonitor.h:65
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:143
int iEvent
Definition: GenABIO.cc:243
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
MonitorElement * h_PVyz
Definition: BeamMonitor.h:137
reco::BeamSpot refBS
Definition: BeamMonitor.h:112
TH1 * getTH1(void) const
DQMStore * dbe_
Definition: BeamMonitor.h:79
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:75
edm::InputTag hltSrc_
Definition: BeamMonitor.h:68
edm::InputTag pvSrc_
Definition: BeamMonitor.h:67
bool StartAverage_
Definition: BeamMonitor.h:103
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:132
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:134
tuple tracks
Definition: testEve_cfg.py:39
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
T const * product() const
Definition: Handle.h:74
TH1F * getCutFlow()
Definition: BeamFitter.h:92
MonitorElement * h_trkPt
Definition: BeamMonitor.h:122
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:133
MonitorElement * h_trkVz
Definition: BeamMonitor.h:123
std::string monitorName_
Definition: BeamMonitor.h:64
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:142
edm::InputTag tracksLabel_
Definition: BeamMonitor.h:66
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
int countLumi_
Definition: BeamMonitor.h:83
bool onlineMode_
Definition: BeamMonitor.h:76
void BeamMonitor::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 127 of file BeamMonitor.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookFloat(), DQMStore::bookProfile(), cutFlowTable, pyrootRender::da, dbe_, jptDQMConfig_cff::dzMax, jptDQMConfig_cff::dzMin, MonitorElement::Fill(), fitResults, DQMStore::get(), MonitorElement::getName(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTH2F(), h_d0_phi0, h_nTrk_lumi, h_nVtx, h_nVtx_st, h_PVx, h_PVxz, h_PVy, h_PVyz, h_PVz, h_sigmaX0, h_sigmaY0, h_sigmaZ0, h_trk_z0, h_trkPt, h_trkVz, h_vx_dz, h_vx_vy, h_vy_dz, h_x0, h_y0, h_z0, interpolateCardsSimple::histo, hs, i, intervalInSec_, diffTwoXMLs::label, monitorName_, n, nFitElements_, AlCaHLTBitMon_ParallelJobs::options, parameters_, jptDQMConfig_cff::phiMax, jptDQMConfig_cff::phiMin, pvResults, DQMStore::removeElement(), reportSummary, reportSummaryContents, reportSummaryMap, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and summaryContent_.

127  {
128 
129 
130  // book some histograms here
131  const int dxBin = parameters_.getParameter<int>("dxBin");
132  const double dxMin = parameters_.getParameter<double>("dxMin");
133  const double dxMax = parameters_.getParameter<double>("dxMax");
134 
135  const int vxBin = parameters_.getParameter<int>("vxBin");
136  const double vxMin = parameters_.getParameter<double>("vxMin");
137  const double vxMax = parameters_.getParameter<double>("vxMax");
138 
139  const int phiBin = parameters_.getParameter<int>("phiBin");
140  const double phiMin = parameters_.getParameter<double>("phiMin");
141  const double phiMax = parameters_.getParameter<double>("phiMax");
142 
143  const int dzBin = parameters_.getParameter<int>("dzBin");
144  const double dzMin = parameters_.getParameter<double>("dzMin");
145  const double dzMax = parameters_.getParameter<double>("dzMax");
146 
147  // create and cd into new folder
149 
150  h_nTrk_lumi=dbe_->book1D("nTrk_lumi","Num. of selected tracks vs lumi",20,0.5,20.5);
151  h_nTrk_lumi->setAxisTitle("Lumisection",1);
152  h_nTrk_lumi->setAxisTitle("Num of Tracks",2);
153 
154  h_d0_phi0 = dbe_->bookProfile("d0_phi0","d_{0} vs. #phi_{0} (Selected Tracks)",phiBin,phiMin,phiMax,dxBin,dxMin,dxMax,"");
155  h_d0_phi0->setAxisTitle("#phi_{0} (rad)",1);
156  h_d0_phi0->setAxisTitle("d_{0} (cm)",2);
157 
158  h_vx_vy = dbe_->book2D("trk_vx_vy","Vertex (PCA) position of selected tracks",vxBin,vxMin,vxMax,vxBin,vxMin,vxMax);
159  h_vx_vy->getTH2F()->SetOption("COLZ");
160  // h_vx_vy->getTH1()->SetBit(TH1::kCanRebin);
161  h_vx_vy->setAxisTitle("x coordinate of input track at PCA (cm)",1);
162  h_vx_vy->setAxisTitle("y coordinate of input track at PCA (cm)",2);
163 
164  TDatime *da = new TDatime();
165  gStyle->SetTimeOffset(da->Convert(kTRUE));
166 
167  const int nvar_ = 6;
168  string coord[nvar_] = {"x","y","z","sigmaX","sigmaY","sigmaZ"};
169  string label[nvar_] = {"x_{0} (cm)","y_{0} (cm)","z_{0} (cm)",
170  "#sigma_{X_{0}} (cm)","#sigma_{Y_{0}} (cm)","#sigma_{Z_{0}} (cm)"};
171  for (int i = 0; i < 4; i++) {
173  for (int ic=0; ic<nvar_; ++ic) {
174  TString histName(coord[ic]);
175  TString histTitle(coord[ic]);
176  string ytitle(label[ic]);
177  string xtitle("");
178  string options("E1");
179  bool createHisto = true;
180  switch(i) {
181  case 1: // BS vs time
182  histName += "0_time";
183  xtitle = "Time [UTC]";
184  if (ic < 3)
185  histTitle += " coordinate of beam spot vs time (Fit)";
186  else
187  histTitle = histTitle.Insert(5," ") + " of beam spot vs time (Fit)";
188  break;
189  case 2: // PV vs lumi
190  if (ic < 3) {
191  dbe_->setCurrentFolder(monitorName_+"PrimaryVertex");
192  histName.Insert(0,"PV");
193  histName += "_lumi";
194  histTitle.Insert(0,"Avg. ");
195  histTitle += " position of primary vtx vs lumi";
196  xtitle = "Lumisection";
197  ytitle.insert(0,"PV");
198  ytitle += " #pm #sigma_{PV";
199  ytitle += coord[ic];
200  ytitle += "} (cm)";
201  }
202  else createHisto = false;
203  break;
204  case 3: // PV vs time
205  if (ic < 3) {
206  dbe_->setCurrentFolder(monitorName_+"PrimaryVertex");
207  histName.Insert(0,"PV");
208  histName += "_time";
209  histTitle.Insert(0,"Avg. ");
210  histTitle += " position of primary vtx vs time";
211  xtitle = "Time [UTC]";
212  ytitle.insert(0,"PV");
213  ytitle += " #pm #sigma_{PV";
214  ytitle += coord[ic];
215  ytitle += "} (cm)";
216  }
217  else createHisto = false;
218  break;
219  default: // BS vs lumi
220  histName += "0_lumi";
221  xtitle = "Lumisection";
222  if (ic < 3)
223  histTitle += " coordinate of beam spot vs lumi (Fit)";
224  else
225  histTitle = histTitle.Insert(5," ") + " of beam spot vs lumi (Fit)";
226  break;
227  }
228  if (createHisto) {
229  edm::LogInfo("BeamMonitor") << "hitsName = " << histName << "; histTitle = " << histTitle << std::endl;
230  hs[histName] = dbe_->book1D(histName,histTitle,40,0.5,40.5);
231  hs[histName]->setAxisTitle(xtitle,1);
232  hs[histName]->setAxisTitle(ytitle,2);
233  hs[histName]->getTH1()->SetOption("E1");
234  if (histName.Contains("time")) {
235  //int nbins = (intervalInSec_/23 > 0 ? intervalInSec_/23 : 40);
236  hs[histName]->getTH1()->SetBins(intervalInSec_,0.5,intervalInSec_+0.5);
237  hs[histName]->setAxisTimeDisplay(1);
238  hs[histName]->setAxisTimeFormat("%H:%M:%S",1);
239  }
240  histName += "_all";
241  histTitle += " all";
242  hs[histName] = dbe_->book1D(histName,histTitle,40,0.5,40.5);
243  hs[histName]->getTH1()->SetBit(TH1::kCanRebin);
244  hs[histName]->setAxisTitle(xtitle,1);
245  hs[histName]->setAxisTitle(ytitle,2);
246  hs[histName]->getTH1()->SetOption("E1");
247  if (histName.Contains("time")) {
248  //int nbins = (intervalInSec_/23 > 0 ? intervalInSec_/23 : 40);
249  hs[histName]->getTH1()->SetBins(intervalInSec_,0.5,intervalInSec_+0.5);
250  hs[histName]->setAxisTimeDisplay(1);
251  hs[histName]->setAxisTimeFormat("%H:%M:%S",1);
252  }
253  }
254  }
255  }
257 
258  h_trk_z0 = dbe_->book1D("trk_z0","z_{0} of selected tracks",dzBin,dzMin,dzMax);
259  h_trk_z0->setAxisTitle("z_{0} of selected tracks (cm)",1);
260 
261  h_vx_dz = dbe_->bookProfile("vx_dz","v_{x} vs. dz of selected tracks",dzBin,dzMin,dzMax,dxBin,dxMin,dxMax,"");
262  h_vx_dz->setAxisTitle("dz (cm)",1);
263  h_vx_dz->setAxisTitle("x coordinate of input track at PCA (cm)",2);
264 
265  h_vy_dz = dbe_->bookProfile("vy_dz","v_{y} vs. dz of selected tracks",dzBin,dzMin,dzMax,dxBin,dxMin,dxMax,"");
266  h_vy_dz->setAxisTitle("dz (cm)",1);
267  h_vy_dz->setAxisTitle("x coordinate of input track at PCA (cm)",2);
268 
269  h_x0 = dbe_->book1D("BeamMonitorFeedBack_x0","x coordinate of beam spot (Fit)",100,-0.01,0.01);
270  h_x0->setAxisTitle("x_{0} (cm)",1);
271  h_x0->getTH1()->SetBit(TH1::kCanRebin);
272 
273  h_y0 = dbe_->book1D("BeamMonitorFeedBack_y0","y coordinate of beam spot (Fit)",100,-0.01,0.01);
274  h_y0->setAxisTitle("y_{0} (cm)",1);
275  h_y0->getTH1()->SetBit(TH1::kCanRebin);
276 
277  h_z0 = dbe_->book1D("BeamMonitorFeedBack_z0","z coordinate of beam spot (Fit)",dzBin,dzMin,dzMax);
278  h_z0->setAxisTitle("z_{0} (cm)",1);
279  h_z0->getTH1()->SetBit(TH1::kCanRebin);
280 
281  h_sigmaX0 = dbe_->book1D("BeamMonitorFeedBack_sigmaX0","sigma x0 of beam spot (Fit)",100,0,0.05);
282  h_sigmaX0->setAxisTitle("#sigma_{X_{0}} (cm)",1);
283  h_sigmaX0->getTH1()->SetBit(TH1::kCanRebin);
284 
285  h_sigmaY0 = dbe_->book1D("BeamMonitorFeedBack_sigmaY0","sigma y0 of beam spot (Fit)",100,0,0.05);
286  h_sigmaY0->setAxisTitle("#sigma_{Y_{0}} (cm)",1);
287  h_sigmaY0->getTH1()->SetBit(TH1::kCanRebin);
288 
289  h_sigmaZ0 = dbe_->book1D("BeamMonitorFeedBack_sigmaZ0","sigma z0 of beam spot (Fit)",100,0,10);
290  h_sigmaZ0->setAxisTitle("#sigma_{Z_{0}} (cm)",1);
291  h_sigmaZ0->getTH1()->SetBit(TH1::kCanRebin);
292 
293  // Histograms of all reco tracks (without cuts):
294  h_trkPt=dbe_->book1D("trkPt","p_{T} of all reco'd tracks (no selection)",200,0.,50.);
295  h_trkPt->setAxisTitle("p_{T} (GeV/c)",1);
296 
297  h_trkVz=dbe_->book1D("trkVz","Z coordinate of PCA of all reco'd tracks (no selection)",dzBin,dzMin,dzMax);
298  h_trkVz->setAxisTitle("V_{Z} (cm)",1);
299 
300  cutFlowTable = dbe_->book1D("cutFlowTable","Cut flow table of track selection", 9, 0, 9 );
301 
302  // Results of previous good fit:
303  fitResults=dbe_->book2D("fitResults","Results of previous good beam fit",2,0,2,8,0,8);
304  fitResults->setAxisTitle("Fitted Beam Spot (cm)",1);
305  fitResults->setBinLabel(8,"x_{0}",2);
306  fitResults->setBinLabel(7,"y_{0}",2);
307  fitResults->setBinLabel(6,"z_{0}",2);
308  fitResults->setBinLabel(5,"#sigma_{Z}",2);
309  fitResults->setBinLabel(4,"#frac{dx}{dz} (rad)",2);
310  fitResults->setBinLabel(3,"#frac{dy}{dz} (rad)",2);
311  fitResults->setBinLabel(2,"#sigma_{X}",2);
312  fitResults->setBinLabel(1,"#sigma_{Y}",2);
313  fitResults->setBinLabel(1,"Mean",1);
314  fitResults->setBinLabel(2,"Stat. Error",1);
315  fitResults->getTH1()->SetOption("text");
316 
317  // Histos of PrimaryVertices:
318  dbe_->setCurrentFolder(monitorName_+"PrimaryVertex");
319 
320  h_nVtx = dbe_->book1D("vtxNbr","Reconstructed Vertices(non-fake) in all Event",60,-0.5,59.5);
321  h_nVtx->setAxisTitle("Num. of reco. vertices",1);
322 
323  //For one Trigger only
324  h_nVtx_st = dbe_->book1D("vtxNbr_SelectedTriggers","Reconstructed Vertices(non-fake) in Events",60,-0.5,59.5);
325  //h_nVtx_st->setAxisTitle("Num. of reco. vertices for Un-Prescaled Jet Trigger",1);
326 
327  // Monitor only the PV with highest sum pt of assoc. trks:
328  h_PVx[0] = dbe_->book1D("PVX","x coordinate of Primary Vtx",50,-0.01,0.01);
329  h_PVx[0]->setAxisTitle("PVx (cm)",1);
330  h_PVx[0]->getTH1()->SetBit(TH1::kCanRebin);
331 
332  h_PVy[0] = dbe_->book1D("PVY","y coordinate of Primary Vtx",50,-0.01,0.01);
333  h_PVy[0]->setAxisTitle("PVy (cm)",1);
334  h_PVy[0]->getTH1()->SetBit(TH1::kCanRebin);
335 
336  h_PVz[0] = dbe_->book1D("PVZ","z coordinate of Primary Vtx",dzBin,dzMin,dzMax);
337  h_PVz[0]->setAxisTitle("PVz (cm)",1);
338 
339  h_PVx[1] = dbe_->book1D("PVXFit","x coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
340  h_PVx[1]->setAxisTitle("PVx (cm)",1);
341  h_PVx[1]->getTH1()->SetBit(TH1::kCanRebin);
342 
343  h_PVy[1] = dbe_->book1D("PVYFit","y coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
344  h_PVy[1]->setAxisTitle("PVy (cm)",1);
345  h_PVy[1]->getTH1()->SetBit(TH1::kCanRebin);
346 
347  h_PVz[1] = dbe_->book1D("PVZFit","z coordinate of Primary Vtx (Last Fit)",dzBin,dzMin,dzMax);
348  h_PVz[1]->setAxisTitle("PVz (cm)",1);
349 
350  h_PVxz = dbe_->bookProfile("PVxz","PVx vs. PVz",dzBin/2,dzMin,dzMax,dxBin/2,dxMin,dxMax,"");
351  h_PVxz->setAxisTitle("PVz (cm)",1);
352  h_PVxz->setAxisTitle("PVx (cm)",2);
353 
354  h_PVyz = dbe_->bookProfile("PVyz","PVy vs. PVz",dzBin/2,dzMin,dzMax,dxBin/2,dxMin,dxMax,"");
355  h_PVyz->setAxisTitle("PVz (cm)",1);
356  h_PVyz->setAxisTitle("PVy (cm)",2);
357 
358  // Results of previous good fit:
359  pvResults=dbe_->book2D("pvResults","Results of fitting Primary Vertices",2,0,2,6,0,6);
360  pvResults->setAxisTitle("Fitted Primary Vertex (cm)",1);
361  pvResults->setBinLabel(6,"PVx",2);
362  pvResults->setBinLabel(5,"PVy",2);
363  pvResults->setBinLabel(4,"PVz",2);
364  pvResults->setBinLabel(3,"#sigma_{X}",2);
365  pvResults->setBinLabel(2,"#sigma_{Y}",2);
366  pvResults->setBinLabel(1,"#sigma_{Z}",2);
367  pvResults->setBinLabel(1,"Mean",1);
368  pvResults->setBinLabel(2,"Stat. Error",1);
369  pvResults->getTH1()->SetOption("text");
370 
371  // Summary plots:
372  dbe_->setCurrentFolder(monitorName_+"EventInfo");
373  reportSummary = dbe_->get(monitorName_+"EventInfo/reportSummary");
375 
376  reportSummary = dbe_->bookFloat("reportSummary");
377  if(reportSummary) reportSummary->Fill(std::numeric_limits<double>::quiet_NaN());
378 
379  char histo[20];
380  dbe_->setCurrentFolder(monitorName_+"EventInfo/reportSummaryContents");
381  for (int n = 0; n < nFitElements_; n++) {
382  switch(n){
383  case 0 : sprintf(histo,"x0_status"); break;
384  case 1 : sprintf(histo,"y0_status"); break;
385  case 2 : sprintf(histo,"z0_status"); break;
386  }
388  }
389 
390  for (int i = 0; i < nFitElements_; i++) {
391  summaryContent_[i] = 0.;
392  reportSummaryContents[i]->Fill(std::numeric_limits<double>::quiet_NaN());
393  }
394 
395  dbe_->setCurrentFolder(monitorName_+"EventInfo");
396 
397  reportSummaryMap = dbe_->get(monitorName_+"EventInfo/reportSummaryMap");
399 
400  reportSummaryMap = dbe_->book2D("reportSummaryMap", "Beam Spot Summary Map", 1, 0, 1, 3, 0, 3);
402  reportSummaryMap->setAxisTitle("Fitted Beam Spot",2);
403  reportSummaryMap->setBinLabel(1," ",1);
404  reportSummaryMap->setBinLabel(1,"x_{0}",2);
405  reportSummaryMap->setBinLabel(2,"y_{0}",2);
406  reportSummaryMap->setBinLabel(3,"z_{0}",2);
407  for (int i = 0; i < nFitElements_; i++) {
408  reportSummaryMap->setBinContent(1,i+1,-1.);
409  }
410 }
T getParameter(std::string const &) const
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
void setBinContent(int binx, double content)
set content of bin (1-D)
int nFitElements_
Definition: BeamMonitor.h:93
MonitorElement * reportSummary
Definition: BeamMonitor.h:157
MonitorElement * h_nVtx
Definition: BeamMonitor.h:131
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:160
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:135
MonitorElement * h_PVxz
Definition: BeamMonitor.h:136
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:130
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:116
MonitorElement * fitResults
Definition: BeamMonitor.h:124
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:129
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * h_y0
Definition: BeamMonitor.h:126
int intervalInSec_
Definition: BeamMonitor.h:74
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:121
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
MonitorElement * h_PVyz
Definition: BeamMonitor.h:137
MonitorElement * pvResults
Definition: BeamMonitor.h:138
TH1 * getTH1(void) const
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
DQMStore * dbe_
Definition: BeamMonitor.h:79
Float_t summaryContent_[3]
Definition: BeamMonitor.h:156
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:128
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:132
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:134
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:158
MonitorElement * h_x0
Definition: BeamMonitor.h:125
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:118
edm::ParameterSet parameters_
Definition: BeamMonitor.h:63
MonitorElement * h_trkPt
Definition: BeamMonitor.h:122
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:120
MonitorElement * h_z0
Definition: BeamMonitor.h:127
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:133
MonitorElement * h_trkVz
Definition: BeamMonitor.h:123
std::string monitorName_
Definition: BeamMonitor.h:64
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:117
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:119
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:159
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:139
void BeamMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 434 of file BeamMonitor.cc.

References beginLumiOfBSFit_, beginLumiOfPVFit_, edm::LuminosityBlockBase::beginTime(), countLumi_, debug_, FitAndFill(), lastlumi_, edm::LuminosityBlockBase::luminosityBlock(), mapBeginBSLS, mapBeginBSTime, mapBeginPVLS, mapBeginPVTime, nextlumi_, onlineMode_, processed_, refBStime, refPVtime, StartAverage_, and edm::Timestamp::value().

435  {
436  int nthlumi = lumiSeg.luminosityBlock();
437  const edm::TimeValue_t fbegintimestamp = lumiSeg.beginTime().value();
438  const std::time_t ftmptime = fbegintimestamp >> 32;
439 
440 
441  if (countLumi_ == 0 && (!processed_)) {
443  refBStime[0] = refPVtime[0] = ftmptime;
444  mapBeginBSLS[countLumi_] = nthlumi;
445  mapBeginPVLS[countLumi_] = nthlumi;
446  mapBeginBSTime[countLumi_] = ftmptime;
447  mapBeginPVTime[countLumi_] = ftmptime;
448  }//for the first record
449 
450 if(nthlumi > nextlumi_){
451  if(processed_){ countLumi_++;
452  //store here them will need when we remove the first one of Last N LS
453  mapBeginBSLS[countLumi_] = nthlumi;
454  mapBeginPVLS[countLumi_] = nthlumi;
455  mapBeginBSTime[countLumi_] = ftmptime;
456  mapBeginPVTime[countLumi_] = ftmptime;
457  }//processed passed but not the first lumi
458  if((!processed_) && countLumi_ !=0){
459  mapBeginBSLS[countLumi_] = nthlumi;
460  mapBeginPVLS[countLumi_] = nthlumi;
461  mapBeginBSTime[countLumi_] = ftmptime;
462  mapBeginPVTime[countLumi_] = ftmptime;
463  }//processed fails for last lumi
464  }//nthLumi > nextlumi
465 
466 
467  if(StartAverage_ ){
468  //Just Make sure it get rest
469  refBStime[0] =0;
470  refPVtime[0] =0;
473 
474  if(debug_)edm::LogInfo("BeamMonitor") << " beginLuminosityBlock: Size of mapBeginBSLS before = "<< mapBeginBSLS.size()<<endl;
475  if(nthlumi> nextlumi_){ //this make sure that it does not take into account this lumi for fitting and only look forward for new lumi
476  //as countLumi also remains the same so map value get overwritten once return to normal running.
477  //even if few LS are misssing and DQM module do not sees them then it catchs up again
478  map<int, int>::iterator itbs=mapBeginBSLS.begin();
479  map<int, int>::iterator itpv=mapBeginPVLS.begin();
480  map<int, std::time_t>::iterator itbstime=mapBeginBSTime.begin();
481  map<int, std::time_t>::iterator itpvtime=mapBeginPVTime.begin();
482 
483  mapBeginBSLS.erase(itbs);
484  mapBeginPVLS.erase(itpv);
485  mapBeginBSTime.erase(itbstime);
486  mapBeginPVTime.erase(itpvtime);
487 
488  /*//not sure if want this or not ??
489  map<int, int>::iterator itgapb=mapBeginBSLS.begin();
490  map<int, int>::iterator itgape=mapBeginBSLS.end(); itgape--;
491  countGapLumi_ = ( (itgape->second) - (itgapb->second) );
492  //if we see Gap more than then 2*resetNFitLumi !!!!!!!
493  //for example if 10-15 is fitted and if 16-25 are missing then we next fit will be for range 11-26 but BS can change in between
494  // so better start as fresh and reset everything like starting in the begining!
495  if(countGapLumi_ >= 2*resetFitNLumi_){RestartFitting(); mapBeginBSLS[countLumi_] = nthlumi;}
496  */
497  }
498 
499  if(debug_) edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Size of mapBeginBSLS After = "<< mapBeginBSLS.size()<<endl;
500 
501  map<int, int>::iterator bbs = mapBeginBSLS.begin();
502  map<int, int>::iterator bpv = mapBeginPVLS.begin();
503  map<int, std::time_t>::iterator bbst = mapBeginBSTime.begin();
504  map<int, std::time_t>::iterator bpvt = mapBeginPVTime.begin();
505 
506 
507  if (beginLumiOfPVFit_ == 0) beginLumiOfPVFit_ = bpv->second; //new begin time after removing the LS
508  if (beginLumiOfBSFit_ == 0) beginLumiOfBSFit_ = bbs->second;
509  if (refBStime[0] == 0) refBStime[0] = bbst->second;
510  if (refPVtime[0] == 0) refPVtime[0] = bpvt->second;
511 
512  }//same logic for average fit as above commented line
513 
514 
515  map<int, std::time_t>::iterator nbbst = mapBeginBSTime.begin();
516  map<int, std::time_t>::iterator nbpvt = mapBeginPVTime.begin();
517 
518 
519  if (onlineMode_ && (nthlumi < nextlumi_)) return;
520 
521  if (onlineMode_) {
522  if (nthlumi > nextlumi_) {
523  if (countLumi_ != 0 && processed_) FitAndFill(lumiSeg,lastlumi_,nextlumi_,nthlumi);
524  nextlumi_ = nthlumi;
525  edm::LogInfo("BeamMonitor") << "beginLuminosityBlock:: Next Lumi to Fit: " << nextlumi_ << endl;
526  if((StartAverage_) && refBStime[0] == 0) refBStime[0] = nbbst->second;
527  if((StartAverage_) && refPVtime[0] == 0) refPVtime[0] = nbpvt->second;
528  }
529  }
530  else{
531  if (processed_) FitAndFill(lumiSeg,lastlumi_,nextlumi_,nthlumi);
532  nextlumi_ = nthlumi;
533  edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Next Lumi to Fit: " << nextlumi_ << endl;
534  if ((StartAverage_) && refBStime[0] == 0) refBStime[0] = nbbst->second;
535  if ((StartAverage_) && refPVtime[0] == 0) refPVtime[0] = nbpvt->second;
536  }
537 
538  //countLumi_++;
539  if (processed_) processed_ = false;
540  edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
541 }
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
bool processed_
Definition: BeamMonitor.h:107
Timestamp const & beginTime() const
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:146
LuminosityBlockNumber_t luminosityBlock() const
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:146
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
unsigned long long TimeValue_t
Definition: Timestamp.h:27
TimeValue_t value() const
Definition: Timestamp.cc:72
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:693
bool StartAverage_
Definition: BeamMonitor.h:103
int beginLumiOfPVFit_
Definition: BeamMonitor.h:86
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:145
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:145
int beginLumiOfBSFit_
Definition: BeamMonitor.h:84
int countLumi_
Definition: BeamMonitor.h:83
bool onlineMode_
Definition: BeamMonitor.h:76
void BeamMonitor::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 413 of file BeamMonitor.cc.

References edm::RunBase::beginTime(), gather_cfg::cout, pyrootRender::da, debug_, formatFitTime(), frun, ftimestamp, hs, refTime, edm::RunBase::run(), startTime, tmpTime, and edm::Timestamp::value().

413  {
414 
415  frun = r.run();
416  ftimestamp = r.beginTime().value();
417  tmpTime = ftimestamp >> 32;
419  const char* eventTime = formatFitTime(tmpTime);
420  std::cout << "TimeOffset = " << eventTime << std::endl;
421  TDatime da(eventTime);
422  if (debug_) {
423  edm::LogInfo("BeamMonitor") << "TimeOffset = ";
424  da.Print();
425  }
426  for (std::map<TString,MonitorElement*>::iterator it = hs.begin();
427  it != hs.end(); ++it) {
428  if ((*it).first.Contains("time"))
429  (*it).second->getTH1()->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
430  }
431 }
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:50
RunNumber_t run() const
Definition: RunBase.h:42
edm::TimeValue_t ftimestamp
Definition: BeamMonitor.h:167
std::time_t refTime
Definition: BeamMonitor.h:166
std::time_t startTime
Definition: BeamMonitor.h:165
TimeValue_t value() const
Definition: Timestamp.cc:72
Timestamp const & beginTime() const
Definition: RunBase.h:43
tuple cout
Definition: gather_cfg.py:121
std::time_t tmpTime
Definition: BeamMonitor.h:164
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:139
void BeamMonitor::endJob ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protected

Definition at line 1354 of file BeamMonitor.cc.

References endLuminosityBlock(), and onlineMode_.

1355  {
1356  if (!onlineMode_) endLuminosityBlock(lumiSeg, iSetup);
1357 }
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: BeamMonitor.cc:681
bool onlineMode_
Definition: BeamMonitor.h:76
void BeamMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 681 of file BeamMonitor.cc.

References edm::LuminosityBlockBase::endTime(), edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), nextlumi_, onlineMode_, refBStime, refPVtime, tmpTime, and edm::Timestamp::value().

Referenced by endJob().

682  {
683  int nthlumi = lumiSeg.id().luminosityBlock();
684  edm::LogInfo("BeamMonitor") << "endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
685 
686  if (onlineMode_ && nthlumi < nextlumi_) return;
687  const edm::TimeValue_t fendtimestamp = lumiSeg.endTime().value();
688  const std::time_t fendtime = fendtimestamp >> 32;
689  tmpTime = refBStime[1] = refPVtime[1] = fendtime;
690 }
LuminosityBlockID id() const
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
Timestamp const & endTime() const
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
unsigned long long TimeValue_t
Definition: Timestamp.h:27
TimeValue_t value() const
Definition: Timestamp.cc:72
LuminosityBlockNumber_t luminosityBlock() const
std::time_t tmpTime
Definition: BeamMonitor.h:164
bool onlineMode_
Definition: BeamMonitor.h:76
void BeamMonitor::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1334 of file BeamMonitor.cc.

References debug_, mapBeginBSLS, mapBeginBSTime, mapBeginPVLS, mapBeginPVTime, mapLSBSTrkSize, mapLSCF, mapLSPVStoreSize, mapNPV, mapPVx, mapPVy, and mapPVz.

1334  {
1335 
1336 if(debug_)edm::LogInfo("BeamMonitor") << "endRun:: Clearing all the Maps "<<endl;
1337 //Clear all the Maps here
1338 mapPVx.clear();
1339 mapPVy.clear();
1340 mapPVz.clear();
1341 mapNPV.clear();
1342 mapBeginBSLS.clear();
1343 mapBeginPVLS.clear();
1344 mapBeginBSTime.clear();
1345 mapBeginPVTime.clear();
1346 mapLSBSTrkSize.clear();
1347 mapLSPVStoreSize.clear();
1348 mapLSCF.clear();
1349 
1350 
1351 }
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:142
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:148
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:142
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:146
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:143
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:146
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:151
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:145
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:145
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:142
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:149
void BeamMonitor::FitAndFill ( const edm::LuminosityBlock lumiSeg,
int &  lastlumi,
int &  nextlumi,
int &  nthlumi 
)
private

Definition at line 693 of file BeamMonitor.cc.

References alpha, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthXError(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::BeamWidthYError(), begin, beginLumiOfBSFit_, beginLumiOfPVFit_, DQMStore::book1D(), countLumi_, dbe_, debug_, reco::BeamSpot::dxdz(), reco::BeamSpot::dxdzError(), reco::BeamSpot::dydz(), reco::BeamSpot::dydzError(), end, endLumiOfBSFit_, endLumiOfPVFit_, python.connectstrParser::f1, MonitorElement::Fill(), firstAverageFit_, fitNLumi_, fitPVNLumi_, fitResults, frun, BeamFitter::getBeamSpot(), BeamFitter::getBSvector(), BeamFitter::getCutFlow(), BeamFitter::getFitLSRange(), MonitorElement::getMean(), MonitorElement::getMeanError(), MonitorElement::getName(), BeamFitter::getPVvectorSize(), BeamFitter::getRefTime(), MonitorElement::getRMS(), MonitorElement::getRMSError(), BeamFitter::getRunNumber(), MonitorElement::getTH1(), getTH1F(), MonitorElement::getTProfile(), h_d0_phi0, h_nTrk_lumi, h_nVtx_st, h_PVx, h_PVy, h_PVz, h_sigmaX0, h_sigmaY0, h_sigmaZ0, h_trk_z0, h_vx_dz, h_vx_vy, h_vy_dz, h_x0, h_y0, h_z0, hs, i, python.multivaluedict::map(), mapLSBSTrkSize, mapLSCF, mapLSPVStoreSize, mapNPV, mapPVx, mapPVy, mapPVz, timingPdfMaker::mean, min_Ntrks_, minNrVertices_, monitorName_, n, nFitElements_, nFits_, nthBSTrk_, onlineMode_, preBS, processed_, pvResults, refBStime, refPVtime, refTime, reportSummary, reportSummary_, reportSummaryContents, reportSummaryMap, MonitorElement::Reset(), resetFitNLumi_, resetHistos_, resetPVNLumi_, BeamFitter::resizeBSvector(), BeamFitter::resizePVvector(), BeamFitter::runPVandTrkFitter(), scrollTH1(), MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), BeamFitter::setFitLSRange(), BeamFitter::SetPVInfo(), BeamFitter::setRefTime(), BeamFitter::setRun(), MonitorElement::ShiftFillLast(), reco::BeamSpot::sigmaZ(), reco::BeamSpot::sigmaZ0Error(), mathSSE::sqrt(), StartAverage_, startTime, BeamFitter::subtractFromCutFlow(), summaryContent_, summarySum_, testScroll(), theBeamFitter, createPayload::tmpfile, tmpTime, reco::BeamSpot::type(), MonitorElement::update(), tablePrinter::width, reco::BeamSpot::x0(), reco::BeamSpot::x0Error(), reco::BeamSpot::y0(), reco::BeamSpot::y0Error(), reco::BeamSpot::z0(), and reco::BeamSpot::z0Error().

Referenced by beginLuminosityBlock().

693  {
694  if (onlineMode_ && (nthlumi <= nextlumi)) return;
695 
696  //set the correct run number when no event in the LS for fake output
698 
699  int currentlumi = nextlumi;
700  edm::LogInfo("BeamMonitor") << "FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
701  lastlumi = currentlumi;
702  endLumiOfBSFit_ = currentlumi;
703  endLumiOfPVFit_ = currentlumi;
704 
705 
706  //---------Fix for Runninv average-------------
708 
709  if(StartAverage_)
710  {
711  std::map<int, std::size_t>::iterator rmLSPVi = mapLSPVStoreSize.begin();
712  size_t SizeToRemovePV= rmLSPVi->second;
713  for(std::map<int, std::size_t>::iterator rmLSPVe = mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
714  rmLSPVi->second -= SizeToRemovePV;
715 
716  theBeamFitter->resizePVvector(SizeToRemovePV);
717 
718  map<int, std::size_t >::iterator tmpItpv=mapLSPVStoreSize.begin();
719  mapLSPVStoreSize.erase(tmpItpv);
720  }
721  if(debug_)edm::LogInfo("BeamMonitor") << "FitAndFill:: Size of thePVvector After removing the PVs = " << theBeamFitter->getPVvectorSize()<<endl;
722 
723 
724  //lets filt the PV for GUI here: It was in analyzer in preivous versiton but moved here due to absence of event in some lumis, works OK
725  bool resetHistoFlag_=false;
726  if((int)mapPVx.size() >= resetFitNLumi_ && (StartAverage_)){
727  h_PVx[0]->Reset();
728  h_PVy[0]->Reset();
729  h_PVz[0]->Reset();
730  h_nVtx_st->Reset();
731  resetHistoFlag_ = true;
732  }
733 
734  int MaxPVs = 0;
735  int countEvtLastNLS_=0;
736  int countTotPV_= 0;
737 
738  std::map< int, std::vector<int> >::iterator mnpv=mapNPV.begin();
739  std::map< int, std::vector<float> >::iterator mpv2=mapPVy.begin();
740  std::map< int, std::vector<float> >::iterator mpv3=mapPVz.begin();
741 
742  for(std::map< int, std::vector<float> >::iterator mpv1=mapPVx.begin(); mpv1 != mapPVx.end(); ++mpv1, ++mpv2, ++mpv3, ++mnpv)
743  {
744  std::vector<float>::iterator mpvs2 = (mpv2->second).begin();
745  std::vector<float>::iterator mpvs3 = (mpv3->second).begin();
746  for(std::vector<float>::iterator mpvs1=(mpv1->second).begin(); mpvs1 !=(mpv1->second).end(); ++mpvs1, ++mpvs2, ++mpvs3){
747  if(resetHistoFlag_)
748  {h_PVx[0]->Fill( *mpvs1 ); //these histogram are reset after StartAverage_ flag is ON
749  h_PVy[0]->Fill( *mpvs2 );
750  h_PVz[0]->Fill( *mpvs3 );
751  }
752  }//loop over second
753 
754  //Do the same here for nPV distr.
755  for(std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).end(); ++mnpvs){
756  if((*mnpvs > 0) && (resetHistoFlag_) )h_nVtx_st->Fill( (*mnpvs)*(1.0) );
757  countEvtLastNLS_++;
758  countTotPV_ += (*mnpvs);
759  if((*mnpvs) > MaxPVs) MaxPVs = (*mnpvs);
760  }//loop over second of mapNPV
761 
762  }//loop over last N lumis
763 
764  char tmpTitlePV[100];
765  sprintf(tmpTitlePV,"%s %i %s %i","Num. of reco. vertices for LS: ",beginLumiOfPVFit_," to ",endLumiOfPVFit_);
766  h_nVtx_st->setAxisTitle(tmpTitlePV,1);
767 
768  std::vector<float> DipPVInfo_;
769  DipPVInfo_.clear();
770 
771  if(countTotPV_ != 0 ){
772  DipPVInfo_.push_back((float)countEvtLastNLS_);
773  DipPVInfo_.push_back(h_nVtx_st->getMean());
774  DipPVInfo_.push_back(h_nVtx_st->getMeanError());
775  DipPVInfo_.push_back(h_nVtx_st->getRMS());
776  DipPVInfo_.push_back(h_nVtx_st->getRMSError());
777  DipPVInfo_.push_back((float)MaxPVs);
778  DipPVInfo_.push_back((float)countTotPV_);
779  MaxPVs =0;
780  }
781  else{ for(size_t i= 0; i < 7; i++){if(i>0)DipPVInfo_.push_back(0.);
782  else DipPVInfo_.push_back((float)countEvtLastNLS_);}
783  }
784  theBeamFitter->SetPVInfo(DipPVInfo_);
785  countEvtLastNLS_=0;
786 
787 
788 
789  if (onlineMode_) { // filling LS gap
790  // FIXME: need to add protection for the case if the gap is at the resetting LS!
791  const int countLS_bs = hs["x0_lumi"]->getTH1()->GetEntries();
792  const int countLS_pv = hs["PVx_lumi"]->getTH1()->GetEntries();
793  edm::LogInfo("BeamMonitor") << "FitAndFill:: countLS_bs = " << countLS_bs << " ; countLS_pv = " << countLS_pv << std::endl;
794  int LSgap_bs = currentlumi/fitNLumi_ - countLS_bs;
795  int LSgap_pv = currentlumi/fitPVNLumi_ - countLS_pv;
796  if (currentlumi%fitNLumi_ == 0)
797  LSgap_bs--;
798  if (currentlumi%fitPVNLumi_ == 0)
799  LSgap_pv--;
800  edm::LogInfo("BeamMonitor") << "FitAndFill:: LSgap_bs = " << LSgap_bs << " ; LSgap_pv = " << LSgap_pv << std::endl;
801  // filling previous fits if LS gap ever exists
802  for (int ig = 0; ig < LSgap_bs; ig++) {
803  hs["x0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );//x0 , x0err, fitNLumi_; see DQMCore....
804  hs["y0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );
805  hs["z0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );
806  hs["sigmaX0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );
807  hs["sigmaY0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );
808  hs["sigmaZ0_lumi"]->ShiftFillLast( 0., 0., fitNLumi_ );
809  }
810  for (int ig = 0; ig < LSgap_pv; ig++) {
811  hs["PVx_lumi"]->ShiftFillLast( 0., 0., fitPVNLumi_ );
812  hs["PVy_lumi"]->ShiftFillLast( 0., 0., fitPVNLumi_ );
813  hs["PVz_lumi"]->ShiftFillLast( 0., 0., fitPVNLumi_ );
814  }
815  const int previousLS = h_nTrk_lumi->getTH1()->GetEntries();
816  for (int i=1;i < (currentlumi - previousLS);i++)//if (current-previoius)= 1 then never go inside the for loop!!!!!!!!!!!
818  }
819 
820  edm::LogInfo("BeamMonitor") << "FitAndFill:: Time lapsed since last scroll = " << tmpTime - refTime << std:: endl;
821 
822  if (testScroll(tmpTime,refTime)) {
823  scrollTH1(hs["x0_time"]->getTH1(),refTime);
824  scrollTH1(hs["y0_time"]->getTH1(),refTime);
825  scrollTH1(hs["z0_time"]->getTH1(),refTime);
826  scrollTH1(hs["sigmaX0_time"]->getTH1(),refTime);
827  scrollTH1(hs["sigmaY0_time"]->getTH1(),refTime);
828  scrollTH1(hs["sigmaZ0_time"]->getTH1(),refTime);
829  scrollTH1(hs["PVx_time"]->getTH1(),refTime);
830  scrollTH1(hs["PVy_time"]->getTH1(),refTime);
831  scrollTH1(hs["PVz_time"]->getTH1(),refTime);
832  }
833 
834  bool doPVFit = false;
835 
836  if (fitPVNLumi_ > 0) {
837  if (onlineMode_) {
838  if (currentlumi%fitPVNLumi_ == 0)
839  doPVFit = true;
840  }
841  else
842  if (countLumi_%fitPVNLumi_ == 0)
843  doPVFit = true;
844  }
845  else
846  doPVFit = true;
847 
848 
849  if (doPVFit) {
850  edm::LogInfo("BeamMonitor") << "FitAndFill:: Do PV Fitting for LS = " << beginLumiOfPVFit_ << " to " << endLumiOfPVFit_ << std::endl;
851  // Primary Vertex Fit:
852  if (h_PVx[0]->getTH1()->GetEntries() > minNrVertices_) {
853 
854  pvResults->Reset();
855  char tmpTitle[50];
856  sprintf(tmpTitle,"%s %i %s %i","Fitted Primary Vertex (cm) of LS: ",beginLumiOfPVFit_," to ",endLumiOfPVFit_);
857  pvResults->setAxisTitle(tmpTitle,1);
858 
859  TF1 *fgaus = new TF1("fgaus","gaus");
860  double mean,width,meanErr,widthErr;
861  fgaus->SetLineColor(4);
862  h_PVx[0]->getTH1()->Fit("fgaus","QLM0");
863  mean = fgaus->GetParameter(1);
864  width = fgaus->GetParameter(2);
865  meanErr = fgaus->GetParError(1);
866  widthErr = fgaus->GetParError(2);
867 
868 
869  hs["PVx_lumi"]->ShiftFillLast(mean,width,fitPVNLumi_);
870  hs["PVx_lumi_all"]->setBinContent(currentlumi,mean);
871  hs["PVx_lumi_all"]->setBinError(currentlumi,width);
872  int nthBin = tmpTime - refTime;
873  if (nthBin < 0)
874  edm::LogInfo("BeamMonitor") << "FitAndFill:: Event time outside current range of time histograms!" << std::endl;
875  if (nthBin > 0) {
876  hs["PVx_time"]->setBinContent(nthBin,mean);
877  hs["PVx_time"]->setBinError(nthBin,width);
878  }
879  int jthBin = tmpTime - startTime;
880  if (jthBin > 0) {
881  hs["PVx_time_all"]->setBinContent(jthBin,mean);
882  hs["PVx_time_all"]->setBinError(jthBin,width);
883  }
884  pvResults->setBinContent(1,6,mean);
885  pvResults->setBinContent(1,3,width);
886  pvResults->setBinContent(2,6,meanErr);
887  pvResults->setBinContent(2,3,widthErr);
888 
889  dbe_->setCurrentFolder(monitorName_+"PrimaryVertex/");
890  const char* tmpfile;
891  TH1D * tmphisto;
892  // snap shot of the fit
893  tmpfile= (h_PVx[1]->getName()).c_str();
894  tmphisto = static_cast<TH1D *>((h_PVx[0]->getTH1())->Clone("tmphisto"));
895  h_PVx[1]->getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
896  h_PVx[1] = dbe_->book1D(tmpfile,h_PVx[0]->getTH1F());
897  h_PVx[1]->getTH1()->Fit("fgaus","QLM");
898 
899 
900  h_PVy[0]->getTH1()->Fit("fgaus","QLM0");
901  mean = fgaus->GetParameter(1);
902  width = fgaus->GetParameter(2);
903  meanErr = fgaus->GetParError(1);
904  widthErr = fgaus->GetParError(2);
905  hs["PVy_lumi"]->ShiftFillLast(mean,width,fitPVNLumi_);
906  hs["PVy_lumi_all"]->setBinContent(currentlumi,mean);
907  hs["PVy_lumi_all"]->setBinError(currentlumi,width);
908  if (nthBin > 0) {
909  hs["PVy_time"]->setBinContent(nthBin,mean);
910  hs["PVy_time"]->setBinError(nthBin,width);
911  }
912  if (jthBin > 0) {
913  hs["PVy_time_all"]->setBinContent(jthBin,mean);
914  hs["PVy_time_all"]->setBinError(jthBin,width);
915  }
916  pvResults->setBinContent(1,5,mean);
917  pvResults->setBinContent(1,2,width);
918  pvResults->setBinContent(2,5,meanErr);
919  pvResults->setBinContent(2,2,widthErr);
920  // snap shot of the fit
921  tmpfile= (h_PVy[1]->getName()).c_str();
922  tmphisto = static_cast<TH1D *>((h_PVy[0]->getTH1())->Clone("tmphisto"));
923  h_PVy[1]->getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
924  h_PVy[1]->update();
925  h_PVy[1] = dbe_->book1D(tmpfile,h_PVy[0]->getTH1F());
926  h_PVy[1]->getTH1()->Fit("fgaus","QLM");
927 
928 
929  h_PVz[0]->getTH1()->Fit("fgaus","QLM0");
930  mean = fgaus->GetParameter(1);
931  width = fgaus->GetParameter(2);
932  meanErr = fgaus->GetParError(1);
933  widthErr = fgaus->GetParError(2);
934  hs["PVz_lumi"]->ShiftFillLast(mean,width,fitPVNLumi_);
935  hs["PVz_lumi_all"]->setBinContent(currentlumi,mean);
936  hs["PVz_lumi_all"]->setBinError(currentlumi,width);
937  if (nthBin > 0) {
938  hs["PVz_time"]->setBinContent(nthBin,mean);
939  hs["PVz_time"]->setBinError(nthBin,width);
940  }
941  if (jthBin > 0) {
942  hs["PVz_time_all"]->setBinContent(jthBin,mean);
943  hs["PVz_time_all"]->setBinError(jthBin,width);
944  }
945  pvResults->setBinContent(1,4,mean);
946  pvResults->setBinContent(1,1,width);
947  pvResults->setBinContent(2,4,meanErr);
948  pvResults->setBinContent(2,1,widthErr);
949  // snap shot of the fit
950  tmpfile= (h_PVz[1]->getName()).c_str();
951  tmphisto = static_cast<TH1D *>((h_PVz[0]->getTH1())->Clone("tmphisto"));
952  h_PVz[1]->getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
953  h_PVz[1]->update();
954  h_PVz[1] = dbe_->book1D(tmpfile,h_PVz[0]->getTH1F());
955  h_PVz[1]->getTH1()->Fit("fgaus","QLM");
956 
957  }//check if found min Vertices
958  }//do PVfit
959 
962  refPVtime[0] = 0;
963  }
964 
965 
966 
967 
968  //---------Readjustment of theBSvector, RefTime, beginLSofFit---------
969  vector<BSTrkParameters> theBSvector1 = theBeamFitter->getBSvector();
970  mapLSBSTrkSize[countLumi_]= (theBSvector1.size());
971  size_t PreviousRecords=0; //needed to fill nth record of tracks in GUI
972 
973  if(StartAverage_){
974  size_t SizeToRemove=0;
975  std::map<int, std::size_t>::iterator rmls=mapLSBSTrkSize.begin();
976  SizeToRemove = rmls->second;
977  if(debug_)edm::LogInfo("BeamMonitor")<< " The size to remove is = "<< SizeToRemove << endl;
978  int changedAfterThis=0;
979  for(std::map<int, std::size_t>::iterator rmLS = mapLSBSTrkSize.begin(); rmLS!=mapLSBSTrkSize.end(); ++rmLS, ++changedAfterThis){
980  if(changedAfterThis > 0 ){(rmLS->second) = (rmLS->second)-SizeToRemove;
981  if((mapLSBSTrkSize.size()- (size_t)changedAfterThis) == 2 )PreviousRecords = (rmLS->second);
982  } }
983 
984  theBeamFitter->resizeBSvector(SizeToRemove);
985 
986  map<int, std::size_t >::iterator tmpIt=mapLSBSTrkSize.begin();
987  mapLSBSTrkSize.erase(tmpIt);
988 
989  std::pair<int,int> checkfitLS = theBeamFitter->getFitLSRange();
990  std::pair<time_t,time_t> checkfitTime =theBeamFitter->getRefTime();
991  theBeamFitter->setFitLSRange(beginLumiOfBSFit_, checkfitLS.second);
992  theBeamFitter->setRefTime(refBStime[0], checkfitTime.second);
993  }
994 
995  //Fill the track for this fit
996  vector<BSTrkParameters> theBSvector = theBeamFitter->getBSvector();
997  h_nTrk_lumi->ShiftFillLast( theBSvector.size() );
998 
999  if(debug_)edm::LogInfo("BeamMonitor")<< "FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1000 
1001 
1002 
1003  bool countFitting = false;
1004  if (theBSvector.size() >= PreviousRecords && theBSvector.size() >= min_Ntrks_) {
1005  countFitting = true;
1006  }
1007 
1008 
1009  //---Fix for Cut Flow Table for Running average in a same way//the previous code has problem for resetting!!!
1011  if(StartAverage_ && mapLSCF.size()){
1012  const TH1F& cutFlowToSubtract = mapLSCF.begin()->second;
1013  // Subtract the last cut flow from all of the others.
1014  std::map<int, TH1F>::iterator cf = mapLSCF.begin();
1015  // Start on second entry
1016  for(; cf != mapLSCF.end(); ++cf) {
1017  cf->second.Add(&cutFlowToSubtract, -1);
1018  }
1019  theBeamFitter->subtractFromCutFlow(&cutFlowToSubtract);
1020  // Remove the obsolete lumi section
1021  mapLSCF.erase(mapLSCF.begin());
1022  }
1023 
1024  if (resetHistos_) {
1025  h_d0_phi0->Reset();
1026  h_vx_vy->Reset();
1027  h_vx_dz->Reset();
1028  h_vy_dz->Reset();
1029  h_trk_z0->Reset();
1030  resetHistos_ = false;
1031  }
1032 
1033  if(StartAverage_) nthBSTrk_ = PreviousRecords; //after average proccess is ON//for 2-6 LS fit PreviousRecords is size from 2-5 LS
1034 
1035  edm::LogInfo("BeamMonitor")<<" The Previous Recored for this fit is ="<<nthBSTrk_<<endl;
1036 
1037  unsigned int itrk = 0;
1038  for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin();
1039  BSTrk != theBSvector.end(); ++BSTrk, ++itrk){
1040  if (itrk >= nthBSTrk_){//fill for this record only !!
1041  h_d0_phi0->Fill( BSTrk->phi0(), BSTrk->d0() );
1042  double vx = BSTrk->vx();
1043  double vy = BSTrk->vy();
1044  double z0 = BSTrk->z0();
1045  h_vx_vy->Fill( vx, vy );
1046  h_vx_dz->Fill( z0, vx );
1047  h_vy_dz->Fill( z0, vy );
1048  h_trk_z0->Fill( z0 );
1049  }
1050  }
1051 
1052 
1053  nthBSTrk_ = theBSvector.size(); // keep track of num of tracks filled so far
1054 
1055  edm::LogInfo("BeamMonitor")<<" The Current Recored for this fit is ="<<nthBSTrk_<<endl;
1056 
1057  if (countFitting) edm::LogInfo("BeamMonitor") << "FitAndFill:: Num of tracks collected = " << nthBSTrk_ << endl;
1058 
1059 
1060  if (fitNLumi_ > 0) {
1061  if (onlineMode_){
1062  if (currentlumi%fitNLumi_!=0) {
1063 // for (std::map<TString,MonitorElement*>::iterator itAll = hs.begin();
1064 // itAll != hs.end(); ++itAll) {
1065 // if ((*itAll).first.Contains("all")) {
1066 // (*itAll).second->setBinContent(currentlumi,0.);
1067 // (*itAll).second->setBinError(currentlumi,0.);
1068 // }
1069 // }
1070  return;
1071  }
1072  }
1073  else
1074  if (countLumi_%fitNLumi_!=0) return;
1075  }
1076 
1077  edm::LogInfo("BeamMonitor") << "FitAndFill:: [DebugTime] refBStime[0] = " << refBStime[0]
1078  << "; address = " << &refBStime[0] << std::endl;
1079  edm::LogInfo("BeamMonitor") << "FitAndFill:: [DebugTime] refBStime[1] = " << refBStime[1]
1080  << "; address = " << &refBStime[1] << std::endl;
1081 
1082  if (countFitting) {
1083  nFits_++;
1084  std::pair<int,int> fitLS = theBeamFitter->getFitLSRange();
1085  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first << " to " << fitLS.second << std::endl;
1086  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamMonitor] Do BeamSpot Fit for LS = " << beginLumiOfBSFit_ << " to " << endLumiOfBSFit_ << std::endl;
1087 
1088  //Now Run the PV and Track Fitter over the collected tracks and pvs
1091  if (bs.type() > 0) // with good beamwidth fit
1092  preBS = bs; // cache good fit results
1093 
1094  edm::LogInfo("BeamMonitor") << "\n RESULTS OF DEFAULT FIT:" << endl;
1095  edm::LogInfo("BeamMonitor") << bs << endl;
1096  edm::LogInfo("BeamMonitor") << "[BeamFitter] fitting done \n" << endl;
1097 
1098  hs["x0_lumi"]->ShiftFillLast( bs.x0(), bs.x0Error(), fitNLumi_ );
1099  hs["y0_lumi"]->ShiftFillLast( bs.y0(), bs.y0Error(), fitNLumi_ );
1100  hs["z0_lumi"]->ShiftFillLast( bs.z0(), bs.z0Error(), fitNLumi_ );
1101  hs["sigmaX0_lumi"]->ShiftFillLast( bs.BeamWidthX(), bs.BeamWidthXError(), fitNLumi_ );
1102  hs["sigmaY0_lumi"]->ShiftFillLast( bs.BeamWidthY(), bs.BeamWidthYError(), fitNLumi_ );
1103  hs["sigmaZ0_lumi"]->ShiftFillLast( bs.sigmaZ(), bs.sigmaZ0Error(), fitNLumi_ );
1104  hs["x0_lumi_all"]->setBinContent(currentlumi,bs.x0());
1105  hs["x0_lumi_all"]->setBinError(currentlumi,bs.x0Error());
1106  hs["y0_lumi_all"]->setBinContent(currentlumi,bs.y0());
1107  hs["y0_lumi_all"]->setBinError(currentlumi,bs.y0Error());
1108  hs["z0_lumi_all"]->setBinContent(currentlumi,bs.z0());
1109  hs["z0_lumi_all"]->setBinError(currentlumi,bs.z0Error());
1110  hs["sigmaX0_lumi_all"]->setBinContent(currentlumi, bs.BeamWidthX());
1111  hs["sigmaX0_lumi_all"]->setBinError(currentlumi, bs.BeamWidthXError());
1112  hs["sigmaY0_lumi_all"]->setBinContent(currentlumi, bs.BeamWidthY());
1113  hs["sigmaY0_lumi_all"]->setBinError(currentlumi, bs.BeamWidthYError());
1114  hs["sigmaZ0_lumi_all"]->setBinContent(currentlumi, bs.sigmaZ());
1115  hs["sigmaZ0_lumi_all"]->setBinError(currentlumi, bs.sigmaZ0Error());
1116 
1117  int nthBin = tmpTime - refTime;
1118  if (nthBin > 0) {
1119  hs["x0_time"]->setBinContent(nthBin, bs.x0());
1120  hs["y0_time"]->setBinContent(nthBin, bs.y0());
1121  hs["z0_time"]->setBinContent(nthBin, bs.z0());
1122  hs["sigmaX0_time"]->setBinContent(nthBin, bs.BeamWidthX());
1123  hs["sigmaY0_time"]->setBinContent(nthBin, bs.BeamWidthY());
1124  hs["sigmaZ0_time"]->setBinContent(nthBin, bs.sigmaZ());
1125  hs["x0_time"]->setBinError(nthBin, bs.x0Error());
1126  hs["y0_time"]->setBinError(nthBin, bs.y0Error());
1127  hs["z0_time"]->setBinError(nthBin, bs.z0Error());
1128  hs["sigmaX0_time"]->setBinError(nthBin, bs.BeamWidthXError());
1129  hs["sigmaY0_time"]->setBinError(nthBin, bs.BeamWidthYError());
1130  hs["sigmaZ0_time"]->setBinError(nthBin, bs.sigmaZ0Error());
1131  }
1132 
1133  int jthBin = tmpTime - startTime;
1134  if (jthBin > 0) {
1135  hs["x0_time_all"]->setBinContent(jthBin, bs.x0());
1136  hs["y0_time_all"]->setBinContent(jthBin, bs.y0());
1137  hs["z0_time_all"]->setBinContent(jthBin, bs.z0());
1138  hs["sigmaX0_time_all"]->setBinContent(jthBin, bs.BeamWidthX());
1139  hs["sigmaY0_time_all"]->setBinContent(jthBin, bs.BeamWidthY());
1140  hs["sigmaZ0_time_all"]->setBinContent(jthBin, bs.sigmaZ());
1141  hs["x0_time_all"]->setBinError(jthBin, bs.x0Error());
1142  hs["y0_time_all"]->setBinError(jthBin, bs.y0Error());
1143  hs["z0_time_all"]->setBinError(jthBin, bs.z0Error());
1144  hs["sigmaX0_time_all"]->setBinError(jthBin, bs.BeamWidthXError());
1145  hs["sigmaY0_time_all"]->setBinError(jthBin, bs.BeamWidthYError());
1146  hs["sigmaZ0_time_all"]->setBinError(jthBin, bs.sigmaZ0Error());
1147  }
1148 
1149  h_x0->Fill( bs.x0());
1150  h_y0->Fill( bs.y0());
1151  h_z0->Fill( bs.z0());
1152  if (bs.type() > 0) { // with good beamwidth fit
1153  h_sigmaX0->Fill( bs.BeamWidthX());
1154  h_sigmaY0->Fill( bs.BeamWidthY());
1155  }
1156  h_sigmaZ0->Fill( bs.sigmaZ());
1157 
1158  if (nthBSTrk_ >= 2*min_Ntrks_) {
1159  double amp = std::sqrt(bs.x0()*bs.x0()+bs.y0()*bs.y0());
1160  double alpha = std::atan2(bs.y0(),bs.x0());
1161  TF1 *f1 = new TF1("f1","[0]*sin(x-[1])",-3.14,3.14);
1162  f1->SetParameters(amp,alpha);
1163  f1->SetParLimits(0,amp-0.1,amp+0.1);
1164  f1->SetParLimits(1,alpha-0.577,alpha+0.577);
1165  f1->SetLineColor(4);
1166  h_d0_phi0->getTProfile()->Fit("f1","QR");
1167 
1168  double mean = bs.z0();
1169  double width = bs.sigmaZ();
1170  TF1 *fgaus = new TF1("fgaus","gaus");
1171  fgaus->SetParameters(mean,width);
1172  fgaus->SetLineColor(4);
1173  h_trk_z0->getTH1()->Fit("fgaus","QLRM","",mean-3*width,mean+3*width);
1174  }
1175 
1176  fitResults->Reset();
1177  std::pair<int,int> LSRange = theBeamFitter->getFitLSRange();
1178  char tmpTitle[50];
1179  sprintf(tmpTitle,"%s %i %s %i","Fitted Beam Spot (cm) of LS: ",LSRange.first," to ",LSRange.second);
1180  fitResults->setAxisTitle(tmpTitle,1);
1181  fitResults->setBinContent(1,8,bs.x0());
1182  fitResults->setBinContent(1,7,bs.y0());
1183  fitResults->setBinContent(1,6,bs.z0());
1184  fitResults->setBinContent(1,5,bs.sigmaZ());
1185  fitResults->setBinContent(1,4,bs.dxdz());
1186  fitResults->setBinContent(1,3,bs.dydz());
1187  if (bs.type() > 0) { // with good beamwidth fit
1188  fitResults->setBinContent(1,2,bs.BeamWidthX());
1189  fitResults->setBinContent(1,1,bs.BeamWidthY());
1190  }
1191  else { // fill cached widths
1194  }
1195 
1196  fitResults->setBinContent(2,8,bs.x0Error());
1197  fitResults->setBinContent(2,7,bs.y0Error());
1198  fitResults->setBinContent(2,6,bs.z0Error());
1200  fitResults->setBinContent(2,4,bs.dxdzError());
1201  fitResults->setBinContent(2,3,bs.dydzError());
1202  if (bs.type() > 0) { // with good beamwidth fit
1205  }
1206  else { // fill cached width errors
1209  }
1210 
1211  // count good fit
1212  // if (std::fabs(refBS.x0()-bs.x0())/bs.x0Error() < deltaSigCut_) { // disabled temporarily
1213  summaryContent_[0] += 1.;
1214  // }
1215  // if (std::fabs(refBS.y0()-bs.y0())/bs.y0Error() < deltaSigCut_) { // disabled temporarily
1216  summaryContent_[1] += 1.;
1217  // }
1218  // if (std::fabs(refBS.z0()-bs.z0())/bs.z0Error() < deltaSigCut_) { // disabled temporarily
1219  summaryContent_[2] += 1.;
1220  // }
1221 
1222  } //if (theBeamFitter->runPVandTrkFitter())
1223  else { // beam fit fails
1225  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1226  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1227  edm::LogInfo("BeamMonitor") << bs << endl;
1228 
1229  hs["sigmaX0_lumi"]->ShiftFillLast( bs.BeamWidthX(), bs.BeamWidthXError(), fitNLumi_ );
1230  hs["sigmaY0_lumi"]->ShiftFillLast( bs.BeamWidthY(), bs.BeamWidthYError(), fitNLumi_ );
1231  hs["sigmaZ0_lumi"]->ShiftFillLast( bs.sigmaZ(), bs.sigmaZ0Error(), fitNLumi_ );
1232  hs["x0_lumi"]->ShiftFillLast( bs.x0(), bs.x0Error(), fitNLumi_ );
1233  hs["y0_lumi"]->ShiftFillLast( bs.y0(), bs.y0Error(), fitNLumi_ );
1234  hs["z0_lumi"]->ShiftFillLast( bs.z0(), bs.z0Error(), fitNLumi_ );
1235  } // end of beam fit fails
1236 
1237 
1238  } //-------- end of countFitting------------------------------------------
1239  else { // no fit
1240  // Overwrite Fit LS and fit time when no event processed or no track selected
1243  if (theBeamFitter->runPVandTrkFitter()) {} // Dump fake beam spot for DIP
1245  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1246  edm::LogInfo("BeamMonitor") << "FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1247  edm::LogInfo("BeamMonitor") << bs << endl;
1248 
1249  hs["sigmaX0_lumi"]->ShiftFillLast( bs.BeamWidthX(), bs.BeamWidthXError(), fitNLumi_ );
1250  hs["sigmaY0_lumi"]->ShiftFillLast( bs.BeamWidthY(), bs.BeamWidthYError(), fitNLumi_ );
1251  hs["sigmaZ0_lumi"]->ShiftFillLast( bs.sigmaZ(), bs.sigmaZ0Error(), fitNLumi_ );
1252  hs["x0_lumi"]->ShiftFillLast( bs.x0(), bs.x0Error(), fitNLumi_ );
1253  hs["y0_lumi"]->ShiftFillLast( bs.y0(), bs.y0Error(), fitNLumi_ );
1254  hs["z0_lumi"]->ShiftFillLast( bs.z0(), bs.z0Error(), fitNLumi_ );
1255  }
1256 
1257 
1258 
1259  // Fill summary report
1260  if (countFitting) {
1261  for (int n = 0; n < nFitElements_; n++) {
1263  }
1264 
1265  summarySum_ = 0;
1266  for (int ii = 0; ii < nFitElements_; ii++) {
1268  }
1269  reportSummary_ = summarySum_ / (nFitElements_ * nFits_);
1271 
1272  for ( int bi = 0; bi < nFitElements_ ; bi++) {
1273  reportSummaryMap->setBinContent(1,bi+1,summaryContent_[bi] / (float)nFits_);
1274  }
1275  }
1276 
1277 
1278 
1279 
1280  if ( ( resetFitNLumi_ > 0 &&
1281  ((onlineMode_ && countLumi_==resetFitNLumi_ ) || //OR it should be currentLumi_ (if in sequence then does not mattar)
1283  ) || (StartAverage_) ){
1284 
1285  edm::LogInfo("BeamMonitor") << "FitAndFill:: The flag is ON for running average Beam Spot fit"<<endl;
1286  StartAverage_ = true;
1287  firstAverageFit_++;
1288  resetHistos_ = true;
1289  nthBSTrk_ = 0;
1290  beginLumiOfBSFit_= 0;
1291  refBStime[0] = 0;
1292 
1293  }
1294 
1295 
1296 
1297 }
double z0() const
z coordinate
Definition: BeamSpot.h:69
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
float alpha
Definition: AMPTWrapper.h:95
unsigned int minNrVertices_
Definition: BeamMonitor.h:98
void setBinContent(int binx, double content)
set content of bin (1-D)
double sigmaZ0Error() const
error on sigma z
Definition: BeamSpot.h:97
int nFitElements_
Definition: BeamMonitor.h:93
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
MonitorElement * reportSummary
Definition: BeamMonitor.h:157
int endLumiOfPVFit_
Definition: BeamMonitor.h:87
int resetFitNLumi_
Definition: BeamMonitor.h:72
bool runPVandTrkFitter()
Definition: BeamFitter.cc:409
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
double dydzError() const
error on dydz
Definition: BeamSpot.h:101
void setRun(int run)
Definition: BeamFitter.h:119
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:135
bool testScroll(std::time_t &, std::time_t &)
std::vector< BSTrkParameters > getBSvector()
Definition: BeamFitter.h:91
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:142
void subtractFromCutFlow(const TH1F *toSubtract)
Definition: BeamFitter.h:93
bool processed_
Definition: BeamMonitor.h:107
std::size_t getPVvectorSize()
Definition: BeamFitter.h:67
void update(void)
Mark the object updated.
MonitorElement * h_sigmaZ0
Definition: BeamMonitor.h:130
MonitorElement * h_nTrk_lumi
Definition: BeamMonitor.h:116
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:148
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * fitResults
Definition: BeamMonitor.h:124
int fitPVNLumi_
Definition: BeamMonitor.h:71
MonitorElement * h_sigmaY0
Definition: BeamMonitor.h:129
double getMeanError(int axis=1) const
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:142
void Fill(long long x)
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:143
double dydz() const
dydz slope
Definition: BeamSpot.h:85
MonitorElement * h_y0
Definition: BeamMonitor.h:126
void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
double dxdzError() const
error on dxdz
Definition: BeamSpot.h:99
MonitorElement * h_vy_dz
Definition: BeamMonitor.h:121
T sqrt(T t)
Definition: SSEVec.h:46
Float_t reportSummary_
Definition: BeamMonitor.h:154
std::time_t refTime
Definition: BeamMonitor.h:166
MonitorElement * pvResults
Definition: BeamMonitor.h:138
int endLumiOfBSFit_
Definition: BeamMonitor.h:85
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
TH1 * getTH1(void) const
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:87
void setFitLSRange(int ls0, int ls1)
Definition: BeamFitter.h:115
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
std::pair< time_t, time_t > getRefTime()
Definition: BeamFitter.h:60
#define end
Definition: vmac.h:38
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
Definition: BeamSpot.h:106
double BeamWidthXError() const
error on beam width X, assume error in X = Y
Definition: BeamSpot.h:104
double z0Error() const
error on z
Definition: BeamSpot.h:95
double dxdz() const
dxdz slope
Definition: BeamSpot.h:83
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:151
double x0Error() const
error on x
Definition: BeamSpot.h:91
double y0Error() const
error on y
Definition: BeamSpot.h:93
DQMStore * dbe_
Definition: BeamMonitor.h:79
int getRunNumber()
Definition: BeamFitter.h:108
std::time_t startTime
Definition: BeamMonitor.h:165
double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
Float_t summaryContent_[3]
Definition: BeamMonitor.h:156
MonitorElement * h_sigmaX0
Definition: BeamMonitor.h:128
bool StartAverage_
Definition: BeamMonitor.h:103
reco::BeamSpot preBS
Definition: BeamMonitor.h:113
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:132
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:134
void resizeBSvector(unsigned int nsize)
Definition: BeamFitter.h:69
int beginLumiOfPVFit_
Definition: BeamMonitor.h:86
MonitorElement * reportSummaryContents[3]
Definition: BeamMonitor.h:158
double sigmaZ() const
sigma z
Definition: BeamSpot.h:81
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:89
MonitorElement * h_x0
Definition: BeamMonitor.h:125
MonitorElement * h_trk_z0
Definition: BeamMonitor.h:118
int resetPVNLumi_
Definition: BeamMonitor.h:73
Float_t summarySum_
Definition: BeamMonitor.h:155
TH1F * getCutFlow()
Definition: BeamFitter.h:92
#define begin
Definition: vmac.h:31
MonitorElement * h_vx_dz
Definition: BeamMonitor.h:120
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * h_z0
Definition: BeamMonitor.h:127
void resizePVvector(unsigned int npvsize)
Definition: BeamFitter.h:74
TProfile * getTProfile(void) const
double y0() const
y coordinate
Definition: BeamSpot.h:67
unsigned int nthBSTrk_
Definition: BeamMonitor.h:92
void SetPVInfo(std::vector< float > v1_)
Definition: BeamFitter.h:79
unsigned int min_Ntrks_
Definition: BeamMonitor.h:96
void setRefTime(time_t t0, time_t t1)
Definition: BeamFitter.h:52
bool resetHistos_
Definition: BeamMonitor.h:102
std::time_t tmpTime
Definition: BeamMonitor.h:164
int firstAverageFit_
Definition: BeamMonitor.h:104
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:133
std::pair< int, int > getFitLSRange()
Definition: BeamFitter.h:112
void Reset(void)
reset ME (ie. contents, errors, etc)
int beginLumiOfBSFit_
Definition: BeamMonitor.h:84
std::string monitorName_
Definition: BeamMonitor.h:64
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:142
MonitorElement * h_d0_phi0
Definition: BeamMonitor.h:117
reco::BeamSpot getBeamSpot()
Definition: BeamFitter.h:89
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * h_vx_vy
Definition: BeamMonitor.h:119
int countLumi_
Definition: BeamMonitor.h:83
void scrollTH1(TH1 *, std::time_t)
BeamType type() const
return beam type
Definition: BeamSpot.h:130
MonitorElement * reportSummaryMap
Definition: BeamMonitor.h:159
bool onlineMode_
Definition: BeamMonitor.h:76
double x0() const
x coordinate
Definition: BeamSpot.h:65
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:139
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:149
const char * BeamMonitor::formatFitTime ( const std::time_t &  )
private

Definition at line 50 of file BeamMonitor.cc.

References b, CEST, plotBeamSpotDB::ptm, and create_public_lumi_plots::year.

Referenced by beginRun(), and scrollTH1().

50  {
51 #define CET (+1)
52 #define CEST (+2)
53 
54  static char ts[] = "yyyy-Mm-dd hh:mm:ss";
55  tm * ptm;
56  ptm = gmtime ( &t );
57  int year = ptm->tm_year;
58  if (year < 1995) {
59  edm::LogError("BadTimeStamp") << "year reported is " << year << "!! resetting to 2011..." << std::endl;
60  year = 2012;
61  }
62  sprintf( ts, "%4d-%02d-%02d %02d:%02d:%02d", year,ptm->tm_mon+1,ptm->tm_mday,(ptm->tm_hour+CEST)%24, ptm->tm_min, ptm->tm_sec);
63 
64 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
65  unsigned int b = strlen(ts);
66  while (ts[--b] == ' ') {ts[b] = 0;}
67 #endif
68  return ts;
69 
70 }
#define CEST
double b
Definition: hdecay.h:120
void BeamMonitor::RestartFitting ( )
private

Definition at line 1300 of file BeamMonitor.cc.

References beginLumiOfBSFit_, beginLumiOfPVFit_, countGapLumi_, countLumi_, debug_, h_PVx, h_PVy, h_PVz, mapBeginBSLS, mapBeginBSTime, mapBeginPVLS, mapBeginPVTime, mapLSBSTrkSize, mapLSCF, mapLSPVStoreSize, mapNPV, mapPVx, mapPVy, mapPVz, nthBSTrk_, refBStime, refPVtime, MonitorElement::Reset(), BeamFitter::resetCutFlow(), resetHistos_, BeamFitter::resetLSRange(), BeamFitter::resetPVFitter(), BeamFitter::resetRefTime(), BeamFitter::resetTrkVector(), StartAverage_, and theBeamFitter.

1300  {
1301  if(debug_)edm::LogInfo("BeamMonitor") << " RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" <<endl;
1302  //track based fit reset here
1303  resetHistos_ = true;
1304  nthBSTrk_ = 0;
1310  beginLumiOfBSFit_ = 0;
1311  refBStime[0] = 0;
1312  //pv based fit iis reset here
1313  h_PVx[0]->Reset();
1314  h_PVy[0]->Reset();
1315  h_PVz[0]->Reset();
1316  beginLumiOfPVFit_ = 0;
1317  refPVtime[0] = 0;
1318  //Clear all the Maps here
1319  mapPVx.clear();
1320  mapPVy.clear();
1321  mapPVz.clear();
1322  mapNPV.clear();
1323  mapBeginBSLS.clear();
1324  mapBeginPVLS.clear();
1325  mapBeginBSTime.clear();
1326  mapBeginPVTime.clear();
1327  mapLSBSTrkSize.clear();
1328  mapLSPVStoreSize.clear();
1329  mapLSCF.clear(); countGapLumi_=0; countLumi_=0; StartAverage_=false;
1330 
1331 }
std::time_t refBStime[2]
Definition: BeamMonitor.h:90
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:135
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:142
void resetTrkVector()
Definition: BeamFitter.h:48
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:148
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:142
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:146
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:143
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:146
int countGapLumi_
Definition: BeamMonitor.h:105
std::time_t refPVtime[2]
Definition: BeamMonitor.h:91
void resetLSRange()
Definition: BeamFitter.h:50
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:151
bool StartAverage_
Definition: BeamMonitor.h:103
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:134
int beginLumiOfPVFit_
Definition: BeamMonitor.h:86
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:145
void resetPVFitter()
Definition: BeamFitter.h:64
void resetCutFlow()
Definition: BeamFitter.h:100
unsigned int nthBSTrk_
Definition: BeamMonitor.h:92
bool resetHistos_
Definition: BeamMonitor.h:102
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:80
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:133
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:145
int beginLumiOfBSFit_
Definition: BeamMonitor.h:84
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:142
int countLumi_
Definition: BeamMonitor.h:83
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:149
void resetRefTime()
Definition: BeamFitter.h:51
void BeamMonitor::scrollTH1 ( TH1 *  ,
std::time_t   
)
private

Definition at line 1360 of file BeamMonitor.cc.

References newFWLiteAna::bin, buffTime, pyrootRender::da, formatFitTime(), and lastNZbin.

Referenced by FitAndFill().

1360  {
1361  const char* offsetTime = formatFitTime(ref);
1362  TDatime da(offsetTime);
1363  if (lastNZbin > 0) {
1364  double val = h->GetBinContent(lastNZbin);
1365  double valErr = h->GetBinError(lastNZbin);
1366  h->Reset();
1367  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1368  int bin = (lastNZbin > buffTime ? buffTime : 1);
1369  h->SetBinContent(bin,val);
1370  h->SetBinError(bin,valErr);
1371  }
1372  else {
1373  h->Reset();
1374  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1375  }
1376 }
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:50
#define buffTime
Definition: BeamMonitor.cc:72
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
bool BeamMonitor::testScroll ( std::time_t &  ,
std::time_t &   
)
private

Definition at line 1380 of file BeamMonitor.cc.

References newFWLiteAna::bin, buffTime, hs, intervalInSec_, lastNZbin, and evf::evtn::offset().

Referenced by FitAndFill().

1380  {
1381  bool scroll_ = false;
1382  if (tmpTime_ - refTime_ >= intervalInSec_) {
1383  scroll_ = true;
1384  edm::LogInfo("BeamMonitor") << "testScroll:: Reset Time Offset" << std::endl;
1386  for (int bin = intervalInSec_; bin >= 1; bin--) {
1387  if (hs["x0_time"]->getBinContent(bin) > 0) {
1388  lastNZbin = bin;
1389  break;
1390  }
1391  }
1392  edm::LogInfo("BeamMonitor") << "testScroll:: Last non zero bin = " << lastNZbin << std::endl;
1393  if (tmpTime_ - refTime_ >= intervalInSec_ + lastNZbin) {
1394  edm::LogInfo("BeamMonitor") << "testScroll:: Time difference too large since last readout" << std::endl;
1395  lastNZbin = 0;
1396  refTime_ = tmpTime_ - buffTime;
1397  }
1398  else{
1399  edm::LogInfo("BeamMonitor") << "testScroll:: Offset to last record" << std::endl;
1400  int offset = ((lastNZbin > buffTime) ? (lastNZbin - buffTime) : (lastNZbin - 1));
1401  refTime_ += offset;
1402  }
1403  }
1404  return scroll_;
1405 }
#define buffTime
Definition: BeamMonitor.cc:72
int intervalInSec_
Definition: BeamMonitor.h:74
unsigned int offset(bool)
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:139

Member Data Documentation

int BeamMonitor::beginLumiOfBSFit_
private

Definition at line 84 of file BeamMonitor.h.

Referenced by BeamMonitor(), beginLuminosityBlock(), FitAndFill(), and RestartFitting().

int BeamMonitor::beginLumiOfPVFit_
private

Definition at line 86 of file BeamMonitor.h.

Referenced by BeamMonitor(), beginLuminosityBlock(), FitAndFill(), and RestartFitting().

edm::InputTag BeamMonitor::bsSrc_
private

Definition at line 65 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

int BeamMonitor::countEvt_
private

Definition at line 82 of file BeamMonitor.h.

Referenced by analyze().

int BeamMonitor::countGapLumi_
private

Definition at line 105 of file BeamMonitor.h.

Referenced by RestartFitting().

int BeamMonitor::countLumi_
private

Definition at line 83 of file BeamMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), FitAndFill(), and RestartFitting().

MonitorElement* BeamMonitor::cutFlowTable
private

Definition at line 160 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

DQMStore* BeamMonitor::dbe_
private

Definition at line 79 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), beginJob(), and FitAndFill().

bool BeamMonitor::debug_
private
double BeamMonitor::deltaSigCut_
private

Definition at line 95 of file BeamMonitor.h.

Referenced by BeamMonitor().

int BeamMonitor::endLumiOfBSFit_
private

Definition at line 85 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::endLumiOfPVFit_
private

Definition at line 87 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::firstAverageFit_
private

Definition at line 104 of file BeamMonitor.h.

Referenced by FitAndFill().

int BeamMonitor::fitNLumi_
private

Definition at line 70 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::fitPVNLumi_
private

Definition at line 71 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

MonitorElement* BeamMonitor::fitResults
private

Definition at line 124 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::frun
private

Definition at line 169 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

edm::TimeValue_t BeamMonitor::ftimestamp
private

Definition at line 167 of file BeamMonitor.h.

Referenced by beginRun().

MonitorElement* BeamMonitor::h_d0_phi0
private

Definition at line 117 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nTrk_lumi
private

Definition at line 116 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nVtx
private

Definition at line 131 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_nVtx_st
private

Definition at line 132 of file BeamMonitor.h.

Referenced by analyze(), beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_PVx[2]
private

Definition at line 133 of file BeamMonitor.h.

Referenced by analyze(), beginJob(), FitAndFill(), and RestartFitting().

MonitorElement* BeamMonitor::h_PVxz
private

Definition at line 136 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVy[2]
private

Definition at line 134 of file BeamMonitor.h.

Referenced by analyze(), beginJob(), FitAndFill(), and RestartFitting().

MonitorElement* BeamMonitor::h_PVyz
private

Definition at line 137 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVz[2]
private

Definition at line 135 of file BeamMonitor.h.

Referenced by analyze(), beginJob(), FitAndFill(), and RestartFitting().

MonitorElement* BeamMonitor::h_sigmaX0
private

Definition at line 128 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaY0
private

Definition at line 129 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaZ0
private

Definition at line 130 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trk_z0
private

Definition at line 118 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trkPt
private

Definition at line 122 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_trkVz
private

Definition at line 123 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_vx_dz
private

Definition at line 120 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vx_vy
private

Definition at line 119 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vy_dz
private

Definition at line 121 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_x0
private

Definition at line 125 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_y0
private

Definition at line 126 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_z0
private

Definition at line 127 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

edm::InputTag BeamMonitor::hltSrc_
private

Definition at line 68 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

std::map<TString, MonitorElement*> BeamMonitor::hs
private

Definition at line 139 of file BeamMonitor.h.

Referenced by beginJob(), beginRun(), FitAndFill(), and testScroll().

int BeamMonitor::intervalInSec_
private

Definition at line 74 of file BeamMonitor.h.

Referenced by BeamMonitor(), beginJob(), and testScroll().

std::vector<std::string> BeamMonitor::jetTrigger_
private

Definition at line 77 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

int BeamMonitor::lastlumi_
private

Definition at line 88 of file BeamMonitor.h.

Referenced by BeamMonitor(), and beginLuminosityBlock().

int BeamMonitor::lastNZbin
private

Definition at line 170 of file BeamMonitor.h.

Referenced by scrollTH1(), and testScroll().

std::map<int, int> BeamMonitor::mapBeginBSLS
private

Definition at line 145 of file BeamMonitor.h.

Referenced by beginLuminosityBlock(), endRun(), and RestartFitting().

std::map<int, std::time_t> BeamMonitor::mapBeginBSTime
private

Definition at line 146 of file BeamMonitor.h.

Referenced by beginLuminosityBlock(), endRun(), and RestartFitting().

std::map<int, int> BeamMonitor::mapBeginPVLS
private

Definition at line 145 of file BeamMonitor.h.

Referenced by beginLuminosityBlock(), endRun(), and RestartFitting().

std::map<int, std::time_t> BeamMonitor::mapBeginPVTime
private

Definition at line 146 of file BeamMonitor.h.

Referenced by beginLuminosityBlock(), endRun(), and RestartFitting().

std::map<int, std::size_t> BeamMonitor::mapLSBSTrkSize
private

Definition at line 148 of file BeamMonitor.h.

Referenced by endRun(), FitAndFill(), and RestartFitting().

std::map<int, TH1F> BeamMonitor::mapLSCF
private

Definition at line 151 of file BeamMonitor.h.

Referenced by endRun(), FitAndFill(), and RestartFitting().

std::map<int, size_t> BeamMonitor::mapLSPVStoreSize
private

Definition at line 149 of file BeamMonitor.h.

Referenced by endRun(), FitAndFill(), and RestartFitting().

std::map<int, std::vector<int> > BeamMonitor::mapNPV
private

Definition at line 143 of file BeamMonitor.h.

Referenced by analyze(), endRun(), FitAndFill(), and RestartFitting().

std::map<int, std::vector<float> > BeamMonitor::mapPVx
private

Definition at line 142 of file BeamMonitor.h.

Referenced by analyze(), endRun(), FitAndFill(), and RestartFitting().

std::map<int, std::vector<float> > BeamMonitor::mapPVy
private

Definition at line 142 of file BeamMonitor.h.

Referenced by analyze(), endRun(), FitAndFill(), and RestartFitting().

std::map<int, std::vector<float> > BeamMonitor::mapPVz
private

Definition at line 142 of file BeamMonitor.h.

Referenced by analyze(), endRun(), FitAndFill(), and RestartFitting().

double BeamMonitor::maxZ_
private

Definition at line 97 of file BeamMonitor.h.

Referenced by BeamMonitor().

unsigned int BeamMonitor::min_Ntrks_
private

Definition at line 96 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

unsigned int BeamMonitor::minNrVertices_
private

Definition at line 98 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

double BeamMonitor::minVtxNdf_
private

Definition at line 99 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

double BeamMonitor::minVtxWgt_
private

Definition at line 100 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

std::string BeamMonitor::monitorName_
private

Definition at line 64 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), beginJob(), and FitAndFill().

int BeamMonitor::nextlumi_
private

Definition at line 89 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), beginLuminosityBlock(), and endLuminosityBlock().

int BeamMonitor::nFitElements_
private

Definition at line 93 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::nFits_
private

Definition at line 94 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

unsigned int BeamMonitor::nthBSTrk_
private

Definition at line 92 of file BeamMonitor.h.

Referenced by FitAndFill(), and RestartFitting().

bool BeamMonitor::onlineMode_
private
edm::ParameterSet BeamMonitor::parameters_
private
reco::BeamSpot BeamMonitor::preBS
private

Definition at line 113 of file BeamMonitor.h.

Referenced by FitAndFill().

bool BeamMonitor::processed_
private

Definition at line 107 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), beginLuminosityBlock(), and FitAndFill().

MonitorElement* BeamMonitor::pvResults
private

Definition at line 138 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

edm::InputTag BeamMonitor::pvSrc_
private

Definition at line 67 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

reco::BeamSpot BeamMonitor::refBS
private

Definition at line 112 of file BeamMonitor.h.

Referenced by analyze().

std::time_t BeamMonitor::refBStime[2]
private
std::time_t BeamMonitor::refPVtime[2]
private
std::time_t BeamMonitor::refTime
private

Definition at line 166 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummary
private

Definition at line 157 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::reportSummary_
private

Definition at line 154 of file BeamMonitor.h.

Referenced by FitAndFill().

MonitorElement* BeamMonitor::reportSummaryContents[3]
private

Definition at line 158 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummaryMap
private

Definition at line 159 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::resetFitNLumi_
private

Definition at line 72 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), and FitAndFill().

bool BeamMonitor::resetHistos_
private

Definition at line 102 of file BeamMonitor.h.

Referenced by FitAndFill(), and RestartFitting().

int BeamMonitor::resetPVNLumi_
private

Definition at line 73 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

bool BeamMonitor::StartAverage_
private

Definition at line 103 of file BeamMonitor.h.

Referenced by analyze(), beginLuminosityBlock(), FitAndFill(), and RestartFitting().

std::time_t BeamMonitor::startTime
private

Definition at line 165 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

Float_t BeamMonitor::summaryContent_[3]
private

Definition at line 156 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::summarySum_
private

Definition at line 155 of file BeamMonitor.h.

Referenced by FitAndFill().

BeamFitter* BeamMonitor::theBeamFitter
private

Definition at line 80 of file BeamMonitor.h.

Referenced by analyze(), BeamMonitor(), FitAndFill(), RestartFitting(), and ~BeamMonitor().

std::time_t BeamMonitor::tmpTime
private

Definition at line 164 of file BeamMonitor.h.

Referenced by beginRun(), endLuminosityBlock(), and FitAndFill().

edm::InputTag BeamMonitor::tracksLabel_
private

Definition at line 66 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().