111 _historyProduct(iConfig.getParameter<edm::InputTag>(
"historyProduct")),
112 _apvphasecoll(iConfig.getParameter<edm::InputTag>(
"apvPhaseCollection")),
113 _phasepart(iConfig.getUntrackedParameter<std::
string>(
"phasePartition",
"None")),
114 _wantdbxvsbxincycle(iConfig.getUntrackedParameter<bool>(
"wantDBXvsBXincycle",
false)),
115 _wantdbxvsbx(iConfig.getUntrackedParameter<bool>(
"wantDBXvsBX",
false)),
116 _wantbxincyclevsbx(iConfig.getUntrackedParameter<bool>(
"wantBXincyclevsBX",
false)),
117 _wantorbitvsbxincycle(iConfig.getUntrackedParameter<bool>(
"wantOrbitvsBXincycle",
false)),
119 m_maxLS(iConfig.getUntrackedParameter<unsigned int>(
"maxLSBeforeRebin",100)),
120 m_LSfrac(iConfig.getUntrackedParameter<unsigned int>(
"startingLSFraction",4)),
121 m_ewhdepthHisto(iConfig.getUntrackedParameter<bool>(
"wantEWHDepthHisto",
false)),
123 _dbxvsbxincycle(0), _dbxvsbx(0), _bxincyclevsbx(0), _orbitvsbxincycle(0), m_ewhdepth(0)
127 std::vector<edm::ParameterSet> dbxhistoparams(iConfig.
getUntrackedParameter<std::vector<edm::ParameterSet> >(
"dbxHistosParams",std::vector<edm::ParameterSet>()));
129 for(std::vector<edm::ParameterSet>::const_iterator params=dbxhistoparams.begin();params!=dbxhistoparams.end();++params) {
130 m_dbxindices.push_back(std::pair<unsigned int,unsigned int>(params->getParameter<
unsigned int>(
"firstEvent"),params->getParameter<
unsigned int>(
"secondEvent")));
132 sprintf(hname,
"dbx_%d_%d",params->getParameter<
unsigned int>(
"firstEvent"),params->getParameter<
unsigned int>(
"secondEvent"));
134 sprintf(htitle,
"dbx(%d,%d)",params->getParameter<
unsigned int>(
"firstEvent"),params->getParameter<
unsigned int>(
"secondEvent"));
136 m_dbxhistos.push_back(
_rhm.
makeTH1F(hname,htitle,params->getParameter<
int>(
"nbins"),params->getParameter<
double>(
"min"),
137 params->getParameter<
double>(
"max")));
138 LogDebug(
"DBXHistoPreBooking") <<
"Booked DBX histo named " << hname <<
" untitled " << htitle;
184 (*_dbx)->Fill(he->deltaBX());
185 std::vector<std::pair<unsigned int,unsigned int> >::const_iterator indices=
m_dbxindices.begin();
186 for(std::vector<TH1F**>::const_iterator dbxhist=
m_dbxhistos.begin();dbxhist!=
m_dbxhistos.end();++dbxhist,++indices) {
187 (*(*dbxhist))->
Fill(he->deltaBX(indices->first,indices->second));
198 long long tbx = he->absoluteBX();
199 if(apvphase.isValid() && !apvphase.failedToGet()) {
200 const int thephase = apvphase->getPhase(
_phasepart);
206 (*_bxincycle)->Fill(tbx%70);
213 LogDebug(
"InvalidPhase") <<
"Invalid APVCyclePhase value : " <<
_phasepart <<
" " << thephase;
224 if(*
_dbx) { (*_dbx)->GetXaxis()->SetTitle(
"#DeltaBX"); }
227 for(std::vector<TH1F**>::const_iterator dbxhist=
m_dbxhistos.begin();dbxhist!=
m_dbxhistos.end();++dbxhist) {
228 LogDebug(
"HistoPointer") << *dbxhist;
229 if(*(*dbxhist)) { (*(*dbxhist))->GetXaxis()->SetTitle(
"#DeltaBX"); }
231 LogDebug(
"LabelDone") <<
"all labels set";
233 if(*
_bx) { (*_bx)->GetXaxis()->SetTitle(
"BX"); }
235 if(*
_bxincycle) { (*_bxincycle)->GetXaxis()->SetTitle(
"Event BX mod(70)"); }
238 (*_orbit)->SetBit(TH1::kCanRebin);
239 (*_orbit)->GetXaxis()->SetTitle(
"time [Orb#]");
242 LogDebug(
"StdPlotsDone") <<
"all labels in std plots set";
245 (*_dbxvsbxincycle)->GetXaxis()->SetTitle(
"Event BX mod(70)"); (*_dbxvsbxincycle)->GetYaxis()->SetTitle(
"#DeltaBX");
248 if(
_dbxvsbx && *
_dbxvsbx) { (*_dbxvsbx)->GetXaxis()->SetTitle(
"BX"); (*_dbxvsbx)->GetYaxis()->SetTitle(
"#DeltaBX"); }
251 (*_bxincyclevsbx)->GetXaxis()->SetTitle(
"BX"); (*_bxincyclevsbx)->GetYaxis()->SetTitle(
"Event BX mod(70)");
255 (*_orbitvsbxincycle)->SetBit(TH1::kCanRebin);
256 (*_orbitvsbxincycle)->GetXaxis()->SetTitle(
"Event BX mod(70)"); (*_orbitvsbxincycle)->GetYaxis()->SetTitle(
"time [Orb#]");
260 (*m_ewhdepth)->GetXaxis()->SetTitle(
"Depth");
T getUntrackedParameter(std::string const &, T const &) const
const bool _wantdbxvsbxincycle
const bool _wantorbitvsbxincycle
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
const edm::InputTag _apvphasecoll
int bunchCrossing() const
std::vector< std::pair< unsigned int, unsigned int > > m_dbxindices
virtual void endRun(const edm::Run &, const edm::EventSetup &) override
TH1F ** makeTH1F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax)
const edm::InputTag _historyProduct
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const unsigned int m_LSfrac
const bool _wantbxincyclevsbx
TH2F ** _orbitvsbxincycle
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
const std::string _phasepart
EventTimeDistribution(const edm::ParameterSet &)
void beginRun(const edm::Run &iRun)
const unsigned int m_maxLS
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
TH2F ** makeTH2F(const char *name, const char *title, const unsigned int nbinx, const double xmin, const double xmax, const unsigned int nbiny, const double ymin, const double ymax)
const bool m_ewhdepthHisto
std::vector< TH1F ** > m_dbxhistos