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
 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
 
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_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 70 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_.

70  :
72 
73  parameters_ = ps;
74  monitorName_ = parameters_.getUntrackedParameter<string>("monitorName","YourSubsystemName");
75  bsSrc_ = consumes<reco::BeamSpot>(
77  tracksLabel_ = consumes<reco::TrackCollection>(
79  .getUntrackedParameter<InputTag>("TrackCollection"));
80  pvSrc_ = consumes<reco::VertexCollection>(
81  parameters_.getUntrackedParameter<InputTag>("primaryVertex"));
82  hltSrc_ = consumes<TriggerResults>(
83  parameters_.getParameter<InputTag>("hltResults"));
84  intervalInSec_ = parameters_.getUntrackedParameter<int>("timeInterval",920);//40 LS X 23"
85  fitNLumi_ = parameters_.getUntrackedParameter<int>("fitEveryNLumi",-1);
86  resetFitNLumi_ = parameters_.getUntrackedParameter<int>("resetEveryNLumi",-1);
87  fitPVNLumi_ = parameters_.getUntrackedParameter<int>("fitPVEveryNLumi",-1);
88  resetPVNLumi_ = parameters_.getUntrackedParameter<int>("resetPVEveryNLumi",-1);
89  deltaSigCut_ = parameters_.getUntrackedParameter<double>("deltaSignificanceCut",15);
90  debug_ = parameters_.getUntrackedParameter<bool>("Debug");
91  onlineMode_ = parameters_.getUntrackedParameter<bool>("OnlineMode");
92  jetTrigger_ = parameters_.getUntrackedParameter<std::vector<std::string> >("jetTrigger");
93  min_Ntrks_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<int>("MinimumInputTracks");
94  maxZ_ = parameters_.getParameter<ParameterSet>("BeamFitter").getUntrackedParameter<double>("MaximumZ");
95  minNrVertices_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<unsigned int>("minNrVerticesForFit");
96  minVtxNdf_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexNdf");
97  minVtxWgt_ = parameters_.getParameter<ParameterSet>("PVFitter").getUntrackedParameter<double>("minVertexMeanWeight");
98 
100 
101  if (monitorName_ != "" ) monitorName_ = monitorName_+"/" ;
102 
108 
109  if (fitNLumi_ <= 0) fitNLumi_ = 1;
111  refBStime[0] = refBStime[1] = refPVtime[0] = refPVtime[1] = 0;
112  maxZ_ = std::fabs(maxZ_);
113  lastlumi_ = 0;
114  nextlumi_ = 0;
115  processed_ = false;
116 }
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
tuple BeamFitter
Input track for PrimaryVertex reconstruction, uncomment the following line to use pixelLess tracks pr...
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.
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 119 of file BeamMonitor.cc.

References theBeamFitter.

119  {
120  delete theBeamFitter;
121 }
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 542 of file BeamMonitor.cc.

References DQMStore::book1D(), 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_, n, nextlumi_, onlineMode_, processed_, edm::Handle< T >::product(), pvSrc_, BeamFitter::readEvent(), refBS, resetFitNLumi_, MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), StartAverage_, AlCaHLTBitMon_QueryRunRegistry::string, edmStreamStallGrapher::t, theBeamFitter, testEve_cfg::tracks, tracksLabel_, edm::TriggerNames::triggerIndex(), edm::TriggerNames::triggerName(), edm::Event::triggerNames(), triggerResults, and trigNames.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 125 of file BeamMonitor.cc.

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

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

Reimplemented from edm::EDAnalyzer.

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

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

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

Definition at line 1352 of file BeamMonitor.cc.

References endLuminosityBlock(), and onlineMode_.

1353  {
1354  if (!onlineMode_) endLuminosityBlock(lumiSeg, iSetup);
1355 }
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
Definition: BeamMonitor.cc:679
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 679 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().

680  {
681  int nthlumi = lumiSeg.id().luminosityBlock();
682  edm::LogInfo("BeamMonitor") << "endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
683 
684  if (onlineMode_ && nthlumi < nextlumi_) return;
685  const edm::TimeValue_t fendtimestamp = lumiSeg.endTime().value();
686  const std::time_t fendtime = fendtimestamp >> 32;
687  tmpTime = refBStime[1] = refPVtime[1] = fendtime;
688 }
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:167
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 1332 of file BeamMonitor.cc.

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

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

Definition at line 691 of file BeamMonitor.cc.

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

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

Definition at line 43 of file BeamMonitor.cc.

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

Referenced by beginRun(), and scrollTH1().

43  {
44 #define CET (+1)
45 #define CEST (+2)
46 
47  static char ts[] = "yyyy-Mm-dd hh:mm:ss";
48  tm * ptm;
49  ptm = gmtime ( &t );
50  int year = ptm->tm_year;
51  if (year < 1995) {
52  edm::LogError("BadTimeStamp") << "year reported is " << year << "!! resetting to 2011..." << std::endl;
53  year = 2012;
54  }
55  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);
56 
57 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
58  unsigned int b = strlen(ts);
59  while (ts[--b] == ' ') {ts[b] = 0;}
60 #endif
61  return ts;
62 
63 }
#define CEST
double b
Definition: hdecay.h:120
void BeamMonitor::RestartFitting ( )
private

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

1298  {
1299  if(debug_)edm::LogInfo("BeamMonitor") << " RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" <<endl;
1300  //track based fit reset here
1301  resetHistos_ = true;
1302  nthBSTrk_ = 0;
1308  beginLumiOfBSFit_ = 0;
1309  refBStime[0] = 0;
1310  //pv based fit iis reset here
1311  h_PVx[0]->Reset();
1312  h_PVy[0]->Reset();
1313  h_PVz[0]->Reset();
1314  beginLumiOfPVFit_ = 0;
1315  refPVtime[0] = 0;
1316  //Clear all the Maps here
1317  mapPVx.clear();
1318  mapPVy.clear();
1319  mapPVz.clear();
1320  mapNPV.clear();
1321  mapBeginBSLS.clear();
1322  mapBeginPVLS.clear();
1323  mapBeginBSTime.clear();
1324  mapBeginPVTime.clear();
1325  mapLSBSTrkSize.clear();
1326  mapLSPVStoreSize.clear();
1327  mapLSCF.clear(); countGapLumi_=0; countLumi_=0; StartAverage_=false;
1328 
1329 }
std::time_t refBStime[2]
Definition: BeamMonitor.h:93
MonitorElement * h_PVz[2]
Definition: BeamMonitor.h:138
std::map< int, std::vector< float > > mapPVx
Definition: BeamMonitor.h:145
void resetTrkVector()
Definition: BeamFitter.h:53
std::map< int, std::size_t > mapLSBSTrkSize
Definition: BeamMonitor.h:151
std::map< int, std::vector< float > > mapPVz
Definition: BeamMonitor.h:145
std::map< int, std::time_t > mapBeginPVTime
Definition: BeamMonitor.h:149
std::map< int, std::vector< int > > mapNPV
Definition: BeamMonitor.h:146
std::map< int, std::time_t > mapBeginBSTime
Definition: BeamMonitor.h:149
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:154
bool StartAverage_
Definition: BeamMonitor.h:106
MonitorElement * h_PVy[2]
Definition: BeamMonitor.h:137
int beginLumiOfPVFit_
Definition: BeamMonitor.h:89
std::map< int, int > mapBeginBSLS
Definition: BeamMonitor.h:148
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:136
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, int > mapBeginPVLS
Definition: BeamMonitor.h:148
int beginLumiOfBSFit_
Definition: BeamMonitor.h:87
std::map< int, std::vector< float > > mapPVy
Definition: BeamMonitor.h:145
int countLumi_
Definition: BeamMonitor.h:86
std::map< int, size_t > mapLSPVStoreSize
Definition: BeamMonitor.h:152
void resetRefTime()
Definition: BeamFitter.h:56
void BeamMonitor::scrollTH1 ( TH1 *  ,
std::time_t   
)
private

Definition at line 1358 of file BeamMonitor.cc.

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

Referenced by FitAndFill().

1358  {
1359  const char* offsetTime = formatFitTime(ref);
1360  TDatime da(offsetTime);
1361  if (lastNZbin > 0) {
1362  double val = h->GetBinContent(lastNZbin);
1363  double valErr = h->GetBinError(lastNZbin);
1364  h->Reset();
1365  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1366  int bin = (lastNZbin > buffTime ? buffTime : 1);
1367  h->SetBinContent(bin,val);
1368  h->SetBinError(bin,valErr);
1369  }
1370  else {
1371  h->Reset();
1372  h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1373  }
1374 }
const char * formatFitTime(const std::time_t &)
Definition: BeamMonitor.cc:43
#define buffTime
Definition: BeamMonitor.cc:65
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 1378 of file BeamMonitor.cc.

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

Referenced by FitAndFill().

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

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 163 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 127 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

int BeamMonitor::frun
private

Definition at line 172 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

edm::TimeValue_t BeamMonitor::ftimestamp
private

Definition at line 170 of file BeamMonitor.h.

Referenced by beginRun().

MonitorElement* BeamMonitor::h_d0_phi0
private

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

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_nVtx_st
private

Definition at line 135 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVx[2]
private

Definition at line 136 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVxz
private

Definition at line 139 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVy[2]
private

Definition at line 137 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_PVyz
private

Definition at line 140 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_PVz[2]
private

Definition at line 138 of file BeamMonitor.h.

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

MonitorElement* BeamMonitor::h_sigmaX0
private

Definition at line 131 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaY0
private

Definition at line 132 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_sigmaZ0
private

Definition at line 133 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trk_z0
private

Definition at line 121 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_trkPt
private

Definition at line 125 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_trkVz
private

Definition at line 126 of file BeamMonitor.h.

Referenced by analyze(), and beginJob().

MonitorElement* BeamMonitor::h_vx_dz
private

Definition at line 123 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vx_vy
private

Definition at line 122 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_vy_dz
private

Definition at line 124 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_x0
private

Definition at line 128 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_y0
private

Definition at line 129 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::h_z0
private

Definition at line 130 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 142 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 173 of file BeamMonitor.h.

Referenced by scrollTH1(), and testScroll().

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

Definition at line 148 of file BeamMonitor.h.

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

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

Definition at line 149 of file BeamMonitor.h.

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

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

Definition at line 148 of file BeamMonitor.h.

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

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

Definition at line 149 of file BeamMonitor.h.

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

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

Definition at line 151 of file BeamMonitor.h.

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

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

Definition at line 154 of file BeamMonitor.h.

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

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

Definition at line 152 of file BeamMonitor.h.

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

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

Definition at line 146 of file BeamMonitor.h.

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

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

Definition at line 145 of file BeamMonitor.h.

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

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

Definition at line 145 of file BeamMonitor.h.

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

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

Definition at line 145 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 141 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 169 of file BeamMonitor.h.

Referenced by beginRun(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummary
private

Definition at line 160 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::reportSummary_
private

Definition at line 157 of file BeamMonitor.h.

Referenced by FitAndFill().

MonitorElement* BeamMonitor::reportSummaryContents[3]
private

Definition at line 161 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

MonitorElement* BeamMonitor::reportSummaryMap
private

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

Referenced by beginRun(), and FitAndFill().

Float_t BeamMonitor::summaryContent_[3]
private

Definition at line 159 of file BeamMonitor.h.

Referenced by beginJob(), and FitAndFill().

Float_t BeamMonitor::summarySum_
private

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