CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
AlCaHcalHBHEMuonProducer Class Reference
Inheritance diagram for AlCaHcalHBHEMuonProducer:
edm::stream::EDProducer< edm::GlobalCache< alcaHcalHBHEMuon::Counters > >

Public Member Functions

 AlCaHcalHBHEMuonProducer (const edm::ParameterSet &, const alcaHcalHBHEMuon::Counters *)
 
void endStream () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~AlCaHcalHBHEMuonProducer () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< alcaHcalHBHEMuon::Counters > >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
static void globalEndJob (const alcaHcalHBHEMuon::Counters *counters)
 
static std::unique_ptr
< alcaHcalHBHEMuon::Counters
initializeGlobalCache (edm::ParameterSet const &)
 

Private Member Functions

double activeLength (const DetId &)
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
int depth16HE (int ieta, int iphi)
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
double gainFactor (const HcalDbService *dbserv, const HcalDetId &id)
 
bool goodCell (const HcalDetId &hcid, const reco::Track *pTrack, const CaloGeometry *geo, const MagneticField *bField)
 
bool isGoodVertex (const reco::Vertex &vtx)
 
int matchId (const HcalDetId &, const HcalDetId &)
 
double respCorr (const DetId &id)
 

Private Attributes

std::vector
< HcalDDDRecConstants::HcalActiveLength
actHB
 
std::vector
< HcalDDDRecConstants::HcalActiveLength
actHE
 
std::vector< std::string > all_triggers_
 
const bool collapseDepth_
 
std::map< DetId, double > corrValue_
 
const std::string fileInCorr_
 
const CaloGeometrygeo_
 
const HcalDDDRecConstantshdc_
 
HLTConfigProvider hltConfig_
 
std::vector< int > hltresults_
 
const bool isItPlan1_
 
const bool isItPreRecHit_
 
const edm::InputTag labelEBRecHit_
 
const edm::InputTag labelEERecHit_
 
const std::string labelHBHEMuon_
 
const edm::InputTag labelHBHERecHit_
 
const std::string labelMuon_
 
const std::string labelVtx_
 
int maxDepth_
 
bool mergedDepth_
 
int nAll_
 
int nGood_
 
int nRun_
 
const std::string processName_
 
const HcalRespCorrsrespCorrs_
 
const HcalTopologytheHBHETopology_
 
edm::ESGetToken
< EcalChannelStatus,
EcalChannelStatusRcd
tok_chan_
 
edm::ESGetToken< HcalDbService,
HcalDbRecord
tok_dbservice_
 
edm::ESGetToken
< HcalDDDRecConstants,
HcalRecNumberingRecord
tok_ddrec_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EB_
 
edm::EDGetTokenT
< EcalRecHitCollection
tok_EE_
 
edm::ESGetToken< CaloGeometry,
CaloGeometryRecord
tok_geom_
 
edm::EDGetTokenT
< HBHERecHitCollection
tok_HBHE_
 
edm::ESGetToken< HcalTopology,
HcalRecNumberingRecord
tok_htopo_
 
edm::ESGetToken< MagneticField,
IdealMagneticFieldRecord
tok_magField_
 
edm::EDGetTokenT
< reco::MuonCollection
tok_Muon_
 
edm::ESGetToken< HcalRespCorrs,
HcalRespCorrsRcd
tok_respcorr_
 
edm::ESGetToken
< EcalSeverityLevelAlgo,
EcalSeverityLevelAlgoRcd
tok_sevlv_
 
edm::ESGetToken< CaloTopology,
CaloTopologyRecord
tok_topo_
 
edm::EDGetTokenT
< edm::TriggerResults
tok_trigRes_
 
edm::EDGetTokenT
< reco::VertexCollection
tok_Vtx_
 
const edm::InputTag triggerResults_
 
const std::vector< std::string > trigNames_
 
bool useMyCorr_
 
const int verbosity_
 
const bool writeRespCorr_
 

Static Private Attributes

static const int depthMax_ = 7
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< alcaHcalHBHEMuon::Counters > >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 79 of file AlCaHcalHBHEMuonProducer.cc.

Constructor & Destructor Documentation

AlCaHcalHBHEMuonProducer::AlCaHcalHBHEMuonProducer ( const edm::ParameterSet iConfig,
const alcaHcalHBHEMuon::Counters  
)
explicit

Definition at line 153 of file AlCaHcalHBHEMuonProducer.cc.

References collapseDepth_, corrValue_, depthMax_, fileInCorr_, edm::ParameterSet::getUntrackedParameter(), gpuClustering::id, timingPdfMaker::infile, isItPlan1_, isItPreRecHit_, labelEBRecHit_, labelEERecHit_, labelHBHEMuon_, labelHBHERecHit_, labelMuon_, labelVtx_, maxDepth_, mergedDepth_, tok_chan_, tok_dbservice_, tok_ddrec_, tok_EB_, tok_EE_, tok_geom_, tok_HBHE_, tok_htopo_, tok_magField_, tok_Muon_, tok_respcorr_, tok_sevlv_, tok_topo_, tok_trigRes_, tok_Vtx_, triggerResults_, and useMyCorr_.

154  : trigNames_(iConfig.getParameter<std::vector<std::string>>("triggers")),
155  processName_(iConfig.getParameter<std::string>("processName")),
156  triggerResults_(iConfig.getParameter<edm::InputTag>("triggerResults")),
157  labelEBRecHit_(iConfig.getParameter<edm::InputTag>("labelEBRecHit")),
158  labelEERecHit_(iConfig.getParameter<edm::InputTag>("labelEERecHit")),
159  labelHBHERecHit_(iConfig.getParameter<edm::InputTag>("labelHBHERecHit")),
160  labelVtx_(iConfig.getParameter<std::string>("labelVertex")),
161  labelMuon_(iConfig.getParameter<std::string>("labelMuon")),
162  labelHBHEMuon_(iConfig.getParameter<std::string>("labelHBHEMuon")),
163  collapseDepth_(iConfig.getParameter<bool>("collapseDepth")),
164  isItPlan1_(iConfig.getParameter<bool>("isItPlan1")),
165  verbosity_(iConfig.getUntrackedParameter<int>("verbosity", 0)),
166  isItPreRecHit_(iConfig.getUntrackedParameter<bool>("isItPreRecHit", false)),
167  writeRespCorr_(iConfig.getUntrackedParameter<bool>("writeRespCorr", false)),
168  fileInCorr_(iConfig.getUntrackedParameter<std::string>("fileInCorr", "")),
169  nRun_(0),
170  nAll_(0),
171  nGood_(0),
172  hdc_(nullptr),
173  theHBHETopology_(nullptr),
174  respCorrs_(nullptr) {
175  //now do what ever initialization is needed
176  maxDepth_ = iConfig.getUntrackedParameter<int>("maxDepth", 4);
177  if (maxDepth_ > depthMax_)
179  else if (maxDepth_ < 1)
180  maxDepth_ = 4;
181 
183  tok_trigRes_ = consumes<edm::TriggerResults>(triggerResults_);
184  tok_EB_ = consumes<EcalRecHitCollection>(labelEBRecHit_);
185  tok_EE_ = consumes<EcalRecHitCollection>(labelEERecHit_);
186  tok_HBHE_ = consumes<HBHERecHitCollection>(labelHBHERecHit_);
187  tok_Vtx_ = consumes<reco::VertexCollection>(labelVtx_);
188  tok_Muon_ = consumes<reco::MuonCollection>(labelMuon_);
189  edm::LogVerbatim("HBHEMuon") << "Labels used: Trig " << triggerResults_ << " Vtx " << labelVtx_ << " EB "
190  << labelEBRecHit_ << " EE " << labelEERecHit_ << " HBHE " << labelHBHERecHit_ << " MU "
191  << labelMuon_;
192 
193  tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
194  tok_htopo_ = esConsumes<HcalTopology, HcalRecNumberingRecord, edm::Transition::BeginRun>();
195  tok_respcorr_ = esConsumes<HcalRespCorrs, HcalRespCorrsRcd, edm::Transition::BeginRun>();
196  tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>();
197  tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
198  tok_chan_ = esConsumes<EcalChannelStatus, EcalChannelStatusRcd>();
199  tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
200  tok_topo_ = esConsumes<CaloTopology, CaloTopologyRecord>();
201  tok_dbservice_ = esConsumes<HcalDbService, HcalDbRecord>();
202 
203  if (!fileInCorr_.empty()) {
204  std::ifstream infile(fileInCorr_.c_str());
205  if (infile.is_open()) {
206  while (true) {
207  unsigned int id;
208  double cfac;
209  infile >> id >> cfac;
210  if (!infile.good())
211  break;
212  corrValue_[DetId(id)] = cfac;
213  }
214  infile.close();
215  }
216  }
217  useMyCorr_ = (!corrValue_.empty());
218  edm::LogVerbatim("HBHEMuon") << "Flags used: ollapseDepth " << collapseDepth_ << ":" << mergedDepth_ << " IsItPlan1 "
219  << isItPlan1_ << " IsItPreRecHit " << isItPreRecHit_ << " UseMyCorr " << useMyCorr_;
220 
221  //create the objects for HcalHBHEMuonVariables which has information of isolated muons
222  produces<HcalHBHEMuonVariablesCollection>(labelHBHEMuon_);
223  edm::LogVerbatim("HcalIsoTrack") << " Expected to produce the collections:\n"
224  << "HcalHBHEMuonVariablesCollection with label " << labelHBHEMuon_;
225 }
Log< level::Info, true > LogVerbatim
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_sevlv_
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
uint16_t *__restrict__ id
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_topo_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_chan_
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbservice_
const HcalDDDRecConstants * hdc_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
const std::vector< std::string > trigNames_
Definition: DetId.h:17
edm::EDGetTokenT< reco::VertexCollection > tok_Vtx_
std::map< DetId, double > corrValue_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const HcalTopology * theHBHETopology_
edm::EDGetTokenT< HBHERecHitCollection > tok_HBHE_
edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_respcorr_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_ddrec_
AlCaHcalHBHEMuonProducer::~AlCaHcalHBHEMuonProducer ( )
overridedefault

Member Function Documentation

double AlCaHcalHBHEMuonProducer::activeLength ( const DetId id_)
private

Definition at line 1036 of file AlCaHcalHBHEMuonProducer.cc.

References actHB, actHE, HLT_FULL_cff::depth, spr::find(), HcalBarrel, hdc_, mps_fire::i, gpuClustering::id, mergedDepth_, HcalDDDRecConstants::unmergeDepthDetId(), and ecaldqm::zside().

Referenced by beginRun(), and produce().

1036  {
1037  HcalDetId id(id_);
1038  int ieta = id.ietaAbs();
1039  int zside = id.zside();
1040  int iphi = id.iphi();
1041  std::vector<int> dpths;
1042  if (mergedDepth_) {
1043  std::vector<HcalDetId> ids;
1044  hdc_->unmergeDepthDetId(id, ids);
1045  for (auto idh : ids)
1046  dpths.emplace_back(idh.depth());
1047  } else {
1048  dpths.emplace_back(id.depth());
1049  }
1050  double lx(0);
1051  if (id.subdet() == HcalBarrel) {
1052  for (unsigned int i = 0; i < actHB.size(); ++i) {
1053  if ((ieta == actHB[i].ieta) && (zside == actHB[i].zside) &&
1054  (std::find(dpths.begin(), dpths.end(), actHB[i].depth) != dpths.end()) &&
1055  (std::find(actHB[i].iphis.begin(), actHB[i].iphis.end(), iphi) != actHB[i].iphis.end())) {
1056  lx += actHB[i].thick;
1057  }
1058  }
1059  } else {
1060  for (unsigned int i = 0; i < actHE.size(); ++i) {
1061  if ((ieta == actHE[i].ieta) && (zside == actHE[i].zside) &&
1062  (std::find(dpths.begin(), dpths.end(), actHE[i].depth) != dpths.end()) &&
1063  (std::find(actHE[i].iphis.begin(), actHE[i].iphis.end(), iphi) != actHE[i].iphis.end())) {
1064  lx += actHE[i].thick;
1065  }
1066  }
1067  }
1068  return lx;
1069 }
uint16_t *__restrict__ id
const HcalDDDRecConstants * hdc_
int zside(DetId const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE
void unmergeDepthDetId(const HcalDetId &id, std::vector< HcalDetId > &ids) const
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB
void AlCaHcalHBHEMuonProducer::beginRun ( edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 970 of file AlCaHcalHBHEMuonProducer.cc.

References actHB, actHE, activeLength(), geo_, edm::EventSetup::getData(), CaloGeometry::getSubdetectorGeometry(), HcalDDDRecConstants::getThickActive(), HcalGeometry::getValidDetIds(), reco::JetExtendedAssociation::getValue(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, HcalEndcap, hdc_, hltConfig_, HLTConfigProvider::init(), relval_steps::k2, mergedDepth_, HcalDDDRecConstants::mergedDepthDetId(), nRun_, processName_, DetId::rawId(), respCorrs_, edm::RunBase::run(), theHBHETopology_, tok_ddrec_, tok_geom_, tok_htopo_, tok_respcorr_, and writeRespCorr_.

970  {
971  hdc_ = &iSetup.getData(tok_ddrec_);
972  actHB.clear();
973  actHE.clear();
974  actHB = hdc_->getThickActive(0);
975  actHE = hdc_->getThickActive(1);
976 #ifdef EDM_ML_DEBUG
977  unsigned int k1(0), k2(0);
978  edm::LogVerbatim("HBHEMuon") << actHB.size() << " Active Length for HB";
979  for (const auto& act : actHB) {
980  edm::LogVerbatim("HBHEMuon") << "[" << k1 << "] ieta " << act.ieta << " depth " << act.depth << " zside "
981  << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":"
982  << act.iphis[0] << " L " << act.thick;
983  HcalDetId hcid1(HcalBarrel, (act.ieta) * (act.zside), act.iphis[0], act.depth);
984  HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1;
985  edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2));
986  ++k1;
987  }
988  edm::LogVerbatim("HBHEMuon") << actHE.size() << " Active Length for HE";
989  for (const auto& act : actHE) {
990  edm::LogVerbatim("HBHEMuon") << "[" << k2 << "] ieta " << act.ieta << " depth " << act.depth << " zside "
991  << act.zside << " type " << act.stype << " phi " << act.iphis.size() << ":"
992  << act.iphis[0] << " L " << act.thick;
993  HcalDetId hcid1(HcalEndcap, (act.ieta) * (act.zside), act.iphis[0], act.depth);
994  HcalDetId hcid2 = mergedDepth_ ? hdc_->mergedDepthDetId(hcid1) : hcid1;
995  edm::LogVerbatim("HBHEMuon") << hcid1 << " | " << hcid2 << " L " << activeLength(DetId(hcid2));
996  ++k2;
997  }
998 #endif
999 
1000  bool changed = true;
1001  bool flag = hltConfig_.init(iRun, iSetup, processName_, changed);
1002  edm::LogVerbatim("HBHEMuon") << "Run[" << nRun_ << "] " << iRun.run() << " hltconfig.init " << flag << std::endl;
1003 
1004  theHBHETopology_ = &iSetup.getData(tok_htopo_);
1005  respCorrs_ = &iSetup.getData(tok_respcorr_);
1006  geo_ = &iSetup.getData(tok_geom_);
1007 
1008  // Write correction factors for all HB/HE events
1009  if (writeRespCorr_) {
1010  const HcalGeometry* gHcal = static_cast<const HcalGeometry*>(geo_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel));
1011  const std::vector<DetId>& ids = gHcal->getValidDetIds(DetId::Hcal, 0);
1012  edm::LogVerbatim("HBHEMuon") << "\nTable of Correction Factors for Run " << iRun.run() << "\n";
1013  for (auto const& id : ids) {
1014  if ((id.det() == DetId::Hcal) && ((id.subdetId() == HcalBarrel) || (id.subdetId() == HcalEndcap))) {
1015  edm::LogVerbatim("HBHEMuon") << HcalDetId(id) << " " << id.rawId() << " "
1016  << (respCorrs_->getValues(id))->getValue();
1017  }
1018  }
1019  }
1020 }
Log< level::Info, true > LogVerbatim
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_htopo_
const std::vector< DetId > & getValidDetIds(DetId::Detector det=DetId::Detector(0), int subdet=0) const override
Get a list of valid detector ids (for the given subdetector)
Definition: HcalGeometry.cc:76
HcalDetId mergedDepthDetId(const HcalDetId &id) const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const HcalDDDRecConstants * hdc_
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE
Definition: DetId.h:17
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const HcalTopology * theHBHETopology_
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
std::vector< HcalActiveLength > getThickActive(const int &type) const
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB
edm::ESGetToken< HcalRespCorrs, HcalRespCorrsRcd > tok_respcorr_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_ddrec_
int AlCaHcalHBHEMuonProducer::depth16HE ( int  ieta,
int  iphi 
)
private

Definition at line 1103 of file AlCaHcalHBHEMuonProducer.cc.

References HcalTopology::dddConstants(), HLT_FULL_cff::depth, HcalDDDRecConstants::getMinDepth(), isItPlan1_, isItPreRecHit_, theHBHETopology_, and ecaldqm::zside().

Referenced by produce().

1103  {
1104  // Transition between HB/HE is special
1105  // For Run 1 or for Plan1 standard reconstruction it is 3
1106  // For runs beyond 2018 or in Plan1 for HEP17 it is 4
1107  int zside = (ieta > 0) ? 1 : -1;
1108  int depth = theHBHETopology_->dddConstants()->getMinDepth(1, 16, iphi, zside);
1109  if (isItPlan1_ && (!isItPreRecHit_))
1110  depth = 3;
1111 #ifdef EDM_ML_DEBUG
1112  edm::LogVerbatim("HBHEMuon") << "Plan1 " << isItPlan1_ << " PreRecHit " << isItPreRecHit_ << " phi " << iphi
1113  << " depth " << depth;
1114 #endif
1115  return depth;
1116 }
Log< level::Info, true > LogVerbatim
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
int zside(DetId const &)
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
const HcalTopology * theHBHETopology_
void AlCaHcalHBHEMuonProducer::endRun ( edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprivate

Definition at line 1022 of file AlCaHcalHBHEMuonProducer.cc.

References nRun_, and edm::RunBase::run().

1022  {
1023  edm::LogVerbatim("HBHEMuon") << "endRun[" << nRun_ << "] " << iRun.run() << "\n";
1024  ++nRun_;
1025 }
Log< level::Info, true > LogVerbatim
void AlCaHcalHBHEMuonProducer::endStream ( )
override

Definition at line 960 of file AlCaHcalHBHEMuonProducer.cc.

References nAll_, and nGood_.

960  {
961  globalCache()->nAll_ += nAll_;
962  globalCache()->nGood_ += nGood_;
963 }
void AlCaHcalHBHEMuonProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 937 of file AlCaHcalHBHEMuonProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addUntracked(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

937  {
939  std::vector<std::string> triggers = {"HLT_IsoMu", "HLT_Mu"};
940  desc.add<std::vector<std::string>>("triggers", triggers);
941  desc.add<std::string>("processName", "HLT");
942  desc.add<edm::InputTag>("triggerResults", edm::InputTag("TriggerResults", "", "HLT"));
943  desc.add<edm::InputTag>("labelEBRecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
944  desc.add<edm::InputTag>("labelEERecHit", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
945  desc.add<edm::InputTag>("labelHBHERecHit", edm::InputTag("hbhereco"));
946  desc.add<std::string>("labelVertex", "offlinePrimaryVertices");
947  desc.add<std::string>("labelMuon", "muons");
948  desc.add<std::string>("labelHBHEMuon", "hbheMuon");
949  desc.add<bool>("collapseDepth", false);
950  desc.add<bool>("isItPlan1", false);
951  desc.addUntracked<int>("verbosity", 0);
952  desc.addUntracked<bool>("isItPreRecHit", false);
953  desc.addUntracked<bool>("writeRespCorr", false);
954  desc.addUntracked<std::string>("fileInCorr", "");
955  desc.addUntracked<int>("maxDepth", 4);
956  descriptions.add("alcaHcalHBHEMuonProducer", desc);
957 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double AlCaHcalHBHEMuonProducer::gainFactor ( const HcalDbService dbserv,
const HcalDetId id 
)
private

Definition at line 1095 of file AlCaHcalHBHEMuonProducer.cc.

References HcalDbService::getHcalCalibrations(), and HcalCalibrations::respcorrgain().

Referenced by produce().

1095  {
1096  double gain(0.0);
1097  const HcalCalibrations& calibs = conditions->getHcalCalibrations(id);
1098  for (int capid = 0; capid < 4; ++capid)
1099  gain += (0.25 * calibs.respcorrgain(capid));
1100  return gain;
1101 }
constexpr double respcorrgain(int fCapId) const
get response corrected gain for capid=0..3
void AlCaHcalHBHEMuonProducer::globalEndJob ( const alcaHcalHBHEMuon::Counters counters)
static

Definition at line 965 of file AlCaHcalHBHEMuonProducer.cc.

References alcaHcalHBHEMuon::Counters::nAll_, and alcaHcalHBHEMuon::Counters::nGood_.

965  {
966  edm::LogVerbatim("HBHEMuon") << "Selects " << count->nGood_ << " out of " << count->nAll_ << " total # of events\n";
967 }
Log< level::Info, true > LogVerbatim
bool AlCaHcalHBHEMuonProducer::goodCell ( const HcalDetId hcid,
const reco::Track pTrack,
const CaloGeometry geo,
const MagneticField bField 
)
private

Definition at line 1118 of file AlCaHcalHBHEMuonProducer.cc.

References HcalDDDRecConstants::getRZ(), HcalEndcap, hdc_, match(), spr::propagateHCAL(), HcalDetId::subdet(), and verbosity_.

Referenced by produce().

1121  {
1122  std::pair<double, double> rz = hdc_->getRZ(hcid);
1123  bool typeRZ = (hcid.subdet() == HcalEndcap) ? false : true;
1124  bool match = spr::propagateHCAL(pTrack, geo, bField, typeRZ, rz, (((verbosity_ / 10000) % 10) > 0));
1125  return match;
1126 }
std::pair< math::XYZPoint, bool > propagateHCAL(const reco::Track *, const MagneticField *, bool debug=false)
const HcalDDDRecConstants * hdc_
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
double getRZ(const int &subdet, const int &ieta, const int &depth) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
static std::unique_ptr<alcaHcalHBHEMuon::Counters> AlCaHcalHBHEMuonProducer::initializeGlobalCache ( edm::ParameterSet const &  )
inlinestatic

Definition at line 84 of file AlCaHcalHBHEMuonProducer.cc.

84  {
85  return std::make_unique<alcaHcalHBHEMuon::Counters>();
86  }
bool AlCaHcalHBHEMuonProducer::isGoodVertex ( const reco::Vertex vtx)
private

Definition at line 1071 of file AlCaHcalHBHEMuonProducer.cc.

References reco::Vertex::isFake(), reco::Vertex::ndof(), and reco::Vertex::position().

Referenced by produce().

1071  {
1072  if (vtx.isFake())
1073  return false;
1074  if (vtx.ndof() < 4)
1075  return false;
1076  if (vtx.position().Rho() > 2.)
1077  return false;
1078  if (fabs(vtx.position().Z()) > 24.)
1079  return false;
1080  return true;
1081 }
const Point & position() const
position
Definition: Vertex.h:127
double ndof() const
Definition: Vertex.h:123
bool isFake() const
Definition: Vertex.h:76
int AlCaHcalHBHEMuonProducer::matchId ( const HcalDetId id1,
const HcalDetId id2 
)
private

Definition at line 1029 of file AlCaHcalHBHEMuonProducer.cc.

References HcalDetId::ieta(), HcalDetId::iphi(), match(), and HcalDetId::subdet().

Referenced by produce().

1029  {
1030  HcalDetId kd1(id1.subdet(), id1.ieta(), id1.iphi(), 1);
1031  HcalDetId kd2(id1.subdet(), id2.ieta(), id2.iphi(), 1);
1032  int match = ((kd1 == kd2) ? 1 : 0);
1033  return match;
1034 }
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void AlCaHcalHBHEMuonProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 232 of file AlCaHcalHBHEMuonProducer.cc.

References funct::abs(), activeLength(), ecalTB2006H4_GenSimDigiReco_cfg::bField, edm::EventBase::bunchCrossing(), HcalHBHEMuonVariables::bxNumber_, trackerTree::check(), chg, HcalHBHEMuonVariables::chiGlobal_, HcalHBHEMuonVariables::chiTracker_, collapseDepth_, submitPVValidationJobs::conditions, alignCSCRings::corr, HcalDetId::depth(), HLT_FULL_cff::depth, depth16HE(), depthMax_, spr::propagatedTrackID::detIdECAL, spr::propagatedTrackID::detIdEHCAL, spr::propagatedTrackID::detIdHCAL, HcalHBHEMuonVariables::dxyTracker_, HcalHBHEMuonVariables::dzTracker_, HcalHBHEMuonVariables::ecal3x3Energy_, HcalHBHEMuonVariables::ecalDetId_, HcalHBHEMuonVariables::ecalEnergy_, spr::eECALmatrix(), HcalHBHEMuonVariables::ehcalDetId_, spr::eHCALmatrix(), spr::energyHCALCell(), HcalHBHEMuonVariables::energyMuon_, HcalHBHEMuonVariables::etaGlob_, edm::EventID::event(), HcalHBHEMuonVariables::eventNumber_, spr::find(), gainFactor(), geo_, edm::EventSetup::getData(), edm::Event::getHandle(), HcalHBHEMuonVariables::globalMuonHits_, HcalHBHEMuonVariables::globalTrack_, HcalHBHEMuonVariables::globalTrackEta_, HcalHBHEMuonVariables::globalTrackPhi_, HcalHBHEMuonVariables::globalTrackPt_, goodCell(), HcalHBHEMuonVariables::goodVertex_, HcalHBHEMuonVariables::hcal1x1Energy_, HcalHBHEMuonVariables::hcal1x1EnergyAux_, HcalHBHEMuonVariables::hcal1x1EnergyRaw_, HcalHBHEMuonVariables::hcalActiveLength_, HcalHBHEMuonVariables::hcalActiveLengthHot_, HcalBarrel, HcalHBHEMuonVariables::hcalDepthActiveLength_, HcalHBHEMuonVariables::hcalDepthActiveLengthHot_, HcalHBHEMuonVariables::hcalDepthChargeHot_, HcalHBHEMuonVariables::hcalDepthChargeHotAux_, HcalHBHEMuonVariables::hcalDepthChargeHotBG_, HcalHBHEMuonVariables::hcalDepthChargeHotBGAux_, HcalHBHEMuonVariables::hcalDepthChargeHotBGRaw_, HcalHBHEMuonVariables::hcalDepthChargeHotRaw_, HcalHBHEMuonVariables::hcalDepthEnergy_, HcalHBHEMuonVariables::hcalDepthEnergyAux_, HcalHBHEMuonVariables::hcalDepthEnergyCorr_, HcalHBHEMuonVariables::hcalDepthEnergyCorrAux_, HcalHBHEMuonVariables::hcalDepthEnergyCorrRaw_, HcalHBHEMuonVariables::hcalDepthEnergyHot_, HcalHBHEMuonVariables::hcalDepthEnergyHotAux_, HcalHBHEMuonVariables::hcalDepthEnergyHotCorr_, HcalHBHEMuonVariables::hcalDepthEnergyHotCorrAux_, HcalHBHEMuonVariables::hcalDepthEnergyHotCorrRaw_, HcalHBHEMuonVariables::hcalDepthEnergyHotRaw_, HcalHBHEMuonVariables::hcalDepthEnergyRaw_, HcalHBHEMuonVariables::hcalDepthMatch_, HcalHBHEMuonVariables::hcalDepthMatchHot_, HcalHBHEMuonVariables::hcalDetId_, HcalEndcap, HcalHBHEMuonVariables::hcalEnergy_, HcalHBHEMuonVariables::hcalHot_, HcalHBHEMuonVariables::hcalIeta_, HcalHBHEMuonVariables::hcalIphi_, hdc_, ValidationMatrix::hlt, HcalHBHEMuonVariables::hoEnergy_, mps_fire::i, edm::EventBase::id(), HcalDetId::ieta(), info(), HcalHBHEMuonVariables::innerTrack_, HcalHBHEMuonVariables::innerTrackEta_, HcalHBHEMuonVariables::innerTrackPhi_, HcalHBHEMuonVariables::innerTrackPt_, HcalDetId::iphi(), isGoodVertex(), isItPlan1_, isItPreRecHit_, muon::isMediumMuon(), HcalHBHEMuonVariables::isolationR03_, HcalHBHEMuonVariables::isolationR04_, muon::isTightMuon(), isotrackApplyRegressor::k, labelHBHEMuon_, edm::EventID::luminosityBlock(), HcalHBHEMuonVariables::lumiNumber_, HcalHBHEMuonVariables::matchedId_, HcalHBHEMuonVariables::matchedStat_, matchId(), SiStripPI::max, maxDepth_, HcalDDDRecConstants::mergedDepthDetId(), TrackingSourceConfig_Tier0_Cosmic_cff::modules, eostools::move(), HcalHBHEMuonVariables::muonChi2LocalPosition_, HcalHBHEMuonVariables::muonGlobal_, HcalHBHEMuonVariables::muonGood_, HcalHBHEMuonVariables::muonMedium_, patZpeak::muons, HcalHBHEMuonVariables::muonSegComp_, HcalHBHEMuonVariables::muonTight_, HcalHBHEMuonVariables::muonTracker_, HcalHBHEMuonVariables::muonTrkKink_, nAll_, nGood_, HcalHBHEMuonVariables::numPixelLayers_, convertSQLiteXML::ok, spr::propagatedTrackID::okECAL, spr::propagatedTrackID::okHCAL, HcalHBHEMuonVariables::outerTrack_, HcalHBHEMuonVariables::outerTrackChi_, HcalHBHEMuonVariables::outerTrackEta_, HcalHBHEMuonVariables::outerTrackHits_, HcalHBHEMuonVariables::outerTrackPhi_, HcalHBHEMuonVariables::outerTrackPt_, HcalHBHEMuonVariables::outerTrackRHits_, HcalHBHEMuonVariables::phiGlob_, HcalHBHEMuonVariables::pMuon_, spr::propagateCALO(), spr::propagateHCALBack(), DiDispStaMuonMonitor_cfi::pt, HcalHBHEMuonVariables::ptGlob_, edm::Event::put(), DetId::rawId(), respCorr(), edm::EventID::run(), convertSQLiteXML::runNumber, HcalHBHEMuonVariables::runNumber_, edm::second(), muon::segmentCompatibility(), HcalDetId::subdet(), theHBHETopology_, HcalHBHEMuonVariables::tightLongPara_, HcalHBHEMuonVariables::tightPixelHits_, HcalHBHEMuonVariables::tightTransImpara_, HcalHBHEMuonVariables::tightValidFraction_, tok_chan_, tok_dbservice_, tok_EB_, tok_EE_, tok_HBHE_, tok_magField_, tok_Muon_, tok_sevlv_, tok_topo_, tok_trigRes_, tok_Vtx_, HcalHBHEMuonVariables::trackerLayer_, edm::TriggerNames::triggerNames(), L1TMuonDQMOffline_cfi::triggerNames, edm::Event::triggerNames(), triggerResults, trigNames_, HcalTopology::validHcal(), and verbosity_.

232  {
233  ++nAll_;
234  auto outputHcalHBHEMuonColl = std::make_unique<HcalHBHEMuonVariablesCollection>();
235 
236  unsigned int runNumber = iEvent.id().run();
237  unsigned int eventNumber = iEvent.id().event();
238  unsigned int lumiNumber = iEvent.id().luminosityBlock();
239  unsigned int bxNumber = iEvent.bunchCrossing();
240 #ifdef EDM_ML_DEBUG
241  edm::LogVerbatim("HBHEMuon") << "Run " << runNumber << " Event " << eventNumber << " Lumi " << lumiNumber << " BX "
242  << bxNumber << std::endl;
243 #endif
244 
245  //Step1: Find if the event passes one of the chosen triggers
246  bool ok(false);
248  if (trigNames_.empty()) {
249  ok = true;
250  } else {
251  auto const& triggerResults = iEvent.getHandle(tok_trigRes_);
252  if (triggerResults.isValid()) {
253  std::vector<std::string> modules;
255  const std::vector<std::string>& triggerNames_ = triggerNames.triggerNames();
256  for (unsigned int iHLT = 0; iHLT < triggerResults->size(); iHLT++) {
257  int hlt = triggerResults->accept(iHLT);
258  for (unsigned int i = 0; i < trigNames_.size(); ++i) {
259  if (triggerNames_[iHLT].find(trigNames_[i]) != std::string::npos) {
260  if (hlt > 0) {
261  ok = true;
262  }
263 #ifdef EDM_ML_DEBUG
264  edm::LogVerbatim("HBHEMuon") << "AlCaHcalHBHEMuonFilter::Trigger " << triggerNames_[iHLT] << " Flag " << hlt
265  << ":" << ok << std::endl;
266 #endif
267  }
268  }
269  }
270  }
271  }
272 
273  // get handles to calogeometry and calotopology
274  const MagneticField* bField = &iSetup.getData(tok_magField_);
275  const EcalChannelStatus* theEcalChStatus = &iSetup.getData(tok_chan_);
276  const EcalSeverityLevelAlgo* sevlv = &iSetup.getData(tok_sevlv_);
277  const CaloTopology* caloTopology = &iSetup.getData(tok_topo_);
279 
280  // Relevant blocks from iEvent
281  auto const& vtx = iEvent.getHandle(tok_Vtx_);
282  auto barrelRecHitsHandle = iEvent.getHandle(tok_EB_);
283  auto endcapRecHitsHandle = iEvent.getHandle(tok_EE_);
284  auto hbhe = iEvent.getHandle(tok_HBHE_);
285  auto const& muons = iEvent.getHandle(tok_Muon_);
286 
287  // require a good vertex
288  math::XYZPoint pvx;
289  unsigned int goodVertex = 0;
290  reco::VertexCollection::const_iterator firstGoodVertex;
291  if (!vtx.isValid()) {
292 #ifdef EDM_ML_DEBUG
293  edm::LogVerbatim("HBHEMuon") << "No Good Vertex found == Reject";
294 #endif
295  } else {
296  firstGoodVertex = vtx->end();
297  for (reco::VertexCollection::const_iterator it = vtx->begin(); it != vtx->end(); it++) {
298  if (isGoodVertex(*it)) {
299  if (firstGoodVertex == vtx->end())
300  firstGoodVertex = it;
301  ++goodVertex;
302  }
303  }
304  if (firstGoodVertex != vtx->end())
305  pvx = firstGoodVertex->position();
306  }
307 
308  if (ok && (goodVertex > 0) && muons.isValid() && barrelRecHitsHandle.isValid() && endcapRecHitsHandle.isValid() &&
309  hbhe.isValid()) {
310  for (reco::MuonCollection::const_iterator recMuon = muons->begin(); recMuon != muons->end(); ++recMuon) {
311  HcalHBHEMuonVariables hbheMuon;
312  hbheMuon.runNumber_ = runNumber;
313  hbheMuon.eventNumber_ = eventNumber;
314  hbheMuon.lumiNumber_ = lumiNumber;
315  hbheMuon.bxNumber_ = bxNumber;
316  hbheMuon.goodVertex_ = goodVertex;
317  hbheMuon.muonGood_ = (recMuon->isPFMuon());
318  hbheMuon.muonGlobal_ = (recMuon->isGlobalMuon());
319  hbheMuon.muonTracker_ = (recMuon->isTrackerMuon());
320  hbheMuon.ptGlob_ = ((recMuon)->pt());
321  hbheMuon.etaGlob_ = (recMuon->eta());
322  hbheMuon.phiGlob_ = (recMuon->phi());
323  hbheMuon.energyMuon_ = (recMuon->energy());
324  hbheMuon.pMuon_ = (recMuon->p());
325 #ifdef EDM_ML_DEBUG
326  edm::LogVerbatim("HBHEMuon") << "Energy:" << recMuon->energy() << " P:" << recMuon->p();
327 #endif
328  hbheMuon.muonTight_ = (muon::isTightMuon(*recMuon, *firstGoodVertex));
329  hbheMuon.muonMedium_ = (muon::isMediumMuon(*recMuon));
330  hbheMuon.muonTrkKink_ = (recMuon->combinedQuality().trkKink);
331  hbheMuon.muonChi2LocalPosition_ = (recMuon->combinedQuality().chi2LocalPosition);
332  hbheMuon.muonSegComp_ = (muon::segmentCompatibility(*recMuon));
333  // acessing tracker hits info
334  if (recMuon->track().isNonnull()) {
335  hbheMuon.trackerLayer_ = (recMuon->track()->hitPattern().trackerLayersWithMeasurement());
336  } else {
337  hbheMuon.trackerLayer_ = -1;
338  }
339  if (recMuon->innerTrack().isNonnull()) {
340  hbheMuon.innerTrack_ = true;
341  hbheMuon.numPixelLayers_ = (recMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement());
342  hbheMuon.chiTracker_ = (recMuon->innerTrack()->normalizedChi2());
343  hbheMuon.dxyTracker_ = (fabs(recMuon->innerTrack()->dxy(pvx)));
344  hbheMuon.dzTracker_ = (fabs(recMuon->innerTrack()->dz(pvx)));
345  hbheMuon.innerTrackPt_ = (recMuon->innerTrack()->pt());
346  hbheMuon.innerTrackEta_ = (recMuon->innerTrack()->eta());
347  hbheMuon.innerTrackPhi_ = (recMuon->innerTrack()->phi());
348  hbheMuon.tightPixelHits_ = (recMuon->innerTrack()->hitPattern().numberOfValidPixelHits());
349  hbheMuon.tightValidFraction_ = (recMuon->innerTrack()->validFraction());
350  }
351  // outer track info
352  if (recMuon->outerTrack().isNonnull()) {
353  hbheMuon.outerTrack_ = true;
354  hbheMuon.outerTrackPt_ = (recMuon->outerTrack()->pt());
355  hbheMuon.outerTrackEta_ = (recMuon->outerTrack()->eta());
356  hbheMuon.outerTrackPhi_ = (recMuon->outerTrack()->phi());
357  hbheMuon.outerTrackChi_ = (recMuon->outerTrack()->normalizedChi2());
358  hbheMuon.outerTrackHits_ = (recMuon->outerTrack()->numberOfValidHits());
359  hbheMuon.outerTrackRHits_ = (recMuon->outerTrack()->recHitsSize());
360  }
361  // Tight Muon cuts
362  if (recMuon->globalTrack().isNonnull()) {
363  hbheMuon.globalTrack_ = true;
364  hbheMuon.chiGlobal_ = (recMuon->globalTrack()->normalizedChi2());
365  hbheMuon.globalMuonHits_ = (recMuon->globalTrack()->hitPattern().numberOfValidMuonHits());
366  hbheMuon.matchedStat_ = (recMuon->numberOfMatchedStations());
367  hbheMuon.globalTrackPt_ = (recMuon->globalTrack()->pt());
368  hbheMuon.globalTrackEta_ = (recMuon->globalTrack()->eta());
369  hbheMuon.globalTrackPhi_ = (recMuon->globalTrack()->phi());
370  hbheMuon.tightTransImpara_ = (fabs(recMuon->muonBestTrack()->dxy(pvx)));
371  hbheMuon.tightLongPara_ = (fabs(recMuon->muonBestTrack()->dz(pvx)));
372  }
373 
374  hbheMuon.isolationR04_ =
375  ((recMuon->pfIsolationR04().sumChargedHadronPt +
376  std::max(0.,
377  recMuon->pfIsolationR04().sumNeutralHadronEt + recMuon->pfIsolationR04().sumPhotonEt -
378  (0.5 * recMuon->pfIsolationR04().sumPUPt))) /
379  recMuon->pt());
380 
381  hbheMuon.isolationR03_ =
382  ((recMuon->pfIsolationR03().sumChargedHadronPt +
383  std::max(0.,
384  recMuon->pfIsolationR03().sumNeutralHadronEt + recMuon->pfIsolationR03().sumPhotonEt -
385  (0.5 * recMuon->pfIsolationR03().sumPUPt))) /
386  recMuon->pt());
387 
388  hbheMuon.ecalEnergy_ = (recMuon->calEnergy().emS9);
389  hbheMuon.hcalEnergy_ = (recMuon->calEnergy().hadS9);
390  hbheMuon.hoEnergy_ = (recMuon->calEnergy().hoS9);
391 
392  if (recMuon->innerTrack().isNonnull()) {
393  const reco::Track* pTrack = (recMuon->innerTrack()).get();
394  spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0)));
395 
396  double activeLengthTot(0), activeLengthHotTot(0);
397  double eHcalDepth[depthMax_], eHcalDepthHot[depthMax_];
398  double eHcalDepthC[depthMax_], eHcalDepthHotC[depthMax_];
399  double cHcalDepthHot[depthMax_], cHcalDepthHotBG[depthMax_];
400  double eHcalDepthRaw[depthMax_], eHcalDepthHotRaw[depthMax_];
401  double eHcalDepthCRaw[depthMax_], eHcalDepthHotCRaw[depthMax_];
402  double cHcalDepthHotRaw[depthMax_], cHcalDepthHotBGRaw[depthMax_];
403  double eHcalDepthAux[depthMax_], eHcalDepthHotAux[depthMax_];
404  double eHcalDepthCAux[depthMax_], eHcalDepthHotCAux[depthMax_];
405  double cHcalDepthHotAux[depthMax_], cHcalDepthHotBGAux[depthMax_];
406  double activeL[depthMax_], activeHotL[depthMax_];
407  bool matchDepth[depthMax_], matchDepthHot[depthMax_];
408  HcalDetId eHcalDetId[depthMax_];
409  unsigned int isHot(0);
410  int ieta(-1000), iphi(-1000);
411  for (int i = 0; i < depthMax_; ++i) {
412  eHcalDepth[i] = eHcalDepthHot[i] = 0;
413  eHcalDepthC[i] = eHcalDepthHotC[i] = 0;
414  cHcalDepthHot[i] = cHcalDepthHotBG[i] = 0;
415  eHcalDepthRaw[i] = eHcalDepthHotRaw[i] = 0;
416  eHcalDepthCRaw[i] = eHcalDepthHotCRaw[i] = 0;
417  cHcalDepthHotRaw[i] = cHcalDepthHotBGRaw[i] = 0;
418  eHcalDepthAux[i] = eHcalDepthHotAux[i] = 0;
419  eHcalDepthCAux[i] = eHcalDepthHotCAux[i] = 0;
420  cHcalDepthHotAux[i] = cHcalDepthHotBGAux[i] = 0;
421  activeL[i] = activeHotL[i] = 0;
422  matchDepth[i] = matchDepthHot[i] = true;
423  }
424 #ifdef EDM_ML_DEBUG
425  double eHcal(0);
426 #endif
427 
428  hbheMuon.ecalDetId_ = ((trackID.detIdECAL)());
429  hbheMuon.hcalDetId_ = ((trackID.detIdHCAL)());
430  hbheMuon.ehcalDetId_ = ((trackID.detIdEHCAL)());
431 
432  HcalDetId check(false);
433  std::pair<bool, HcalDetId> info = spr::propagateHCALBack(pTrack, geo_, bField, (((verbosity_ / 100) % 10 > 0)));
434  if (info.first) {
435  check = info.second;
436  }
437 
438  bool okE = trackID.okECAL;
439  if (okE) {
440  const DetId isoCell(trackID.detIdECAL);
441  std::pair<double, bool> e3x3 = spr::eECALmatrix(isoCell,
442  barrelRecHitsHandle,
443  endcapRecHitsHandle,
444  *theEcalChStatus,
445  geo_,
446  caloTopology,
447  sevlv,
448  1,
449  1,
450  -100.0,
451  -100.0,
452  -500.0,
453  500.0,
454  false);
455  hbheMuon.ecal3x3Energy_ = e3x3.first;
456  okE = e3x3.second;
457  }
458 #ifdef EDM_ML_DEBUG
459  edm::LogVerbatim("HBHEMuon") << "Propagate Track to ECAL: " << okE << ":" << trackID.okECAL << " E "
460  << hbheMuon.ecal3x3Energy_;
461 #endif
462 
463  if (trackID.okHCAL) {
464  DetId closestCell(trackID.detIdHCAL);
465  HcalDetId hcidt(closestCell.rawId());
466  if ((hcidt.ieta() == check.ieta()) && (hcidt.iphi() == check.iphi()))
467  hbheMuon.matchedId_ = true;
468 #ifdef EDM_ML_DEBUG
469  edm::LogVerbatim("HBHEMuon") << "Front " << hcidt << " Back " << info.first << ":" << check << " Match "
470  << hbheMuon.matchedId_;
471 #endif
472  HcalSubdetector subdet = hcidt.subdet();
473  ieta = hcidt.ieta();
474  iphi = hcidt.iphi();
475  bool hborhe = (std::abs(ieta) == 16);
476 
477  hbheMuon.hcal1x1Energy_ = spr::eHCALmatrix(
478  theHBHETopology_, closestCell, hbhe, 0, 0, false, true, -100.0, -100.0, -100.0, -100.0, -500., 500., 0);
480  theHBHETopology_, closestCell, hbhe, 0, 0, false, true, -100.0, -100.0, -100.0, -100.0, -500., 500., 1);
482  theHBHETopology_, closestCell, hbhe, 0, 0, false, true, -100.0, -100.0, -100.0, -100.0, -500., 500., 2);
483  std::vector<std::pair<double, int>> ehdepth, ehdepthAux, ehdepthRaw;
484  spr::energyHCALCell((HcalDetId)closestCell,
485  hbhe,
486  ehdepth,
487  maxDepth_,
488  -100.0,
489  -100.0,
490  -100.0,
491  -100.0,
492  -500.0,
493  500.0,
494  0,
495  depth16HE(ieta, iphi),
496  (((verbosity_ / 1000) % 10) > 0));
497  for (int i = 0; i < depthMax_; ++i)
498  eHcalDetId[i] = HcalDetId();
499  spr::energyHCALCell((HcalDetId)closestCell,
500  hbhe,
501  ehdepthAux,
502  maxDepth_,
503  -100.0,
504  -100.0,
505  -100.0,
506  -100.0,
507  -500.0,
508  500.0,
509  1,
510  depth16HE(ieta, iphi),
511  (((verbosity_ / 1000) % 10) > 0));
512  spr::energyHCALCell((HcalDetId)closestCell,
513  hbhe,
514  ehdepthRaw,
515  maxDepth_,
516  -100.0,
517  -100.0,
518  -100.0,
519  -100.0,
520  -500.0,
521  500.0,
522  2,
523  depth16HE(ieta, iphi),
524  (((verbosity_ / 1000) % 10) > 0));
525  for (unsigned int i = 0; i < ehdepth.size(); ++i) {
526  HcalSubdetector subdet0 =
527  (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
528  HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second);
529  double actL = activeLength(DetId(hcid0));
530  double ene = ehdepth[i].first;
531  double eneAux = ehdepthAux[i].first;
532  double eneRaw = ehdepthRaw[i].first;
533  bool tmpC(false);
534  if (ene > 0.0) {
535  if (!(theHBHETopology_->validHcal(hcid0))) {
536  edm::LogWarning("HBHEMuon") << "(1) Invalid ID " << hcid0 << " with E = " << ene;
537  edm::LogWarning("HBHEMuon") << HcalDetId(closestCell) << " with " << ehdepth.size() << " depths:";
538  for (const auto& ehd : ehdepth)
539  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
540  } else {
541  tmpC = goodCell(hcid0, pTrack, geo_, bField);
542  double enec(ene);
543  double corr = respCorr(DetId(hcid0));
544  if (corr != 0)
545  ene /= corr;
546 #ifdef EDM_ML_DEBUG
547  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
548  edm::LogVerbatim("HBHEMuon") << hcid0 << ":" << id << " Corr " << corr;
549 #endif
550  int depth = ehdepth[i].second - 1;
551  if (collapseDepth_) {
552  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
553  depth = id.depth() - 1;
554  }
555  eHcalDepth[depth] += ene;
556  eHcalDepthC[depth] += enec;
557  activeL[depth] += actL;
558  activeLengthTot += actL;
559  matchDepth[depth] = (matchDepth[depth] && tmpC);
560 #ifdef EDM_ML_DEBUG
561  if ((verbosity_ % 10) > 0)
562  edm::LogVerbatim("HBHEMuon")
563  << hcid0 << " E " << ene << ":" << enec << " L " << actL << " Match " << tmpC;
564 #endif
565  }
566  }
567  if (eneAux > 0.0) {
568  if (theHBHETopology_->validHcal(hcid0)) {
569  double enecAux(eneAux);
570  double corr = respCorr(DetId(hcid0));
571  if (corr != 0)
572  eneAux /= corr;
573  int depth = ehdepthAux[i].second - 1;
574  if (collapseDepth_) {
575  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
576  depth = id.depth() - 1;
577  }
578  eHcalDepthAux[depth] += eneAux;
579  eHcalDepthCAux[depth] += enecAux;
580 #ifdef EDM_ML_DEBUG
581  if ((verbosity_ % 10) > 0)
582  edm::LogVerbatim("HBHEMuon")
583  << hcid0 << " E " << eneAux << ":" << enecAux << " L " << actL << " Match " << tmpC;
584 #endif
585  }
586  }
587  if (eneRaw > 0.0) {
588  if (theHBHETopology_->validHcal(hcid0)) {
589  double enecRaw(eneRaw);
590  double corr = respCorr(DetId(hcid0));
591  if (corr != 0)
592  eneRaw /= corr;
593  int depth = ehdepthRaw[i].second - 1;
594  if (collapseDepth_) {
595  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
596  depth = id.depth() - 1;
597  }
598  eHcalDepthRaw[depth] += eneRaw;
599  eHcalDepthCRaw[depth] += enecRaw;
600 #ifdef EDM_ML_DEBUG
601  if ((verbosity_ % 10) > 0)
602  edm::LogVerbatim("HBHEMuon")
603  << hcid0 << " E " << eneRaw << ":" << enecRaw << " L " << actL << " Match " << tmpC;
604 #endif
605  }
606  }
607  }
608 #ifdef EDM_ML_DEBUG
609  if ((verbosity_ % 10) > 0) {
610  edm::LogVerbatim("HBHEMuon") << hcidt << " Match " << hbheMuon.matchedId_ << " Depths " << ehdepth.size();
611  for (unsigned int k = 0; k < ehdepth.size(); ++k)
612  edm::LogVerbatim("HBHEMuon") << " [" << k << ":" << ehdepth[k].second << "] " << matchDepth[k];
613  }
614 #endif
615  HcalDetId hotCell;
616  spr::eHCALmatrix(geo_, theHBHETopology_, closestCell, hbhe, 1, 1, hotCell, false, 0, false);
617  isHot = matchId(closestCell, hotCell);
618  if (hotCell != HcalDetId()) {
619  subdet = HcalDetId(hotCell).subdet();
620  ieta = HcalDetId(hotCell).ieta();
621  iphi = HcalDetId(hotCell).iphi();
622  hborhe = (std::abs(ieta) == 16);
623  std::vector<std::pair<double, int>> ehdepth, ehdepthAux, ehdepthRaw;
624  spr::energyHCALCell(hotCell,
625  hbhe,
626  ehdepth,
627  maxDepth_,
628  -100.0,
629  -100.0,
630  -100.0,
631  -100.0,
632  -500.0,
633  500.0,
634  0,
635  depth16HE(ieta, iphi),
636  false);
637  spr::energyHCALCell(hotCell,
638  hbhe,
639  ehdepthAux,
640  maxDepth_,
641  -100.0,
642  -100.0,
643  -100.0,
644  -100.0,
645  -500.0,
646  500.0,
647  1,
648  depth16HE(ieta, iphi),
649  false);
650  spr::energyHCALCell(hotCell,
651  hbhe,
652  ehdepthRaw,
653  maxDepth_,
654  -100.0,
655  -100.0,
656  -100.0,
657  -100.0,
658  -500.0,
659  500.0,
660  2,
661  depth16HE(ieta, iphi),
662  false);
663  for (int i = 0; i < depthMax_; ++i)
664  eHcalDetId[i] = HcalDetId();
665  for (unsigned int i = 0; i < ehdepth.size(); ++i) {
666  HcalSubdetector subdet0 =
667  (hborhe) ? ((ehdepth[i].second >= depth16HE(ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
668  HcalDetId hcid0(subdet0, ieta, iphi, ehdepth[i].second);
669  double actL = activeLength(DetId(hcid0));
670  double ene = ehdepth[i].first;
671  bool tmpC(false);
672  if (ene > 0.0) {
673  if (!(theHBHETopology_->validHcal(hcid0))) {
674  edm::LogWarning("HBHEMuon") << "(2) Invalid ID " << hcid0 << " with E = " << ene;
675  edm::LogWarning("HBHEMuon") << HcalDetId(hotCell) << " with " << ehdepth.size() << " depths:";
676  for (const auto& ehd : ehdepth)
677  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
678  } else {
679  tmpC = goodCell(hcid0, pTrack, geo_, bField);
680  double chg(ene), enec(ene);
681  double corr = respCorr(DetId(hcid0));
682  if (corr != 0)
683  ene /= corr;
684 #ifdef EDM_ML_DEBUG
685  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
686  edm::LogVerbatim("HBHEMuon") << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << enec;
687 #endif
688  double gain = gainFactor(conditions, hcid0);
689  if (gain != 0)
690  chg /= gain;
691 #ifdef EDM_ML_DEBUG
692  edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg;
693 #endif
694  int depth = ehdepth[i].second - 1;
695  if (collapseDepth_) {
696  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
697  depth = id.depth() - 1;
698  }
699  eHcalDepthHot[depth] += ene;
700  eHcalDepthHotC[depth] += enec;
701  cHcalDepthHot[depth] += chg;
702  activeHotL[depth] += actL;
703  activeLengthHotTot += actL;
704  matchDepthHot[depth] = (matchDepthHot[depth] && tmpC);
705 #ifdef EDM_ML_DEBUG
706  eHcal += ene;
707  if ((verbosity_ % 10) > 0)
708  edm::LogVerbatim("HBHEMuon") << hcid0 << " depth " << depth << " E " << ene << ":" << enec << " C "
709  << chg << " L " << actL << " Match " << tmpC;
710 #endif
711  }
712  }
713  double eneAux = ehdepthAux[i].first;
714  if (eneAux > 0.0) {
715  if (theHBHETopology_->validHcal(hcid0)) {
716  double chgAux(eneAux), enecAux(eneAux);
717  double corr = respCorr(DetId(hcid0));
718  if (corr != 0)
719  eneAux /= corr;
720  double gain = gainFactor(conditions, hcid0);
721  if (gain != 0)
722  chgAux /= gain;
723  int depth = ehdepthAux[i].second - 1;
724  if (collapseDepth_) {
725  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
726  depth = id.depth() - 1;
727  }
728  eHcalDepthHotAux[depth] += eneAux;
729  eHcalDepthHotCAux[depth] += enecAux;
730  cHcalDepthHotAux[depth] += chgAux;
731 #ifdef EDM_ML_DEBUG
732  if ((verbosity_ % 10) > 0)
733  edm::LogVerbatim("HBHEMuon") << hcid0 << " depth " << depth << " E " << eneAux << ":" << enecAux
734  << " C " << chgAux << " L " << actL << " Match " << tmpC;
735 #endif
736  }
737  }
738  double eneRaw = ehdepthRaw[i].first;
739  if (eneRaw > 0.0) {
740  if (theHBHETopology_->validHcal(hcid0)) {
741  double chgRaw(eneRaw), enecRaw(eneRaw);
742  double corr = respCorr(DetId(hcid0));
743  if (corr != 0)
744  eneRaw /= corr;
745  double gain = gainFactor(conditions, hcid0);
746  if (gain != 0)
747  chgRaw /= gain;
748  int depth = ehdepthRaw[i].second - 1;
749  if (collapseDepth_) {
750  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
751  depth = id.depth() - 1;
752  }
753  eHcalDepthHotRaw[depth] += eneRaw;
754  eHcalDepthHotCRaw[depth] += enecRaw;
755  cHcalDepthHotRaw[depth] += chgRaw;
756 #ifdef EDM_ML_DEBUG
757  if ((verbosity_ % 10) > 0)
758  edm::LogVerbatim("HBHEMuon") << hcid0 << " depth " << depth << " E " << eneRaw << ":" << enecRaw
759  << " C " << chgRaw << " L " << actL << " Match " << tmpC;
760 #endif
761  }
762  }
763  }
764 
765  HcalDetId oppCell(subdet, -ieta, iphi, HcalDetId(hotCell).depth());
766  std::vector<std::pair<double, int>> ehdeptho, ehdepthoAux, ehdepthoRaw;
767  spr::energyHCALCell(oppCell,
768  hbhe,
769  ehdeptho,
770  maxDepth_,
771  -100.0,
772  -100.0,
773  -100.0,
774  -100.0,
775  -500.0,
776  500.0,
777  0,
778  depth16HE(-ieta, iphi),
779  false);
780  spr::energyHCALCell(oppCell,
781  hbhe,
782  ehdepthoAux,
783  maxDepth_,
784  -100.0,
785  -100.0,
786  -100.0,
787  -100.0,
788  -500.0,
789  500.0,
790  1,
791  depth16HE(-ieta, iphi),
792  false);
793  spr::energyHCALCell(oppCell,
794  hbhe,
795  ehdepthoRaw,
796  maxDepth_,
797  -100.0,
798  -100.0,
799  -100.0,
800  -100.0,
801  -500.0,
802  500.0,
803  2,
804  depth16HE(-ieta, iphi),
805  false);
806  for (unsigned int i = 0; i < ehdeptho.size(); ++i) {
807  HcalSubdetector subdet0 =
808  (hborhe) ? ((ehdeptho[i].second >= depth16HE(-ieta, iphi)) ? HcalEndcap : HcalBarrel) : subdet;
809  HcalDetId hcid0(subdet0, -ieta, iphi, ehdeptho[i].second);
810  double ene = ehdeptho[i].first;
811  if (ene > 0.0) {
812  if (!(theHBHETopology_->validHcal(hcid0))) {
813  edm::LogWarning("HBHEMuon") << "(3) Invalid ID " << hcid0 << " with E = " << ene;
814  edm::LogWarning("HBHEMuon") << oppCell << " with " << ehdeptho.size() << " depths:";
815  for (const auto& ehd : ehdeptho)
816  edm::LogWarning("HBHEMuon") << " " << ehd.second << ":" << ehd.first;
817  } else {
818  double chg(ene);
819  double corr = respCorr(DetId(hcid0));
820  if (corr != 0)
821  ene /= corr;
822 #ifdef EDM_ML_DEBUG
823  HcalDetId id = (isItPlan1_ && isItPreRecHit_) ? hdc_->mergedDepthDetId(hcid0) : hcid0;
824  edm::LogVerbatim("HBHEMuon")
825  << hcid0 << ":" << id << " Corr " << corr << " E " << ene << ":" << ehdeptho[i].first;
826 #endif
827  double gain = gainFactor(conditions, hcid0);
828  if (gain != 0)
829  chg /= gain;
830 #ifdef EDM_ML_DEBUG
831  edm::LogVerbatim("HBHEMuon") << hcid0 << " Gain " << gain << " C " << chg;
832 #endif
833  int depth = ehdeptho[i].second - 1;
834  if (collapseDepth_) {
835  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
836  depth = id.depth() - 1;
837  }
838  cHcalDepthHotBG[depth] += chg;
839 #ifdef EDM_ML_DEBUG
840  if ((verbosity_ % 10) > 0)
841  edm::LogVerbatim("HBHEMuon") << hcid0 << " Depth " << depth << " E " << ene << " C " << chg;
842 #endif
843  }
844  }
845  double eneAux = ehdepthoAux[i].first;
846  if (eneAux > 0.0) {
847  if (theHBHETopology_->validHcal(hcid0)) {
848  double chgAux(eneAux);
849  double corr = respCorr(DetId(hcid0));
850  if (corr != 0)
851  eneAux /= corr;
852  double gain = gainFactor(conditions, hcid0);
853  if (gain != 0)
854  chgAux /= gain;
855  int depth = ehdepthoAux[i].second - 1;
856  if (collapseDepth_) {
857  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
858  depth = id.depth() - 1;
859  }
860  cHcalDepthHotBGAux[depth] += chgAux;
861 #ifdef EDM_ML_DEBUG
862  if ((verbosity_ % 10) > 0)
863  edm::LogVerbatim("HBHEMuon") << hcid0 << " Depth " << depth << " E " << eneAux << " C " << chgAux;
864 #endif
865  }
866  }
867  double eneRaw = ehdepthoRaw[i].first;
868  if (eneRaw > 0.0) {
869  if (theHBHETopology_->validHcal(hcid0)) {
870  double chgRaw(eneRaw);
871  double corr = respCorr(DetId(hcid0));
872  if (corr != 0)
873  eneRaw /= corr;
874  double gain = gainFactor(conditions, hcid0);
875  if (gain != 0)
876  chgRaw /= gain;
877  int depth = ehdepthoRaw[i].second - 1;
878  if (collapseDepth_) {
879  HcalDetId id = hdc_->mergedDepthDetId(hcid0);
880  depth = id.depth() - 1;
881  }
882  cHcalDepthHotBGRaw[depth] += chgRaw;
883 #ifdef EDM_ML_DEBUG
884  if ((verbosity_ % 10) > 0)
885  edm::LogVerbatim("HBHEMuon") << hcid0 << " Depth " << depth << " E " << eneRaw << " C " << chgRaw;
886 #endif
887  }
888  }
889  }
890  }
891  }
892 #ifdef EDM_ML_DEBUG
893  edm::LogVerbatim("HBHEMuon") << "Propagate Track to HCAL: " << trackID.okHCAL << " Match "
894  << hbheMuon.matchedId_ << " Hot " << isHot << " Energy " << eHcal;
895 #endif
896  hbheMuon.hcalIeta_ = ieta;
897  hbheMuon.hcalIphi_ = iphi;
898  for (int i = 0; i < depthMax_; ++i) {
899  hbheMuon.hcalDepthEnergy_.push_back(eHcalDepth[i]);
900  hbheMuon.hcalDepthActiveLength_.push_back(activeL[i]);
901  hbheMuon.hcalDepthEnergyHot_.push_back(eHcalDepthHot[i]);
902  hbheMuon.hcalDepthActiveLengthHot_.push_back(activeHotL[i]);
903  hbheMuon.hcalDepthEnergyCorr_.push_back(eHcalDepthC[i]);
904  hbheMuon.hcalDepthEnergyHotCorr_.push_back(eHcalDepthHotC[i]);
905  hbheMuon.hcalDepthChargeHot_.push_back(cHcalDepthHot[i]);
906  hbheMuon.hcalDepthChargeHotBG_.push_back(cHcalDepthHotBG[i]);
907  hbheMuon.hcalDepthMatch_.push_back(matchDepth[i]);
908  hbheMuon.hcalDepthMatchHot_.push_back(matchDepthHot[i]);
909  hbheMuon.hcalDepthEnergyAux_.push_back(eHcalDepthAux[i]);
910  hbheMuon.hcalDepthEnergyHotAux_.push_back(eHcalDepthHotAux[i]);
911  hbheMuon.hcalDepthEnergyCorrAux_.push_back(eHcalDepthCAux[i]);
912  hbheMuon.hcalDepthEnergyHotCorrAux_.push_back(eHcalDepthHotCAux[i]);
913  hbheMuon.hcalDepthChargeHotAux_.push_back(cHcalDepthHotAux[i]);
914  hbheMuon.hcalDepthChargeHotBGAux_.push_back(cHcalDepthHotBGAux[i]);
915  hbheMuon.hcalDepthEnergyRaw_.push_back(eHcalDepthRaw[i]);
916  hbheMuon.hcalDepthEnergyHotRaw_.push_back(eHcalDepthHotRaw[i]);
917  hbheMuon.hcalDepthEnergyCorrRaw_.push_back(eHcalDepthCRaw[i]);
918  hbheMuon.hcalDepthEnergyHotCorrRaw_.push_back(eHcalDepthHotCRaw[i]);
919  hbheMuon.hcalDepthChargeHotRaw_.push_back(cHcalDepthHotRaw[i]);
920  hbheMuon.hcalDepthChargeHotBGRaw_.push_back(cHcalDepthHotBGRaw[i]);
921  }
922  hbheMuon.hcalActiveLength_ = activeLengthTot;
923  hbheMuon.hcalHot_ = isHot;
924  hbheMuon.hcalActiveLengthHot_ = activeLengthHotTot;
925 
926  if ((recMuon->p() > 10.0) && (trackID.okHCAL))
927  outputHcalHBHEMuonColl->emplace_back(hbheMuon);
928  }
929  }
930  }
931  if (!outputHcalHBHEMuonColl->empty())
932  ++nGood_;
933  iEvent.put(std::move(outputHcalHBHEMuonColl), labelHBHEMuon_);
934 }
RunNumber_t run() const
Definition: EventID.h:38
Log< level::Info, true > LogVerbatim
EventNumber_t event() const
Definition: EventID.h:40
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_sevlv_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
static const TGPicture * info(bool iBackgroundIsBlack)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_topo_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
const float chg[109]
Definition: CoreSimTrack.cc:5
HcalDetId mergedDepthDetId(const HcalDetId &id) const
std::vector< float > hcalDepthEnergyCorrRaw_
std::vector< float > hcalDepthEnergyRaw_
std::vector< float > hcalDepthEnergy_
std::vector< float > hcalDepthEnergyHotRaw_
int bunchCrossing() const
Definition: EventBase.h:64
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_chan_
double respCorr(const DetId &id)
edm::ESGetToken< HcalDbService, HcalDbRecord > tok_dbservice_
const HcalDDDRecConstants * hdc_
std::vector< float > hcalDepthChargeHotRaw_
std::vector< bool > hcalDepthMatchHot_
bool validHcal(const HcalDetId &id) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
std::vector< float > hcalDepthChargeHotBGRaw_
Strings const & triggerNames() const
Definition: TriggerNames.cc:48
std::vector< float > hcalDepthEnergyHotAux_
std::vector< float > hcalDepthEnergyHotCorr_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
U second(std::pair< T, U > const &p)
constexpr HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:138
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
Definition: Event.h:563
bool isGoodVertex(const reco::Vertex &vtx)
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
const std::vector< std::string > trigNames_
spr::propagatedTrackDirection propagateHCALBack(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
constexpr int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
std::vector< float > hcalDepthChargeHotAux_
std::vector< float > hcalDepthEnergyHot_
def move
Definition: eostools.py:511
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
std::vector< float > hcalDepthEnergyCorr_
std::vector< float > hcalDepthActiveLength_
static std::string const triggerResults
Definition: EdmProvDump.cc:44
std::vector< float > hcalDepthEnergyAux_
std::vector< float > hcalDepthEnergyHotCorrRaw_
Definition: DetId.h:17
edm::EDGetTokenT< reco::VertexCollection > tok_Vtx_
std::vector< float > hcalDepthChargeHotBG_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const HcalTopology * theHBHETopology_
edm::EDGetTokenT< HBHERecHitCollection > tok_HBHE_
edm::EventID id() const
Definition: EventBase.h:59
tuple muons
Definition: patZpeak.py:39
std::vector< float > hcalDepthChargeHot_
std::vector< float > hcalDepthEnergyCorrAux_
std::vector< bool > hcalDepthMatch_
double gainFactor(const HcalDbService *dbserv, const HcalDetId &id)
int matchId(const HcalDetId &, const HcalDetId &)
constexpr int depth() const
get the tower depth
Definition: HcalDetId.h:164
std::vector< float > hcalDepthEnergyHotCorrAux_
bool goodCell(const HcalDetId &hcid, const reco::Track *pTrack, const CaloGeometry *geo, const MagneticField *bField)
Log< level::Warning, false > LogWarning
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
std::vector< float > hcalDepthActiveLengthHot_
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, int depthHE=3, bool debug=false)
int depth16HE(int ieta, int iphi)
std::vector< float > hcalDepthChargeHotBGAux_
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int useRaw=0, bool debug=false)
double AlCaHcalHBHEMuonProducer::respCorr ( const DetId id)
private

Definition at line 1083 of file AlCaHcalHBHEMuonProducer.cc.

References corrValue_, reco::JetExtendedAssociation::getValue(), HcalCondObjectContainer< Item >::getValues(), respCorrs_, and useMyCorr_.

Referenced by produce().

1083  {
1084  double cfac(1.0);
1085  if (useMyCorr_) {
1086  auto itr = corrValue_.find(id);
1087  if (itr != corrValue_.end())
1088  cfac = itr->second;
1089  } else if (respCorrs_ != nullptr) {
1090  cfac = (respCorrs_->getValues(id))->getValue();
1091  }
1092  return cfac;
1093 }
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::map< DetId, double > corrValue_
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found

Member Data Documentation

std::vector<HcalDDDRecConstants::HcalActiveLength> AlCaHcalHBHEMuonProducer::actHB
private

Definition at line 148 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by activeLength(), and beginRun().

std::vector<HcalDDDRecConstants::HcalActiveLength> AlCaHcalHBHEMuonProducer::actHE
private

Definition at line 148 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by activeLength(), and beginRun().

std::vector<std::string> AlCaHcalHBHEMuonProducer::all_triggers_
private

Definition at line 145 of file AlCaHcalHBHEMuonProducer.cc.

const bool AlCaHcalHBHEMuonProducer::collapseDepth_
private

Definition at line 114 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

std::map<DetId, double> AlCaHcalHBHEMuonProducer::corrValue_
private

Definition at line 149 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and respCorr().

const int AlCaHcalHBHEMuonProducer::depthMax_ = 7
staticprivate

Definition at line 144 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

const std::string AlCaHcalHBHEMuonProducer::fileInCorr_
private

Definition at line 117 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const CaloGeometry* AlCaHcalHBHEMuonProducer::geo_
private

Definition at line 123 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun(), and produce().

const HcalDDDRecConstants* AlCaHcalHBHEMuonProducer::hdc_
private

Definition at line 121 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by activeLength(), beginRun(), goodCell(), and produce().

HLTConfigProvider AlCaHcalHBHEMuonProducer::hltConfig_
private

Definition at line 108 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun().

std::vector<int> AlCaHcalHBHEMuonProducer::hltresults_
private

Definition at line 146 of file AlCaHcalHBHEMuonProducer.cc.

const bool AlCaHcalHBHEMuonProducer::isItPlan1_
private

Definition at line 114 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), depth16HE(), and produce().

const bool AlCaHcalHBHEMuonProducer::isItPreRecHit_
private

Definition at line 116 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), depth16HE(), and produce().

const edm::InputTag AlCaHcalHBHEMuonProducer::labelEBRecHit_
private

Definition at line 112 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const edm::InputTag AlCaHcalHBHEMuonProducer::labelEERecHit_
private

Definition at line 112 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const std::string AlCaHcalHBHEMuonProducer::labelHBHEMuon_
private

Definition at line 113 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

const edm::InputTag AlCaHcalHBHEMuonProducer::labelHBHERecHit_
private

Definition at line 112 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const std::string AlCaHcalHBHEMuonProducer::labelMuon_
private

Definition at line 113 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const std::string AlCaHcalHBHEMuonProducer::labelVtx_
private

Definition at line 113 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

int AlCaHcalHBHEMuonProducer::maxDepth_
private

Definition at line 119 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

bool AlCaHcalHBHEMuonProducer::mergedDepth_
private

Definition at line 118 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by activeLength(), AlCaHcalHBHEMuonProducer(), and beginRun().

int AlCaHcalHBHEMuonProducer::nAll_
private

Definition at line 119 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by endStream(), and produce().

int AlCaHcalHBHEMuonProducer::nGood_
private

Definition at line 119 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by endStream(), and produce().

int AlCaHcalHBHEMuonProducer::nRun_
private

Definition at line 119 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun(), and endRun().

const std::string AlCaHcalHBHEMuonProducer::processName_
private

Definition at line 110 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun().

const HcalRespCorrs* AlCaHcalHBHEMuonProducer::respCorrs_
private

Definition at line 124 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun(), and respCorr().

const HcalTopology* AlCaHcalHBHEMuonProducer::theHBHETopology_
private

Definition at line 122 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun(), depth16HE(), and produce().

edm::ESGetToken<EcalChannelStatus, EcalChannelStatusRcd> AlCaHcalHBHEMuonProducer::tok_chan_
private

Definition at line 138 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<HcalDbService, HcalDbRecord> AlCaHcalHBHEMuonProducer::tok_dbservice_
private

Definition at line 141 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<HcalDDDRecConstants, HcalRecNumberingRecord> AlCaHcalHBHEMuonProducer::tok_ddrec_
private

Definition at line 133 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and beginRun().

edm::EDGetTokenT<EcalRecHitCollection> AlCaHcalHBHEMuonProducer::tok_EB_
private

Definition at line 128 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::EDGetTokenT<EcalRecHitCollection> AlCaHcalHBHEMuonProducer::tok_EE_
private

Definition at line 129 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> AlCaHcalHBHEMuonProducer::tok_geom_
private

Definition at line 136 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and beginRun().

edm::EDGetTokenT<HBHERecHitCollection> AlCaHcalHBHEMuonProducer::tok_HBHE_
private

Definition at line 130 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> AlCaHcalHBHEMuonProducer::tok_htopo_
private

Definition at line 134 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and beginRun().

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> AlCaHcalHBHEMuonProducer::tok_magField_
private

Definition at line 137 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::EDGetTokenT<reco::MuonCollection> AlCaHcalHBHEMuonProducer::tok_Muon_
private

Definition at line 131 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<HcalRespCorrs, HcalRespCorrsRcd> AlCaHcalHBHEMuonProducer::tok_respcorr_
private

Definition at line 135 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and beginRun().

edm::ESGetToken<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd> AlCaHcalHBHEMuonProducer::tok_sevlv_
private

Definition at line 139 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::ESGetToken<CaloTopology, CaloTopologyRecord> AlCaHcalHBHEMuonProducer::tok_topo_
private

Definition at line 140 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::EDGetTokenT<edm::TriggerResults> AlCaHcalHBHEMuonProducer::tok_trigRes_
private

Definition at line 126 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

edm::EDGetTokenT<reco::VertexCollection> AlCaHcalHBHEMuonProducer::tok_Vtx_
private

Definition at line 127 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and produce().

const edm::InputTag AlCaHcalHBHEMuonProducer::triggerResults_
private

Definition at line 111 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer().

const std::vector<std::string> AlCaHcalHBHEMuonProducer::trigNames_
private

Definition at line 109 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by produce().

bool AlCaHcalHBHEMuonProducer::useMyCorr_
private

Definition at line 118 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by AlCaHcalHBHEMuonProducer(), and respCorr().

const int AlCaHcalHBHEMuonProducer::verbosity_
private

Definition at line 115 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by goodCell(), and produce().

const bool AlCaHcalHBHEMuonProducer::writeRespCorr_
private

Definition at line 116 of file AlCaHcalHBHEMuonProducer.cc.

Referenced by beginRun().