113 else if (maxDepth_ < 1) maxDepth_ = 4;
116 <<
":" << hcLabel_ <<
"\nVerbosity " << verbosity_ <<
" MaxDepth " 117 << maxDepth_ <<
" Maximum Eta " << etaMax_ <<
" tMin|tMax " 149 edm::SimTrackContainer::const_iterator simTrkItr;
160 std::vector<PCaloHit> calohh;
162 for (
unsigned int k=1;
k<pcalohh->size(); ++
k) {
166 int det = ((((*pcalohh)[
k].id())>>28)&0xF);
167 if (det != 4) {testN =
true;
break;}
170 for (edm::PCaloHitContainer::const_iterator itr=pcalohh->begin(); itr != pcalohh->end(); ++itr) {
178 calohh.push_back(hit);
181 calohh.insert(calohh.end(),pcalohh->begin(),pcalohh->end());
202 for (edm::SimTrackContainer::const_iterator simTrkItr=SimTk->begin();
203 simTrkItr!= SimTk->end(); simTrkItr++) {
204 if ((
std::abs(simTrkItr->type()) ==
idMuon_) && (simTrkItr->vertIndex() == 0) &&
206 unsigned int thisTrk = simTrkItr->trackId();
209 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
212 unsigned int isHot(0);
213 bool tmpmatch(
false);
215 eHcalDepth[
i] = eHcalDepthHot[
i] = activeL[
i] = activeHotL[
i] = -10000;
219 std::cout <<
"Track Type " << simTrkItr->type() <<
" Vertex " 220 << simTrkItr->vertIndex() <<
" Charge " << simTrkItr->charge()
221 <<
" Momentum " << simTrkItr->momentum().P() <<
":" 222 << simTrkItr->momentum().eta() <<
":" 223 << simTrkItr->momentum().phi() <<
" ECAL|HCAL " << trkD.
okECAL 230 bool propageback(
false);
246 std::cout <<
"Track at vertex " << tkvx.
ok <<
" position " 258 eEcal =
spr::eECALmatrix(isoCell, pcaloeb, pcaloee, geo, caloTopology, 1, 1, -100.0, -100.0,
tMinE_,
tMaxE_, debug);
268 eHcal =
spr::eHCALmatrix(theHBHETopology, closestCell, calohh,0,0,
false, -100.0, -100.0, -100.0, -100.0,
tMinH_,
tMaxH_, debug);
272 << eHcal << std::endl;
279 std::vector<std::pair<double,int> > ehdepth;
280 spr::energyHCALCell((
HcalDetId)closestCell, calohh, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0, debug);
281 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
282 eHcalDepth[ehdepth[
i].second-1] = ehdepth[
i].first;
286 activeL[ehdepth[
i].second-1] = actL;
287 activeLengthTot += actL;
290 std::cout << hcid0 <<
" E " << ehdepth[
i].first <<
" L " << actL
299 spr::eHCALmatrix(geo,theHBHETopology, closestCell, calohh, 1,1, hotCell, debug);
300 isHot =
matchId(closestCell,hotCell);
303 std::cout <<
"hcal 3X3 < " << h3x3 <<
">" <<
" ClosestCell <" 304 << (
HcalDetId)(closestCell) <<
"> hotCell id < " << hotCell
305 <<
"> 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_, 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< double > ecal3x3Energy_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
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
#define DEFINE_FWK_MODULE(type)
std::vector< double > hcal1x1Energy_
static const int depthMax_
Geom::Phi< T > phi() 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, bool useRaw=false, bool debug=false)
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 endRun(edm::Run const &, edm::EventSetup const &) override
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)
std::vector< double > hcalActiveLength_
int ieta() const
get the cell ieta
std::vector< double > hcalDepthEnergy_[depthMax_]
Abs< T >::type abs(const T &t)
~HcalHBHEMuonSimAnalyzer()
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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, bool useRaw=false, bool debug=false)
std::vector< double > phiGlob_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE_
virtual 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
virtual void beginJob() override
T const * product() const
virtual void analyze(edm::Event const &, edm::EventSetup const &) override
std::vector< unsigned int > hcalHot_
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)