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 edm::EDConsumerBase

Public Member Functions

 BeamMonitor (const edm::ParameterSet &)
 
 ~BeamMonitor ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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::EDGetTokenT< reco::BeamSpotbsSrc_
 
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_lumi
 
MonitorElementh_nVtx_lumi_all
 
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::EDGetTokenT
< edm::TriggerResults
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::EDGetTokenT
< reco::VertexCollection
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::EDGetTokenT
< reco::TrackCollection
tracksLabel_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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 33 of file BeamMonitor.h.

Constructor & Destructor Documentation

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

Definition at line 76 of file BeamMonitor.cc.

References beam_dqm_sourceclient-live_cfg::BeamFitter, beginLumiOfBSFit_, beginLumiOfPVFit_, bsSrc_, edm::EDConsumerBase::consumesCollector(), 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_.

76  :
78 
79  parameters_ = ps;
80  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName");
81  bsSrc_ = consumes<reco::BeamSpot>(
83  tracksLabel_ = consumes<reco::TrackCollection>(
85  .getUntrackedParameter<InputTag>("TrackCollection"));
86  pvSrc_ = consumes<reco::VertexCollection>(
87  parameters_.getUntrackedParameter<InputTag>("primaryVertex"));
88  hltSrc_ = consumes<TriggerResults>(
89  parameters_.getParameter<InputTag>("hltResults"));
90  intervalInSec_ = parameters_.getUntrackedParameter<int>("timeInterval",920);//40 LS X 23"
91  fitNLumi_ = parameters_.getUntrackedParameter<int>("fitEveryNLumi",-1);
92  resetFitNLumi_ = parameters_.getUntrackedParameter<int>("resetEveryNLumi",-1);
93  fitPVNLumi_ = parameters_.getUntrackedParameter<int>("fitPVEveryNLumi",-1);
94  resetPVNLumi_ = parameters_.getUntrackedParameter<int>("resetPVEveryNLumi",-1);
95  deltaSigCut_ = parameters_.getUntrackedParameter<double>("deltaSignificanceCut",15);
96  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
97  onlineMode_ = parameters_.getUntrackedParameter<bool>("OnlineMode");
98  jetTrigger_ = parameters_.getUntrackedParameter<std::vector<std::string> >("jetTrigger");
99  min_Ntrks_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumInputTracks");
100  maxZ_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumZ");
101  minNrVertices_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minNrVerticesForFit");
102  minVtxNdf_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexNdf");
103  minVtxWgt_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexMeanWeight");
104 
106 
107  if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ;
108 
114 
115  if (fitNLumi_ <= 0) fitNLumi_ = 1;
117  refBStime[0] = refBStime[1] = refPVtime[0] = refPVtime[1] = 0;
118  maxZ_ = std::fabs(maxZ_);
119  lastlumi_ = 0;
120  nextlumi_ = 0;
121  processed_ = false;
122 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
Definition: BeamMonitor.h:71
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minNrVertices_
Definition: BeamMonitor.h:101
int nFitElements_
Definition: BeamMonitor.h:96
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
int endLumiOfPVFit_
Definition: BeamMonitor.h:90
int resetFitNLumi_
Definition: BeamMonitor.h:75
double minVtxWgt_
Definition: BeamMonitor.h:103
double minVtxNdf_
Definition: BeamMonitor.h:102
bool processed_
Definition: BeamMonitor.h:110
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
Definition: BeamMonitor.h:70
void resetTrkVector()
Definition: BeamFitter.h:53
std::vector< std::string > jetTrigger_
Definition: BeamMonitor.h:80
int fitPVNLumi_
Definition: BeamMonitor.h:74
int intervalInSec_
Definition: BeamMonitor.h:77
int countGapLumi_
Definition: BeamMonitor.h:108
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
Definition: BeamMonitor.h:69
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
tuple BeamFitter
SETUP TRACKING RECONSTRUCTION ####.
int endLumiOfBSFit_
Definition: BeamMonitor.h:88
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
void resetLSRange()
Definition: BeamFitter.h:55
DQMStore * dbe_
Definition: BeamMonitor.h:82
double maxZ_
Definition: BeamMonitor.h:100
bool StartAverage_
Definition: BeamMonitor.h:106
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
Definition: BeamMonitor.h:68
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
int resetPVNLumi_
Definition: BeamMonitor.h:76
edm::ParameterSet parameters_
Definition: BeamMonitor.h:66
void resetPVFitter()
Definition: BeamFitter.h:69
unsigned int nthBSTrk_
Definition: BeamMonitor.h:95
unsigned int min_Ntrks_
Definition: BeamMonitor.h:99
bool resetHistos_
Definition: BeamMonitor.h:105
double deltaSigCut_
Definition: BeamMonitor.h:98
int firstAverageFit_
Definition: BeamMonitor.h:107
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
std::string monitorName_
Definition: BeamMonitor.h:67
int countLumi_
Definition: BeamMonitor.h:86
bool onlineMode_
Definition: BeamMonitor.h:79
void resetRefTime()
Definition: BeamFitter.h:56
BeamMonitor::~BeamMonitor ( )

Definition at line 125 of file BeamMonitor.cc.

References theBeamFitter.

125  {
126  delete theBeamFitter;
127 }
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 558 of file BeamMonitor.cc.

References bsSrc_, countEvt_, countLumi_, cutFlowTable, dbe_, MonitorElement::Fill(), newFWLiteAna::found, edm::Event::getByToken(), 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_, gen::n, nextlumi_, onlineMode_, processed_, edm::Handle< T >::product(), MetAnalyzer::pv(), pvSrc_, BeamFitter::readEvent(), refBS, resetFitNLumi_, MonitorElement::setBinLabel(), StartAverage_, AlCaHLTBitMon_QueryRunRegistry::string, edmStreamStallGrapher::t, theBeamFitter, testEve_cfg::tracks, tracksLabel_, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerResults, and trigNames.

559  {
560  const int nthlumi = iEvent.luminosityBlock();
561  if (onlineMode_ && (nthlumi < nextlumi_)) {
562  edm::LogInfo("BeamMonitor") << "analyze:: Spilt event from previous lumi section!" << std::endl;
563  return;
564  }
565  if (onlineMode_ && (nthlumi > nextlumi_)) {
566  edm::LogInfo("BeamMonitor") << "analyze:: Spilt event from next lumi section!!!" << std::endl;
567  return;
568  }
569 
570  countEvt_++;
571  theBeamFitter->readEvent(iEvent); //Remember when track fitter read the event in the same place the PVFitter read the events !!!!!!!!!
572 
573  Handle<reco::BeamSpot> recoBeamSpotHandle;
574  iEvent.getByToken(bsSrc_,recoBeamSpotHandle);
575  refBS = *recoBeamSpotHandle;
576 
577  dbe_->setCurrentFolder(monitorName_+"Fit/");
578 
579  //------Cut Flow Table filled every event!--------------------------------------
580  std::string cutFlowTableName = cutFlowTable->getName();
581  // Make a copy of the cut flow table from the beam fitter.
582  TH1F * tmphisto =
583  static_cast<TH1F*>((theBeamFitter->getCutFlow())->Clone("tmphisto"));
584  cutFlowTable->getTH1()->SetBins(
585  tmphisto->GetNbinsX(),
586  tmphisto->GetXaxis()->GetXmin(),
587  tmphisto->GetXaxis()->GetXmax());
588  // Update the bin labels
589  if (countEvt_ == 1) // SetLabel just once
590  for(int n=0; n < tmphisto->GetNbinsX(); n++)
591  cutFlowTable->setBinLabel(n+1,tmphisto->GetXaxis()->GetBinLabel(n+1),1);
592  cutFlowTable = dbe_->book1D(cutFlowTableName, tmphisto);
593  delete tmphisto;
594 
595  //----Reco tracks -------------------------------------
597  iEvent.getByToken(tracksLabel_, TrackCollection);
598  const reco::TrackCollection *tracks = TrackCollection.product();
599  for ( reco::TrackCollection::const_iterator track = tracks->begin();
600  track != tracks->end(); ++track ) {
601  h_trkPt->Fill(track->pt()); //no need to change here for average bs
602  h_trkVz->Fill(track->vz());
603  }
604 
605  //-------HLT Trigger --------------------------------
607  bool JetTrigPass= false;
608  if(iEvent.getByToken(hltSrc_, triggerResults)){
609  const edm::TriggerNames & trigNames = iEvent.triggerNames(*triggerResults);
610  for (unsigned int i=0; i< triggerResults->size(); i++){
611  std::string trigName = trigNames.triggerName(i);
612 
613  if(JetTrigPass) continue;
614 
615  for(size_t t=0; t <jetTrigger_.size(); ++t){
616 
617  if(JetTrigPass) continue;
618 
619  string string_search (jetTrigger_[t]);
620  size_t found = trigName.find(string_search);
621 
622  if(found != string::npos){
623  int thisTrigger_ = trigNames.triggerIndex(trigName);
624  if(triggerResults->accept(thisTrigger_))JetTrigPass = true;
625  }//if trigger found
626  }//for(t=0;..)
627  }//for(i=0; ..)
628  }//if trigger colleciton exist)
629 
630  //------ Primary Vertices-------
632 
633  if (iEvent.getByToken(pvSrc_, PVCollection )) {
634  int nPVcount = 0;
635  int nPVcount_ST =0; //For Single Trigger(hence ST)
636 
637  for (reco::VertexCollection::const_iterator pv = PVCollection->begin(); pv != PVCollection->end(); ++pv) {
638  //--- vertex selection
639  if (pv->isFake() || pv->tracksSize()==0) continue;
640  nPVcount++; // count non fake pv:
641 
642  if(JetTrigPass)nPVcount_ST++; //non-fake pv with a specific trigger
643 
644  if (pv->ndof() < minVtxNdf_ || (pv->ndof()+3.)/pv->tracksSize() < 2*minVtxWgt_) continue;
645 
646  //Fill this map to store xyx for pv so that later we can remove the first one for run aver
647  mapPVx[countLumi_].push_back(pv->x());
648  mapPVy[countLumi_].push_back(pv->y());
649  mapPVz[countLumi_].push_back(pv->z());
650 
651  if(!StartAverage_){//for first N LS
652  h_PVx[0]->Fill(pv->x());
653  h_PVy[0]->Fill(pv->y());
654  h_PVz[0]->Fill(pv->z());
655  h_PVxz->Fill(pv->z(),pv->x());
656  h_PVyz->Fill(pv->z(),pv->y());
657  }//for first N LiS
658  else{
659  h_PVxz->Fill(pv->z(),pv->x());
660  h_PVyz->Fill(pv->z(),pv->y());}
661 
662  }//loop over pvs
663 
664 
665  h_nVtx->Fill(nPVcount*1.); //no need to change it for average BS
666 
667  mapNPV[countLumi_].push_back((nPVcount_ST));
668 
669  if(!StartAverage_){ h_nVtx_st->Fill(nPVcount_ST*1.);}
670 
671  }//if pv collection is availaable
672 
673 
674  if(StartAverage_)
675  {
676  map<int, std::vector<float> >::iterator itpvx=mapPVx.begin();
677  map<int, std::vector<float> >::iterator itpvy=mapPVy.begin();
678  map<int, std::vector<float> >::iterator itpvz=mapPVz.begin();
679 
680  map<int, std::vector<int> >::iterator itbspvinfo=mapNPV.begin();
681 
682  if( (int)mapPVx.size() > resetFitNLumi_){ //sometimes the events is not there but LS is there!
683  mapPVx.erase(itpvx);
684  mapPVy.erase(itpvy);
685  mapPVz.erase(itpvz);
686  mapNPV.erase(itbspvinfo);
687  }//loop over Last N lumi collected
688 
689  }//StartAverage==true
690 
691  processed_ = true;
692 }
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
Definition: BeamMonitor.h:71
const std::string & getName(void) const
get name of ME
int i
Definition: DBlmapReader.cc:9
int resetFitNLumi_
Definition: BeamMonitor.h:75
MonitorElement * h_nVtx
Definition: BeamMonitor.h:136
double minVtxWgt_
Definition: BeamMonitor.h:103
MonitorElement * cutFlowTable
Definition: BeamMonitor.h:165
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:140
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:147
MonitorElement * h_PVxz
Definition: BeamMonitor.h:141
double minVtxNdf_
Definition: BeamMonitor.h:102
bool processed_
Definition: BeamMonitor.h:110
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
Definition: BeamMonitor.h:70
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:13
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:80
void readEvent(const edm::Event &iEvent)
Definition: BeamFitter.cc:215
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:147
void Fill(long long x)
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:148
int iEvent
Definition: GenABIO.cc:230
unsigned int triggerIndex(std::string const &name) const
Definition: TriggerNames.cc:32
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
Definition: BeamMonitor.h:69
MonitorElement * h_PVyz
Definition: BeamMonitor.h:142
reco::BeamSpot refBS
Definition: BeamMonitor.h:115
TH1 * getTH1(void) const
static std::string const triggerResults
Definition: EdmProvDump.cc:40
DQMStore * dbe_
Definition: BeamMonitor.h:82
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:74
bool StartAverage_
Definition: BeamMonitor.h:106
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
Definition: BeamMonitor.h:68
MonitorElement * h_nVtx_st
Definition: BeamMonitor.h:137
T const * product() const
Definition: Handle.h:81
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:139
tuple tracks
Definition: testEve_cfg.py:39
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
TH1F * getCutFlow()
Definition: BeamFitter.h:97
MonitorElement * h_trkPt
Definition: BeamMonitor.h:127
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:138
MonitorElement * h_trkVz
Definition: BeamMonitor.h:128
std::string monitorName_
Definition: BeamMonitor.h:67
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:147
int countLumi_
Definition: BeamMonitor.h:86
bool onlineMode_
Definition: BeamMonitor.h:79
void BeamMonitor::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file BeamMonitor.cc.

References cutFlowTable, pyrootRender::da, dbe_, objects.IsoTrackAnalyzer::dzMax, MonitorElement::Fill(), fitResults, MonitorElement::getName(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), MonitorElement::getTH2F(), h_d0_phi0, h_nTrk_lumi, h_nVtx, h_nVtx_lumi, h_nVtx_lumi_all, 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, timingPdfMaker::histo, hs, i, intervalInSec_, diffTwoXMLs::label, monitorName_, gen::n, nFitElements_, AlCaHLTBitMon_ParallelJobs::options, parameters_, pvResults, reportSummary, reportSummaryContents, reportSummaryMap, MonitorElement::setAxisTitle(), MonitorElement::setBinContent(), MonitorElement::setBinLabel(), and summaryContent_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 448 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().

449  {
450  int nthlumi = lumiSeg.luminosityBlock();
451  const edm::TimeValue_t fbegintimestamp = lumiSeg.beginTime().value();
452  const std::time_t ftmptime = fbegintimestamp >> 32;
453 
454 
455  if (countLumi_ == 0 && (!processed_)) {
457  refBStime[0] = refPVtime[0] = ftmptime;
458  mapBeginBSLS[countLumi_] = nthlumi;
459  mapBeginPVLS[countLumi_] = nthlumi;
460  mapBeginBSTime[countLumi_] = ftmptime;
461  mapBeginPVTime[countLumi_] = ftmptime;
462  }//for the first record
463 
464 if(nthlumi > nextlumi_){
465  if(processed_){ countLumi_++;
466  //store here them will need when we remove the first one of Last N LS
467  mapBeginBSLS[countLumi_] = nthlumi;
468  mapBeginPVLS[countLumi_] = nthlumi;
469  mapBeginBSTime[countLumi_] = ftmptime;
470  mapBeginPVTime[countLumi_] = ftmptime;
471  }//processed passed but not the first lumi
472  if((!processed_) && countLumi_ !=0){
473  mapBeginBSLS[countLumi_] = nthlumi;
474  mapBeginPVLS[countLumi_] = nthlumi;
475  mapBeginBSTime[countLumi_] = ftmptime;
476  mapBeginPVTime[countLumi_] = ftmptime;
477  }//processed fails for last lumi
478  }//nthLumi > nextlumi
479 
480 
481  if(StartAverage_ ){
482  //Just Make sure it get rest
483  refBStime[0] =0;
484  refPVtime[0] =0;
487 
488  if(debug_)edm::LogInfo("BeamMonitor") << " beginLuminosityBlock: Size of mapBeginBSLS before = "<< mapBeginBSLS.size()<<endl;
489  if(nthlumi> nextlumi_){ //this make sure that it does not take into account this lumi for fitting and only look forward for new lumi
490  //as countLumi also remains the same so map value get overwritten once return to normal running.
491  //even if few LS are misssing and DQM module do not sees them then it catchs up again
492  map<int, int>::iterator itbs=mapBeginBSLS.begin();
493  map<int, int>::iterator itpv=mapBeginPVLS.begin();
494  map<int, std::time_t>::iterator itbstime=mapBeginBSTime.begin();
495  map<int, std::time_t>::iterator itpvtime=mapBeginPVTime.begin();
496 
497  mapBeginBSLS.erase(itbs);
498  mapBeginPVLS.erase(itpv);
499  mapBeginBSTime.erase(itbstime);
500  mapBeginPVTime.erase(itpvtime);
501 
502  /*//not sure if want this or not ??
503  map<int, int>::iterator itgapb=mapBeginBSLS.begin();
504  map<int, int>::iterator itgape=mapBeginBSLS.end(); itgape--;
505  countGapLumi_ = ( (itgape->second) - (itgapb->second) );
506  //if we see Gap more than then 2*resetNFitLumi !!!!!!!
507  //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
508  // so better start as fresh and reset everything like starting in the begining!
509  if(countGapLumi_ >= 2*resetFitNLumi_){RestartFitting(); mapBeginBSLS[countLumi_] = nthlumi;}
510  */
511  }
512 
513  if(debug_) edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Size of mapBeginBSLS After = "<< mapBeginBSLS.size()<<endl;
514 
515  map<int, int>::iterator bbs = mapBeginBSLS.begin();
516  map<int, int>::iterator bpv = mapBeginPVLS.begin();
517  map<int, std::time_t>::iterator bbst = mapBeginBSTime.begin();
518  map<int, std::time_t>::iterator bpvt = mapBeginPVTime.begin();
519 
520 
521  if (beginLumiOfPVFit_ == 0) beginLumiOfPVFit_ = bpv->second; //new begin time after removing the LS
522  if (beginLumiOfBSFit_ == 0) beginLumiOfBSFit_ = bbs->second;
523  if (refBStime[0] == 0) refBStime[0] = bbst->second;
524  if (refPVtime[0] == 0) refPVtime[0] = bpvt->second;
525 
526  }//same logic for average fit as above commented line
527 
528 
529  map<int, std::time_t>::iterator nbbst = mapBeginBSTime.begin();
530  map<int, std::time_t>::iterator nbpvt = mapBeginPVTime.begin();
531 
532 
533  if (onlineMode_ && (nthlumi < nextlumi_)) return;
534 
535  if (onlineMode_) {
536  if (nthlumi > nextlumi_) {
537  if (countLumi_ != 0 && processed_) FitAndFill(lumiSeg,lastlumi_,nextlumi_,nthlumi);
538  nextlumi_ = nthlumi;
539  edm::LogInfo("BeamMonitor") << "beginLuminosityBlock:: Next Lumi to Fit: " << nextlumi_ << endl;
540  if((StartAverage_) && refBStime[0] == 0) refBStime[0] = nbbst->second;
541  if((StartAverage_) && refPVtime[0] == 0) refPVtime[0] = nbpvt->second;
542  }
543  }
544  else{
545  if (processed_) FitAndFill(lumiSeg,lastlumi_,nextlumi_,nthlumi);
546  nextlumi_ = nthlumi;
547  edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Next Lumi to Fit: " << nextlumi_ << endl;
548  if ((StartAverage_) && refBStime[0] == 0) refBStime[0] = nbbst->second;
549  if ((StartAverage_) && refPVtime[0] == 0) refPVtime[0] = nbpvt->second;
550  }
551 
552  //countLumi_++;
553  if (processed_) processed_ = false;
554  edm::LogInfo("BeamMonitor") << " beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
555 }
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
bool processed_
Definition: BeamMonitor.h:110
Timestamp const & beginTime() const
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:151
LuminosityBlockNumber_t luminosityBlock() const
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:151
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
unsigned long long TimeValue_t
Definition: Timestamp.h:28
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Definition: BeamMonitor.cc:708
bool StartAverage_
Definition: BeamMonitor.h:106
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:150
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:150
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
TimeValue_t value() const
Definition: Timestamp.h:56
int countLumi_
Definition: BeamMonitor.h:86
bool onlineMode_
Definition: BeamMonitor.h:79
void BeamMonitor::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 427 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().

427  {
428 
429  frun = r.run();
430  ftimestamp = r.beginTime().value();
431  tmpTime = ftimestamp >> 32;
433  const char* eventTime = formatFitTime(tmpTime);
434  std::cout << "TimeOffset = " << eventTime << std::endl;
435  TDatime da(eventTime);
436  if (debug_) {
437  edm::LogInfo("BeamMonitor") << "TimeOffset = ";
438  da.Print();
439  }
440  for (std::map<TString,MonitorElement*>::iterator it = hs.begin();
441  it != hs.end(); ++it) {
442  if ((*it).first.Contains("time"))
443  (*it).second->getTH1()->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
444  }
445 }
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:44
RunNumber_t run() const
Definition: RunBase.h:42
edm::TimeValue_t ftimestamp
Definition: BeamMonitor.h:172
std::time_t refTime
Definition: BeamMonitor.h:171
std::time_t startTime
Definition: BeamMonitor.h:170
Timestamp const & beginTime() const
Definition: RunBase.h:43
tuple cout
Definition: gather_cfg.py:121
std::time_t tmpTime
Definition: BeamMonitor.h:169
TimeValue_t value() const
Definition: Timestamp.h:56
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:144
void BeamMonitor::endJob ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protected

Definition at line 1375 of file BeamMonitor.cc.

References endLuminosityBlock(), and onlineMode_.

1376  {
1377  if (!onlineMode_) endLuminosityBlock(lumiSeg, iSetup);
1378 }
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: BeamMonitor.cc:696
bool onlineMode_
Definition: BeamMonitor.h:79
void BeamMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 696 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().

697  {
698  int nthlumi = lumiSeg.id().luminosityBlock();
699  edm::LogInfo("BeamMonitor") << "endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
700 
701  if (onlineMode_ && nthlumi < nextlumi_) return;
702  const edm::TimeValue_t fendtimestamp = lumiSeg.endTime().value();
703  const std::time_t fendtime = fendtimestamp >> 32;
704  tmpTime = refBStime[1] = refPVtime[1] = fendtime;
705 }
LuminosityBlockID id() const
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
Timestamp const & endTime() const
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
unsigned long long TimeValue_t
Definition: Timestamp.h:28
LuminosityBlockNumber_t luminosityBlock() const
std::time_t tmpTime
Definition: BeamMonitor.h:169
TimeValue_t value() const
Definition: Timestamp.h:56
bool onlineMode_
Definition: BeamMonitor.h:79
void BeamMonitor::endRun ( const edm::Run r,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1355 of file BeamMonitor.cc.

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

1355  {
1356 
1357 if(debug_)edm::LogInfo("BeamMonitor") << "endRun:: Clearing all the Maps "<<endl;
1358 //Clear all the Maps here
1359 mapPVx.clear();
1360 mapPVy.clear();
1361 mapPVz.clear();
1362 mapNPV.clear();
1363 mapBeginBSLS.clear();
1364 mapBeginPVLS.clear();
1365 mapBeginBSTime.clear();
1366 mapBeginPVTime.clear();
1367 mapLSBSTrkSize.clear();
1368 mapLSPVStoreSize.clear();
1369 mapLSCF.clear();
1370 
1371 
1372 }
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:147
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:153
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:147
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:151
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:148
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:151
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:156
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:150
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:150
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:147
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:154
void BeamMonitor::FitAndFill ( const edm::LuminosityBlock lumiSeg,
int &  lastlumi,
int &  nextlumi,
int &  nthlumi 
)
private

Definition at line 708 of file BeamMonitor.cc.

References alpha, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthXError(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::BeamWidthYError(), begin, beginLumiOfBSFit_, beginLumiOfPVFit_, 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_lumi, h_nVtx_lumi_all, 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, cuy::ii, python.multivaluedict::map(), mapLSBSTrkSize, mapLSCF, mapLSPVStoreSize, mapNPV, mapPVx, mapPVy, mapPVz, timingPdfMaker::mean, min_Ntrks_, minNrVertices_, monitorName_, gen::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(), 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, filesave_online::tmpfile, tmpTime, reco::BeamSpot::type(), MonitorElement::update(), create_public_lumi_plots::width, reco::BeamSpot::x0(), reco::BeamSpot::x0Error(), reco::BeamSpot::y0(), reco::BeamSpot::y0Error(), reco::BeamSpot::z0(), and reco::BeamSpot::z0Error().

Referenced by beginLuminosityBlock().

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

Definition at line 44 of file BeamMonitor.cc.

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

Referenced by beginRun(), and scrollTH1().

44  {
45 #define CET (+1)
46 #define CEST (+2)
47 
48  static char ts[] = "yyyy-Mm-dd hh:mm:ss";
49  tm * ptm;
50  ptm = gmtime ( &t );
51  int year = ptm->tm_year;
52  //check if year is ok
53  if (year <= 37) year += 2000;
54  if (year >= 70 && year <= 137) year += 1900;
55 
56  if (year < 1995){
57  edm::LogError("BadTimeStamp") << "year reported is " << year <<" !!"<<std::endl;
58  year = 2015; //overwritten later by BeamFitter.cc for fits but needed here for TH1
59  edm::LogError("BadTimeStamp") << "Resetting to " <<year<<std::endl;
60  }
61  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);
62 
63 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
64  unsigned int b = strlen(ts);
65  while (ts[--b] == ' ') {ts[b] = 0;}
66 #endif
67  return ts;
68 
69 }
#define CEST
double b
Definition: hdecay.h:120
void BeamMonitor::RestartFitting ( )
private

Definition at line 1321 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.

1321  {
1322  if(debug_)edm::LogInfo("BeamMonitor") << " RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" <<endl;
1323  //track based fit reset here
1324  resetHistos_ = true;
1325  nthBSTrk_ = 0;
1331  beginLumiOfBSFit_ = 0;
1332  refBStime[0] = 0;
1333  //pv based fit iis reset here
1334  h_PVx[0]->Reset();
1335  h_PVy[0]->Reset();
1336  h_PVz[0]->Reset();
1337  beginLumiOfPVFit_ = 0;
1338  refPVtime[0] = 0;
1339  //Clear all the Maps here
1340  mapPVx.clear();
1341  mapPVy.clear();
1342  mapPVz.clear();
1343  mapNPV.clear();
1344  mapBeginBSLS.clear();
1345  mapBeginPVLS.clear();
1346  mapBeginBSTime.clear();
1347  mapBeginPVTime.clear();
1348  mapLSBSTrkSize.clear();
1349  mapLSPVStoreSize.clear();
1350  mapLSCF.clear(); countGapLumi_=0; countLumi_=0; StartAverage_=false;
1351 
1352 }
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:140
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:147
void resetTrkVector()
Definition: BeamFitter.h:53
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:153
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:147
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:151
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:148
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:151
int countGapLumi_
Definition: BeamMonitor.h:108
std::time_t refPVtime[2]
Definition: BeamMonitor.h:94
void resetLSRange()
Definition: BeamFitter.h:55
std::map< int, TH1F > mapLSCF
Definition: BeamMonitor.h:156
bool StartAverage_
Definition: BeamMonitor.h:106
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:139
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:150
void resetPVFitter()
Definition: BeamFitter.h:69
void resetCutFlow()
Definition: BeamFitter.h:105
unsigned int nthBSTrk_
Definition: BeamMonitor.h:95
bool resetHistos_
Definition: BeamMonitor.h:105
BeamFitter * theBeamFitter
Definition: BeamMonitor.h:83
MonitorElement * h_PVx[2]
Definition: BeamMonitor.h:138
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:150
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:147
int countLumi_
Definition: BeamMonitor.h:86
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:154
void resetRefTime()
Definition: BeamFitter.h:56
void BeamMonitor::scrollTH1 ( TH1 *  ,
std::time_t   
)
private

Definition at line 1381 of file BeamMonitor.cc.

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

Referenced by FitAndFill().

1381  {
1382  const char* offsetTime = formatFitTime(ref);
1383  TDatime da(offsetTime);
1384  if (lastNZbin > 0) {
1385  double val = h->GetBinContent(lastNZbin);
1386  double valErr = h->GetBinError(lastNZbin);
1387  h->Reset();
1388  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1389  int bin = (lastNZbin > buffTime ? buffTime : 1);
1390  h->SetBinContent(bin,val);
1391  h->SetBinError(bin,valErr);
1392  }
1393  else {
1394  h->Reset();
1395  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1396  }
1397 }
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:44
#define buffTime
Definition: BeamMonitor.cc:71
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 1401 of file BeamMonitor.cc.

References newFWLiteAna::bin, buffTime, hs, intervalInSec_, lastNZbin, and hltrates_dqm_sourceclient-live_cfg::offset.

Referenced by FitAndFill().

1401  {
1402  bool scroll_ = false;
1403  if (tmpTime_ - refTime_ >= intervalInSec_) {
1404  scroll_ = true;
1405  edm::LogInfo("BeamMonitor") << "testScroll:: Reset Time Offset" << std::endl;
1407  for (int bin = intervalInSec_; bin >= 1; bin--) {
1408  if (hs["x0_time"]->getBinContent(bin) > 0) {
1409  lastNZbin = bin;
1410  break;
1411  }
1412  }
1413  edm::LogInfo("BeamMonitor") << "testScroll:: Last non zero bin = " << lastNZbin << std::endl;
1414  if (tmpTime_ - refTime_ >= intervalInSec_ + lastNZbin) {
1415  edm::LogInfo("BeamMonitor") << "testScroll:: Time difference too large since last readout" << std::endl;
1416  lastNZbin = 0;
1417  refTime_ = tmpTime_ - buffTime;
1418  }
1419  else{
1420  edm::LogInfo("BeamMonitor") << "testScroll:: Offset to last record" << std::endl;
1421  int offset = ((lastNZbin > buffTime) ? (lastNZbin - buffTime) : (lastNZbin - 1));
1422  refTime_ += offset;
1423  }
1424  }
1425  return scroll_;
1426 }
#define buffTime
Definition: BeamMonitor.cc:71
int intervalInSec_
Definition: BeamMonitor.h:77
std::map< TString, MonitorElement * > hs
Definition: BeamMonitor.h:144

Member Data Documentation

int BeamMonitor::beginLumiOfBSFit_
private

Definition at line 87 of file BeamMonitor.h.

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

int BeamMonitor::beginLumiOfPVFit_
private

Definition at line 89 of file BeamMonitor.h.

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

edm::EDGetTokenT<reco::BeamSpot> BeamMonitor::bsSrc_
private

Definition at line 68 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

int BeamMonitor::countEvt_
private

Definition at line 85 of file BeamMonitor.h.

Referenced by analyze().

int BeamMonitor::countGapLumi_
private

Definition at line 108 of file BeamMonitor.h.

Referenced by RestartFitting().

int BeamMonitor::countLumi_
private

Definition at line 86 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::cutFlowTable
private

Definition at line 165 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

DQMStore* BeamMonitor::dbe_
private

Definition at line 82 of file BeamMonitor.h.

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

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

Definition at line 98 of file BeamMonitor.h.

Referenced by BeamMonitor().

int BeamMonitor::endLumiOfBSFit_
private

Definition at line 88 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::endLumiOfPVFit_
private

Definition at line 90 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::firstAverageFit_
private

Definition at line 107 of file BeamMonitor.h.

Referenced by FitAndFill().

int BeamMonitor::fitNLumi_
private

Definition at line 73 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

int BeamMonitor::fitPVNLumi_
private

Definition at line 74 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

MonitorElement* BeamMonitor::fitResults
private

Definition at line 129 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::frun
private

Definition at line 174 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

edm::TimeValue_t BeamMonitor::ftimestamp
private

Definition at line 172 of file BeamMonitor.h.

Referenced by beginRun().

MonitorElement* BeamMonitor::h_d0_phi0
private

Definition at line 122 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nTrk_lumi
private

Definition at line 119 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nVtx
private

Definition at line 136 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_nVtx_lumi
private

Definition at line 120 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nVtx_lumi_all
private

Definition at line 121 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_nVtx_st
private

Definition at line 137 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVx[2]
private

Definition at line 138 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVxz
private

Definition at line 141 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVy[2]
private

Definition at line 139 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVyz
private

Definition at line 142 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVz[2]
private

Definition at line 140 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_sigmaX0
private

Definition at line 133 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaY0
private

Definition at line 134 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaZ0
private

Definition at line 135 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trk_z0
private

Definition at line 123 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trkPt
private

Definition at line 127 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_trkVz
private

Definition at line 128 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_vx_dz
private

Definition at line 125 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vx_vy
private

Definition at line 124 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vy_dz
private

Definition at line 126 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_x0
private

Definition at line 130 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_y0
private

Definition at line 131 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_z0
private

Definition at line 132 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

edm::EDGetTokenT<edm::TriggerResults> BeamMonitor::hltSrc_
private

Definition at line 71 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

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

Definition at line 144 of file BeamMonitor.h.

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

int BeamMonitor::intervalInSec_
private

Definition at line 77 of file BeamMonitor.h.

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

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

Definition at line 80 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

int BeamMonitor::lastlumi_
private

Definition at line 91 of file BeamMonitor.h.

Referenced by BeamMonitor(), and beginLuminosityBlock().

int BeamMonitor::lastNZbin
private

Definition at line 175 of file BeamMonitor.h.

Referenced by scrollTH1(), and testScroll().

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

Definition at line 150 of file BeamMonitor.h.

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

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

Definition at line 151 of file BeamMonitor.h.

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

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

Definition at line 150 of file BeamMonitor.h.

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

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

Definition at line 151 of file BeamMonitor.h.

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

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

Definition at line 153 of file BeamMonitor.h.

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

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

Definition at line 156 of file BeamMonitor.h.

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

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

Definition at line 154 of file BeamMonitor.h.

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

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

Definition at line 148 of file BeamMonitor.h.

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

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

Definition at line 147 of file BeamMonitor.h.

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

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

Definition at line 147 of file BeamMonitor.h.

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

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

Definition at line 147 of file BeamMonitor.h.

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

double BeamMonitor::maxZ_
private

Definition at line 100 of file BeamMonitor.h.

Referenced by BeamMonitor().

unsigned int BeamMonitor::min_Ntrks_
private

Definition at line 99 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

unsigned int BeamMonitor::minNrVertices_
private

Definition at line 101 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

double BeamMonitor::minVtxNdf_
private

Definition at line 102 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

double BeamMonitor::minVtxWgt_
private

Definition at line 103 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

std::string BeamMonitor::monitorName_
private

Definition at line 67 of file BeamMonitor.h.

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

int BeamMonitor::nextlumi_
private

Definition at line 92 of file BeamMonitor.h.

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

int BeamMonitor::nFitElements_
private

Definition at line 96 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::nFits_
private

Definition at line 97 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

unsigned int BeamMonitor::nthBSTrk_
private

Definition at line 95 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 116 of file BeamMonitor.h.

Referenced by FitAndFill().

bool BeamMonitor::processed_
private

Definition at line 110 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::pvResults
private

Definition at line 143 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

edm::EDGetTokenT<reco::VertexCollection> BeamMonitor::pvSrc_
private

Definition at line 70 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().

reco::BeamSpot BeamMonitor::refBS
private

Definition at line 115 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 171 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummary
private

Definition at line 162 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::reportSummary_
private

Definition at line 159 of file BeamMonitor.h.

Referenced by FitAndFill().

MonitorElement* BeamMonitor::reportSummaryContents[3]
private

Definition at line 163 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummaryMap
private

Definition at line 164 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::resetFitNLumi_
private

Definition at line 75 of file BeamMonitor.h.

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

bool BeamMonitor::resetHistos_
private

Definition at line 105 of file BeamMonitor.h.

Referenced by FitAndFill(), and RestartFitting().

int BeamMonitor::resetPVNLumi_
private

Definition at line 76 of file BeamMonitor.h.

Referenced by BeamMonitor(), and FitAndFill().

bool BeamMonitor::StartAverage_
private

Definition at line 106 of file BeamMonitor.h.

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

std::time_t BeamMonitor::startTime
private

Definition at line 170 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

Float_t BeamMonitor::summaryContent_[3]
private

Definition at line 161 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::summarySum_
private

Definition at line 160 of file BeamMonitor.h.

Referenced by FitAndFill().

BeamFitter* BeamMonitor::theBeamFitter
private

Definition at line 83 of file BeamMonitor.h.

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

std::time_t BeamMonitor::tmpTime
private

Definition at line 169 of file BeamMonitor.h.

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

edm::EDGetTokenT<reco::TrackCollection> BeamMonitor::tracksLabel_
private

Definition at line 69 of file BeamMonitor.h.

Referenced by analyze(), and BeamMonitor().