|
|
Go to the documentation of this file.
125 tok_ddrec_ = esConsumes<HcalDDDRecConstants, HcalRecNumberingRecord, edm::Transition::BeginRun>();
126 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
128 tok_topo_ = esConsumes<HcalTopology, HcalRecNumberingRecord>();
129 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
156 std::vector<PCaloHit> calohh;
158 for (
unsigned int k = 1;
k < pcalohh->size(); ++
k) {
162 int det = ((((*pcalohh)[
k].id()) >> 28) & 0xF);
169 for (edm::PCaloHitContainer::const_iterator itr = pcalohh->begin(); itr != pcalohh->end(); ++itr) {
174 calohh.push_back(
hit);
177 calohh.insert(calohh.end(), pcalohh->begin(), pcalohh->end());
187 for (edm::SimTrackContainer::const_iterator simTrkItr = SimTk->begin(); simTrkItr != SimTk->end(); simTrkItr++) {
188 if ((
std::abs(simTrkItr->type()) ==
idMuon_) && (simTrkItr->vertIndex() == 0) &&
190 unsigned int thisTrk = simTrkItr->trackId();
193 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
196 unsigned int isHot(0);
197 bool tmpmatch(
false);
199 eHcalDepth[
i] = eHcalDepthHot[
i] = activeL[
i] = activeHotL[
i] = -10000;
202 edm::LogVerbatim(
"HBHEMuon") <<
"Track Type " << simTrkItr->type() <<
" Vertex " << simTrkItr->vertIndex()
203 <<
" Charge " << simTrkItr->charge() <<
" Momentum " << simTrkItr->momentum().P()
204 <<
":" << simTrkItr->momentum().eta() <<
":" << simTrkItr->momentum().phi()
205 <<
" ECAL|HCAL " << trkD.
okECAL <<
":" << trkD.
okHCAL <<
" Point "
210 bool propageback(
false);
234 isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0,
tMinE_,
tMaxE_,
debug);
244 theHBHETopology, closestCell, calohh, 0, 0,
false, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_,
debug);
254 std::vector<std::pair<double, int> > ehdepth;
267 for (
unsigned int i = 0;
i < ehdepth.size(); ++
i) {
268 eHcalDepth[ehdepth[
i].second - 1] = ehdepth[
i].first;
272 activeL[ehdepth[
i].second - 1] = actL;
273 activeLengthTot += actL;
275 edm::LogVerbatim(
"HBHEMuon") << hcid0 <<
" E " << ehdepth[
i].first <<
" L " << actL;
280 isHot =
matchId(closestCell, hotCell);
283 <<
"> hotCell id < " << hotCell <<
"> isHot" << isHot;
292 std::vector<std::pair<double, int> > ehdepth;
294 hotCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, depthHE,
debug);
295 for (
unsigned int i = 0;
i < ehdepth.size(); ++
i) {
296 eHcalDepthHot[ehdepth[
i].second - 1] = ehdepth[
i].first;
300 activeHotL[ehdepth[
i].second - 1] = actL;
301 activeLengthHotTot += actL;
303 edm::LogVerbatim(
"HBHEMuon") << hcid0 <<
" E " << ehdepth[
i].first <<
" L " << actL;
308 edm::LogVerbatim(
"HBHEMuon") <<
"Depth " <<
k <<
" E " << eHcalDepth[
k] <<
":" << eHcalDepthHot[
k];
351 sprintf(
name,
"hcal_edepth%d", (
k + 1));
353 sprintf(
name,
"hcal_activeL%d", (
k + 1));
355 sprintf(
name,
"hcal_edepthHot%d", (
k + 1));
357 sprintf(
name,
"hcal_activeHotL%d", (
k + 1));
376 desc.addUntracked<
int>(
"Verbosity", 0);
377 desc.addUntracked<
int>(
"MaxDepth", 4);
378 desc.addUntracked<
double>(
"EtaMax", 3.0);
379 desc.addUntracked<
double>(
"TimeMinCutECAL", -500.);
380 desc.addUntracked<
double>(
"TimeMaxCutECAL", 500.);
381 desc.addUntracked<
double>(
"TimeMinCutHCAL", -500.);
382 desc.addUntracked<
double>(
"TimeMaxCutHCAL", 500.);
383 descriptions.
add(
"hcalHBHEMuonSim",
desc);
416 unsigned int match = ((kd1 == kd2) ? 1 : 0);
422 int ieta =
id.ietaAbs();
423 int depth =
id.depth();
426 for (
unsigned int i = 0;
i <
actHB_.size(); ++
i) {
433 for (
unsigned int i = 0;
i <
actHE_.size(); ++
i) {
std::vector< double > ecal3x3Energy_
void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< double > hcalDepthActiveLength_[depthMax_]
std::vector< double > hcalDepthActiveLengthHot_[depthMax_]
std::vector< double > hcalDepthEnergyHot_[depthMax_]
static const int depthMax_
std::vector< double > hcal1x1Energy_
std::vector< unsigned int > hcalDetId_
constexpr int iphi() const
get the cell iphi
std::vector< HcalActiveLength > getThickActive(const int &type) const
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > tok_topo_
U second(std::pair< T, U > const &p)
edm::Service< TFileService > fs_
std::vector< double > ptGlob_
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_caloTopology_
std::vector< double > matchedId_
std::vector< double > hcalActiveLengthHot_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
double activeLength(const DetId &)
edm::EDGetTokenT< edm::SimVertexContainer > tok_SimVtx_
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)
#define DEFINE_FWK_MODULE(type)
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)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
std::vector< double > hcalActiveLength_
edm::ESGetToken< HcalDDDRecConstants, HcalRecNumberingRecord > tok_ddrec_
edm::EDGetTokenT< edm::SimTrackContainer > tok_SimTk_
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
constexpr int ieta() const
get the cell ieta
std::vector< double > hcalDepthEnergy_[depthMax_]
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
constexpr HcalSubdetector subdet() const
get the subdetector
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
unsigned int eventNumber_
~HcalHBHEMuonSimAnalyzer() override
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
GlobalVector directionECAL
void endRun(edm::Run const &, edm::EventSetup const &) override
GlobalVector directionHCAL
bool getData(T &iHolder) const
std::vector< double > phiGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
std::vector< double > etaGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE_
std::vector< double > pMuon_
DetId relabel(const uint32_t testId) const
constexpr uint32_t rawId() const
get the raw id
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)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Log< level::Info, true > LogVerbatim
static const std::string kSharedResource
HcalHBHEMuonSimAnalyzer(const edm::ParameterSet &)
T getParameter(std::string const &) const
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)
unsigned int matchId(const HcalDetId &, const HcalDetId &)
const HcalDDDRecConstants * hcons_
Abs< T >::type abs(const T &t)
std::vector< unsigned int > hcalHot_
constexpr int zside() const
get the z-side of the cell (1/-1)
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
Geom::Phi< T > phi() const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
T * make(const Args &... args) const
make new ROOT object
std::vector< unsigned int > ecalDetId_