Skip to content

Commit

Permalink
Code check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Sep 12, 2021
1 parent 986a9ec commit 80e17e4
Show file tree
Hide file tree
Showing 5 changed files with 3,634 additions and 3,287 deletions.
17 changes: 12 additions & 5 deletions Calibration/HcalAlCaRecoProducers/plugins/AlCaHBHEMuonFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,11 @@ AlCaHBHEMuonFilter::AlCaHBHEMuonFilter(edm::ParameterSet const& iConfig, const A
tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();

edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \nProcess " << processName_ << " Prescale " << preScale_ << " Isolation Cuts " << pfCut_ << ":" << pfIsoCut_ << ":" << trackIsoCut_ << ":" << caloIsoCut_ << " OnlyOuterTrack " << onlyOuterTrack_ << "\nInput tags " << labelMuon_ << " and " << triggerResults_ << "\nStudy " << trigNames_.size() << " triggers: ";
edm::LogVerbatim("HBHEMuon") << "Parameters read from config file \nProcess " << processName_ << " Prescale "
<< preScale_ << " Isolation Cuts " << pfCut_ << ":" << pfIsoCut_ << ":" << trackIsoCut_
<< ":" << caloIsoCut_ << " OnlyOuterTrack " << onlyOuterTrack_ << "\nInput tags "
<< labelMuon_ << " and " << triggerResults_ << "\nStudy " << trigNames_.size()
<< " triggers: ";
for (unsigned int k = 0; k < trigNames_.size(); ++k)
edm::LogVerbatim("HBHEMuon") << "Trigger[" << k << "] " << trigNames_[k] << "\n";
} // AlCaHBHEMuonFilter::AlCaHBHEMuonFilter constructor
Expand Down Expand Up @@ -184,8 +188,10 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu
<< RecMuon->outerTrack().isNonnull() << " globalTrack "
<< RecMuon->globalTrack().isNonnull() << std::endl;
#endif
bool check = (onlyOuterTrack_) ? (RecMuon->outerTrack().isNonnull()) : ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) && (RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull()));
if (check) {
bool check = (onlyOuterTrack_) ? (RecMuon->outerTrack().isNonnull())
: ((RecMuon->track().isNonnull()) && (RecMuon->innerTrack().isNonnull()) &&
(RecMuon->outerTrack().isNonnull()) && (RecMuon->globalTrack().isNonnull()));
if (check) {
const reco::Track* pTrack = (onlyOuterTrack_) ? (RecMuon->outerTrack()).get() : (RecMuon->innerTrack()).get();
spr::propagatedTrackID trackID = spr::propagateCALO(pTrack, geo, bField, false);
#ifdef EDM_ML_DEBUG
Expand All @@ -202,9 +208,10 @@ bool AlCaHBHEMuonFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSetu
RecMuon->pt());
bool isoCut = (pfCut_) ? (isolR04 < pfIsoCut_) : ((trackIso < trackIsoCut_) && (caloIso < caloIsoCut_));
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Isolation: " << trackIso << ":" << caloIso << ":" << isolR04 << " --> " << isoCut;
edm::LogVerbatim("HBHEMuon") << "AlCaHBHEMuonFilter::Isolation: " << trackIso << ":" << caloIso << ":"
<< isolR04 << " --> " << isoCut;
#endif
if ((trackID.okECAL) && (trackID.okHCAL) && isoCut) {
if ((trackID.okECAL) && (trackID.okHCAL) && isoCut) {
accept = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet
foundCollections = false;
}
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: foundCollections: " << foundCollections;
edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: foundCollections: " << foundCollections;
#endif

//Step3 propagate the tracks to calorimeter surface and find
Expand All @@ -332,7 +332,8 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet

std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: Has " << trkCaloDirections.size() << " propagated tracks from a total of " << trkCollection->size();
edm::LogVerbatim("HcalIsoTrack") << "AlCaIsoTracksFilter:: Has " << trkCaloDirections.size()
<< " propagated tracks from a total of " << trkCollection->size();
#endif
unsigned int nTracks(0), nselTracks(0), ntrin(0), ntrout(0), ntrH(0);
for (trkDetItr = trkCaloDirections.begin(), nTracks = 0; trkDetItr != trkCaloDirections.end();
Expand All @@ -341,7 +342,8 @@ bool AlCaIsoTracksFilter::filter(edm::Event& iEvent, edm::EventSetup const& iSet
math::XYZTLorentzVector v4(pTrack->px(), pTrack->py(), pTrack->pz(), pTrack->p());
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HcalIsoTrack") << "This track : " << nTracks << " (pt|eta|phi|p) :" << pTrack->pt() << "|"
<< pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p() << " OK HCAL " << trkDetItr->okHCAL;
<< pTrack->eta() << "|" << pTrack->phi() << "|" << pTrack->p() << " OK HCAL "
<< trkDetItr->okHCAL;
#endif
//Selection of good track
int ieta(0);
Expand Down

0 comments on commit 80e17e4

Please sign in to comment.