CMS 3D CMS Logo

AlCaHOCalibProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Dec 2015 : Added bool m_cosmic to choose cosmic or collision run through python file
3 
4 //integrate the code with some 8_0_X or 7_6_X recent IB and run the
5 // following tests: 4.22, 8.0, 25.0, 140.53. You can always activate them using
6 //runTheMatrix.py -l 4.22
7 
8 // 7th Nov 2015 : tmpHOCalib.ecal03 = iso05.sumPt; // iso03.emEt+muonenr.em;
9 // tmpHOCalib.inslumi=lumiScale->begin()->pileup();
10 //
11 // April 2015 : Remove all digi part
12 // Also look for HO geometry in CMSSW in parallel with stanalone one.
13 // Official one has problem in reco geometry, particularly tiles at the edge of wheel
14 // Remove all histogrammes except occupancy one
15 // Remove Trigger bits
16 // But addition of these variables, ilumi (analyser), inslumi (analyser), nprim
17 
18 // Feb09 2009
19 // Move the initialisation of SteppingHelixPropagator from ::beginJob() to ::produce()
20 //
21 // Oct3 2008
22 // Difference in tag V00-02-45 with previous code
23 
24 // 1. One new object on data format, which was realised in
25 // CRUZET data analysis.
26 //2. Remove all histogram and cout in the code
27 //3. An upgrade in code, which increases the acceptance of
28 // muon near the edge (this also realised in CRUZET data).
29 // Difference in wrt V00-02-45
30 // 1. initialisation tmpHOCalib.htime = -1000;
31 // 2. By mistake HLT was commented out
32 
33 // Package: AlCaHOCalibProducer
34 // Class: AlCaHOCalibProducer
35 //
68 //
69 // Original Author: Gobinda Majumder
70 // Created: Fri Jul 6 17:17:21 CEST 2007
71 //
72 //
73 
74 // system include files
75 #include <memory>
76 
77 // user include files
80 
87 
91 
96 
100 
102 
105 
108 
111 
114 #include "CLHEP/Vector/LorentzVector.h"
115 
118 
123 
130 
131 // Necessary includes for identify severity of flagged problems in HO rechits
132 //#include "RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h"
137 #include "CLHEP/Units/GlobalPhysicalConstants.h"
138 #include "CLHEP/Units/GlobalSystemOfUnits.h"
139 
140 #include "TH2F.h"
141 
142 /* C++ Headers */
143 #include <string>
144 
145 #include <iostream>
146 #include <fstream>
147 //
148 // class decleration
149 //
150 
151 class AlCaHOCalibProducer : public edm::one::EDProducer<edm::one::SharedResources> {
152 public:
153  explicit AlCaHOCalibProducer(const edm::ParameterSet&);
154 
158 
159 private:
160  void produce(edm::Event&, const edm::EventSetup&) override;
161  void beginJob() override;
162  void endJob() override;
163 
164  void fillHOStore(const reco::TrackRef& ncosm,
165  HOCalibVariables& tmpHOCalib,
166  std::unique_ptr<HOCalibVariableCollection>& hostore,
167  int Noccu_old,
168  int indx,
171  const edm::Event& iEvent,
173  const MagneticField&);
174 
175  void findHOEtaPhi(int iphsect, int& ietaho, int& iphiho);
176  // virtual void endRun(edm::Run const &, edm::EventSetup const &) override;
177  // ----------member data ---------------------------
178 
179  float xhor0; //x-position in ring 0
180  float yhor0; //y-position in ring 0
181  float xhor1; //x-position in ring 1
182  float yhor1; //y-position in ring 1
183  int iring; //Ring number -2,-1,0,1,2
184 
185  float localxhor0; //local x-distance from edege in ring 0
186  float localyhor0; //local y-distance from edege in ring 0
187  float localxhor1; //local x-distance from edege in ring 1
188  float localyhor1; //local y-distance from edege in ring 1
189 
190  TH2F* ho_occupency[5];
192  bool m_cosmic;
193 
194  const int netabin = 16;
195  const int nphimx = 72;
196  const int netamx = 32;
197  const int ncidmx = 5;
198  const double rHOL0 = 382.0;
199  const double rHOL1 = 407.0;
200 
201  edm::InputTag muonTags_; // cosmicMuons (for cosmic run) or muons (for collision run)
202 
206  // edm::EDGetTokenT<LumiDetails> tok_lumi_;
208 
212 
217 
218  bool m_hbinfo;
220  int m_endTS;
221  double m_sigma;
222 
224  int Noccu;
225  int nRuns;
226 
227  // SteppingHelixPropagator* stepProp;
228  FreeTrajectoryState getFreeTrajectoryState(const reco::Track& tk, const MagneticField* field, int itag, bool dir);
229 
230  unsigned int Ntp; // # of HLT trigger paths (should be the same for all events!)
231  std::map<std::string, bool> fired;
232 
233  //hcal severity ES
235  // edm::ESHandle<HcalChannelQuality> theHcalChStatus;
237  int Nevents;
238 };
239 
240 //
241 // constants, enums and typedefs
242 //
243 
244 //
245 // static data member definitions
246 //
247 
248 //
249 // constructors and destructor
250 //
252  usesResource(TFileService::kSharedResource);
253  //register your products
254 
255  m_hbinfo = iConfig.getUntrackedParameter<bool>("hbinfo", false);
256  m_sigma = iConfig.getUntrackedParameter<double>("sigma", 0.05);
257  m_occupancy = iConfig.getUntrackedParameter<bool>("plotOccupancy", false);
258  m_cosmic = iConfig.getUntrackedParameter<bool>("CosmicData", false);
259 
260  // keep InputTag muonTags_ since it is used below. - cowden
261  muonTags_ = iConfig.getUntrackedParameter<edm::InputTag>("muons");
262  tok_muonsCosmic_ = consumes<reco::TrackCollection>(muonTags_);
263  tok_muons_ = consumes<edm::View<reco::Muon> >(muonTags_);
264  tok_vertex_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexTags"));
265  // tok_lumi_ = consumes<LumiDetails ,edm::InLumi>(iConfig.getParameter<edm::InputTag>("lumiTags"));
266  tok_lumi_ = consumes<LumiScalersCollection>(iConfig.getParameter<edm::InputTag>("lumiTags"));
267  tok_ho_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInput"));
268  tok_hbhe_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInput"));
269  tok_tower_ = consumes<CaloTowerCollection>(iConfig.getParameter<edm::InputTag>("towerInput"));
270 
271  tok_hcalChStatus_ = esConsumes<HcalChannelQuality, HcalChannelQualityRcd>(edm::ESInputTag("", "withTopo"));
272  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
273  tok_hcalSevLvlComputer_ = esConsumes<HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd>();
274  tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
275 
276  produces<HOCalibVariableCollection>("HOCalibVariableCollection").setBranchAlias("HOCalibVariableCollection");
277 
278  if (m_occupancy) {
280 
281  char title[200];
282 
283  for (int ij = 0; ij < 5; ij++) {
284  sprintf(title, "ho_occupency (>%i #sigma)", ij + 2);
285  ho_occupency[ij] =
286  fs->make<TH2F>(title, title, netamx + 1, -netamx - 0.5, netamx / 2 + 0.5, nphimx, 0.5, nphimx + 0.5);
287  }
288  }
289 }
290 
291 //
292 // member functions
293 //
294 
295 // ------------ method called to produce the data ------------
297  int irun = iEvent.id().run();
298  // int ilumi = iEvent.luminosityBlock();
299 
300  Nevents++;
301 
302  if (Nevents % 5000 == 1)
303  edm::LogInfo("HOCalib") << "AlCaHOCalibProducer Processing event # " << Nevents << " " << Noccu << " " << irun
304  << " " << iEvent.id().event();
305 
307 
308  auto hostore = std::make_unique<HOCalibVariableCollection>();
309 
311  edm::Handle<edm::View<reco::Muon> > collisionmuon;
312 
313  bool muonOK(true);
314  HOCalibVariables tmpHOCalib;
315  tmpHOCalib.nprim = -1;
316  tmpHOCalib.inslumi = -1.;
317 
318  if (m_cosmic) {
319  iEvent.getByToken(tok_muonsCosmic_, cosmicmuon);
320  muonOK = (cosmicmuon.isValid() && !cosmicmuon->empty());
321  } else {
322  iEvent.getByToken(tok_muons_, collisionmuon);
323  muonOK = (collisionmuon.isValid() && !collisionmuon->empty());
324 
325  if (iEvent.isRealData()) {
327  iEvent.getByToken(tok_vertex_, primaryVertices);
328  if (primaryVertices.isValid()) {
329  tmpHOCalib.nprim = primaryVertices->size();
330  }
331 
332  tmpHOCalib.inslumi = 0.;
333 
335  iEvent.getByToken(tok_lumi_, lumiScale);
336 
337  if (lumiScale.isValid()) {
338  if (lumiScale->empty()) {
339  edm::LogError("HOCalib") << "lumiScale collection is empty";
340  } else {
341  tmpHOCalib.inslumi = lumiScale->begin()->pileup();
342  }
343  }
344  }
345  }
346 
347  if (muonOK) {
348  int Noccu_old = Noccu;
350 
352 
353  MagneticField const& magField = iSetup.getData(tok_magField_);
354 
355  const CaloGeometry& geo = iSetup.getData(tok_geom_);
357 
358  if (m_cosmic) {
359  int indx(0);
360  for (reco::TrackCollection::const_iterator ncosm = cosmicmuon->begin(); ncosm != cosmicmuon->end();
361  ++ncosm, ++indx) {
362  if ((*ncosm).ndof() < 15)
363  continue;
364  if ((*ncosm).normalizedChi2() > 30.0)
365  continue;
366  reco::TrackRef tRef = reco::TrackRef(cosmicmuon, indx);
367  fillHOStore(tRef, tmpHOCalib, hostore, Noccu_old, indx, cosmicmuon, muon1, iEvent, gHO, magField);
368  }
369  } else {
370  for (muon1 = collisionmuon->begin(); muon1 < collisionmuon->end(); muon1++) {
371  if ((!muon1->isGlobalMuon()) || (!muon1->isTrackerMuon()))
372  continue;
373  reco::TrackRef ncosm = muon1->innerTrack();
374  fillHOStore(ncosm, tmpHOCalib, hostore, Noccu_old, 0, cosmicmuon, muon1, iEvent, gHO, magField);
375  }
376  }
377  }
378 
379  iEvent.put(std::move(hostore), "HOCalibVariableCollection");
380 }
381 
382 // ------------ method called once each job just before starting event loop ------------
384  Nevents = 0;
385  nRuns = 0;
386  Noccu = 0;
387 }
388 
389 // ------------ method called once each job just after ending the event loop ------------
391  if (m_occupancy) {
392  for (int ij = 0; ij < 5; ij++) {
393  ho_occupency[ij]->Scale(1. / std::max(1, Noccu));
394  }
395  }
396  edm::LogInfo("HOCalib") << " AlCaHOCalibProducer processed event " << Nevents;
397 }
398 
400  HOCalibVariables& tmpHOCalib,
401  std::unique_ptr<HOCalibVariableCollection>& hostore,
402  int Noccu_old,
403  int indx,
406  const edm::Event& iEvent,
407  const CaloSubdetectorGeometry* gHO,
408  const MagneticField& magField) {
409  // Get Hcal Severity Level Computer, so that the severity of each rechit flag/status may be determined
410  // edm::ESHandle<HcalSeverityLevelComputer> hcalSevLvlComputerHndl;
411 
412  int charge = ncosm->charge();
413 
414  double innerr = (*ncosm).innerPosition().Perp2();
415  double outerr = (*ncosm).outerPosition().Perp2();
416  int iiner = (innerr < outerr) ? 1 : 0;
417 
418  //---------------------------------------------------
419  // in_to_out Dir in_to_out Dir
420  // StandAlone ^ ^ Cosmic ^ |
421  // | | | v
422  //---------------------------------------------------Y=0
423  // StandAlone | | Cosmic ^ |
424  // v v | v
425  //----------------------------------------------------
426 
427  double posx, posy, posz;
428  double momx, momy, momz;
429 
430  if (iiner == 1) {
431  posx = (*ncosm).innerPosition().X();
432  posy = (*ncosm).innerPosition().Y();
433  posz = (*ncosm).innerPosition().Z();
434 
435  momx = (*ncosm).innerMomentum().X();
436  momy = (*ncosm).innerMomentum().Y();
437  momz = (*ncosm).innerMomentum().Z();
438 
439  } else {
440  posx = (*ncosm).outerPosition().X();
441  posy = (*ncosm).outerPosition().Y();
442  posz = (*ncosm).outerPosition().Z();
443 
444  momx = (*ncosm).outerMomentum().X();
445  momy = (*ncosm).outerMomentum().Y();
446  momz = (*ncosm).outerMomentum().Z();
447  }
448 
449  PositionType trkpos(posx, posy, posz);
450 
451  CLHEP::Hep3Vector tmpmuon3v(posx, posy, posz);
452  CLHEP::Hep3Vector tmpmuondir(momx, momy, momz);
453 
454  bool samedir = (tmpmuon3v.dot(tmpmuondir) > 0) ? true : false;
455  for (int ij = 0; ij < 3; ij++) {
456  tmpHOCalib.caloen[ij] = 0.0;
457  }
458  int inearbymuon = 0;
459  localxhor0 = localyhor0 = 20000; //GM for 22OCT07 data
460 
461  if (m_cosmic) {
462  int ind(0);
463  for (reco::TrackCollection::const_iterator ncosmcor = cosmicmuon->begin(); ncosmcor != cosmicmuon->end();
464  ++ncosmcor, ++ind) {
465  if (indx == ind)
466  continue;
467  CLHEP::Hep3Vector tmpmuon3vcor;
468  CLHEP::Hep3Vector tmpmom3v;
469  if (iiner == 1) {
470  tmpmuon3vcor = CLHEP::Hep3Vector(
471  (*ncosmcor).innerPosition().X(), (*ncosmcor).innerPosition().Y(), (*ncosmcor).innerPosition().Z());
472  tmpmom3v = CLHEP::Hep3Vector(
473  (*ncosmcor).innerMomentum().X(), (*ncosmcor).innerMomentum().Y(), (*ncosmcor).innerMomentum().Z());
474  } else {
475  tmpmuon3vcor = CLHEP::Hep3Vector(
476  (*ncosmcor).outerPosition().X(), (*ncosmcor).outerPosition().Y(), (*ncosmcor).outerPosition().Z());
477  tmpmom3v = CLHEP::Hep3Vector(
478  (*ncosmcor).outerMomentum().X(), (*ncosmcor).outerMomentum().Y(), (*ncosmcor).outerMomentum().Z());
479  }
480 
481  if (tmpmom3v.mag() < 0.2 || (*ncosmcor).ndof() < 5)
482  continue;
483 
484  double angle = tmpmuon3v.angle(tmpmuon3vcor);
485  if (angle < 7.5 * CLHEP::deg) {
486  inearbymuon = 1;
487  } // break;}
488 
489  // if (muonTagsi_.label() =="cosmicMuons") {
490  if (angle < 7.5 * CLHEP::deg) {
491  tmpHOCalib.caloen[0] += 1.;
492  }
493  if (angle < 15.0 * CLHEP::deg) {
494  tmpHOCalib.caloen[1] += 1.;
495  }
496  if (angle < 35.0 * CLHEP::deg) {
497  tmpHOCalib.caloen[2] += 1.;
498  }
499  }
500  } else {
501  // if (muonTags_.label() =="muons") {
503  iEvent.getByToken(tok_tower_, calotower);
504 
505  for (CaloTowerCollection::const_iterator calt = calotower->begin(); calt != calotower->end(); calt++) {
506  //CMSSW_2_1_x const math::XYZVector towermom = (*calt).momentum();
507  double ith = (*calt).momentum().theta();
508  double iph = (*calt).momentum().phi();
509 
510  CLHEP::Hep3Vector calo3v(sin(ith) * cos(iph), sin(ith) * sin(iph), cos(ith));
511 
512  double angle = tmpmuon3v.angle(calo3v);
513 
514  if (angle < 7.5 * CLHEP::deg) {
515  tmpHOCalib.caloen[0] += calt->emEnergy() + calt->hadEnergy();
516  }
517  if (angle < 15 * CLHEP::deg) {
518  tmpHOCalib.caloen[1] += calt->emEnergy() + calt->hadEnergy();
519  }
520  if (angle < 35 * CLHEP::deg) {
521  tmpHOCalib.caloen[2] += calt->emEnergy() + calt->hadEnergy();
522  }
523  }
524  }
525  if ((m_cosmic) || (tmpHOCalib.caloen[0] <= 10.0)) {
526  GlobalPoint glbpt(posx, posy, posz);
527 
528  double mom = sqrt(momx * momx + momy * momy + momz * momz);
529 
530  momx /= mom;
531  momy /= mom;
532  momz /= mom;
533 
534  DirectionType trkdir(momx, momy, momz);
535 
536  tmpHOCalib.trkdr = (*ncosm).d0();
537  tmpHOCalib.trkdz = (*ncosm).dz();
538  tmpHOCalib.nmuon = (m_cosmic) ? cosmicmuon->size() : 1;
539  tmpHOCalib.trkvx = glbpt.x();
540  tmpHOCalib.trkvy = glbpt.y();
541  tmpHOCalib.trkvz = glbpt.z();
542  tmpHOCalib.trkmm = mom * charge;
543  tmpHOCalib.trkth = trkdir.theta();
544  tmpHOCalib.trkph = trkdir.phi();
545  tmpHOCalib.isect2 = -2;
546  tmpHOCalib.isect = -2;
547  tmpHOCalib.hodx = -100;
548  tmpHOCalib.hody = -100;
549  tmpHOCalib.hoang = -2.0;
550  tmpHOCalib.momatho = -2;
551  tmpHOCalib.ndof = (inearbymuon == 0) ? (int)(*ncosm).ndof() : -(int)(*ncosm).ndof();
552  tmpHOCalib.chisq = (*ncosm).normalizedChi2(); // max(1.,tmpHOCalib.ndof);
553  if (!m_cosmic) {
554  reco::MuonEnergy muonenr = muon1->calEnergy();
555  reco::MuonIsolation iso03 = muon1->isolationR03();
556  reco::MuonIsolation iso05 = muon1->isolationR05();
557 
558  tmpHOCalib.tkpt03 = iso03.sumPt;
559  tmpHOCalib.ecal03 = iso05.sumPt; // iso03.emEt+muonenr.em;
560  tmpHOCalib.hcal03 = iso03.hadEt + muonenr.had;
561  }
562  tmpHOCalib.therr = 0.;
563  tmpHOCalib.pherr = 0.;
564  if (iiner == 1) {
565  reco::TrackBase::CovarianceMatrix innercov = (*ncosm).innerStateCovariance();
566  tmpHOCalib.therr = innercov(1, 1); //thetaError();
567  tmpHOCalib.pherr = innercov(2, 2); //phi0Error();
568  } else {
569  reco::TrackBase::CovarianceMatrix outercov = (*ncosm).outerStateCovariance();
570  tmpHOCalib.therr = outercov(1, 1); //thetaError();
571  tmpHOCalib.pherr = outercov(2, 2); //phi0Error();
572  }
573 
574  SteppingHelixPropagator myHelix(&magField, anyDirection);
575  myHelix.setMaterialMode(false);
576  myHelix.applyRadX0Correction(true);
577  double phiho = trkpos.phi();
578  if (phiho < 0)
579  phiho += CLHEP::twopi;
580 
581  int iphisect_dt = int(6 * (phiho + 10.0 * CLHEP::deg) / CLHEP::pi); //for u 18/12/06
582  if (iphisect_dt >= 12)
583  iphisect_dt = 0;
584 
585  int iphisect = -1;
586  bool ipath = false;
587  for (int kl = 0; kl <= 2; kl++) {
588  int iphisecttmp = (kl < 2) ? iphisect_dt + kl : iphisect_dt - 1;
589  if (iphisecttmp < 0)
590  iphisecttmp = 11;
591  if (iphisecttmp >= 12)
592  iphisecttmp = 0;
593 
594  double phipos = iphisecttmp * CLHEP::pi / 6.;
595  double phirot = phipos;
596 
597  GlobalVector xLocal(-sin(phirot), cos(phirot), 0.);
598  GlobalVector yLocal(0., 0., 1.);
599  GlobalVector zLocal = xLocal.cross(yLocal).unit();
600  // GlobalVector zLocal(cos(phirot), sin(phirot), 0.0);
601 
602  FreeTrajectoryState freetrajectorystate_ = getFreeTrajectoryState(*ncosm, &(magField), iiner, samedir);
603 
604  Surface::RotationType rot(xLocal, yLocal, zLocal);
605 
606  for (int ik = 1; ik >= 0; ik--) { //propagate track in two HO layers
607 
608  double radial = rHOL1;
609  if (ik == 0)
610  radial = rHOL0;
611 
612  Surface::PositionType pos(radial * cos(phipos), radial * sin(phipos), 0.);
614 
615  auto aPlane2 = new Plane(pos, rot);
616 
617  SteppingHelixStateInfo steppingHelixstateinfo_;
618  myHelix.propagate(SteppingHelixStateInfo(freetrajectorystate_), (*aPlane2), steppingHelixstateinfo_);
619 
620  if (steppingHelixstateinfo_.isValid()) {
621  GlobalPoint hotrkpos2xx(steppingHelixstateinfo_.position().x(),
622  steppingHelixstateinfo_.position().y(),
623  steppingHelixstateinfo_.position().z());
624 
625  if (ik == 1) {
626  HcalDetId ClosestCell = (HcalDetId)gHO->getClosestCell(hotrkpos2xx);
627  int ixeta = ClosestCell.ieta();
628  int ixphi = ClosestCell.iphi();
629  tmpHOCalib.isect2 = 100 * std::abs(ixeta + 50) + std::abs(ixphi);
630  }
631 
632  GlobalVector hotrkpos2(steppingHelixstateinfo_.position().x(),
633  steppingHelixstateinfo_.position().y(),
634  steppingHelixstateinfo_.position().z());
635  CLHEP::Hep3Vector hotrkdir2(steppingHelixstateinfo_.momentum().x(),
636  steppingHelixstateinfo_.momentum().y(),
637  steppingHelixstateinfo_.momentum().z());
638 
639  LocalVector lclvt0 = (*aPlane).toLocal(hotrkpos2);
640 
641  double xx = lclvt0.x();
642  double yy = lclvt0.y();
643 
644  if (ik == 1) {
645  if ((std::abs(yy) < 130 && xx > -64.7 && xx < 138.2) //Ring-0
646  || (std::abs(yy) > 130 && std::abs(yy) < 700 && xx > -76.3 && xx < 140.5)) { //Ring +-1,2
647  ipath = true; //Only look for tracks which as hits in layer 1
648  iphisect = iphisecttmp;
649  }
650  }
651 
652  if (iphisect != iphisecttmp)
653  continue; //Look for ring-0 only when ring1 is accepted for that sector
654 
655  switch (ik) {
656  case 0:
657  xhor0 = xx; //lclvt0.x();
658  yhor0 = yy; //lclvt0.y();
659  break;
660  case 1:
661  xhor1 = xx; //lclvt0.x();
662  yhor1 = yy; //lclvt0.y();
663  tmpHOCalib.momatho = hotrkdir2.mag();
664  tmpHOCalib.hoang = CLHEP::Hep3Vector(zLocal.x(), zLocal.y(), zLocal.z()).dot(hotrkdir2.unit());
665  break;
666  default:
667  break;
668  }
669  } else {
670  break;
671  }
672  }
673  if (ipath)
674  break;
675  }
676  if (ipath) { //If muon crossed HO laeyrs
677 
678  int ietaho = 50;
679  int iphiho = -1;
680 
681  for (int ij = 0; ij < 9; ij++) {
682  tmpHOCalib.hosig[ij] = -100.0;
683  }
684  for (int ij = 0; ij < 18; ij++) {
685  tmpHOCalib.hocorsig[ij] = -100.0;
686  }
687  for (int ij = 0; ij < 9; ij++) {
688  tmpHOCalib.hbhesig[ij] = -100.0;
689  }
690  tmpHOCalib.hocro = -100;
691  tmpHOCalib.htime = -1000;
692 
693  int isect = 0;
694 
695  findHOEtaPhi(iphisect, ietaho, iphiho);
696 
697  if (ietaho != 0 && iphiho != 0 && std::abs(iring) <= 2) { //Muon passed through a tower
698  isect = 100 * std::abs(ietaho + 50) + std::abs(iphiho);
699  if (std::abs(ietaho) >= netabin || iphiho < 0)
700  isect *= -1; //Not extrapolated to any tower
701  if (std::abs(ietaho) >= netabin)
702  isect -= 1000000; //not matched with eta
703  if (iphiho < 0)
704  isect -= 2000000; //not matched with phi
705  tmpHOCalib.isect = isect;
706 
707  tmpHOCalib.hodx = localxhor1;
708  tmpHOCalib.hody = localyhor1;
709 
710  if (iring == 0) {
711  tmpHOCalib.hocorsig[8] = localxhor0;
712  tmpHOCalib.hocorsig[9] = localyhor0;
713  }
714 
715  int etamn = -4;
716  int etamx = 4;
717  if (iring == 1) {
718  etamn = 5;
719  etamx = 10;
720  }
721  if (iring == 2) {
722  etamn = 11;
723  etamx = 16;
724  }
725  if (iring == -1) {
726  etamn = -10;
727  etamx = -5;
728  }
729  if (iring == -2) {
730  etamn = -16;
731  etamx = -11;
732  }
733 
734  int phimn = 1;
735  int phimx = 2;
736  if (iring == 0) {
737  phimx = 2 * int((iphiho + 1) / 2.);
738  phimn = phimx - 1;
739  } else {
740  phimn = 3 * int((iphiho + 1) / 3.) - 1;
741  phimx = phimn + 2;
742  }
743 
744  if (phimn < 1)
745  phimn += nphimx;
746  if (phimx > 72)
747  phimx -= nphimx;
748 
749  if (m_hbinfo) {
750  for (int ij = 0; ij < 9; ij++) {
751  tmpHOCalib.hbhesig[ij] = -100.0;
752  }
753 
754  edm::Handle<HBHERecHitCollection> hbheht; // iEvent.getByType(hbheht);
755  iEvent.getByToken(tok_hbhe_, hbheht);
756 
757  if (!(*hbheht).empty()) {
758  if ((*hbheht).empty())
759  throw(int)(*hbheht).size();
760 
761  for (HBHERecHitCollection::const_iterator jk = (*hbheht).begin(); jk != (*hbheht).end(); jk++) {
762  HcalDetId id = (*jk).id();
763  int tmpeta = id.ieta();
764  int tmpphi = id.iphi();
765 
766  int deta = tmpeta - ietaho;
767  if (tmpeta < 0 && ietaho > 0)
768  deta += 1;
769  if (tmpeta > 0 && ietaho < 0)
770  deta -= 1;
771 
772  // if (tmpeta==-1 && ietaho== 1) deta = -1;
773  // if (tmpeta== 1 && ietaho==-1) deta = 1;
774 
775  int dphi = tmpphi - iphiho;
776  if (dphi > nphimx / 2) {
777  dphi -= nphimx;
778  }
779  if (dphi < -nphimx / 2) {
780  dphi += nphimx;
781  }
782 
783  // if (phimn >phimx) {
784  // if (dphi==71) dphi=-1;
785  // if (dphi==-71) dphi=1;
786  // }
787 
788  if (m_occupancy) {
789  float signal = (*jk).energy();
790  // int tmpeta1 = (tmpeta>0) ? tmpeta -1 : -tmpeta +14;
791  if (signal > -100 && Noccu == Noccu_old) {
792  for (int ij = 0; ij < 5; ij++) {
793  if (signal > (ij + 2) * m_sigma) {
794  ho_occupency[ij]->Fill(tmpeta, tmpphi);
795  }
796  }
797  }
798  }
799 
800  int ipass2 = (std::abs(deta) <= 1 && std::abs(dphi) <= 1) ? 1 : 0; //NEED correction in full CMS detector
801  if (ipass2 == 0)
802  continue;
803 
804  float signal = (*jk).energy();
805 
806  if (3 * (deta + 1) + dphi + 1 < 9)
807  tmpHOCalib.hbhesig[3 * (deta + 1) + dphi + 1] = signal;
808  }
809  }
810  } //m_hbinfo #endif
811 
813  iEvent.getByToken(tok_ho_, hoht);
814 
815  if (!(*hoht).empty()) {
816  for (HORecHitCollection::const_iterator jk = (*hoht).begin(); jk != (*hoht).end(); jk++) {
817  HcalDetId id = (*jk).id();
818  int tmpeta = id.ieta();
819  int tmpphi = id.iphi();
820 
821  int ipass1 = 0;
822  if (tmpeta >= etamn && tmpeta <= etamx) {
823  if (phimn < phimx) {
824  ipass1 = (tmpphi >= phimn && tmpphi <= phimx) ? 1 : 0;
825  } else {
826  ipass1 = (tmpphi == 71 || tmpphi == 72 || tmpphi == 1) ? 1 : 0;
827  }
828  }
829 
830  int deta = tmpeta - ietaho;
831  int dphi = tmpphi - iphiho;
832 
833  if (tmpeta < 0 && ietaho > 0)
834  deta += 1;
835  if (tmpeta > 0 && ietaho < 0)
836  deta -= 1;
837  // if (tmpeta==-1 && ietaho== 1) deta = -1;
838  // if (tmpeta== 1 && ietaho==-1) deta = 1;
839 
840  if (dphi > nphimx / 2) {
841  dphi -= nphimx;
842  }
843  if (dphi < -nphimx / 2) {
844  dphi += nphimx;
845  }
846  // if (phimn>phimx) {
847  // if (dphi==71) dphi=-1;
848  // if (dphi==-71) dphi=1;
849  // }
850 
851  float signal = (*jk).energy();
852 
853  int ipass2 = (std::abs(deta) <= 1 && std::abs(dphi) <= 1) ? 1 : 0;
854 
855  if (ipass1 == 0 && ipass2 == 0)
856  continue;
857 
858  if (ipass1 == 1) {
859  int tmpdph = tmpphi - phimn;
860  if (tmpdph < 0)
861  tmpdph = 2; //only case of iphi==1, where phimn=71
862 
863  int ilog = 2 * (tmpeta - etamn) + tmpdph;
864  if (iring != 0) {
865  if (iring > 0) {
866  ilog = 3 * (tmpeta - etamn) + tmpdph; //Again CMS correction
867  } else {
868  ilog = 3 * (etamx - tmpeta) + tmpdph; //Again CMS correction
869  }
870  }
871  if (ilog > -1 && ilog < 18) {
872  tmpHOCalib.hocorsig[ilog] = signal;
873  }
874  }
875 
876  if (ipass2 == 1) {
877  if (3 * (deta + 1) + dphi + 1 < 9) {
878  tmpHOCalib.hosig[3 * (deta + 1) + dphi + 1] = signal; //Again CMS azimuthal near phi 1&72
879  }
880  }
881 
882  if (deta == 0 && dphi == 0) {
883  tmpHOCalib.htime = (*jk).time();
884  tmpHOCalib.hoflag = (*jk).flags();
885 
886  // Get Channel Quality information for the given detID
887  unsigned theStatusValue = theHcalChStatus->getValues(id)->getValue();
888  // Now get severity of problems for the given detID, based on the rechit flag word and the channel quality status value
889  int hitSeverity = hcalSevLvlComputerHndl->getSeverityLevel(id, (*jk).flags(), theStatusValue);
890  tmpHOCalib.hoflag = hitSeverity;
891  int crphi = tmpphi + 6;
892  if (crphi > 72)
893  crphi -= 72;
894 
895  for (HORecHitCollection::const_iterator jcr = (*hoht).begin(); jcr != (*hoht).end(); jcr++) {
896  const HORecHit reccr = (const HORecHit)(*jcr);
897  HcalDetId idcr = reccr.id();
898  int etacr = idcr.ieta();
899  int phicr = idcr.iphi();
900  if (tmpeta == etacr && crphi == phicr) {
901  tmpHOCalib.hocro = reccr.energy();
902  }
903  }
904  }
905  }
906  }
907  }
908 
909  //GMA Npass++;
910  if (Noccu == Noccu_old)
911  Noccu++;
912  hostore->push_back(tmpHOCalib);
913  } // if (ipath)
914  } // Cut on calo energy
915 }
916 
917 void AlCaHOCalibProducer::findHOEtaPhi(int iphisect, int& ietaho, int& iphiho) {
918  //18/12/06 : use only position, not angle phi
919 
920  const double etalow[16] = {0.025,
921  35.195,
922  70.625,
923  106.595,
924  141.565,
925  180.765,
926  220.235,
927  261.385,
928  304.525,
929  349.975,
930  410.025,
931  452.085,
932  506.645,
933  565.025,
934  627.725,
935  660.25};
936  const double etahgh[16] = {35.145,
937  70.575,
938  106.545,
939  125.505,
940  180.715,
941  220.185,
942  261.335,
943  304.475,
944  349.925,
945  392.575,
946  452.035,
947  506.595,
948  564.975,
949  627.675,
950  661.075,
951  700.25};
952 
953  const double philow[6] = {-76.27, -35.11, 0.35, 35.81, 71.77, 108.93}; //Ring+/-1 & 2
954  const double phihgh[6] = {-35.81, -0.35, 35.11, 71.07, 108.23, 140.49};
955 
956  const double philow00[6] = {-60.27, -32.91, 0.35, 33.61, 67.37, 102.23}; //Ring0 L0
957  const double phihgh00[6] = {-33.61, -0.35, 32.91, 66.67, 101.53, 129.49};
958 
959  const double philow01[6] = {-64.67, -34.91, 0.35, 35.61, 71.37, 108.33}; //Ring0 L1
960  const double phihgh01[6] = {-35.61, -0.35, 34.91, 70.67, 107.63, 138.19};
961 
962  iring = -10;
963 
964  double tmpdy = std::abs(yhor1);
965  for (int ij = 0; ij < netabin; ij++) {
966  if (tmpdy > etalow[ij] && tmpdy < etahgh[ij]) {
967  ietaho = ij + 1;
968  float tmp1 = fabs(tmpdy - etalow[ij]);
969  float tmp2 = fabs(tmpdy - etahgh[ij]);
970 
971  localyhor1 = (tmp1 < tmp2) ? -tmp1 : tmp2;
972  if (yhor1 < 0)
973  localyhor1 *= -1.;
974 
975  if (ij < 4)
976  iring = 0;
977  if (ij >= 4 && ij < 10)
978  iring = 1;
979  if (ij >= 10 && ij < netabin)
980  iring = 2;
981  break;
982  }
983  }
984 
985  int tmpphi = 0;
986  int tmpphi0 = 0;
987 
988  if (ietaho > 4) { //Ring 1 and 2
989  for (int ij = 0; ij < 6; ij++) {
990  if (xhor1 > philow[ij] && xhor1 < phihgh[ij]) {
991  tmpphi = ij + 1;
992  float tmp1 = fabs(xhor1 - philow[ij]);
993  float tmp2 = fabs(xhor1 - phihgh[ij]);
994  localxhor1 = (tmp1 < tmp2) ? -tmp1 : tmp2;
995  break;
996  }
997  }
998  } else { //Ring 0
999  for (int ij = 0; ij < 6; ij++) {
1000  if (xhor1 > philow01[ij] && xhor1 < phihgh01[ij]) {
1001  tmpphi = ij + 1;
1002  float tmp1 = fabs(xhor1 - philow01[ij]);
1003  float tmp2 = fabs(xhor1 - phihgh01[ij]);
1004  localxhor1 = (tmp1 < tmp2) ? -tmp1 : tmp2;
1005  break;
1006  }
1007  }
1008 
1009  for (int ij = 0; ij < 6; ij++) {
1010  if (xhor0 > philow00[ij] && xhor0 < phihgh00[ij]) {
1011  tmpphi0 = ij + 1;
1012  float tmp1 = fabs(xhor0 - philow00[ij]);
1013  float tmp2 = fabs(xhor0 - phihgh00[ij]);
1014  localxhor0 = (tmp1 < tmp2) ? -tmp1 : tmp2;
1015  if (tmpphi != tmpphi0)
1016  localxhor0 += 10000.;
1017  break;
1018  }
1019  }
1020 
1021  double tmpdy = std::abs(yhor0);
1022  for (int ij = 0; ij < 4; ij++) {
1023  if (tmpdy > etalow[ij] && tmpdy < etahgh[ij]) {
1024  float tmp1 = fabs(tmpdy - etalow[ij]);
1025  float tmp2 = fabs(tmpdy - etahgh[ij]);
1026  localyhor0 = (tmp1 < tmp2) ? -tmp1 : tmp2;
1027  if (yhor0 < 0)
1028  localyhor0 *= -1.;
1029  if (ij + 1 != ietaho)
1030  localyhor0 += 10000.;
1031  break;
1032  }
1033  }
1034  }
1035 
1036  if (tmpphi != 0) {
1037  iphiho = 6 * iphisect - 2 + tmpphi;
1038  if (iphiho <= 0)
1039  iphiho += nphimx;
1040  if (iphiho > nphimx)
1041  iphiho -= nphimx;
1042  }
1043 
1044  // isect2 = 15*iring+iphisect+1;
1045 
1046  if (yhor1 < 0) {
1047  if (std::abs(ietaho) > netabin) { //Initialised with 50
1048  ietaho += 1;
1049  } else {
1050  ietaho *= -1;
1051  }
1052  // isect2 *=-1;
1053  iring *= -1;
1054  }
1055 }
1056 
1058  const MagneticField* field,
1059  int iiner,
1060  bool dir) {
1061  if (iiner == 0) {
1062  GlobalPoint gpos(tk.outerX(), tk.outerY(), tk.outerZ());
1063  GlobalVector gmom(tk.outerPx(), tk.outerPy(), tk.outerPz());
1064  if (dir)
1065  gmom *= -1.;
1066  GlobalTrajectoryParameters par(gpos, gmom, tk.charge(), field);
1067  CurvilinearTrajectoryError err(tk.extra()->outerStateCovariance());
1068  return FreeTrajectoryState(par, err);
1069  } else {
1070  GlobalPoint gpos(tk.innerPosition().X(), tk.innerPosition().Y(), tk.innerPosition().Z());
1071  GlobalVector gmom(tk.innerMomentum().X(), tk.innerMomentum().Y(), tk.innerMomentum().Z());
1072  if (dir)
1073  gmom *= -1.;
1074  GlobalTrajectoryParameters par(gpos, -gmom, tk.charge(), field);
1075  CurvilinearTrajectoryError err(tk.extra()->innerStateCovariance());
1076  return FreeTrajectoryState(par, err);
1077  }
1078 }
1079 
1081 
1082 //define this as a plug-in
dot
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
Definition: Basic3DVectorLD.h:212
AlCaHOCalibProducer::nRuns
int nRuns
Definition: AlCaHOCalibProducer.cc:225
Vector3DBase
Definition: Vector3DBase.h:8
SteppingHelixStateInfo::momentum
GlobalVector momentum() const
Definition: SteppingHelixStateInfo.h:60
HOCalibVariables::nmuon
int nmuon
Definition: HOCalibVariables.h:7
TkRotation< float >
HOCalibVariables::tkpt03
float tkpt03
Definition: HOCalibVariables.h:51
reco::MuonEnergy
Definition: MuonEnergy.h:17
HOCalibVariables::trkph
float trkph
Definition: HOCalibVariables.h:22
LumiScalers.h
AlCaHOCalibProducer::tok_ho_
edm::EDGetTokenT< HORecHitCollection > tok_ho_
Definition: AlCaHOCalibProducer.cc:210
Basic3DVector::theta
Geom::Theta< T > theta() const
Definition: extBasic3DVector.h:139
reco::Track::outerPy
double outerPy() const
y coordinate of momentum vector at the outermost hit position
Definition: Track.h:103
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
anyDirection
Definition: PropagationDirection.h:4
edm::ESInputTag
Definition: ESInputTag.h:87
AlCaHOCalibProducer::beginJob
void beginJob() override
Definition: AlCaHOCalibProducer.cc:383
EDProducer.h
FreeTrajectoryState.h
edm::SortedCollection< CaloTower >::const_iterator
std::vector< CaloTower >::const_iterator const_iterator
Definition: SortedCollection.h:80
Muon.h
AlCaHOCalibProducer::PositionType
Basic3DVector< float > PositionType
Definition: AlCaHOCalibProducer.cc:155
MessageLogger.h
SteppingHelixStateInfo::position
GlobalPoint position() const
Definition: SteppingHelixStateInfo.h:59
SteppingHelixPropagator.h
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
AlCaHOCalibProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: AlCaHOCalibProducer.cc:296
HOCalibVariables::therr
float therr
Definition: HOCalibVariables.h:28
ESHandle.h
HOCalibVariables::hoang
float hoang
Definition: HOCalibVariables.h:36
HcalDetId::iphi
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
HOCalibVariables
Definition: HOCalibVariables.h:5
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
reco::Track::outerPx
double outerPx() const
x coordinate of momentum vector at the outermost hit position
Definition: Track.h:100
HOCalibVariables::isect2
int isect2
Definition: HOCalibVariables.h:32
HORecHit
Definition: HORecHit.h:11
edm::EDGetTokenT< reco::TrackCollection >
AlCaHOCalibProducer::m_cosmic
bool m_cosmic
Definition: AlCaHOCalibProducer.cc:192
HOCalibVariables::inslumi
float inslumi
Definition: HOCalibVariables.h:10
AlCaHOCalibProducer::endJob
void endJob() override
Definition: AlCaHOCalibProducer.cc:390
pos
Definition: PixelAliasList.h:18
AlCaHOCalibProducer::tok_vertex_
edm::EDGetTokenT< reco::VertexCollection > tok_vertex_
Definition: AlCaHOCalibProducer.cc:205
DetId::Hcal
Definition: DetId.h:28
AlCaHOCalibProducer::CovarianceMatrix
math::Error< 5 >::type CovarianceMatrix
Definition: AlCaHOCalibProducer.cc:223
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
HOCalibVariables::hocro
float hocro
Definition: HOCalibVariables.h:47
reco::MuonEnergy::had
float had
Definition: MuonEnergy.h:36
reco::Track::outerX
double outerX() const
x coordinate of the outermost hit position
Definition: Track.h:109
AlCaHOCalibProducer::tok_muons_
edm::EDGetTokenT< edm::View< reco::Muon > > tok_muons_
Definition: AlCaHOCalibProducer.cc:204
ewkMuLumiMonitorDQM_cfi.calotower
calotower
Definition: ewkMuLumiMonitorDQM_cfi.py:36
HOCalibVariables::trkmm
float trkmm
Definition: HOCalibVariables.h:20
HOCalibVariables::hocorsig
float hocorsig[18]
Definition: HOCalibVariables.h:43
edm::one::EDProducer
Definition: EDProducer.h:30
AlCaHOCalibProducer::findHOEtaPhi
void findHOEtaPhi(int iphsect, int &ietaho, int &iphiho)
Definition: AlCaHOCalibProducer.cc:917
AlCaHOCalibProducer::localyhor1
float localyhor1
Definition: AlCaHOCalibProducer.cc:188
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
HcalChannelQuality
Definition: HcalChannelQuality.h:17
ReferenceCountingPointer< Plane >
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
AlCaHOCalibProducer::Noccu
int Noccu
Definition: AlCaHOCalibProducer.cc:224
AlCaHOCalibProducer::tok_hbhe_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
Definition: AlCaHOCalibProducer.cc:209
edm::Handle< reco::TrackCollection >
HOCalibVariables::caloen
float caloen[3]
Definition: HOCalibVariables.h:50
reco::MuonIsolation
Definition: MuonIsolation.h:5
HcalCondObjectContainer::getValues
const Item * getValues(DetId fId, bool throwOnFail=true) const
Definition: HcalCondObjectContainer.h:159
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
AlCaHOCalibProducer::tok_hcalChStatus_
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd > tok_hcalChStatus_
Definition: AlCaHOCalibProducer.cc:213
HOCalibVariables::htime
float htime
Definition: HOCalibVariables.h:37
AlCaHOCalibProducer::localxhor1
float localxhor1
Definition: AlCaHOCalibProducer.cc:187
edm::Ref< TrackCollection >
reco::Track::outerPz
double outerPz() const
z coordinate of momentum vector at the outermost hit position
Definition: Track.h:106
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
HOCalibVariables::pherr
float pherr
Definition: HOCalibVariables.h:29
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
AlCaHOCalibProducer::m_endTS
int m_endTS
Definition: AlCaHOCalibProducer.cc:220
MakerMacros.h
reco::MuonIsolation::sumPt
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
AlCaHOCalibProducer::fillHOStore
void fillHOStore(const reco::TrackRef &ncosm, HOCalibVariables &tmpHOCalib, std::unique_ptr< HOCalibVariableCollection > &hostore, int Noccu_old, int indx, edm::Handle< reco::TrackCollection > cosmicmuon, edm::View< reco::Muon >::const_iterator muon1, const edm::Event &iEvent, const CaloSubdetectorGeometry *, const MagneticField &)
Definition: AlCaHOCalibProducer.cc:399
CaloGeometry
Definition: CaloGeometry.h:21
PlaneBuilder.h
reco::Track::outerZ
double outerZ() const
z coordinate of the outermost hit position
Definition: Track.h:115
reco::Track::innerMomentum
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
Definition: Track.h:59
SteppingHelixPropagator
Definition: SteppingHelixPropagator.h:36
HOCalibVariables::trkth
float trkth
Definition: HOCalibVariables.h:21
HOCalibVariables::hbhesig
float hbhesig[9]
Definition: HOCalibVariables.h:49
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Track.h
TrackFwd.h
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
AlCaHOCalibProducer::m_sigma
double m_sigma
Definition: AlCaHOCalibProducer.cc:221
AlCaHOCalibProducer::tok_magField_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
Definition: AlCaHOCalibProducer.cc:216
AlCaHOCalibProducer::tok_geom_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Definition: AlCaHOCalibProducer.cc:214
Service.h
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HOCalibVariables::trkvy
float trkvy
Definition: HOCalibVariables.h:16
reco::Track
Definition: Track.h:27
AlCaHOCalibProducer::muonTags_
edm::InputTag muonTags_
Definition: AlCaHOCalibProducer.cc:201
IdealMagneticFieldRecord.h
AlCaHOCalibProducer::ho_occupency
TH2F * ho_occupency[5]
Definition: AlCaHOCalibProducer.cc:190
edm::ESHandle< HcalSeverityLevelComputer >
BXlumiParameters_cfi.lumiScale
lumiScale
Definition: BXlumiParameters_cfi.py:11
HOCalibVariables::momatho
float momatho
Definition: HOCalibVariables.h:19
HOCalibVariables::chisq
float chisq
Definition: HOCalibVariables.h:26
HOCalibVariables::hoflag
unsigned int hoflag
Definition: HOCalibVariables.h:38
HcalOuter
Definition: HcalAssistant.h:35
AlCaHOCalibProducer::Nevents
int Nevents
Definition: AlCaHOCalibProducer.cc:237
reco::TrackBase::charge
int charge() const
track electric charge
Definition: TrackBase.h:596
AlCaHOCalibProducer::xhor1
float xhor1
Definition: AlCaHOCalibProducer.cc:181
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
AlCaHOCalibProducer::m_occupancy
bool m_occupancy
Definition: AlCaHOCalibProducer.cc:191
AlCaHOCalibProducer::netabin
const int netabin
Definition: AlCaHOCalibProducer.cc:194
Point3DBase< float, GlobalTag >
IsoDeposit.h
CaloGeometryRecord.h
reco::TrackRef
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
Definition: TrackFwd.h:20
AlCaHOCalibProducer::localxhor0
float localxhor0
Definition: AlCaHOCalibProducer.cc:185
Vertex.h
SteppingHelixStateInfo
Definition: SteppingHelixStateInfo.h:27
HcalSeverityLevelComputerRcd.h
TFileService.h
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
HcalSeverityLevelComputer::getSeverityLevel
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
Definition: HcalSeverityLevelComputer.cc:304
HcalChannelStatus::getValue
uint32_t getValue() const
Definition: HcalChannelStatus.h:60
Error.h
CaloSubdetectorGeometry.h
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
AlCaHOCalibProducer::fired
std::map< std::string, bool > fired
Definition: AlCaHOCalibProducer.cc:231
edm::ParameterSet
Definition: ParameterSet.h:47
AlCaHOCalibProducer::tok_tower_
edm::EDGetTokenT< CaloTowerCollection > tok_tower_
Definition: AlCaHOCalibProducer.cc:211
AlCaHOCalibProducer::DirectionType
Basic3DVector< float > DirectionType
Definition: AlCaHOCalibProducer.cc:156
AlCaHOCalibProducer
Definition: AlCaHOCalibProducer.cc:151
zMuMuMuonUserData.primaryVertices
primaryVertices
Definition: zMuMuMuonUserData.py:12
Event.h
LumiDetails.h
geometryCSVtoXML.yy
yy
Definition: geometryCSVtoXML.py:19
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HcalDetId.h
AlCaHOCalibProducer::yhor0
float yhor0
Definition: AlCaHOCalibProducer.cc:180
HOCalibVariables::trkdz
float trkdz
Definition: HOCalibVariables.h:13
AlCaHOCalibProducer::theHcalChStatus
const HcalChannelQuality * theHcalChStatus
Definition: AlCaHOCalibProducer.cc:234
SteppingHelixPropagator::applyRadX0Correction
void applyRadX0Correction(bool applyRadX0Correction)
Definition: SteppingHelixPropagator.h:133
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
AlCaHOCalibProducer::Ntp
unsigned int Ntp
Definition: AlCaHOCalibProducer.cc:230
HOCalibVariables::trkvz
float trkvz
Definition: HOCalibVariables.h:17
reco::Track::innerPosition
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:56
HcalDetId
Definition: HcalDetId.h:12
edm::Service< TFileService >
createfilelist.int
int
Definition: createfilelist.py:10
HOCalibVariables::hodx
float hodx
Definition: HOCalibVariables.h:33
HOCalibVariables::hosig
float hosig[9]
Definition: HOCalibVariables.h:39
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
Vector3DBase::cross
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:110
IdealGeometryRecord.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
HcalSubdetector.h
CaloSubdetectorGeometry::getClosestCell
virtual DetId getClosestCell(const GlobalPoint &r) const
Definition: CaloSubdetectorGeometry.cc:44
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PlaneBuilder::plane
ReturnType plane(const PositionType &pos, const RotationType &rot) const
Definition: PlaneBuilder.h:21
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
HOCalibVariables::ndof
float ndof
Definition: HOCalibVariables.h:24
AlCaHOCalibProducer::AlCaHOCalibProducer
AlCaHOCalibProducer(const edm::ParameterSet &)
Definition: AlCaHOCalibProducer.cc:251
SteppingHelixStateInfo::isValid
bool isValid() const
Definition: SteppingHelixStateInfo.h:65
TrajectorySeedCollection.h
edm::ESGetToken< HcalChannelQuality, HcalChannelQualityRcd >
SteppingHelixPropagator::setMaterialMode
void setMaterialMode(bool noMaterial)
Switch for material effects mode: no material effects if true.
Definition: SteppingHelixPropagator.h:124
HcalChannelQualityRcd.h
AlCaHOCalibProducer::m_hbinfo
bool m_hbinfo
Definition: AlCaHOCalibProducer.cc:218
InputTag.h
PropagationDirection.h
HOCalibVariables::isect
int isect
Definition: HOCalibVariables.h:31
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:120
HcalChannelQuality.h
CaloTowerCollection.h
HOCalibVariables::hcal03
float hcal03
Definition: HOCalibVariables.h:53
VertexFwd.h
AlCaHOCalibProducer::nphimx
const int nphimx
Definition: AlCaHOCalibProducer.cc:195
AlCaHOCalibProducer::ncidmx
const int ncidmx
Definition: AlCaHOCalibProducer.cc:197
HOCalibVariables::trkvx
float trkvx
Definition: HOCalibVariables.h:15
AlCaHOCalibProducer::yhor1
float yhor1
Definition: AlCaHOCalibProducer.cc:182
HOCalibVariables.h
CaloCellGeometry.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
AlCaHOCalibProducer::tok_muonsCosmic_
edm::EDGetTokenT< reco::TrackCollection > tok_muonsCosmic_
Definition: AlCaHOCalibProducer.cc:203
AlCaHOCalibProducer::tok_lumi_
edm::EDGetTokenT< LumiScalersCollection > tok_lumi_
Definition: AlCaHOCalibProducer.cc:207
reco::MuonIsolation::hadEt
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:8
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Frameworkfwd.h
AlCaHOCalibProducer::rHOL0
const double rHOL0
Definition: AlCaHOCalibProducer.cc:198
AlCaHOCalibProducer::RotationType
Basic3DVector< float > RotationType
Definition: AlCaHOCalibProducer.cc:157
HOCalibVariables::nprim
int nprim
Definition: HOCalibVariables.h:8
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
CaloGeometry.h
TFileService::kSharedResource
static const std::string kSharedResource
Definition: TFileService.h:76
Plane
Definition: Plane.h:16
AlCaHOCalibProducer::hcalSevLvlComputerHndl
edm::ESHandle< HcalSeverityLevelComputer > hcalSevLvlComputerHndl
Definition: AlCaHOCalibProducer.cc:236
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
AlCaHOCalibProducer::localyhor0
float localyhor0
Definition: AlCaHOCalibProducer.cc:186
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
EventSetup.h
SteppingHelixPropagator::propagate
void propagate(const SteppingHelixStateInfo &ftsStart, const Surface &sDest, SteppingHelixStateInfo &out) const
Propagate to Plane given a starting point.
Definition: SteppingHelixPropagator.cc:152
CaloSubdetectorGeometry
Definition: CaloSubdetectorGeometry.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HcalRecHitCollections.h
HcalSeverityLevelComputer.h
HORecHit::id
constexpr HcalDetId id() const
get the id
Definition: HORecHit.h:19
PlaneBuilder
Definition: PlaneBuilder.h:13
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
AlCaHOCalibProducer::iring
int iring
Definition: AlCaHOCalibProducer.cc:183
HOCalibVariables::hody
float hody
Definition: HOCalibVariables.h:35
pi
const Double_t pi
Definition: trackSplitPlot.h:36
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
AlCaHOCalibProducer::xhor0
float xhor0
Definition: AlCaHOCalibProducer.cc:179
HOCalibVariables::trkdr
float trkdr
Definition: HOCalibVariables.h:12
ParameterSet.h
AlCaHOCalibProducer::tok_hcalSevLvlComputer_
edm::ESGetToken< HcalSeverityLevelComputer, HcalSeverityLevelComputerRcd > tok_hcalSevLvlComputer_
Definition: AlCaHOCalibProducer.cc:215
MuonGeometryRecord.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
reco::TrackBase::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
5 parameter covariance matrix
Definition: TrackBase.h:74
edm::Event
Definition: Event.h:73
MagneticField
Definition: MagneticField.h:19
AlCaHOCalibProducer::m_startTS
int m_startTS
Definition: AlCaHOCalibProducer.cc:219
AlCaHOCalibProducer::getFreeTrajectoryState
FreeTrajectoryState getFreeTrajectoryState(const reco::Track &tk, const MagneticField *field, int itag, bool dir)
Definition: AlCaHOCalibProducer.cc:1057
Basic3DVector::phi
Geom::Phi< T > phi() const
Definition: extBasic3DVector.h:132
edm::InputTag
Definition: InputTag.h:15
reco::Track::outerY
double outerY() const
y coordinate of the outermost hit position
Definition: Track.h:112
Basic3DVector< float >
geometryCSVtoXML.xx
xx
Definition: geometryCSVtoXML.py:19
HOCalibVariables::ecal03
float ecal03
Definition: HOCalibVariables.h:52
TFileService::make
T * make(const Args &... args) const
make new ROOT object
Definition: TFileService.h:64
AlCaHOCalibProducer::netamx
const int netamx
Definition: AlCaHOCalibProducer.cc:196
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
AlCaHOCalibProducer::rHOL1
const double rHOL1
Definition: AlCaHOCalibProducer.cc:199