113 else if (maxDepth_ < 1) maxDepth_ = 4;
116 <<
":" << hcLabel_ <<
"\nVerbosity " << verbosity_ <<
" MaxDepth " 117 << maxDepth_ <<
" Maximum Eta " << etaMax_ <<
" tMin|tMax " 156 std::vector<PCaloHit> calohh;
158 for (
unsigned int k=1;
k<pcalohh->size(); ++
k) {
162 int det = ((((*pcalohh)[
k].id())>>28)&0xF);
163 if (det != 4) {testN =
true;
break;}
166 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());
198 for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
199 simTrkItr!= SimTk->end(); simTrkItr++) {
200 if ((
std::abs(simTrkItr->type()) ==
idMuon_) && (simTrkItr->vertIndex() == 0) &&
202 unsigned int thisTrk = simTrkItr->trackId();
205 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
208 unsigned int isHot(0);
209 bool tmpmatch(
false);
211 eHcalDepth[
i] = eHcalDepthHot[
i] = activeL[
i] = activeHotL[
i] = -10000;
215 std::cout <<
"Track Type " << simTrkItr->type() <<
" Vertex " 216 << simTrkItr->vertIndex() <<
" Charge " << simTrkItr->charge()
217 <<
" Momentum " << simTrkItr->momentum().P() <<
":" 218 << simTrkItr->momentum().eta() <<
":" 219 << simTrkItr->momentum().phi() <<
" ECAL|HCAL " << trkD.
okECAL 226 bool propageback(
false);
242 std::cout <<
"Track at vertex " << tkvx.
ok <<
" position " 254 eEcal =
spr::eECALmatrix(isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0,
tMinE_,
tMaxE_, debug);
264 eHcal =
spr::eHCALmatrix(theHBHETopology, closestCell, calohh,0,0,
false, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, debug);
268 << eHcal << std::endl;
277 std::vector<std::pair<double,int> > ehdepth;
278 spr::energyHCALCell((
HcalDetId)closestCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0, depthHE, debug);
279 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
280 eHcalDepth[ehdepth[
i].second-1] = ehdepth[
i].first;
284 activeL[ehdepth[
i].second-1] = actL;
285 activeLengthTot += actL;
288 std::cout << hcid0 <<
" E " << ehdepth[
i].first <<
" L " << actL
297 spr::eHCALmatrix(geo,theHBHETopology, closestCell, calohh, 1,1, hotCell, debug);
298 isHot =
matchId(closestCell,hotCell);
301 std::cout <<
"hcal 3X3 < " << h3x3 <<
">" <<
" ClosestCell <" 302 << (
HcalDetId)(closestCell) <<
"> hotCell id < " << hotCell
303 <<
"> isHot" << isHot << std::endl;
313 std::vector<std::pair<double,int> > ehdepth;
314 spr::energyHCALCell(hotCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, depthHE, debug);
315 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
316 eHcalDepthHot[ehdepth[
i].second-1] = ehdepth[
i].first;
320 activeHotL[ehdepth[
i].second-1] = actL;
321 activeLengthHotTot += actL;
324 std::cout << hcid0 <<
" E " << ehdepth[
i].first <<
" L " 325 << actL << std::endl;
332 std::cout <<
"Depth " <<
k <<
" E " << eHcalDepth[
k] <<
":" 333 << eHcalDepthHot[
k] << std::endl;
377 sprintf (name,
"hcal_edepth%d", (
k+1));
379 sprintf (name,
"hcal_activeL%d", (k+1));
381 sprintf (name,
"hcal_edepthHot%d", (k+1));
383 sprintf (name,
"hcal_activeHotL%d", (k+1));
415 descriptions.
add(
"hcalHBHEMuonSim",desc);
451 unsigned int match = ((kd1 == kd2) ? 1 : 0);
457 int ieta =
id.ietaAbs();
458 int depth=
id.depth();
461 for (
unsigned int i=0;
i<
actHB_.size(); ++
i) {
468 for (
unsigned int i=0;
i<
actHE_.size(); ++
i) {
static const std::string kSharedResource
std::vector< double > hcalDepthActiveLengthHot_[depthMax_]
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
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 > ecal3x3Energy_
HcalSubdetector subdet() const
get the subdetector
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< double > hcalDepthEnergyHot_[depthMax_]
std::vector< unsigned int > hcalDetId_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int zside() const
get the z-side of the cell (1/-1)
std::vector< double > hcal1x1Energy_
static const int depthMax_
Geom::Phi< T > phi() const
constexpr uint32_t rawId() const
get the raw id
int bunchCrossing() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< edm::SimVertexContainer > tok_SimVtx_
T * make(const Args &...args) const
make new ROOT object
spr::trackAtOrigin simTrackAtOrigin(unsigned int thisTrk, edm::Handle< edm::SimTrackContainer > &SimTk, edm::Handle< edm::SimVertexContainer > &SimVtx, bool debug=false)
std::vector< double > ptGlob_
LuminosityBlockNumber_t luminosityBlock() const
edm::Service< TFileService > fs_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > matchedId_
std::vector< double > hcalActiveLengthHot_
double activeLength(const DetId &)
U second(std::pair< T, U > const &p)
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< edm::SimTrackContainer > tok_SimTk_
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)
int getMinDepth(const int &itype, const int &ieta, const int &iphi, const int &zside) const
std::vector< double > hcalActiveLength_
int ieta() const
get the cell ieta
std::vector< double > hcalDepthEnergy_[depthMax_]
Abs< T >::type abs(const T &t)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
~HcalHBHEMuonSimAnalyzer() override
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< double > phiGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE_
void beginRun(edm::Run const &, edm::EventSetup const &) override
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
int iphi() const
get the cell iphi
GlobalVector directionHCAL
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
unsigned int eventNumber_
std::vector< double > etaGlob_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB_
std::vector< double > pMuon_
GlobalVector directionECAL
void setID(unsigned int id)
unsigned int matchId(const HcalDetId &, const HcalDetId &)
HcalHBHEMuonSimAnalyzer(const edm::ParameterSet &)
std::vector< HcalActiveLength > getThickActive(const int &type) const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
DetId relabel(const uint32_t testId) const
T const * product() const
void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< unsigned int > hcalHot_
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)
std::vector< unsigned int > ecalDetId_
std::vector< double > hcalDepthActiveLength_[depthMax_]
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)