50 int year = ptm->tm_year;
52 if (year <= 37) year += 2000;
53 if (year >= 70 && year <= 137) year += 1900;
56 edm::LogError(
"BadTimeStamp") <<
"year reported is " << year <<
" !!"<<std::endl;
58 edm::LogError(
"BadTimeStamp") <<
"Resetting to " <<year<<std::endl;
60 sprintf( ts,
"%4d-%02d-%02d %02d:%02d:%02d", year,ptm->tm_mon+1,ptm->tm_mday,(ptm->tm_hour+
CEST)%24, ptm->tm_min, ptm->tm_sec);
62 #ifdef STRIP_TRAILING_BLANKS_IN_TIMEZONE
63 unsigned int b = strlen(ts);
64 while (ts[--b] ==
' ') {ts[
b] = 0;}
74 countEvt_(0),countLumi_(0),nthBSTrk_(0),nFitElements_(3),resetHistos_(
false),StartAverage_(
false),firstAverageFit_(0),countGapLumi_(0) {
78 bsSrc_ = consumes<reco::BeamSpot>(
82 .getUntrackedParameter<InputTag>(
"TrackCollection"));
83 pvSrc_ = consumes<reco::VertexCollection>(
85 hltSrc_ = consumes<TriggerResults>(
112 if (fitNLumi_ <= 0) fitNLumi_ = 1;
151 h_nTrk_lumi=
dbe_->book1D(
"nTrk_lumi",
"Num. of selected tracks vs lumi (Fit)",20,0.5,20.5);
156 h_nVtx_lumi=
dbe_->book1D(
"nVtx_lumi",
"Num. of selected Vtx vs lumi (Fit)",20,0.5,20.5);
160 h_nVtx_lumi_all=
dbe_->book1D(
"nVtx_lumi_all",
"Num. of selected Vtx vs lumi (Fit) all",20,0.5,20.5);
165 h_d0_phi0 =
dbe_->bookProfile(
"d0_phi0",
"d_{0} vs. #phi_{0} (Selected Tracks)",phiBin,phiMin,phiMax,dxBin,dxMin,dxMax,
"");
169 h_vx_vy =
dbe_->book2D(
"trk_vx_vy",
"Vertex (PCA) position of selected tracks",vxBin,vxMin,vxMax,vxBin,vxMin,vxMax);
175 TDatime *
da =
new TDatime();
176 gStyle->SetTimeOffset(da->Convert(kTRUE));
179 string coord[nvar_] = {
"x",
"y",
"z",
"sigmaX",
"sigmaY",
"sigmaZ"};
180 string label[nvar_] = {
"x_{0} (cm)",
"y_{0} (cm)",
"z_{0} (cm)",
181 "#sigma_{X_{0}} (cm)",
"#sigma_{Y_{0}} (cm)",
"#sigma_{Z_{0}} (cm)"};
182 for (
int i = 0;
i < 4;
i++) {
184 for (
int ic=0; ic<nvar_; ++ic) {
185 TString histName(coord[ic]);
186 TString histTitle(coord[ic]);
187 string ytitle(label[ic]);
190 bool createHisto =
true;
193 histName +=
"0_time";
194 xtitle =
"Time [UTC]";
196 histTitle +=
" coordinate of beam spot vs time (Fit)";
198 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs time (Fit)";
203 histName.Insert(0,
"PV");
205 histTitle.Insert(0,
"Avg. ");
206 histTitle +=
" position of primary vtx vs lumi";
207 xtitle =
"Lumisection";
208 ytitle.insert(0,
"PV");
209 ytitle +=
" #pm #sigma_{PV";
213 else createHisto =
false;
218 histName.Insert(0,
"PV");
220 histTitle.Insert(0,
"Avg. ");
221 histTitle +=
" position of primary vtx vs time";
222 xtitle =
"Time [UTC]";
223 ytitle.insert(0,
"PV");
224 ytitle +=
" #pm #sigma_{PV";
228 else createHisto =
false;
231 histName +=
"0_lumi";
232 xtitle =
"Lumisection";
234 histTitle +=
" coordinate of beam spot vs lumi (Fit)";
236 histTitle = histTitle.Insert(5,
" ") +
" of beam spot vs lumi (Fit)";
240 edm::LogInfo(
"BeamMonitor") <<
"hitsName = " << histName <<
"; histTitle = " << histTitle << std::endl;
241 hs[histName] =
dbe_->book1D(histName,histTitle,40,0.5,40.5);
242 hs[histName]->setAxisTitle(xtitle,1);
243 hs[histName]->setAxisTitle(ytitle,2);
244 hs[histName]->getTH1()->SetOption(
"E1");
245 if (histName.Contains(
"time")) {
248 hs[histName]->setAxisTimeDisplay(1);
249 hs[histName]->setAxisTimeFormat(
"%H:%M:%S",1);
253 hs[histName] =
dbe_->book1D(histName,histTitle,40,0.5,40.5);
254 hs[histName]->getTH1()->SetCanExtend(TH1::kAllAxes);
255 hs[histName]->setAxisTitle(xtitle,1);
256 hs[histName]->setAxisTitle(ytitle,2);
257 hs[histName]->getTH1()->SetOption(
"E1");
258 if (histName.Contains(
"time")) {
261 hs[histName]->setAxisTimeDisplay(1);
262 hs[histName]->setAxisTimeFormat(
"%H:%M:%S",1);
269 h_trk_z0 =
dbe_->book1D(
"trk_z0",
"z_{0} of selected tracks",dzBin,dzMin,dzMax);
272 h_vx_dz =
dbe_->bookProfile(
"vx_dz",
"v_{x} vs. dz of selected tracks",dzBin,dzMin,dzMax,dxBin,dxMin,dxMax,
"");
276 h_vy_dz =
dbe_->bookProfile(
"vy_dz",
"v_{y} vs. dz of selected tracks",dzBin,dzMin,dzMax,dxBin,dxMin,dxMax,
"");
280 h_x0 =
dbe_->book1D(
"BeamMonitorFeedBack_x0",
"x coordinate of beam spot (Fit)",100,-0.01,0.01);
284 h_y0 =
dbe_->book1D(
"BeamMonitorFeedBack_y0",
"y coordinate of beam spot (Fit)",100,-0.01,0.01);
288 h_z0 =
dbe_->book1D(
"BeamMonitorFeedBack_z0",
"z coordinate of beam spot (Fit)",dzBin,dzMin,dzMax);
292 h_sigmaX0 =
dbe_->book1D(
"BeamMonitorFeedBack_sigmaX0",
"sigma x0 of beam spot (Fit)",100,0,0.05);
296 h_sigmaY0 =
dbe_->book1D(
"BeamMonitorFeedBack_sigmaY0",
"sigma y0 of beam spot (Fit)",100,0,0.05);
300 h_sigmaZ0 =
dbe_->book1D(
"BeamMonitorFeedBack_sigmaZ0",
"sigma z0 of beam spot (Fit)",100,0,10);
305 h_trkPt=
dbe_->book1D(
"trkPt",
"p_{T} of all reco'd tracks (no selection)",200,0.,50.);
308 h_trkVz=
dbe_->book1D(
"trkVz",
"Z coordinate of PCA of all reco'd tracks (no selection)",dzBin,dzMin,dzMax);
311 cutFlowTable =
dbe_->book1D(
"cutFlowTable",
"Cut flow table of track selection", 9, 0, 9 );
314 fitResults=
dbe_->book2D(
"fitResults",
"Results of previous good beam fit",2,0,2,8,0,8);
331 h_nVtx =
dbe_->book1D(
"vtxNbr",
"Reconstructed Vertices(non-fake) in all Event",60,-0.5,59.5);
335 h_nVtx_st =
dbe_->book1D(
"vtxNbr_SelectedTriggers",
"Reconstructed Vertices(non-fake) in Events",60,-0.5,59.5);
339 h_PVx[0] =
dbe_->book1D(
"PVX",
"x coordinate of Primary Vtx",50,-0.01,0.01);
343 h_PVy[0] =
dbe_->book1D(
"PVY",
"y coordinate of Primary Vtx",50,-0.01,0.01);
347 h_PVz[0] =
dbe_->book1D(
"PVZ",
"z coordinate of Primary Vtx",dzBin,dzMin,dzMax);
350 h_PVx[1] =
dbe_->book1D(
"PVXFit",
"x coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
354 h_PVy[1] =
dbe_->book1D(
"PVYFit",
"y coordinate of Primary Vtx (Last Fit)",50,-0.01,0.01);
358 h_PVz[1] =
dbe_->book1D(
"PVZFit",
"z coordinate of Primary Vtx (Last Fit)",dzBin,dzMin,dzMax);
361 h_PVxz =
dbe_->bookProfile(
"PVxz",
"PVx vs. PVz",dzBin/2,dzMin,dzMax,dxBin/2,dxMin,dxMax,
"");
365 h_PVyz =
dbe_->bookProfile(
"PVyz",
"PVy vs. PVz",dzBin/2,dzMin,dzMax,dxBin/2,dxMin,dxMax,
"");
370 pvResults=
dbe_->book2D(
"pvResults",
"Results of fitting Primary Vertices",2,0,2,6,0,6);
394 case 0 : sprintf(histo,
"x0_status");
break;
395 case 1 : sprintf(histo,
"y0_status");
break;
396 case 2 : sprintf(histo,
"z0_status");
break;
432 std::cout <<
"TimeOffset = " << eventTime << std::endl;
433 TDatime
da(eventTime);
438 for (std::map<TString,MonitorElement*>::iterator it =
hs.begin();
439 it !=
hs.end(); ++it) {
440 if ((*it).first.Contains(
"time"))
441 (*it).second->getTH1()->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
450 const std::time_t ftmptime = fbegintimestamp >> 32;
553 edm::LogInfo(
"BeamMonitor") <<
" beginLuminosityBlock:: Begin of Lumi: " << nthlumi << endl;
561 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from previous lumi section!" << std::endl;
565 edm::LogInfo(
"BeamMonitor") <<
"analyze:: Spilt event from next lumi section!!!" << std::endl;
574 refBS = *recoBeamSpotHandle;
584 tmphisto->GetNbinsX(),
585 tmphisto->GetXaxis()->GetXmin(),
586 tmphisto->GetXaxis()->GetXmax());
589 for(
int n=0;
n < tmphisto->GetNbinsX();
n++)
598 for ( reco::TrackCollection::const_iterator track = tracks->begin();
599 track != tracks->end(); ++track ) {
606 bool JetTrigPass=
false;
609 for (
unsigned int i=0;
i< triggerResults->size();
i++){
612 if(JetTrigPass)
continue;
616 if(JetTrigPass)
continue;
619 size_t found = trigName.find(string_search);
621 if(found != string::npos){
623 if(triggerResults->accept(thisTrigger_))JetTrigPass =
true;
636 for (reco::VertexCollection::const_iterator
pv = PVCollection->begin();
pv != PVCollection->end(); ++
pv) {
638 if (
pv->isFake() ||
pv->tracksSize()==0)
continue;
641 if(JetTrigPass)nPVcount_ST++;
675 map<int, std::vector<float> >::iterator itpvx=
mapPVx.begin();
676 map<int, std::vector<float> >::iterator itpvy=
mapPVy.begin();
677 map<int, std::vector<float> >::iterator itpvz=
mapPVz.begin();
679 map<int, std::vector<int> >::iterator itbspvinfo=
mapNPV.begin();
698 edm::LogInfo(
"BeamMonitor") <<
"endLuminosityBlock:: Lumi of the last event before endLuminosityBlock: " << nthlumi << endl;
702 const std::time_t fendtime = fendtimestamp >> 32;
713 int currentlumi = nextlumi;
714 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Lumi of the current fit: " << currentlumi << endl;
715 lastlumi = currentlumi;
726 size_t SizeToRemovePV= rmLSPVi->second;
727 for(std::map<int, std::size_t>::iterator rmLSPVe =
mapLSPVStoreSize.end(); ++rmLSPVi != rmLSPVe;)
728 rmLSPVi->second -= SizeToRemovePV;
739 bool resetHistoFlag_=
false;
745 resetHistoFlag_ =
true;
749 int countEvtLastNLS_=0;
752 std::map< int, std::vector<int> >::iterator mnpv=
mapNPV.begin();
753 std::map< int, std::vector<float> >::iterator mpv2=
mapPVy.begin();
754 std::map< int, std::vector<float> >::iterator mpv3=
mapPVz.begin();
756 for(std::map<
int, std::vector<float> >::iterator mpv1=
mapPVx.begin(); mpv1 !=
mapPVx.end(); ++mpv1, ++mpv2, ++mpv3, ++mnpv)
758 std::vector<float>::iterator mpvs2 = (mpv2->second).
begin();
759 std::vector<float>::iterator mpvs3 = (mpv3->second).
begin();
760 for(std::vector<float>::iterator mpvs1=(mpv1->second).begin(); mpvs1 !=(mpv1->second).
end(); ++mpvs1, ++mpvs2, ++mpvs3){
769 for(std::vector<int>::iterator mnpvs = (mnpv->second).begin(); mnpvs != (mnpv->second).
end(); ++mnpvs){
770 if((*mnpvs > 0) && (resetHistoFlag_) )
h_nVtx_st->
Fill( (*mnpvs)*(1.0) );
772 countTotPV_ += (*mnpvs);
773 if((*mnpvs) > MaxPVs) MaxPVs = (*mnpvs);
778 char tmpTitlePV[100];
782 std::vector<float> DipPVInfo_;
785 if(countTotPV_ != 0 ){
786 DipPVInfo_.push_back((
float)countEvtLastNLS_);
791 DipPVInfo_.push_back((
float)MaxPVs);
792 DipPVInfo_.push_back((
float)countTotPV_);
795 else{
for(
size_t i= 0;
i < 7;
i++){
if(
i>0)DipPVInfo_.push_back(0.);
796 else DipPVInfo_.push_back((
float)countEvtLastNLS_);}
805 const int countLS_bs =
hs[
"x0_lumi"]->getTH1()->GetEntries();
806 const int countLS_pv =
hs[
"PVx_lumi"]->getTH1()->GetEntries();
807 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: countLS_bs = " << countLS_bs <<
" ; countLS_pv = " << countLS_pv << std::endl;
808 int LSgap_bs = currentlumi/
fitNLumi_ - countLS_bs;
809 int LSgap_pv = currentlumi/
fitPVNLumi_ - countLS_pv;
814 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: LSgap_bs = " << LSgap_bs <<
" ; LSgap_pv = " << LSgap_pv << std::endl;
816 for (
int ig = 0; ig < LSgap_bs; ig++) {
820 hs[
"sigmaX0_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
821 hs[
"sigmaY0_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
822 hs[
"sigmaZ0_lumi"]->ShiftFillLast( 0., 0.,
fitNLumi_ );
825 for (
int ig = 0; ig < LSgap_pv; ig++) {
831 for (
int i=1;
i < (currentlumi - previousLS);
i++)
849 bool doPVFit =
false;
874 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus") };
876 fgaus->SetLineColor(4);
878 mean = fgaus->GetParameter(1);
879 width = fgaus->GetParameter(2);
880 meanErr = fgaus->GetParError(1);
881 widthErr = fgaus->GetParError(2);
885 hs[
"PVx_lumi_all"]->setBinContent(currentlumi,mean);
886 hs[
"PVx_lumi_all"]->setBinError(currentlumi,width);
889 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Event time outside current range of time histograms!" << std::endl;
891 hs[
"PVx_time"]->setBinContent(nthBin,mean);
892 hs[
"PVx_time"]->setBinError(nthBin,width);
896 hs[
"PVx_time_all"]->setBinContent(jthBin,mean);
897 hs[
"PVx_time_all"]->setBinError(jthBin,width);
909 tmphisto =
static_cast<TH1D *
>((
h_PVx[0]->
getTH1())->Clone(
"tmphisto"));
910 h_PVx[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
916 mean = fgaus->GetParameter(1);
917 width = fgaus->GetParameter(2);
918 meanErr = fgaus->GetParError(1);
919 widthErr = fgaus->GetParError(2);
921 hs[
"PVy_lumi_all"]->setBinContent(currentlumi,mean);
922 hs[
"PVy_lumi_all"]->setBinError(currentlumi,width);
924 hs[
"PVy_time"]->setBinContent(nthBin,mean);
925 hs[
"PVy_time"]->setBinError(nthBin,width);
928 hs[
"PVy_time_all"]->setBinContent(jthBin,mean);
929 hs[
"PVy_time_all"]->setBinError(jthBin,width);
937 tmphisto =
static_cast<TH1D *
>((
h_PVy[0]->
getTH1())->Clone(
"tmphisto"));
938 h_PVy[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
945 mean = fgaus->GetParameter(1);
946 width = fgaus->GetParameter(2);
947 meanErr = fgaus->GetParError(1);
948 widthErr = fgaus->GetParError(2);
950 hs[
"PVz_lumi_all"]->setBinContent(currentlumi,mean);
951 hs[
"PVz_lumi_all"]->setBinError(currentlumi,width);
953 hs[
"PVz_time"]->setBinContent(nthBin,mean);
954 hs[
"PVz_time"]->setBinError(nthBin,width);
957 hs[
"PVz_time_all"]->setBinContent(jthBin,mean);
958 hs[
"PVz_time_all"]->setBinError(jthBin,width);
966 tmphisto =
static_cast<TH1D *
>((
h_PVz[0]->
getTH1())->Clone(
"tmphisto"));
967 h_PVz[1]->
getTH1()->SetBins(tmphisto->GetNbinsX(),tmphisto->GetXaxis()->GetXmin(),tmphisto->GetXaxis()->GetXmax());
987 size_t PreviousRecords=0;
990 size_t SizeToRemove=0;
992 SizeToRemove = rmls->second;
993 if(
debug_)
edm::LogInfo(
"BeamMonitor")<<
" The size to remove is = "<< SizeToRemove << endl;
994 int changedAfterThis=0;
996 if(changedAfterThis > 0 ){(rmLS->second) = (rmLS->second)-SizeToRemove;
997 if((
mapLSBSTrkSize.size()- (size_t)changedAfterThis) == 2 )PreviousRecords = (rmLS->second);
1015 if(
debug_)
edm::LogInfo(
"BeamMonitor")<<
"FitAndFill:: Size of theBSViector.size() After =" << theBSvector.size() << endl;
1019 bool countFitting =
false;
1020 if (theBSvector.size() >= PreviousRecords && theBSvector.size() >=
min_Ntrks_) {
1021 countFitting =
true;
1028 const TH1F& cutFlowToSubtract =
mapLSCF.begin()->second;
1030 std::map<int, TH1F>::iterator cf =
mapLSCF.begin();
1032 for(; cf !=
mapLSCF.end(); ++cf) {
1033 cf->second.Add(&cutFlowToSubtract, -1);
1053 unsigned int itrk = 0;
1054 for (vector<BSTrkParameters>::const_iterator BSTrk = theBSvector.begin();
1055 BSTrk != theBSvector.end(); ++BSTrk, ++itrk){
1058 double vx = BSTrk->vx();
1059 double vy = BSTrk->vy();
1060 double z0 = BSTrk->z0();
1073 if (countFitting)
edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: Num of tracks collected = " <<
nthBSTrk_ << endl;
1094 <<
"; address = " << &
refBStime[0] << std::endl;
1096 <<
"; address = " << &
refBStime[1] << std::endl;
1105 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamFitter] Do BeamSpot Fit for LS = " << fitLS.first <<
" to " << fitLS.second << std::endl;
1114 edm::LogInfo(
"BeamMonitor") <<
"\n RESULTS OF DEFAULT FIT:" << endl;
1116 edm::LogInfo(
"BeamMonitor") <<
"[BeamFitter] fitting done \n" << endl;
1124 hs[
"x0_lumi_all"]->setBinContent(currentlumi,bs.
x0());
1125 hs[
"x0_lumi_all"]->setBinError(currentlumi,bs.
x0Error());
1126 hs[
"y0_lumi_all"]->setBinContent(currentlumi,bs.
y0());
1127 hs[
"y0_lumi_all"]->setBinError(currentlumi,bs.
y0Error());
1128 hs[
"z0_lumi_all"]->setBinContent(currentlumi,bs.
z0());
1129 hs[
"z0_lumi_all"]->setBinError(currentlumi,bs.
z0Error());
1130 hs[
"sigmaX0_lumi_all"]->setBinContent(currentlumi, bs.
BeamWidthX());
1132 hs[
"sigmaY0_lumi_all"]->setBinContent(currentlumi, bs.
BeamWidthY());
1134 hs[
"sigmaZ0_lumi_all"]->setBinContent(currentlumi, bs.
sigmaZ());
1135 hs[
"sigmaZ0_lumi_all"]->setBinError(currentlumi, bs.
sigmaZ0Error());
1139 hs[
"x0_time"]->setBinContent(nthBin, bs.
x0());
1140 hs[
"y0_time"]->setBinContent(nthBin, bs.
y0());
1141 hs[
"z0_time"]->setBinContent(nthBin, bs.
z0());
1142 hs[
"sigmaX0_time"]->setBinContent(nthBin, bs.
BeamWidthX());
1143 hs[
"sigmaY0_time"]->setBinContent(nthBin, bs.
BeamWidthY());
1144 hs[
"sigmaZ0_time"]->setBinContent(nthBin, bs.
sigmaZ());
1145 hs[
"x0_time"]->setBinError(nthBin, bs.
x0Error());
1146 hs[
"y0_time"]->setBinError(nthBin, bs.
y0Error());
1147 hs[
"z0_time"]->setBinError(nthBin, bs.
z0Error());
1155 hs[
"x0_time_all"]->setBinContent(jthBin, bs.
x0());
1156 hs[
"y0_time_all"]->setBinContent(jthBin, bs.
y0());
1157 hs[
"z0_time_all"]->setBinContent(jthBin, bs.
z0());
1158 hs[
"sigmaX0_time_all"]->setBinContent(jthBin, bs.
BeamWidthX());
1159 hs[
"sigmaY0_time_all"]->setBinContent(jthBin, bs.
BeamWidthY());
1160 hs[
"sigmaZ0_time_all"]->setBinContent(jthBin, bs.
sigmaZ());
1161 hs[
"x0_time_all"]->setBinError(jthBin, bs.
x0Error());
1162 hs[
"y0_time_all"]->setBinError(jthBin, bs.
y0Error());
1163 hs[
"z0_time_all"]->setBinError(jthBin, bs.
z0Error());
1172 if (bs.
type() > 0) {
1180 double alpha = std::atan2(bs.
y0(),bs.
x0());
1181 std::unique_ptr<TF1>
f1{
new TF1(
"f1",
"[0]*sin(x-[1])",-3.14,3.14) };
1182 f1->SetParameters(amp,alpha);
1183 f1->SetParLimits(0,amp-0.1,amp+0.1);
1184 f1->SetParLimits(1,alpha-0.577,alpha+0.577);
1185 f1->SetLineColor(4);
1190 std::unique_ptr<TF1> fgaus{
new TF1(
"fgaus",
"gaus") };
1191 fgaus->SetParameters(mean,width);
1192 fgaus->SetLineColor(4);
1199 sprintf(tmpTitle,
"%s %i %s %i",
"Fitted Beam Spot (cm) of LS: ",LSRange.first,
" to ",LSRange.second);
1207 if (bs.
type() > 0) {
1222 if (bs.
type() > 0) {
1245 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Beam fit fails!!! \n" << endl;
1246 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output beam spot for DIP \n" << endl;
1265 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] No fitting \n" << endl;
1266 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: [BeamMonitor] Output fake beam spot for DIP \n" << endl;
1305 edm::LogInfo(
"BeamMonitor") <<
"FitAndFill:: The flag is ON for running average Beam Spot fit"<<endl;
1321 if(
debug_)
edm::LogInfo(
"BeamMonitor") <<
" RestartingFitting:: Restart Beami everything to a fresh start !!! because Gap is > 10 LS" <<endl;
1381 char offsetTime[64];
1383 TDatime
da(offsetTime);
1385 double val = h->GetBinContent(
lastNZbin);
1386 double valErr = h->GetBinError(
lastNZbin);
1388 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1390 h->SetBinContent(bin,val);
1391 h->SetBinError(bin,valErr);
1395 h->GetXaxis()->SetTimeOffset(da.Convert(kTRUE));
1402 bool scroll_ =
false;
1405 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Reset Time Offset" << std::endl;
1408 if (
hs[
"x0_time"]->getBinContent(
bin) > 0) {
1415 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Time difference too large since last readout" << std::endl;
1420 edm::LogInfo(
"BeamMonitor") <<
"testScroll:: Offset to last record" << std::endl;
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
LuminosityBlockID id() const
T getParameter(std::string const &) const
BeamMonitor(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > hltSrc_
double z0() const
z coordinate
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
unsigned int minNrVertices_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
void setBinContent(int binx, double content)
set content of bin (1-D)
double sigmaZ0Error() const
error on sigma z
MonitorElement * reportSummary
void analyze(const edm::Event &e, const edm::EventSetup &c)
tuple BeamFitter
SETUP TRACKING RECONSTRUCTION ####.
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * cutFlowTable
double dydzError() const
error on dydz
MonitorElement * h_PVz[2]
bool testScroll(std::time_t &, std::time_t &)
std::vector< BSTrkParameters > getBSvector()
#define DEFINE_FWK_MODULE(type)
std::map< int, std::vector< float > > mapPVx
void subtractFromCutFlow(const TH1F *toSubtract)
edm::EDGetTokenT< reco::VertexCollection > pvSrc_
std::vector< Track > TrackCollection
collection of Tracks
std::size_t getPVvectorSize()
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)
edm::TimeValue_t ftimestamp
edm::LuminosityBlockNumber_t luminosityBlock() const
void update(void)
Mark the object updated.
Timestamp const & beginTime() const
MonitorElement * h_sigmaZ0
MonitorElement * h_nTrk_lumi
std::map< int, std::size_t > mapLSBSTrkSize
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * fitResults
std::vector< std::string > jetTrigger_
void readEvent(const edm::Event &iEvent)
MonitorElement * h_sigmaY0
double getMeanError(int axis=1) const
std::map< int, std::vector< float > > mapPVz
std::map< int, std::time_t > mapBeginPVTime
std::map< int, std::vector< int > > mapNPV
LuminosityBlockNumber_t luminosityBlock() const
std::map< int, std::time_t > mapBeginBSTime
double dydz() const
dydz slope
void ShiftFillLast(double y, double ye=0., int32_t xscale=1)
double dxdzError() const
error on dxdz
unsigned int triggerIndex(std::string const &name) const
edm::EDGetTokenT< reco::TrackCollection > tracksLabel_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
Timestamp const & endTime() const
void beginRun(const edm::Run &r, const edm::EventSetup &c)
void formatFitTime(char *, const std::time_t &)
MonitorElement * pvResults
MonitorElement * h_nVtx_lumi
double BeamWidthX() const
beam width X
void setFitLSRange(int ls0, int ls1)
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
std::pair< time_t, time_t > getRefTime()
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
static std::string const triggerResults
double BeamWidthXError() const
error on beam width X, assume error in X = Y
double z0Error() const
error on z
unsigned long long TimeValue_t
double dxdz() const
dxdz slope
std::map< int, TH1F > mapLSCF
void SetPVInfo(const std::vector< float > &v1_)
double x0Error() const
error on x
double y0Error() const
error on y
MonitorElement * h_nVtx_lumi_all
static const char *const trigNames[]
double getRMSError(int axis=1) const
get RMS uncertainty of histogram along x, y or z axis(axis=1,2,3 respectively)
void FitAndFill(const edm::LuminosityBlock &lumiSeg, int &, int &, int &)
Float_t summaryContent_[3]
MonitorElement * h_sigmaX0
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
MonitorElement * h_nVtx_st
T const * product() const
MonitorElement * h_PVy[2]
void resizeBSvector(unsigned int nsize)
std::string const & triggerName(unsigned int index) const
MonitorElement * reportSummaryContents[3]
double sigmaZ() const
sigma z
double BeamWidthY() const
beam width Y
LuminosityBlockNumber_t luminosityBlock() const
MonitorElement * h_trk_z0
std::map< int, int > mapBeginBSLS
Timestamp const & beginTime() const
edm::ParameterSet parameters_
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void resizePVvector(unsigned int npvsize)
TProfile * getTProfile(void) const
double y0() const
y coordinate
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void setRefTime(time_t t0, time_t t1)
volatile std::atomic< bool > shutdown_flag false
TH2F * getTH2F(void) const
BeamFitter * theBeamFitter
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]
std::pair< int, int > getFitLSRange()
void Reset(void)
reset ME (ie. contents, errors, etc)
std::map< int, int > mapBeginPVLS
void endRun(const edm::Run &r, const edm::EventSetup &c)
TimeValue_t value() const
std::map< int, std::vector< float > > mapPVy
MonitorElement * h_d0_phi0
reco::BeamSpot getBeamSpot()
void scrollTH1(TH1 *, std::time_t)
BeamType type() const
return beam type
MonitorElement * reportSummaryMap
double x0() const
x coordinate
std::map< TString, MonitorElement * > hs
std::map< int, size_t > mapLSPVStoreSize