128 std::vector<HcalDDDRecConstants::HcalActiveLength>
actHB,
actHE;
158 else if (maxDepth_ < 1) maxDepth_ = 4;
171 << labelVtx_ <<
" " << labelEBRecHit_ <<
" " 172 << labelEERecHit_ <<
" " << labelHBHERecHit_
179 <<
"\n " << labelEBRecHit_
180 <<
"\n " << labelEERecHit_
181 <<
"\n " << labelHBHERecHit_
221 std::vector<int>
index;
222 for (
int i=0;
i<Ntriggers;
i++) {
224 int triggerSize =
int( _Triggers->
size());
228 <<
"\ntriggerSize " << triggerSize
231 if (index[i] < triggerSize) {
236 <<
" triggerSize " << index[
i]
238 <<
" hltresult" << std::endl;
243 <<
"\" does not exist\n";
275 respCorrs->
setTopo(theHBHETopology);
298 reco::VertexCollection::const_iterator firstGoodVertex = vtx->end();
299 for (reco::VertexCollection::const_iterator it = vtx->begin();
300 it != firstGoodVertex; it++) {
302 firstGoodVertex = it;
306 if (firstGoodVertex != vtx->end()) {
307 pvx = firstGoodVertex->position();
327 for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon!= _Muon->end(); ++RecMuon) {
329 if ((RecMuon->p()>10.0) && (RecMuon->track().isNonnull())) accept =
true;
338 pMuon_.push_back(RecMuon->p());
341 << RecMuon->p() << std::endl;
343 muon_trkKink.push_back(RecMuon->combinedQuality().trkKink);
347 if (RecMuon->track().isNonnull()) {
348 trackerLayer_.push_back(RecMuon->track()->hitPattern().trackerLayersWithMeasurement());
352 if (RecMuon->innerTrack().isNonnull()) {
354 numPixelLayers_.push_back(RecMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement());
355 chiTracker_.push_back(RecMuon->innerTrack()->normalizedChi2());
356 dxyTracker_.push_back(fabs(RecMuon->innerTrack()->dxy(pvx)));
357 dzTracker_.push_back(fabs(RecMuon->innerTrack()->dz(pvx)));
361 tight_PixelHits_.push_back(RecMuon->innerTrack()->hitPattern().numberOfValidPixelHits());
376 if (RecMuon->outerTrack().isNonnull()) {
381 outerTrackChi_.push_back(RecMuon->outerTrack()->normalizedChi2());
394 if (RecMuon->globalTrack().isNonnull()) {
396 chiGlobal_.push_back(RecMuon->globalTrack()->normalizedChi2());
397 globalMuonHits_.push_back(RecMuon->globalTrack()->hitPattern().numberOfValidMuonHits());
398 matchedStat_.push_back(RecMuon->numberOfMatchedStations());
416 isolationR04_.push_back(((RecMuon->pfIsolationR04().sumChargedHadronPt +
std::max(0.,RecMuon->pfIsolationR04().sumNeutralHadronEt + RecMuon->pfIsolationR04().sumPhotonEt - (0.5 *RecMuon->pfIsolationR04().sumPUPt))) / RecMuon->pt()) );
418 isolationR03_.push_back(((RecMuon->pfIsolationR03().sumChargedHadronPt +
std::max(0.,RecMuon->pfIsolationR03().sumNeutralHadronEt + RecMuon->pfIsolationR03().sumPhotonEt - (0.5 * RecMuon->pfIsolationR03().sumPUPt))) / RecMuon->pt()));
422 hoEnergy_.push_back(RecMuon->calEnergy().hoS9);
424 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
429 unsigned int isHot(0);
430 bool tmpmatch(
false);
432 eHcalDepth[
i] = eHcalDepthHot[
i] = 0;
433 eHcalDepthC[
i] = eHcalDepthHotC[
i] = 0;
434 activeL[
i] = activeHotL[
i] = 0;
436 if (RecMuon->innerTrack().isNonnull()) {
437 const reco::Track* pTrack = (RecMuon->innerTrack()).
get();
450 bool okE = trackID.
okECAL;
453 std::pair<double,bool> e3x3 =
spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle,*theEcalChStatus,geo,caloTopology,sevlv.
product(),1,1,-100.0,-100.0,-500.0,500.0,
false);
459 <<
":" << trackID.
okECAL <<
" E " 460 << eEcal << std::endl;
466 if ((hcidt.ieta() == check.
ieta()) && (hcidt.iphi() == check.
iphi()))
472 bool hborhe = (
std::abs(ieta) == 16);
474 eHcal =
spr::eHCALmatrix(theHBHETopology, closestCell, hbhe,0,0,
false,
true, -100.0, -100.0, -100.0, -100.0, -500.,500.,
useRaw_);
475 std::vector<std::pair<double,int> > ehdepth;
476 spr::energyHCALCell((
HcalDetId) closestCell, hbhe, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0,
useRaw_, (((
verbosity_/1000)%10)>0));
478 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
482 double ene = ehdepth[
i].first;
486 if (corr != 0) ene /=
corr;
491 int depth = ehdepth[
i].second - 1;
494 depth =
id.
depth() - 1;
496 eHcalDepth[
depth] += ene;
497 eHcalDepthC[
depth]+= enec;
498 activeL[
depth] += actL;
499 activeLengthTot += actL;
503 << actL << std::endl;
509 isHot =
matchId(closestCell,hotCell);
515 std::vector<std::pair<double,int> > ehdepth;
516 spr::energyHCALCell(hotCell, hbhe, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0,
useRaw_,
false);
518 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
522 double ene = ehdepth[
i].first;
526 if (corr != 0) ene /=
corr;
531 int depth = ehdepth[
i].second - 1;
534 depth =
id.
depth() - 1;
536 eHcalDepthHot[
depth] += ene;
537 eHcalDepthHotC[
depth]+= enec;
538 activeHotL[
depth] += actL;
539 activeLengthHotTot += actL;
543 <<
" L " << actL << std::endl;
550 << trackID.
okHCAL <<
" Match " << tmpmatch
551 <<
" Hot " << isHot <<
" Energy " 552 << eHcal << std::endl;
577 if (accept)
tree_->Fill();
605 sprintf (name,
"hcal_edepth%d", (
k+1));
607 sprintf (name,
"hcal_activeL%d", (k+1));
609 sprintf (name,
"hcal_edepthHot%d", (k+1));
611 sprintf (name,
"hcal_activeHotL%d", (k+1));
614 sprintf (name,
"hcal_edepthCorrect%d", (k+1));
616 sprintf (name,
"hcal_edepthHotCorrect%d", (k+1));
689 <<
"HLT" <<
" successfully extracted" 693 for (
unsigned int t=0;
t<ntriggers;++
t) {
695 for (
unsigned int ik=0; ik<6; ++ik) {
705 edm::LogError(
"HBHEMuon") <<
"Error! HLT config extraction with process name " 706 <<
"HLT" <<
" failed";
722 std::vector<std::string> trig = {
"HLT_IsoMu17",
"HLT_IsoMu20",
723 "HLT_IsoMu24",
"HLT_IsoMu27",
724 "HLT_Mu45",
"HLT_Mu50"};
725 desc.
add<std::vector<std::string>>(
"Triggers",trig);
726 desc.
add<
bool>(
"UseRaw",
false);
727 desc.
add<
bool>(
"UnCorrect",
false);
728 desc.
add<
bool>(
"CollapseDepth",
false);
729 desc.
add<
bool>(
"SaveCorrect",
false);
734 descriptions.
add(
"hcalHBHEMuon",desc);
810 int match = ((kd1 == kd2) ? 1 : 0);
816 int ieta =
id.ietaAbs();
817 int depth=
id.depth();
818 int zside=
id.zside();
819 int iphi =
id.iphi();
822 for (
unsigned int i=0;
i<
actHB.size(); ++
i) {
823 if ((ieta ==
actHB[
i].ieta) && (depth ==
actHB[
i].depth) &&
824 (zside ==
actHB[
i].zside) &&
832 for (
unsigned int i=0;
i<
actHE.size(); ++
i) {
833 if ((ieta ==
actHE[
i].ieta) && (depth ==
actHE[
i].depth) &&
834 (zside ==
actHE[
i].zside) &&
846 if (vtx.
isFake())
return false;
847 if (vtx.
ndof() < 4)
return false;
848 if (vtx.
position().Rho() > 2.)
return false;
849 if (fabs(vtx.
position().Z()) > 24.)
return false;
unsigned int size() const
number of trigger paths in trigger table
static const std::string kSharedResource
std::vector< double > tight_validFraction_
T getParameter(std::string const &) const
EventNumber_t event() const
std::vector< double > innerTrackphi_
HcalHBHEMuonAnalyzer(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
unsigned int eventNumber_
std::vector< double > hcalHot_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
std::vector< std::string > triggers_
std::vector< double > dzTracker_
static const int depthMax_
HcalSubdetector subdet() const
get the subdetector
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void analyze(edm::Event const &, edm::EventSetup const &) override
const std::string & triggerName(unsigned int triggerIndex) const
edm::InputTag HLTriggerResults_
std::vector< double > muon_chi2LocalPosition
std::vector< double > outerTrackChi_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > matchedStat_
HcalDetId mergedDepthDetId(const HcalDetId &id) const
std::vector< double > tight_LongPara_
#define DEFINE_FWK_MODULE(type)
std::vector< double > muon_trkKink
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< unsigned int > ecalDetId_
std::vector< double > pMuon_
bool accept() const
Has at least one path accepted the event?
std::vector< double > globalTrckPhi_
std::vector< double > outerTrackHits_
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
T * make(const Args &...args) const
make new ROOT object
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE
std::vector< double > isolationR03_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
LuminosityBlockNumber_t luminosityBlock() const
const Point & position() const
position
std::vector< bool > muon_global_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::vector< double > hcalDepthEnergy_[depthMax_]
std::vector< double > outerTrackPt_
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< reco::VertexCollection > tok_Vtx_
void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< double > globalTrckPt_
int depth() const
get the tower depth
std::vector< bool > muon_tracker_
std::vector< double > ecalEnergy_
unsigned int triggerIndex(std::string const &name) const
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
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 > hcalActiveLengthHot_
std::vector< double > innerTracketa_
std::vector< double > globalTrckEta_
std::vector< double > isolationR04_
unsigned int size() const
Get number of paths stored.
std::vector< double > hcalDepthActiveLengthHot_[depthMax_]
std::vector< double > hcalDepthEnergyHotCorr_[depthMax_]
std::vector< double > ptGlob_
std::vector< unsigned int > ehcalDetId_
int ieta() const
get the cell ieta
Abs< T >::type abs(const T &t)
std::vector< double > tight_PixelHits_
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
std::vector< double > hcalEnergy_
std::vector< double > trackerLayer_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< double > outerTrackEta_
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)
double activeLength(const DetId &)
std::vector< bool > globalTrack_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > outerTrackRHits_
std::vector< double > hcal1x1Energy_
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
std::vector< bool > muon_is_good_
int iphi() const
get the cell iphi
std::vector< double > chiGlobal_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB
std::vector< unsigned int > hcalDetId_
std::vector< double > hcalDepthEnergyHot_[depthMax_]
edm::InputTag labelHBHERecHit_
void endRun(edm::Run const &, edm::EventSetup const &) override
std::vector< int > hltresults
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< double > hcalDepthEnergyCorr_[depthMax_]
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::vector< std::string > all_triggers
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< double > globalMuonHits_
std::vector< double > hcalDepthActiveLength_[depthMax_]
std::vector< double > hoEnergy_
int matchId(const HcalDetId &, const HcalDetId &)
edm::InputTag labelEERecHit_
const HcalDDDRecConstants * hdc
std::vector< double > phiGlob_
HLTConfigProvider hltConfig_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > hcalActiveLength_
std::vector< double > chiTracker_
std::vector< double > matchedId_
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
const Point & position() const
position
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< bool > outerTrack_
std::vector< double > muon_segComp
std::vector< double > numPixelLayers_
edm::EDGetTokenT< HBHERecHitCollection > tok_HBHE_
edm::Service< TFileService > fs
T const * product() const
std::vector< double > dxyTracker_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::vector< double > ecal3x3Energy_
edm::InputTag labelEBRecHit_
void setTopo(const HcalTopology *topo)
std::vector< double > tight_TransImpara_
std::vector< double > energyMuon_
std::vector< double > etaGlob_
bool isGoodVertex(const reco::Vertex &vtx)
std::vector< double > outerTrackPhi_
std::vector< double > innerTrackpt_
std::vector< bool > innerTrack_
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)