|
|
Go to the documentation of this file.
52 ecalHitsProducer_(iConfig.getParameter<
std::
string>(
"ecalRecHitsProducer")),
53 barrelHits_(iConfig.getParameter<
std::
string>(
"barrelHitCollection")),
54 endcapHits_(iConfig.getParameter<
std::
string>(
"endcapHitCollection")),
55 eCut_barl_(iConfig.getParameter<double>(
"eCut_barrel")),
56 ap_(iConfig.getParameter<double>(
"ap")),
57 b_(iConfig.getParameter<double>(
"b")),
58 eventSet_(iConfig.getParameter<
int>(
"eventSet")),
59 statusThreshold_(iConfig.getUntrackedParameter<
int>(
"statusThreshold", 3)),
60 reiteration_(iConfig.getUntrackedParameter<
bool>(
"reiteration",
false)),
61 oldcalibfile_(iConfig.getUntrackedParameter<
std::
string>(
"oldcalibfile",
"EcalintercalibConstants.xml")) {
129 t <<
"et_spectrum_b_" <<
i + 1;
133 t <<
"e_spectrum_b_" <<
i + 1;
138 t <<
"et_spectrum_e_" <<
i + 1;
142 t <<
"e_spectrum_e_" <<
i + 1;
154 edm::LogInfo(
"Calibration") <<
"[PhiSymmetryCalibration] At end of job";
158 TFile
f(
"Espectra_plus.root",
"recreate");
178 std::ofstream k_barl_out(
"k_barl.dat",
ios::out);
183 std::ofstream k_endc_out(
"k_endc.dat",
ios::out);
192 stringstream etsum_file_barl;
193 etsum_file_barl <<
"etsum_barl_" <<
eventSet_ <<
".dat";
195 std::ofstream etsum_barl_out(etsum_file_barl.str().c_str(),
ios::out);
205 etsum_barl_out.close();
207 stringstream etsum_file_endc;
208 etsum_file_endc <<
"etsum_endc_" <<
eventSet_ <<
".dat";
210 std::ofstream etsum_endc_out(etsum_file_endc.str().c_str(),
ios::out);
222 etsum_endc_out.close();
243 if (!barrelRecHitsHandle.
isValid()) {
244 LogError(
"") <<
"[PhiSymmetryCalibration] Error! Can't get product!" << std::endl;
248 if (!endcapRecHitsHandle.
isValid()) {
249 LogError(
"") <<
"[PhiSymmetryCalibration] Error! Can't get product!" << std::endl;
261 for (itb = barrelRecHitsHandle->
begin(); itb != barrelRecHitsHandle->
end(); itb++) {
264 float et = itb->energy() / cosh(
eta);
265 float e = itb->energy();
276 int sign =
hit.ieta() > 0 ? 1 : 0;
307 for (ite = endcapRecHitsHandle->
begin(); ite != endcapRecHitsHandle->
end(); ite++) {
312 float et = ite->energy() / cosh(
eta);
313 float e = ite->energy();
321 int sign =
hit.zside() > 0 ? 1 : 0;
326 double eCut_endc = 0;
330 eCut_endc =
ap_ + eta_ring *
b_;
334 float et_thr = eCut_endc / cosh(
eta) + 1.;
381 std::cout <<
"PHIREPRT : run " <<
run.run() <<
" start " << (
run.beginTime().value() >> 32) <<
" end "
382 << (
run.endTime().value() >> 32) <<
" dur "
383 << (
run.endTime().value() >> 32) - (
run.beginTime().value() >> 32)
400 std::vector<TGraph*> k_barl_graph(
kBarlRings);
401 std::vector<TCanvas*> k_barl_plot(
kBarlRings);
404 TF1 mypol1(
"mypol1",
"pol1");
409 epsilon_M_eb[imiscal] =
miscalEB_[imiscal] - 1.;
412 k_barl_graph[
ieta]->Fit(&mypol1);
415 t <<
"k_barl_" <<
ieta + 1;
416 k_barl_plot[
ieta] =
new TCanvas(
t.str().c_str(),
"");
417 k_barl_plot[
ieta]->SetFillColor(10);
418 k_barl_plot[
ieta]->SetGrid();
419 k_barl_graph[
ieta]->SetMarkerSize(1.);
420 k_barl_graph[
ieta]->SetMarkerColor(4);
421 k_barl_graph[
ieta]->SetMarkerStyle(20);
423 k_barl_graph[
ieta]->GetXaxis()->SetTitleSize(.05);
424 k_barl_graph[
ieta]->GetYaxis()->SetTitleSize(.05);
425 k_barl_graph[
ieta]->GetXaxis()->SetTitle(
"#epsilon_{M}");
426 k_barl_graph[
ieta]->GetYaxis()->SetTitle(
"#epsilon_{T}");
427 k_barl_graph[
ieta]->Draw(
"AP");
429 k_barl_[
ieta] = k_barl_graph[
ieta]->GetFunction(
"pol1")->GetParameter(1);
440 epsilon_M_ee[imiscal] =
miscalEE_[imiscal] - 1.;
443 k_endc_graph[
ring]->Fit(&mypol1);
446 t <<
"k_endc_" <<
ring + 1;
447 k_endc_plot[
ring] =
new TCanvas(
t.str().c_str(),
"");
448 k_endc_plot[
ring]->SetFillColor(10);
449 k_endc_plot[
ring]->SetGrid();
450 k_endc_graph[
ring]->SetMarkerSize(1.);
451 k_endc_graph[
ring]->SetMarkerColor(4);
452 k_endc_graph[
ring]->SetMarkerStyle(20);
454 k_endc_graph[
ring]->GetXaxis()->SetTitleSize(.05);
455 k_endc_graph[
ring]->GetYaxis()->SetTitleSize(.05);
456 k_endc_graph[
ring]->GetXaxis()->SetTitle(
"#epsilon_{M}");
457 k_endc_graph[
ring]->GetYaxis()->SetTitle(
"#epsilon_{T}");
458 k_endc_graph[
ring]->Draw(
"AP");
460 k_endc_[
ring] = k_endc_graph[
ring]->GetFunction(
"pol1")->GetParameter(1);
464 TFile
f(
"PhiSymmetryCalibration_kFactors.root",
"recreate");
466 k_barl_plot[
ieta]->Write();
467 delete k_barl_plot[
ieta];
468 delete k_barl_graph[
ieta];
471 k_endc_plot[
ring]->Write();
472 delete k_endc_plot[
ring];
473 delete k_endc_graph[
ring];
500 edm::LogError(
"PhiSym") <<
"Error reading XML files" << endl;
ret
prodAgent to be discontinued
static const int kBarlRings
PhiSymmetryCalibration(const edm::ParameterSet &iConfig)
Constructor.
std::vector< EcalRecHit >::const_iterator const_iterator
unsigned int nhits_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Timestamp const & beginTime() const
double etsum_barl_[kBarlRings][kBarlWedges][kSides]
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
double miscalEB_[kNMiscalBinsEB]
TimeValue_t value() const
Log< level::Info, false > LogInfo
bool goodCell_endc[kEndcWedgesX][kEndcWedgesX][kSides]
bool goodCell_barl[kBarlRings][kBarlWedges][kSides]
static int readXML(const std::string &filename, EcalCondHeader &header, EcalFloatCondObjectContainer &record)
static const int kNMiscalBinsEE
std::vector< TH1F * > e_spectrum_e_histos
static const int kEndcWedgesY
GlobalPoint cellPos_[kEndcWedgesX][kEndcWedgesY]
std::string oldcalibfile_
double etaBoundary_[kEndcEtaRings+1]
void setup(const CaloGeometry *geometry, const EcalChannelStatus *chstatus, int statusThreshold)
void analyze(const edm::Event &, const edm::EventSetup &) override
Called at each event.
double etsum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
void endJob() override
Called at end of job.
Timestamp const & endTime() const
double miscalEE_[kNMiscalBinsEE]
double k_barl_[kBarlRings]
static const float kMiscalRangeEE
const_iterator begin() const
void endRun(edm::Run const &, const edm::EventSetup &) override
int endcapRing_[kEndcWedgesX][kEndcWedgesY]
static const float kMiscalRangeEB
void beginJob() override
Called at beginning of job.
static const int kNMiscalBinsEB
~PhiSymmetryCalibration() override
Destructor.
const_iterator end() const
void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) override
LuminosityBlockID id() const
void setUp(const edm::EventSetup &setup)
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
static const int kEndcEtaRings
Log< level::Error, false > LogError
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< TH1F * > et_spectrum_b_histos
static const int kEndcWedgesX
EcalIntercalibConstants oldCalibs_
the old calibration constants (when reiterating, the last ones derived)
std::vector< TH1F * > e_spectrum_b_histos
double etsum_endc_miscal_[kNMiscalBinsEE][kEndcEtaRings]
static const int kBarlWedges
Abs< T >::type abs(const T &t)
std::vector< TH1F * > et_spectrum_e_histos
std::string ecalHitsProducer_
double etsum_barl_miscal_[kNMiscalBinsEB][kBarlRings]
int nRing_[kEndcEtaRings]
double k_endc_[kEndcEtaRings]
std::string fullPath() const
unsigned int nhits_barl_[kBarlRings][kBarlWedges][kSides]
int statusThreshold_
threshold in channel status beyond which channel is marked bad