CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PhiSymmetryCalibration_step2 Class Reference

#include <PhiSymmetryCalibration_step2.h>

Inheritance diagram for PhiSymmetryCalibration_step2:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
void fillConstantsHistos ()
 
void fillHistos ()
 
void outResidHistos ()
 
 PhiSymmetryCalibration_step2 (const edm::ParameterSet &iConfig)
 
void readEtSums ()
 
void setUp (const edm::EventSetup &setup)
 
void setupResidHistos ()
 
 ~PhiSymmetryCalibration_step2 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

std::vector< DetIdbarrelCells
 
std::vector< TH2F * > correl_barl_histos
 
std::vector< TH2F * > correl_endc_histos
 
EcalGeomPhiSymHelper e_
 
std::vector< DetIdendcapCells
 
float epsilon_M_barl [kBarlRings][kBarlWedges][kSides]
 
float epsilon_M_endc [kEndcWedgesX][kEndcWedgesY][kSides]
 
double esum_barl_ [kBarlRings][kBarlWedges][kSides]
 
double esum_endc_ [kEndcWedgesX][kEndcWedgesX][kSides]
 
double esumMean_barl_ [kBarlRings]
 
double esumMean_endc_ [kEndcEtaRings]
 
double etsum_barl_ [kBarlRings][kBarlWedges][kSides]
 
double etsum_endc_ [kEndcWedgesX][kEndcWedgesX][kSides]
 
double etsum_endc_uncorr [kEndcWedgesX][kEndcWedgesX][kSides]
 
double etsumMean_barl_ [kBarlRings]
 
double etsumMean_endc_ [kEndcEtaRings]
 
bool firstpass_
 
bool have_initial_miscalib_
 
std::string initialmiscalibfile_
 
double k_barl_ [kBarlRings]
 
double k_endc_ [kEndcEtaRings]
 
std::vector< TH1F * > miscal_resid_barl_histos
 res miscalib histos More...
 
std::vector< TH1F * > miscal_resid_endc_histos
 
EcalIntercalibConstants miscalib_
 initial miscalibration applied if any) More...
 
EcalIntercalibConstants newCalibs_
 calib constants that we are going to calculate More...
 
unsigned int nhits_barl_ [kBarlRings][kBarlWedges][kSides]
 
unsigned int nhits_endc_ [kEndcWedgesX][kEndcWedgesX][kSides]
 
std::string oldcalibfile_
 
EcalIntercalibConstants oldCalibs_
 the old calibration constants (when reiterating, the last ones derived) More...
 
float rawconst_barl [kBarlRings][kBarlWedges][kSides]
 
float rawconst_endc [kEndcWedgesX][kEndcWedgesX][kSides]
 
bool reiteration_
 
int statusThreshold_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 12 of file PhiSymmetryCalibration_step2.h.

Constructor & Destructor Documentation

◆ PhiSymmetryCalibration_step2()

PhiSymmetryCalibration_step2::PhiSymmetryCalibration_step2 ( const edm::ParameterSet iConfig)

Definition at line 23 of file PhiSymmetryCalibration_step2.cc.

23  {
24  statusThreshold_ = iConfig.getUntrackedParameter<int>("statusThreshold", 0);
25  have_initial_miscalib_ = iConfig.getUntrackedParameter<bool>("haveInitialMiscalib", false);
26  initialmiscalibfile_ = iConfig.getUntrackedParameter<std::string>("initialmiscalibfile", "InitialMiscalib.xml");
27  oldcalibfile_ = iConfig.getUntrackedParameter<std::string>("oldcalibfile", "EcalIntercalibConstants.xml");
28  reiteration_ = iConfig.getUntrackedParameter<bool>("reiteration", false);
29  firstpass_ = true;
30 }

References edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PhiSymmetryCalibration_step2()

PhiSymmetryCalibration_step2::~PhiSymmetryCalibration_step2 ( )
override

Definition at line 21 of file PhiSymmetryCalibration_step2.cc.

21 {}

Member Function Documentation

◆ analyze()

void PhiSymmetryCalibration_step2::analyze ( const edm::Event ev,
const edm::EventSetup se 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 32 of file PhiSymmetryCalibration_step2.cc.

32  {
33  if (firstpass_) {
34  setUp(se);
35  firstpass_ = false;
36  }
37 }

◆ beginJob()

void PhiSymmetryCalibration_step2::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file PhiSymmetryCalibration_step2.cc.

98  {
99  for (int ieta = 0; ieta < kBarlRings; ieta++) {
100  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
101  for (int sign = 0; sign < kSides; sign++) {
102  etsum_barl_[ieta][iphi][sign] = 0.;
103  nhits_barl_[ieta][iphi][sign] = 0;
104  esum_barl_[ieta][iphi][sign] = 0.;
105  }
106  }
107  }
108 
109  for (int ix = 0; ix < kEndcWedgesX; ix++) {
110  for (int iy = 0; iy < kEndcWedgesY; iy++) {
111  for (int sign = 0; sign < kSides; sign++) {
112  etsum_endc_[ix][iy][sign] = 0.;
113  nhits_endc_[ix][iy][sign] = 0;
114  esum_endc_[ix][iy][sign] = 0.;
115  }
116  }
117  }
118 
119  readEtSums();
121 }

References LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, kBarlRings, kBarlWedges, kEndcWedgesX, kEndcWedgesY, kSides, and Validation_hcalonly_cfi::sign.

◆ endJob()

void PhiSymmetryCalibration_step2::endJob ( void  )
overridevirtual

this is the new constant, or better, the correction to be applied to the old constant

residual miscalibraition / expected precision

Reimplemented from edm::EDAnalyzer.

Definition at line 123 of file PhiSymmetryCalibration_step2.cc.

123  {
124  if (firstpass_) {
125  edm::LogError("PhiSym") << "Must process at least one event-Exiting" << endl;
126  return;
127  }
128 
129  // Here the real calculation of constants happens
130 
131  // perform the area correction for endcap etsum
132  // NOT USED ANYMORE
133 
134  for (int ix = 0; ix < kEndcWedgesX; ix++) {
135  for (int iy = 0; iy < kEndcWedgesY; iy++) {
136  int ring = e_.endcapRing_[ix][iy];
137 
138  if (ring != -1) {
139  for (int sign = 0; sign < kSides; sign++) {
140  etsum_endc_uncorr[ix][iy][sign] = etsum_endc_[ix][iy][sign];
141  etsum_endc_[ix][iy][sign] *= e_.meanCellArea_[ring] / e_.cellArea_[ix][iy];
142  }
143  }
144  }
145  }
146 
147  // ETsum histos, maps and other usefull histos (area,...)
148  // are filled and saved here
149  fillHistos();
150 
151  // write ETsum mean for all rings
152  std::ofstream etsumMean_barl_out("etsumMean_barl.dat", ios::out);
153  for (int ieta = 0; ieta < kBarlRings; ieta++) {
154  etsumMean_barl_out << ieta << " " << etsumMean_barl_[ieta] << endl;
155  }
156  etsumMean_barl_out.close();
157 
158  std::ofstream etsumMean_endc_out("etsumMean_endc.dat", ios::out);
159  for (int ring = 0; ring < kEndcEtaRings; ring++) {
160  etsumMean_endc_out << e_.cellPos_[ring][50].eta() << " " << etsumMean_endc_[ring] << endl;
161  }
162  etsumMean_endc_out.close();
163 
164  // determine barrel calibration constants
165  for (int ieta = 0; ieta < kBarlRings; ieta++) {
166  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
167  for (int sign = 0; sign < kSides; sign++) {
168  if (e_.goodCell_barl[ieta][iphi][sign]) {
169  float etsum = etsum_barl_[ieta][iphi][sign];
170  float epsilon_T = (etsum / etsumMean_barl_[ieta]) - 1.;
171  rawconst_barl[ieta][iphi][sign] = epsilon_T + 1.;
172  epsilon_M_barl[ieta][iphi][sign] = epsilon_T / k_barl_[ieta];
173  } else {
174  rawconst_barl[ieta][iphi][sign] = 1.;
175  epsilon_M_barl[ieta][iphi][sign] = 0.;
176  } //if
177  } //sign
178  } //iphi
179  } //ieta
180 
181  // determine endcap calibration constants
182  for (int ix = 0; ix < kEndcWedgesX; ix++) {
183  for (int iy = 0; iy < kEndcWedgesY; iy++) {
184  for (int sign = 0; sign < kSides; sign++) {
185  int ring = e_.endcapRing_[ix][iy];
186  if (ring != -1 && e_.goodCell_endc[ix][iy][sign]) {
187  float etsum = etsum_endc_[ix][iy][sign];
188  float epsilon_T = (etsum / etsumMean_endc_[ring]) - 1.;
189  rawconst_endc[ix][iy][sign] = epsilon_T + 1.;
190  epsilon_M_endc[ix][iy][sign] = epsilon_T / k_endc_[ring];
191  } else {
192  epsilon_M_endc[ix][iy][0] = 0.;
193  epsilon_M_endc[ix][iy][1] = 0.;
194  rawconst_endc[ix][iy][0] = 1.;
195  rawconst_endc[ix][iy][1] = 1.;
196  } //if
197  } //sign
198  } //iy
199  } //ix
200 
201  std::string newcalibfile("EcalIntercalibConstants_new.xml");
202 
203  TFile ehistof("ehistos.root", "recreate");
204 
205  TH1D ebhisto("eb", "eb", 100, 0., 2.);
206 
207  std::vector<DetId>::const_iterator barrelIt = barrelCells.begin();
208  for (; barrelIt != barrelCells.end(); barrelIt++) {
209  EBDetId eb(*barrelIt);
210  int ieta = abs(eb.ieta()) - 1;
211  int iphi = eb.iphi() - 1;
212  int sign = eb.zside() > 0 ? 1 : 0;
213 
216  newCalibs_[eb] = oldCalibs_[eb] / (1 + epsilon_M_barl[ieta][iphi][sign]);
217 
218  if (e_.goodCell_barl[ieta][iphi][sign]) {
219  ebhisto.Fill(newCalibs_[eb]);
220 
223  correl_barl_histos[ieta]->Fill(miscalib_[eb], newCalibs_[eb]);
224  }
225 
226  } // barrelit
227 
228  TH1D eehisto("ee", "ee", 100, 0., 2.);
229  std::vector<DetId>::const_iterator endcapIt = endcapCells.begin();
230 
231  for (; endcapIt != endcapCells.end(); endcapIt++) {
232  EEDetId ee(*endcapIt);
233  int ix = ee.ix() - 1;
234  int iy = ee.iy() - 1;
235  int sign = ee.zside() > 0 ? 1 : 0;
236 
237  newCalibs_[ee] = oldCalibs_[ee] / (1 + epsilon_M_endc[ix][iy][sign]);
238 
239  if (e_.goodCell_endc[ix][iy][sign]) {
240  eehisto.Fill(newCalibs_[ee]);
241  miscal_resid_endc_histos[e_.endcapRing_[ix][iy]]->Fill(miscalib_[ee] * newCalibs_[ee]);
242  ;
243 
244  correl_endc_histos[e_.endcapRing_[ix][iy]]->Fill(miscalib_[ee], newCalibs_[ee]);
245  }
246  } //endcapit
247  // Write xml file
249  header.method_ = "phi symmetry";
250  header.version_ = "0";
251  header.datasource_ = "testdata";
252  header.since_ = 1;
253  header.tag_ = "unknown";
254  header.date_ = "Mar 24 1973";
255 
257 
258  eehisto.Write();
259  ebhisto.Write();
260  ehistof.Close();
261 
263 
264  outResidHistos();
265 
266  // finally output global etsums
267  std::fstream ebf("etsummary_barl.dat", ios::out);
268  std::fstream eef("etsummary_endc.dat", ios::out);
269 
270  for (int ieta = 0; ieta < kBarlRings; ieta++) {
271  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
272  for (int sign = 0; sign < kSides; sign++) {
273  ebf << ieta << " " << iphi << " " << sign << " " << etsum_barl_[ieta][iphi][sign] << endl;
274  }
275  }
276  }
277 
278  for (int ix = 0; ix < kEndcWedgesX; ix++) {
279  for (int iy = 0; iy < kEndcWedgesY; iy++) {
280  for (int sign = 0; sign < kSides; sign++) {
281  eef << ix << " " << iy << " " << sign << " " << etsum_endc_[ix][iy][sign] << endl;
282  }
283  }
284  }
285 }

References funct::abs(), RecoTauValidation_cfi::header, EBDetId::ieta(), LEDCalibrationChannels::ieta, EBDetId::iphi(), LEDCalibrationChannels::iphi, EEDetId::ix(), EEDetId::iy(), kBarlRings, kBarlWedges, kEndcEtaRings, kEndcWedgesX, kEndcWedgesY, kSides, MillePedeFileConverter_cfg::out, relativeConstraints::ring, Validation_hcalonly_cfi::sign, AlCaHLTBitMon_QueryRunRegistry::string, EcalFloatCondObjectContainerXMLTranslator::writeXML(), EBDetId::zside(), and EEDetId::zside().

Referenced by o2olib.O2ORunMgr::executeJob().

◆ fillConstantsHistos()

void PhiSymmetryCalibration_step2::fillConstantsHistos ( )

Definition at line 287 of file PhiSymmetryCalibration_step2.cc.

287  {
288  TFile f("CalibHistos.root", "recreate");
289 
290  TH2F barreletamap("barreletamap", "barreletamap", 171, -85, 86, 100, 0., 2.);
291  TH2F barreletamapraw("barreletamapraw", "barreletamapraw", 171, -85, 86, 100, 0., 2.);
292 
293  TH2F barrelmapold("barrelmapold", "barrelmapold", 360, 1., 361., 171, -85., 86.);
294  TH2F barrelmapnew("barrelmapnew", "barrelmapnew", 360, 1., 361., 171, -85., 86.);
295  TH2F barrelmapratio("barrelmapratio", "barrelmapratio", 360, 1., 361., 171, -85., 86.);
296 
297  TH1F rawconst_endc_h("rawconst_endc", "rawconst_endc", 100, 0., 2.);
298  TH1F const_endc_h("const_endc", "const_endc", 100, 0., 2.);
299 
300  TH1F oldconst_endc_h("oldconst_endc", "oldconst_endc;oldCalib;", 200, 0, 2);
301  TH2F newvsraw_endc_h("newvsraw_endc", "newvsraw_endc;rawConst;newCalib", 200, 0, 2, 200, 0, 2);
302 
303  TH2F endcapmapold_plus("endcapmapold_plus", "endcapmapold_plus", 100, 1., 101., 100, 1., 101.);
304  TH2F endcapmapnew_plus("endcapmapnew_plus", "endcapmapnew_plus", 100, 1., 101., 100, 1., 101.);
305  TH2F endcapmapratio_plus("endcapmapratio_plus", "endcapmapratio_plus", 100, 1., 101., 100, 1., 101.);
306 
307  TH2F endcapmapold_minus("endcapmapold_minus", "endcapmapold_minus", 100, 1., 101., 100, 1., 101.);
308  TH2F endcapmapnew_minus("endcapmapnew_minus", "endcapmapnew_minus", 100, 1., 101., 100, 1., 101.);
309  TH2F endcapmapratio_minus("endcapmapratio_minus", "endcapmapratio_minus", 100, 1., 101., 100, 1., 101.);
310 
311  for (int sign = 0; sign < kSides; sign++) {
312  int thesign = sign == 1 ? 1 : -1;
313 
314  for (int ieta = 0; ieta < kBarlRings; ieta++) {
315  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
316  if (e_.goodCell_barl[ieta][iphi][sign]) {
317  EBDetId eb(thesign * (ieta + 1), iphi + 1);
318  //int mod20= (iphi+1)%20;
319  //if (mod20==0 || mod20==1 ||mod20==2) continue; // exclude SM boundaries
320  barreletamap.Fill(ieta * thesign + thesign, newCalibs_[eb]);
321  barreletamapraw.Fill(ieta * thesign + thesign, rawconst_barl[ieta][iphi][sign]);
322 
323  barrelmapold.Fill(iphi + 1, ieta * thesign + thesign, oldCalibs_[eb]);
324  barrelmapnew.Fill(iphi + 1, ieta * thesign + thesign, newCalibs_[eb]);
325  barrelmapratio.Fill(iphi + 1, ieta * thesign + thesign, newCalibs_[eb] / oldCalibs_[eb]);
326  } //if
327  } //iphi
328  } //ieta
329 
330  for (int ix = 0; ix < kEndcWedgesX; ix++) {
331  for (int iy = 0; iy < kEndcWedgesY; iy++) {
332  if (e_.goodCell_endc[ix][iy][sign]) {
333  if (!EEDetId::validDetId(ix + 1, iy + 1, thesign))
334  continue;
335  EEDetId ee(ix + 1, iy + 1, thesign);
336 
337  rawconst_endc_h.Fill(rawconst_endc[ix][iy][sign]);
338  const_endc_h.Fill(newCalibs_[ee]);
339  oldconst_endc_h.Fill(oldCalibs_[ee]);
340  newvsraw_endc_h.Fill(rawconst_endc[ix][iy][sign], newCalibs_[ee]);
341 
342  if (sign == 1) {
343  endcapmapold_plus.Fill(ix + 1, iy + 1, oldCalibs_[ee]);
344  endcapmapnew_plus.Fill(ix + 1, iy + 1, newCalibs_[ee]);
345  endcapmapratio_plus.Fill(ix + 1, iy + 1, newCalibs_[ee] / oldCalibs_[ee]);
346  } else {
347  endcapmapold_minus.Fill(ix + 1, iy + 1, oldCalibs_[ee]);
348  endcapmapnew_minus.Fill(ix + 1, iy + 1, newCalibs_[ee]);
349  endcapmapratio_minus.Fill(ix + 1, iy + 1, newCalibs_[ee] / oldCalibs_[ee]);
350  }
351 
352  } //if
353  } //iy
354  } //ix
355 
356  } // sides
357 
358  barreletamap.Write();
359  barreletamapraw.Write();
360  rawconst_endc_h.Write();
361  const_endc_h.Write();
362  oldconst_endc_h.Write();
363  newvsraw_endc_h.Write();
364  barrelmapold.Write();
365  barrelmapnew.Write();
366  barrelmapratio.Write();
367  endcapmapold_plus.Write();
368  endcapmapnew_plus.Write();
369  endcapmapratio_plus.Write();
370  endcapmapold_minus.Write();
371  endcapmapnew_minus.Write();
372  endcapmapratio_minus.Write();
373 
374  f.Close();
375 }

References f, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, kBarlRings, kBarlWedges, kEndcWedgesX, kEndcWedgesY, kSides, Validation_hcalonly_cfi::sign, and EEDetId::validDetId().

◆ fillHistos()

void PhiSymmetryCalibration_step2::fillHistos ( )

Definition at line 379 of file PhiSymmetryCalibration_step2.cc.

379  {
380  TFile f("PhiSymmetryCalibration.root", "recreate");
381 
382  std::vector<TH1F*> etsum_barl_histos(kBarlRings);
383  std::vector<TH1F*> esum_barl_histos(kBarlRings);
384 
385  // determine ranges of ET sums to get histo bounds and book histos (barrel)
386  for (int ieta = 0; ieta < kBarlRings; ieta++) {
387  float low = 999999.;
388  float high = 0.;
389  float low_e = 999999.;
390  float high_e = 0.;
391 
392  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
393  for (int sign = 0; sign < kSides; sign++) {
394  float etsum = etsum_barl_[ieta][iphi][sign];
395  if (etsum < low && etsum != 0.)
396  low = etsum;
397  if (etsum > high)
398  high = etsum;
399 
400  float esum = esum_barl_[ieta][iphi][sign];
401  if (esum < low_e && esum != 0.)
402  low_e = esum;
403  if (esum > high_e)
404  high_e = esum;
405  }
406  }
407 
408  ostringstream t;
409  t << "etsum_barl_" << ieta + 1;
410  etsum_barl_histos[ieta] = new TH1F(t.str().c_str(), "", 50, low - .2 * low, high + .1 * high);
411  t.str("");
412 
413  t << "esum_barl_" << ieta + 1;
414  esum_barl_histos[ieta] = new TH1F(t.str().c_str(), "", 50, low_e - .2 * low_e, high_e + .1 * high_e);
415  t.str("");
416 
417  // fill barrel ET sum histos
418  etsumMean_barl_[ieta] = 0.;
419  esumMean_barl_[ieta] = 0.;
420  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
421  for (int sign = 0; sign < kSides; sign++) {
422  if (e_.goodCell_barl[ieta][iphi][sign]) {
423  float etsum = etsum_barl_[ieta][iphi][sign];
424  float esum = esum_barl_[ieta][iphi][sign];
425  etsum_barl_histos[ieta]->Fill(etsum);
426  esum_barl_histos[ieta]->Fill(esum);
427  etsumMean_barl_[ieta] += etsum;
428  esumMean_barl_[ieta] += esum;
429  }
430  }
431  }
432 
433  etsum_barl_histos[ieta]->Write();
434  esum_barl_histos[ieta]->Write();
435  etsumMean_barl_[ieta] /= (720. - e_.nBads_barl[ieta]);
436  esumMean_barl_[ieta] /= (720. - e_.nBads_barl[ieta]);
437  delete etsum_barl_histos[ieta];
438  delete esum_barl_histos[ieta]; //VS
439  }
440 
441  std::vector<TH1F*> etsum_endc_histos(kEndcEtaRings);
442  std::vector<TH1F*> etsum_endc_uncorr_histos(kEndcEtaRings);
443  std::vector<TH1F*> esum_endc_histos(kEndcEtaRings);
444 
445  std::vector<TH2F*> etsumvsarea_endc_histos(kEndcEtaRings);
446  std::vector<TH2F*> esumvsarea_endc_histos(kEndcEtaRings);
447 
448  // determine ranges of ET sums to get histo bounds and book histos (endcap)
449  for (int ring = 0; ring < kEndcEtaRings; ring++) {
450  float low = FLT_MAX;
451  float low_uncorr = FLT_MAX;
452  float high = 0.;
453  float high_uncorr = 0;
454  float low_e = FLT_MAX;
455  float high_e = 0.;
456  float low_a = 1.;
457  float high_a = 0.;
458  for (int ix = 0; ix < kEndcWedgesX; ix++) {
459  for (int iy = 0; iy < kEndcWedgesY; iy++) {
460  if (e_.endcapRing_[ix][iy] == ring) {
461  for (int sign = 0; sign < kSides; sign++) {
462  float etsum = etsum_endc_[ix][iy][sign];
463  if (etsum < low && etsum != 0.)
464  low = etsum;
465  if (etsum > high)
466  high = etsum;
467 
468  float etsum_uncorr = etsum_endc_uncorr[ix][iy][sign];
469  if (etsum_uncorr < low_uncorr && etsum_uncorr != 0.)
470  low_uncorr = etsum_uncorr;
471  if (etsum_uncorr > high_uncorr)
472  high_uncorr = etsum_uncorr;
473 
474  float esum = esum_endc_[ix][iy][sign];
475  if (esum < low_e && esum != 0.)
476  low_e = esum;
477  if (esum > high_e)
478  high_e = esum;
479 
480  float area = e_.cellArea_[ix][iy];
481  if (area < low_a)
482  low_a = area;
483  if (area > high_a)
484  high_a = area;
485  }
486  }
487  }
488  }
489 
490  ostringstream t;
491  t << "etsum_endc_" << ring + 1;
492  etsum_endc_histos[ring] = new TH1F(t.str().c_str(), "", 50, low - .2 * low, high + .1 * high);
493  t.str("");
494 
495  t << "etsum_endc_uncorr_" << ring + 1;
496  etsum_endc_uncorr_histos[ring] =
497  new TH1F(t.str().c_str(), "", 50, low_uncorr - .2 * low_uncorr, high_uncorr + .1 * high_uncorr);
498  t.str("");
499 
500  t << "esum_endc_" << ring + 1;
501  esum_endc_histos[ring] = new TH1F(t.str().c_str(), "", 50, low_e - .2 * low_e, high_e + .1 * high_e);
502  t.str("");
503 
504  t << "etsumvsarea_endc_" << ring + 1;
505  etsumvsarea_endc_histos[ring] =
506  new TH2F(t.str().c_str(), ";A_{#eta#phi};#Sigma E_{T}", 50, low_a, high_a, 50, low, high);
507  t.str("");
508 
509  t << "esumvsarea_endc_" << ring + 1;
510  esumvsarea_endc_histos[ring] =
511  new TH2F(t.str().c_str(), ";A_{#eta#phi};#Sigma E", 50, low_a, high_a, 50, low_e, high_e);
512  t.str("");
513 
514  // fill endcap ET sum histos
515  etsumMean_endc_[ring] = 0.;
516  esumMean_endc_[ring] = 0.;
517  for (int ix = 0; ix < kEndcWedgesX; ix++) {
518  for (int iy = 0; iy < kEndcWedgesY; iy++) {
519  if (e_.endcapRing_[ix][iy] == ring) {
520  for (int sign = 0; sign < kSides; sign++) {
521  if (e_.goodCell_endc[ix][iy][sign]) {
522  float etsum = etsum_endc_[ix][iy][sign];
523  float esum = esum_endc_[ix][iy][sign];
524  float etsum_uncorr = etsum_endc_uncorr[ix][iy][sign];
525  etsum_endc_histos[ring]->Fill(etsum);
526  etsum_endc_uncorr_histos[ring]->Fill(etsum_uncorr);
527  esum_endc_histos[ring]->Fill(esum);
528 
529  float area = e_.cellArea_[ix][iy];
530  etsumvsarea_endc_histos[ring]->Fill(area, etsum);
531  esumvsarea_endc_histos[ring]->Fill(area, esum);
532 
533  etsumMean_endc_[ring] += etsum;
534  esumMean_endc_[ring] += esum;
535  }
536  }
537  }
538  }
539  }
540 
541  etsum_endc_histos[ring]->Write();
542  etsum_endc_uncorr_histos[ring]->Write();
543  esum_endc_histos[ring]->Write();
546  etsumvsarea_endc_histos[ring]->Write();
547  esumvsarea_endc_histos[ring]->Write();
548 
549  delete etsum_endc_histos[ring];
550  delete etsum_endc_uncorr_histos[ring];
551  delete esum_endc_histos[ring];
552  delete etsumvsarea_endc_histos[ring];
553  delete esumvsarea_endc_histos[ring];
554  } //ring
555 
556  // Maps of etsum in EB and EE
557  TH2F barreletamap("barreletamap", "barreletamap", 171, -85, 86, 100, 0, 2);
558  TH2F barrelmap("barrelmap", "barrelmap - #frac{#Sigma E_{T}}{<#Sigma E_{T}>_{0}}", 360, 1, 360, 171, -85, 86);
559  TH2F barrelmap_e("barrelmape", "barrelmape - #frac{#Sigma E}{<#Sigma E>_{0}}", 360, 1, 360, 171, -85, 86);
560  TH2F barrelmap_divided("barrelmapdiv", "barrelmapdivided - #frac{#Sigma E_{T}}{hits}", 360, 1, 360, 171, -85, 86);
561  TH2F barrelmap_e_divided("barrelmapediv", "barrelmapedivided - #frac{#Sigma E}{hits}", 360, 1, 360, 171, -85, 86);
562  TH2F endcmap_plus_corr(
563  "endcapmapplus_corrected", "endcapmapplus - #frac{#Sigma E_{T}}{<#Sigma E_{T}>_{38}}", 100, 1, 101, 100, 1, 101);
564  TH2F endcmap_minus_corr(
565  "endcapmapminus_corrected", "endcapmapminus - #frac{#Sigma E_{T}}{<#Sigma E_{T}>_{38}}", 100, 1, 101, 100, 1, 101);
566  TH2F endcmap_plus_uncorr("endcapmapplus_uncorrected",
567  "endcapmapplus_uncor - #frac{#Sigma E_{T}}{<#Sigma E_{T}>_{38}}",
568  100,
569  1,
570  101,
571  100,
572  1,
573  101);
574  TH2F endcmap_minus_uncorr("endcapmapminus_uncorrected",
575  "endcapmapminus_uncor - #frac{#Sigma E_{T}}{<#Sigma E_{T}>_{38}}",
576  100,
577  1,
578  101,
579  100,
580  1,
581  101);
582  TH2F endcmap_e_plus("endcapmapeplus", "endcapmapeplus - #frac{#Sigma E}{<#Sigma E>_{38}}", 100, 1, 101, 100, 1, 101);
583  TH2F endcmap_e_minus(
584  "endcapmapeminus", "endcapmapeminus - #frac{#Sigma E}{<#Sigma E>_{38}}", 100, 1, 101, 100, 1, 101);
585 
586  for (int sign = 0; sign < kSides; sign++) {
587  int thesign = sign == 1 ? 1 : -1;
588 
589  for (int ieta = 0; ieta < kBarlRings; ieta++) {
590  for (int iphi = 0; iphi < kBarlWedges; iphi++) {
591  if (e_.goodCell_barl[ieta][iphi][sign]) {
592  barrelmap.Fill(iphi + 1, ieta * thesign + thesign, etsum_barl_[ieta][iphi][sign] / etsumMean_barl_[0]);
593  barrelmap_e.Fill(iphi + 1, ieta * thesign + thesign, esum_barl_[ieta][iphi][sign] / esumMean_barl_[0]); //VS
594  if (!nhits_barl_[ieta][iphi][sign])
595  nhits_barl_[ieta][iphi][sign] = 1;
596  barrelmap_divided.Fill(
597  iphi + 1, ieta * thesign + thesign, etsum_barl_[ieta][iphi][sign] / nhits_barl_[ieta][iphi][sign]);
598  barrelmap_e_divided.Fill(
599  iphi + 1, ieta * thesign + thesign, esum_barl_[ieta][iphi][sign] / nhits_barl_[ieta][iphi][sign]); //VS
600  //int mod20= (iphi+1)%20;
601  //if (mod20==0 || mod20==1 ||mod20==2) continue; // exclude SM boundaries
602  barreletamap.Fill(ieta * thesign + thesign, etsum_barl_[ieta][iphi][sign] / etsumMean_barl_[0]);
603  } //if
604  } //iphi
605  } //ieta
606 
607  for (int ix = 0; ix < kEndcWedgesX; ix++) {
608  for (int iy = 0; iy < kEndcWedgesY; iy++) {
609  if (sign == 1) {
610  endcmap_plus_corr.Fill(ix + 1, iy + 1, etsum_endc_[ix][iy][sign] / etsumMean_endc_[38]);
611  endcmap_plus_uncorr.Fill(ix + 1, iy + 1, etsum_endc_uncorr[ix][iy][sign] / etsumMean_endc_[38]);
612  endcmap_e_plus.Fill(ix + 1, iy + 1, esum_endc_[ix][iy][sign] / esumMean_endc_[38]);
613  } else {
614  endcmap_minus_corr.Fill(ix + 1, iy + 1, etsum_endc_[ix][iy][sign] / etsumMean_endc_[38]);
615  endcmap_minus_uncorr.Fill(ix + 1, iy + 1, etsum_endc_uncorr[ix][iy][sign] / etsumMean_endc_[38]);
616  endcmap_e_minus.Fill(ix + 1, iy + 1, esum_endc_[ix][iy][sign] / esumMean_endc_[38]);
617  }
618  } //iy
619  } //ix
620 
621  } //sign
622 
623  barreletamap.Write();
624  barrelmap_divided.Write();
625  barrelmap.Write();
626  barrelmap_e_divided.Write();
627  barrelmap_e.Write();
628  endcmap_plus_corr.Write();
629  endcmap_minus_corr.Write();
630  endcmap_plus_uncorr.Write();
631  endcmap_minus_uncorr.Write();
632  endcmap_e_plus.Write();
633  endcmap_e_minus.Write();
634 
635  vector<TH1F*> etavsphi_endc(kEndcEtaRings);
636  vector<TH1F*> areavsphi_endc(kEndcEtaRings);
637  vector<TH1F*> etsumvsphi_endcp_corr(kEndcEtaRings);
638  vector<TH1F*> etsumvsphi_endcm_corr(kEndcEtaRings);
639  vector<TH1F*> etsumvsphi_endcp_uncorr(kEndcEtaRings);
640  vector<TH1F*> etsumvsphi_endcm_uncorr(kEndcEtaRings);
641  vector<TH1F*> esumvsphi_endcp(kEndcEtaRings);
642  vector<TH1F*> esumvsphi_endcm(kEndcEtaRings);
643 
644  std::vector<TH1F*> deltaeta_histos(kEndcEtaRings);
645  std::vector<TH1F*> deltaphi_histos(kEndcEtaRings);
646 
647  for (int ring = 0; ring < kEndcEtaRings; ++ring) {
648  ostringstream t;
649  t << "etavsphi_endc_" << ring;
650  etavsphi_endc[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
651  t.str("");
652 
653  t << "areavsphi_endc_" << ring;
654  areavsphi_endc[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
655  t.str("");
656 
657  t << "etsumvsphi_endcp_corr_" << ring;
658  etsumvsphi_endcp_corr[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
659  t.str("");
660 
661  t << "etsumvsphi_endcm_corr_" << ring;
662  etsumvsphi_endcm_corr[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
663  t.str("");
664 
665  t << "etsumvsphi_endcp_uncorr_" << ring;
666  etsumvsphi_endcp_uncorr[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
667  t.str("");
668 
669  t << "etsumvsphi_endcm_uncorr_" << ring;
670  etsumvsphi_endcm_uncorr[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
671  t.str("");
672 
673  t << "esumvsphi_endcp_" << ring;
674  esumvsphi_endcp[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
675  t.str("");
676 
677  t << "esumvsphi_endcm_" << ring;
678  esumvsphi_endcm[ring] = new TH1F(t.str().c_str(), t.str().c_str(), e_.nRing_[ring], 0, e_.nRing_[ring]);
679  t.str("");
680 
681  t << "deltaeta_" << ring;
682  deltaeta_histos[ring] = new TH1F(t.str().c_str(), "", 50, -.1, .1);
683  t.str("");
684  t << "deltaphi_" << ring;
685  deltaphi_histos[ring] = new TH1F(t.str().c_str(), "", 50, -.1, .1);
686  t.str("");
687  }
688 
689  for (int ix = 0; ix < kEndcWedgesX; ix++) {
690  for (int iy = 0; iy < kEndcWedgesY; iy++) {
691  int ring = e_.endcapRing_[ix][iy];
692  if (ring != -1) {
693  int iphi_endc = -1;
694  for (int ip = 0; ip < e_.nRing_[ring]; ip++) {
695  if (e_.cellPhi_[ix][iy] == e_.phi_endc_[ip][ring])
696  iphi_endc = ip;
697  }
698 
699  if (iphi_endc != -1) {
700  for (int sign = 0; sign < kSides; sign++) {
701  if (e_.goodCell_endc[ix][iy][sign]) {
702  if (sign == 1) {
703  etsumvsphi_endcp_corr[ring]->Fill(iphi_endc, etsum_endc_[ix][iy][sign]);
704  etsumvsphi_endcp_uncorr[ring]->Fill(iphi_endc, etsum_endc_uncorr[ix][iy][sign]);
705  esumvsphi_endcp[ring]->Fill(iphi_endc, esum_endc_[ix][iy][sign]);
706  } else {
707  etsumvsphi_endcm_corr[ring]->Fill(iphi_endc, etsum_endc_[ix][iy][sign]);
708  etsumvsphi_endcm_uncorr[ring]->Fill(iphi_endc, etsum_endc_uncorr[ix][iy][sign]);
709  esumvsphi_endcm[ring]->Fill(iphi_endc, esum_endc_[ix][iy][sign]);
710  }
711  } //if
712  } //sign
713  etavsphi_endc[ring]->Fill(iphi_endc, e_.cellPos_[ix][iy].eta());
714  areavsphi_endc[ring]->Fill(iphi_endc, e_.cellArea_[ix][iy]);
715  } //if iphi_endc
716 
717  } //if ring
718  } //iy
719  } //ix
720 
721  for (int ring = 0; ring < kEndcEtaRings; ++ring) {
722  etavsphi_endc[ring]->Write();
723  areavsphi_endc[ring]->Write();
724  etsumvsphi_endcp_corr[ring]->Write();
725  etsumvsphi_endcm_corr[ring]->Write();
726  etsumvsphi_endcp_uncorr[ring]->Write();
727  etsumvsphi_endcm_uncorr[ring]->Write();
728  esumvsphi_endcp[ring]->Write();
729  esumvsphi_endcm[ring]->Write();
730  deltaeta_histos[ring]->Write();
731  deltaphi_histos[ring]->Write();
732 
733  delete etsumvsphi_endcp_corr[ring];
734  delete etsumvsphi_endcm_corr[ring];
735  delete etsumvsphi_endcp_uncorr[ring];
736  delete etsumvsphi_endcm_uncorr[ring];
737  delete etavsphi_endc[ring];
738  delete areavsphi_endc[ring];
739  delete esumvsphi_endcp[ring];
740  delete esumvsphi_endcm[ring];
741  delete deltaeta_histos[ring];
742  delete deltaphi_histos[ring];
743  }
744 
745  f.Close();
746 }

References custom_jme_cff::area, f, dqmMemoryStats::float, LaserClient_cfi::high, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, kBarlRings, kBarlWedges, kEndcEtaRings, kEndcWedgesX, kEndcWedgesY, kSides, LaserClient_cfi::low, relativeConstraints::ring, Validation_hcalonly_cfi::sign, and submitPVValidationJobs::t.

◆ outResidHistos()

void PhiSymmetryCalibration_step2::outResidHistos ( )

Definition at line 803 of file PhiSymmetryCalibration_step2.cc.

803  {
804  // output histograms of residual miscalibrations
805  TFile f("PhiSymmetryCalibration_miscal_resid.root", "recreate");
806  for (int ieta = 0; ieta < 85; ieta++) {
807  miscal_resid_barl_histos[ieta]->Write();
808  correl_barl_histos[ieta]->Write();
809 
811  delete correl_barl_histos[ieta];
812  }
813 
814  for (int ring = 0; ring < 39; ring++) {
815  miscal_resid_endc_histos[ring]->Write();
816  correl_endc_histos[ring]->Write();
817 
819  delete correl_endc_histos[ring];
820  }
821  f.Close();
822 }

References f, LEDCalibrationChannels::ieta, and relativeConstraints::ring.

◆ readEtSums()

void PhiSymmetryCalibration_step2::readEtSums ( )

Definition at line 748 of file PhiSymmetryCalibration_step2.cc.

748  {
749  //read in ET sums
750 
751  int ieta, iphi, sign, ix, iy, dummy;
752  double etsum;
753  unsigned int nhits;
754  std::ifstream etsum_barl_in("etsum_barl.dat", ios::in);
755  while (etsum_barl_in >> dummy >> ieta >> iphi >> sign >> etsum >> nhits) {
756  etsum_barl_[ieta][iphi][sign] += etsum;
758  }
759 
760  std::ifstream etsum_endc_in("etsum_endc.dat", ios::in);
761  while (etsum_endc_in >> dummy >> ix >> iy >> sign >> etsum >> nhits >> dummy) {
762  etsum_endc_[ix][iy][sign] += etsum;
763  nhits_endc_[ix][iy][sign] += nhits;
764  }
765 
766  std::ifstream k_barl_in("k_barl.dat", ios::in);
767  for (int ieta = 0; ieta < kBarlRings; ieta++) {
768  k_barl_in >> dummy >> k_barl_[ieta];
769  }
770 
771  std::ifstream k_endc_in("k_endc.dat", ios::in);
772  for (int ring = 0; ring < kEndcEtaRings; ring++) {
773  k_endc_in >> dummy >> k_endc_[ring];
774  }
775 }

References LEDCalibrationChannels::ieta, recoMuon::in, LEDCalibrationChannels::iphi, kBarlRings, kEndcEtaRings, nhits, relativeConstraints::ring, and Validation_hcalonly_cfi::sign.

◆ setUp()

void PhiSymmetryCalibration_step2::setUp ( const edm::EventSetup setup)

if a miscalibration was applied, load it, if not put it to 1

Definition at line 39 of file PhiSymmetryCalibration_step2.cc.

39  {
41  se.get<EcalChannelStatusRcd>().get(chStatus);
42 
44  se.get<CaloGeometryRecord>().get(geoHandle);
45 
48 
49  e_.setup(&(*geoHandle), &(*chStatus), statusThreshold_);
50 
54  namespace fs = std::filesystem;
56  if (!fs::exists(p))
57  edm::LogError("PhiSym") << "File not found: " << initialmiscalibfile_ << endl;
58 
60  if (ret)
61  edm::LogError("PhiSym") << "Error reading XML files" << endl;
62  ;
63  } else {
64  for (vector<DetId>::iterator it = barrelCells.begin(); it != barrelCells.end(); ++it) {
65  miscalib_[*it] = 1;
66  }
67 
68  for (vector<DetId>::iterator it = endcapCells.begin(); it != endcapCells.end(); ++it) {
69  miscalib_[*it] = 1;
70  }
71  }
72 
73  // if we are reiterating, read constants from previous iter
74  // if not put them to one
75  if (reiteration_) {
77  namespace fs = std::filesystem;
78  fs::path p(oldcalibfile_.c_str());
79  if (!fs::exists(p))
80  edm::LogError("PhiSym") << "File not found: " << oldcalibfile_ << endl;
81 
83 
84  if (ret)
85  edm::LogError("PhiSym") << "Error reading XML files" << endl;
86  ;
87 
88  } else {
89  for (vector<DetId>::iterator it = barrelCells.begin(); it != barrelCells.end(); ++it)
90  oldCalibs_[*it] = 1;
91 
92  for (vector<DetId>::iterator it = endcapCells.begin(); it != endcapCells.end(); ++it)
93  oldCalibs_[*it] = 1;
94 
95  } // else
96 }

References DetId::Ecal, EcalBarrel, EcalEndcap, edm::EventSetup::get(), get, CaloGeometry::getValidDetIds(), h, AlCaHLTBitMon_ParallelJobs::p, castor_dqm_sourceclient_file_cfg::path, EcalFloatCondObjectContainerXMLTranslator::readXML(), and runTheMatrix::ret.

◆ setupResidHistos()

void PhiSymmetryCalibration_step2::setupResidHistos ( )

Definition at line 777 of file PhiSymmetryCalibration_step2.cc.

777  {
780 
781  for (int ieta = 0; ieta < kBarlRings; ieta++) {
782  ostringstream t1;
783  t1 << "mr_barl_" << ieta + 1;
784  miscal_resid_barl_histos[ieta] = new TH1F(t1.str().c_str(), "", 100, 0., 2.);
785  ostringstream t2;
786  t2 << "co_barl_" << ieta + 1;
787  correl_barl_histos[ieta] = new TH2F(t2.str().c_str(), "", 50, .5, 1.5, 50, .5, 1.5);
788  }
789 
792 
793  for (int ring = 0; ring < kEndcEtaRings; ring++) {
794  ostringstream t1;
795  t1 << "mr_endc_" << ring + 1;
796  miscal_resid_endc_histos[ring] = new TH1F(t1.str().c_str(), "", 100, 0., 2.);
797  ostringstream t2;
798  t2 << "co_endc_" << ring + 1;
799  correl_endc_histos[ring] = new TH2F(t2.str().c_str(), "", 50, .5, 1.5, 50, .5, 1.5);
800  }
801 }

References LEDCalibrationChannels::ieta, kBarlRings, kEndcEtaRings, relativeConstraints::ring, RandomServiceHelper::t1, and RandomServiceHelper::t2.

Member Data Documentation

◆ barrelCells

std::vector<DetId> PhiSymmetryCalibration_step2::barrelCells
private

Definition at line 61 of file PhiSymmetryCalibration_step2.h.

◆ correl_barl_histos

std::vector<TH2F*> PhiSymmetryCalibration_step2::correl_barl_histos
private

Definition at line 85 of file PhiSymmetryCalibration_step2.h.

◆ correl_endc_histos

std::vector<TH2F*> PhiSymmetryCalibration_step2::correl_endc_histos
private

Definition at line 88 of file PhiSymmetryCalibration_step2.h.

◆ e_

EcalGeomPhiSymHelper PhiSymmetryCalibration_step2::e_
private

Definition at line 59 of file PhiSymmetryCalibration_step2.h.

◆ endcapCells

std::vector<DetId> PhiSymmetryCalibration_step2::endcapCells
private

Definition at line 62 of file PhiSymmetryCalibration_step2.h.

◆ epsilon_M_barl

float PhiSymmetryCalibration_step2::epsilon_M_barl[kBarlRings][kBarlWedges][kSides]
private

Definition at line 56 of file PhiSymmetryCalibration_step2.h.

◆ epsilon_M_endc

float PhiSymmetryCalibration_step2::epsilon_M_endc[kEndcWedgesX][kEndcWedgesY][kSides]
private

Definition at line 57 of file PhiSymmetryCalibration_step2.h.

◆ esum_barl_

double PhiSymmetryCalibration_step2::esum_barl_[kBarlRings][kBarlWedges][kSides]
private

Definition at line 42 of file PhiSymmetryCalibration_step2.h.

◆ esum_endc_

double PhiSymmetryCalibration_step2::esum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
private

Definition at line 43 of file PhiSymmetryCalibration_step2.h.

◆ esumMean_barl_

double PhiSymmetryCalibration_step2::esumMean_barl_[kBarlRings]
private

Definition at line 45 of file PhiSymmetryCalibration_step2.h.

◆ esumMean_endc_

double PhiSymmetryCalibration_step2::esumMean_endc_[kEndcEtaRings]
private

Definition at line 46 of file PhiSymmetryCalibration_step2.h.

◆ etsum_barl_

double PhiSymmetryCalibration_step2::etsum_barl_[kBarlRings][kBarlWedges][kSides]
private

Definition at line 33 of file PhiSymmetryCalibration_step2.h.

◆ etsum_endc_

double PhiSymmetryCalibration_step2::etsum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
private

Definition at line 34 of file PhiSymmetryCalibration_step2.h.

◆ etsum_endc_uncorr

double PhiSymmetryCalibration_step2::etsum_endc_uncorr[kEndcWedgesX][kEndcWedgesX][kSides]
private

Definition at line 35 of file PhiSymmetryCalibration_step2.h.

◆ etsumMean_barl_

double PhiSymmetryCalibration_step2::etsumMean_barl_[kBarlRings]
private

Definition at line 36 of file PhiSymmetryCalibration_step2.h.

◆ etsumMean_endc_

double PhiSymmetryCalibration_step2::etsumMean_endc_[kEndcEtaRings]
private

Definition at line 37 of file PhiSymmetryCalibration_step2.h.

◆ firstpass_

bool PhiSymmetryCalibration_step2::firstpass_
private

Definition at line 64 of file PhiSymmetryCalibration_step2.h.

◆ have_initial_miscalib_

bool PhiSymmetryCalibration_step2::have_initial_miscalib_
private

Definition at line 80 of file PhiSymmetryCalibration_step2.h.

◆ initialmiscalibfile_

std::string PhiSymmetryCalibration_step2::initialmiscalibfile_
private

Definition at line 81 of file PhiSymmetryCalibration_step2.h.

◆ k_barl_

double PhiSymmetryCalibration_step2::k_barl_[kBarlRings]
private

Definition at line 48 of file PhiSymmetryCalibration_step2.h.

◆ k_endc_

double PhiSymmetryCalibration_step2::k_endc_[kEndcEtaRings]
private

Definition at line 49 of file PhiSymmetryCalibration_step2.h.

◆ miscal_resid_barl_histos

std::vector<TH1F*> PhiSymmetryCalibration_step2::miscal_resid_barl_histos
private

res miscalib histos

Definition at line 84 of file PhiSymmetryCalibration_step2.h.

◆ miscal_resid_endc_histos

std::vector<TH1F*> PhiSymmetryCalibration_step2::miscal_resid_endc_histos
private

Definition at line 87 of file PhiSymmetryCalibration_step2.h.

◆ miscalib_

EcalIntercalibConstants PhiSymmetryCalibration_step2::miscalib_
private

initial miscalibration applied if any)

Definition at line 77 of file PhiSymmetryCalibration_step2.h.

◆ newCalibs_

EcalIntercalibConstants PhiSymmetryCalibration_step2::newCalibs_
private

calib constants that we are going to calculate

Definition at line 74 of file PhiSymmetryCalibration_step2.h.

◆ nhits_barl_

unsigned int PhiSymmetryCalibration_step2::nhits_barl_[kBarlRings][kBarlWedges][kSides]
private

Definition at line 39 of file PhiSymmetryCalibration_step2.h.

◆ nhits_endc_

unsigned int PhiSymmetryCalibration_step2::nhits_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
private

Definition at line 40 of file PhiSymmetryCalibration_step2.h.

◆ oldcalibfile_

std::string PhiSymmetryCalibration_step2::oldcalibfile_
private

Definition at line 68 of file PhiSymmetryCalibration_step2.h.

◆ oldCalibs_

EcalIntercalibConstants PhiSymmetryCalibration_step2::oldCalibs_
private

the old calibration constants (when reiterating, the last ones derived)

Definition at line 71 of file PhiSymmetryCalibration_step2.h.

◆ rawconst_barl

float PhiSymmetryCalibration_step2::rawconst_barl[kBarlRings][kBarlWedges][kSides]
private

Definition at line 52 of file PhiSymmetryCalibration_step2.h.

◆ rawconst_endc

float PhiSymmetryCalibration_step2::rawconst_endc[kEndcWedgesX][kEndcWedgesX][kSides]
private

Definition at line 53 of file PhiSymmetryCalibration_step2.h.

◆ reiteration_

bool PhiSymmetryCalibration_step2::reiteration_
private

Definition at line 67 of file PhiSymmetryCalibration_step2.h.

◆ statusThreshold_

int PhiSymmetryCalibration_step2::statusThreshold_
private

Definition at line 65 of file PhiSymmetryCalibration_step2.h.

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:367
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
kBarlRings
static const int kBarlRings
Definition: EcalGeomPhiSymHelper.h:7
EcalGeomPhiSymHelper::nBads_endc
int nBads_endc[kEndcEtaRings]
Definition: EcalGeomPhiSymHelper.h:36
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
EcalGeomPhiSymHelper::nBads_barl
int nBads_barl[kBarlRings]
Definition: EcalGeomPhiSymHelper.h:35
PhiSymmetryCalibration_step2::esumMean_barl_
double esumMean_barl_[kBarlRings]
Definition: PhiSymmetryCalibration_step2.h:45
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PhiSymmetryCalibration_step2::nhits_barl_
unsigned int nhits_barl_[kBarlRings][kBarlWedges][kSides]
Definition: PhiSymmetryCalibration_step2.h:39
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
PhiSymmetryCalibration_step2::initialmiscalibfile_
std::string initialmiscalibfile_
Definition: PhiSymmetryCalibration_step2.h:81
EBDetId
Definition: EBDetId.h:17
PhiSymmetryCalibration_step2::firstpass_
bool firstpass_
Definition: PhiSymmetryCalibration_step2.h:64
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
PhiSymmetryCalibration_step2::fillHistos
void fillHistos()
Definition: PhiSymmetryCalibration_step2.cc:379
PhiSymmetryCalibration_step2::setupResidHistos
void setupResidHistos()
Definition: PhiSymmetryCalibration_step2.cc:777
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EcalGeomPhiSymHelper::goodCell_endc
bool goodCell_endc[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: EcalGeomPhiSymHelper.h:34
EcalGeomPhiSymHelper::goodCell_barl
bool goodCell_barl[kBarlRings][kBarlWedges][kSides]
Definition: EcalGeomPhiSymHelper.h:33
EcalFloatCondObjectContainerXMLTranslator::readXML
static int readXML(const std::string &filename, EcalCondHeader &header, EcalFloatCondObjectContainer &record)
Definition: EcalFloatCondObjectContainerXMLTranslator.cc:23
PhiSymmetryCalibration_step2::epsilon_M_barl
float epsilon_M_barl[kBarlRings][kBarlWedges][kSides]
Definition: PhiSymmetryCalibration_step2.h:56
kEndcWedgesY
static const int kEndcWedgesY
Definition: EcalGeomPhiSymHelper.h:12
EcalBarrel
Definition: EcalSubdetector.h:10
EcalGeomPhiSymHelper::cellPos_
GlobalPoint cellPos_[kEndcWedgesX][kEndcWedgesY]
Definition: EcalGeomPhiSymHelper.h:23
PhiSymmetryCalibration_step2::oldcalibfile_
std::string oldcalibfile_
Definition: PhiSymmetryCalibration_step2.h:68
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalGeomPhiSymHelper::setup
void setup(const CaloGeometry *geometry, const EcalChannelStatus *chstatus, int statusThreshold)
Definition: EcalGeomPhiSymHelper.cc:18
PhiSymmetryCalibration_step2::epsilon_M_endc
float epsilon_M_endc[kEndcWedgesX][kEndcWedgesY][kSides]
Definition: PhiSymmetryCalibration_step2.h:57
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
h
PhiSymmetryCalibration_step2::barrelCells
std::vector< DetId > barrelCells
Definition: PhiSymmetryCalibration_step2.h:61
PhiSymmetryCalibration_step2::rawconst_barl
float rawconst_barl[kBarlRings][kBarlWedges][kSides]
Definition: PhiSymmetryCalibration_step2.h:52
PhiSymmetryCalibration_step2::etsum_endc_uncorr
double etsum_endc_uncorr[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: PhiSymmetryCalibration_step2.h:35
PhiSymmetryCalibration_step2::k_barl_
double k_barl_[kBarlRings]
Definition: PhiSymmetryCalibration_step2.h:48
EcalGeomPhiSymHelper::endcapRing_
int endcapRing_[kEndcWedgesX][kEndcWedgesY]
Definition: EcalGeomPhiSymHelper.h:29
edm::ESHandle
Definition: DTSurvey.h:22
PhiSymmetryCalibration_step2::outResidHistos
void outResidHistos()
Definition: PhiSymmetryCalibration_step2.cc:803
PhiSymmetryCalibration_step2::etsum_barl_
double etsum_barl_[kBarlRings][kBarlWedges][kSides]
Definition: PhiSymmetryCalibration_step2.h:33
nhits
Definition: HIMultiTrackSelector.h:42
PhiSymmetryCalibration_step2::reiteration_
bool reiteration_
Definition: PhiSymmetryCalibration_step2.h:67
PhiSymmetryCalibration_step2::statusThreshold_
int statusThreshold_
Definition: PhiSymmetryCalibration_step2.h:65
EEDetId
Definition: EEDetId.h:14
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalEndcap
Definition: EcalSubdetector.h:10
PhiSymmetryCalibration_step2::endcapCells
std::vector< DetId > endcapCells
Definition: PhiSymmetryCalibration_step2.h:62
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
PhiSymmetryCalibration_step2::etsumMean_endc_
double etsumMean_endc_[kEndcEtaRings]
Definition: PhiSymmetryCalibration_step2.h:37
PhiSymmetryCalibration_step2::correl_endc_histos
std::vector< TH2F * > correl_endc_histos
Definition: PhiSymmetryCalibration_step2.h:88
EcalGeomPhiSymHelper::cellPhi_
double cellPhi_[kEndcWedgesX][kEndcWedgesY]
Definition: EcalGeomPhiSymHelper.h:24
PhiSymmetryCalibration_step2::have_initial_miscalib_
bool have_initial_miscalib_
Definition: PhiSymmetryCalibration_step2.h:80
EcalChannelStatusRcd
Definition: EcalChannelStatusRcd.h:5
EcalCondHeader
Definition: EcalCondHeader.h:16
PhiSymmetryCalibration_step2::k_endc_
double k_endc_[kEndcEtaRings]
Definition: PhiSymmetryCalibration_step2.h:49
PhiSymmetryCalibration_step2::oldCalibs_
EcalIntercalibConstants oldCalibs_
the old calibration constants (when reiterating, the last ones derived)
Definition: PhiSymmetryCalibration_step2.h:71
recoMuon::in
Definition: RecoMuonEnumerators.h:6
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PhiSymmetryCalibration_step2::miscal_resid_barl_histos
std::vector< TH1F * > miscal_resid_barl_histos
res miscalib histos
Definition: PhiSymmetryCalibration_step2.h:84
PhiSymmetryCalibration_step2::miscal_resid_endc_histos
std::vector< TH1F * > miscal_resid_endc_histos
Definition: PhiSymmetryCalibration_step2.h:87
PhiSymmetryCalibration_step2::nhits_endc_
unsigned int nhits_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: PhiSymmetryCalibration_step2.h:40
EcalGeomPhiSymHelper::meanCellArea_
double meanCellArea_[kEndcEtaRings]
Definition: EcalGeomPhiSymHelper.h:27
kEndcEtaRings
static const int kEndcEtaRings
Definition: EcalGeomPhiSymHelper.h:14
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PhiSymmetryCalibration_step2::setUp
void setUp(const edm::EventSetup &setup)
Definition: PhiSymmetryCalibration_step2.cc:39
DetId::Ecal
Definition: DetId.h:27
get
#define get
kSides
static const int kSides
Definition: EcalGeomPhiSymHelper.h:9
PhiSymmetryCalibration_step2::correl_barl_histos
std::vector< TH2F * > correl_barl_histos
Definition: PhiSymmetryCalibration_step2.h:85
kEndcWedgesX
static const int kEndcWedgesX
Definition: EcalGeomPhiSymHelper.h:11
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
CaloGeometry::getValidDetIds
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
Definition: CaloGeometry.cc:75
PhiSymmetryCalibration_step2::miscalib_
EcalIntercalibConstants miscalib_
initial miscalibration applied if any)
Definition: PhiSymmetryCalibration_step2.h:77
PhiSymmetryCalibration_step2::readEtSums
void readEtSums()
Definition: PhiSymmetryCalibration_step2.cc:748
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
PhiSymmetryCalibration_step2::esum_barl_
double esum_barl_[kBarlRings][kBarlWedges][kSides]
Definition: PhiSymmetryCalibration_step2.h:42
PhiSymmetryCalibration_step2::newCalibs_
EcalIntercalibConstants newCalibs_
calib constants that we are going to calculate
Definition: PhiSymmetryCalibration_step2.h:74
EEDetId::validDetId
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
EcalGeomPhiSymHelper::phi_endc_
double phi_endc_[kMaxEndciPhi][kEndcEtaRings]
Definition: EcalGeomPhiSymHelper.h:26
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
kBarlWedges
static const int kBarlWedges
Definition: EcalGeomPhiSymHelper.h:8
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PhiSymmetryCalibration_step2::rawconst_endc
float rawconst_endc[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: PhiSymmetryCalibration_step2.h:53
dummy
Definition: DummySelector.h:38
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
PhiSymmetryCalibration_step2::esum_endc_
double esum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: PhiSymmetryCalibration_step2.h:43
custom_jme_cff.area
area
Definition: custom_jme_cff.py:140
EcalGeomPhiSymHelper::nRing_
int nRing_[kEndcEtaRings]
Definition: EcalGeomPhiSymHelper.h:30
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
PhiSymmetryCalibration_step2::esumMean_endc_
double esumMean_endc_[kEndcEtaRings]
Definition: PhiSymmetryCalibration_step2.h:46
PhiSymmetryCalibration_step2::fillConstantsHistos
void fillConstantsHistos()
Definition: PhiSymmetryCalibration_step2.cc:287
PhiSymmetryCalibration_step2::etsumMean_barl_
double etsumMean_barl_[kBarlRings]
Definition: PhiSymmetryCalibration_step2.h:36
PhiSymmetryCalibration_step2::e_
EcalGeomPhiSymHelper e_
Definition: PhiSymmetryCalibration_step2.h:59
PhiSymmetryCalibration_step2::etsum_endc_
double etsum_endc_[kEndcWedgesX][kEndcWedgesX][kSides]
Definition: PhiSymmetryCalibration_step2.h:34
EcalFloatCondObjectContainerXMLTranslator::writeXML
static int writeXML(const std::string &filename, const EcalCondHeader &header, const EcalFloatCondObjectContainer &record)
Definition: EcalFloatCondObjectContainerXMLTranslator.cc:246
EcalGeomPhiSymHelper::cellArea_
double cellArea_[kEndcWedgesX][kEndcWedgesY]
Definition: EcalGeomPhiSymHelper.h:25