113 else if (maxDepth_ < 1) maxDepth_ = 4;
116 <<
":" << hcLabel_ <<
"\nVerbosity " << verbosity_ <<
" MaxDepth " 117 << maxDepth_ <<
" Maximum Eta " << etaMax_ <<
" tMin|tMax " 146 edm::SimTrackContainer::const_iterator simTrkItr;
157 std::vector<PCaloHit> calohh;
159 for (
unsigned int k=1;
k<pcalohh->size(); ++
k) {
163 int det = ((((*pcalohh)[
k].id())>>28)&0xF);
164 if (det != 4) {testN =
true;
break;}
167 for (edm::PCaloHitContainer::const_iterator itr=pcalohh->begin(); itr != pcalohh->end(); ++itr) {
175 calohh.push_back(hit);
178 calohh.insert(calohh.end(),pcalohh->begin(),pcalohh->end());
199 for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
200 simTrkItr!= SimTk->end(); simTrkItr++) {
201 if ((
std::abs(simTrkItr->type()) ==
idMuon_) && (simTrkItr->vertIndex() == 0) &&
203 unsigned int thisTrk = simTrkItr->trackId();
206 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
209 unsigned int isHot(0);
210 bool tmpmatch(
false);
212 eHcalDepth[
i] = eHcalDepthHot[
i] = activeL[
i] = activeHotL[
i] = -10000;
216 std::cout <<
"Track Type " << simTrkItr->type() <<
" Vertex " 217 << simTrkItr->vertIndex() <<
" Charge " << simTrkItr->charge()
218 <<
" Momentum " << simTrkItr->momentum().P() <<
":" 219 << simTrkItr->momentum().eta() <<
":" 220 << simTrkItr->momentum().phi() <<
" ECAL|HCAL " << trkD.
okECAL 227 bool propageback(
false);
243 std::cout <<
"Track at vertex " << tkvx.
ok <<
" position " 255 eEcal =
spr::eECALmatrix(isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0,
tMinE_,
tMaxE_, debug);
265 eHcal =
spr::eHCALmatrix(theHBHETopology, closestCell, calohh,0,0,
false, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, debug);
269 << eHcal << std::endl;
278 std::vector<std::pair<double,int> > ehdepth;
279 spr::energyHCALCell((
HcalDetId)closestCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0, depthHE, debug);
280 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
281 eHcalDepth[ehdepth[
i].second-1] = ehdepth[
i].first;
285 activeL[ehdepth[
i].second-1] = actL;
286 activeLengthTot += actL;
289 std::cout << hcid0 <<
" E " << ehdepth[
i].first <<
" L " << actL
298 spr::eHCALmatrix(geo,theHBHETopology, closestCell, calohh, 1,1, hotCell, debug);
299 isHot =
matchId(closestCell,hotCell);
302 std::cout <<
"hcal 3X3 < " << h3x3 <<
">" <<
" ClosestCell <" 303 << (
HcalDetId)(closestCell) <<
"> hotCell id < " << hotCell
304 <<
"> isHot" << isHot << std::endl;
314 std::vector<std::pair<double,int> > ehdepth;
315 spr::energyHCALCell(hotCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, depthHE, debug);
316 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
317 eHcalDepthHot[ehdepth[
i].second-1] = ehdepth[
i].first;
321 activeHotL[ehdepth[
i].second-1] = actL;
322 activeLengthHotTot += actL;
325 std::cout << hcid0 <<
" E " << ehdepth[
i].first <<
" L " 326 << actL << std::endl;
333 std::cout <<
"Depth " <<
k <<
" E " << eHcalDepth[
k] <<
":" 334 << eHcalDepthHot[
k] << std::endl;
378 sprintf (name,
"hcal_edepth%d", (
k+1));
380 sprintf (name,
"hcal_activeL%d", (k+1));
382 sprintf (name,
"hcal_edepthHot%d", (k+1));
384 sprintf (name,
"hcal_activeHotL%d", (k+1));
416 descriptions.
add(
"hcalHBHEMuonSim",desc);
452 unsigned int match = ((kd1 == kd2) ? 1 : 0);
458 int ieta =
id.ietaAbs();
459 int depth=
id.depth();
462 for (
unsigned int i=0;
i<
actHB_.size(); ++
i) {
469 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)
#define DEFINE_FWK_MODULE(type)
std::vector< double > hcal1x1Energy_
static const int depthMax_
Geom::Phi< T > phi() const
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 &)
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
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)