|
|
Go to the documentation of this file.
16 #include "TDirectory.h"
19 #include <Math/GenVector/VectorUtil.h>
163 : doMC_(iConfig.getUntrackedParameter<
bool>(
"DoMC",
false)),
164 myverbose_(iConfig.getUntrackedParameter<
int>(
"Verbosity", 5)),
165 theTrackQuality_(iConfig.getUntrackedParameter<
std::
string>(
"TrackQuality",
"highPurity")),
166 a_mipR_(iConfig.getUntrackedParameter<double>(
"ConeRadiusMIP", 14.0)),
167 a_coneR_(iConfig.getUntrackedParameter<double>(
"ConeRadius", 34.98)),
168 tMinE_(iConfig.getUntrackedParameter<double>(
"TimeMinCutECAL", -500.)),
169 tMaxE_(iConfig.getUntrackedParameter<double>(
"TimeMaxCutECAL", 500.)),
170 trackerHitAssociatorConfig_(consumesCollector()) {
216 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
218 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
220 tok_sevlv_ = esConsumes<EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd>();
225 desc.addUntracked<
bool>(
"doMC",
false);
226 desc.addUntracked<
int>(
"Verbosity", 0);
228 desc.addUntracked<
double>(
"MinTrackPt", 10.0);
229 desc.addUntracked<
double>(
"MaxDxyPV", 0.02);
230 desc.addUntracked<
double>(
"MaxDzPV", 0.02);
231 desc.addUntracked<
double>(
"MaxChi2", 5.0);
232 desc.addUntracked<
double>(
"MaxDpOverP", 0.1);
233 desc.addUntracked<
int>(
"MinOuterHit", 4);
234 desc.addUntracked<
int>(
"MinLayerCrossed", 8);
235 desc.addUntracked<
int>(
"MaxInMiss", 0);
236 desc.addUntracked<
int>(
"MaxOutMiss", 0);
237 desc.addUntracked<
double>(
"ConeRadius", 34.98);
238 desc.addUntracked<
double>(
"ConeRadiusMIP", 14.0);
239 desc.addUntracked<
double>(
"TimeMinCutECAL", -500.0);
240 desc.addUntracked<
double>(
"TimeMaxCutECAL", 500.0);
241 descriptions.
add(
"isolatedTracksHcalScale",
desc);
274 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
275 leadPV =
math::XYZPoint((*recVtxs)[0].
x(), (*recVtxs)[0].
y(), (*recVtxs)[0].
z());
276 }
else if (beamSpotH.
isValid()) {
286 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
288 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
309 std::unique_ptr<TrackerHitAssociator> associate;
321 for (trkDetItr = trkCaloDirections.begin(),
nTracks = 0; trkDetItr != trkCaloDirections.end();
323 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
326 int nRH_eMipDR = 0, nRH_eDR = 0, nNearTRKs = 0, nRecHitsCone = -99;
327 double distFromHotCell = -99.0, distFromHotCell2 = -99.0;
328 int ietaHotCell = -99, iphiHotCell = -99;
329 int ietaHotCell2 = -99, iphiHotCell2 = -99;
330 GlobalPoint gposHotCell(0., 0., 0.), gposHotCell2(0., 0., 0.);
331 std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
332 std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
335 trkDetItr->pointHCAL,
336 trkDetItr->pointECAL,
338 trkDetItr->directionHCAL,
348 trkDetItr->pointHCAL,
349 trkDetItr->pointECAL,
351 trkDetItr->directionHCAL,
361 trkDetItr->pointHCAL,
362 trkDetItr->pointECAL,
364 trkDetItr->directionHCAL,
374 trkDetItr->pointHCAL,
375 trkDetItr->pointECAL,
377 trkDetItr->directionHCAL,
386 double conehmaxNearP =
392 trkDetItr->pointHCAL,
393 trkDetItr->pointECAL,
395 trkDetItr->directionECAL,
400 trkDetItr->pointHCAL,
401 trkDetItr->pointECAL,
403 trkDetItr->directionECAL,
408 trkDetItr->pointHCAL,
409 trkDetItr->pointECAL,
411 trkDetItr->directionECAL,
418 trkDetItr->pointHCAL,
419 trkDetItr->pointECAL,
421 trkDetItr->directionECAL,
428 trkDetItr->pointHCAL,
429 trkDetItr->pointECAL,
431 trkDetItr->directionECAL,
438 trkDetItr->pointHCAL,
439 trkDetItr->pointECAL,
441 trkDetItr->directionECAL,
497 edm::LogVerbatim(
"IsoTrack") <<
"Track p " << pTrack->
p() <<
" pt " << pTrack->
pt() <<
" eta "
499 <<
" ieta/iphi (" << closestCell.
ieta() <<
", " << closestCell.
iphi()
500 <<
") Energy in cone " << hCone <<
" Charge Isolation " << conehmaxNearP
501 <<
" eMIP (" << eMipDR <<
", " << eMipDR_1 <<
", " << eMipDR_2 <<
")"
502 <<
" Neutral isolation (ECAL) (" << eECALDR - eMipDR <<
", "
503 << eECALDR_1 - eMipDR_1 <<
", " << eECALDR_2 - eMipDR_2 <<
") (ECAL NxN) "
504 << e15x15_20SigP.first - e11x11_20SigP.first <<
" (HCAL) " << eHCALDR - hCone;
510 std::map<std::string, double> hsimInfo;
511 std::vector<int> multiplicity;
513 geo, pcalohh, trkDetItr->pointHCAL, trkDetItr->pointECAL,
a_coneR_, trkDetItr->directionHCAL, nSimHits);
514 hsimInfo = spr::eHCALSimInfoCone(
iEvent,
521 trkDetItr->pointHCAL,
522 trkDetItr->pointECAL,
524 trkDetItr->directionHCAL,
546 edm::LogVerbatim(
"IsoTrack") <<
"Matched (E) " << hsimInfo[
"eMatched"] <<
" (N) " << multiplicity.at(0)
547 <<
" Rest (E) " << hsimInfo[
"eRest"] <<
" (N) " << multiplicity.at(1)
548 <<
" Gamma (E) " << hsimInfo[
"eGamma"] <<
" (N) " << multiplicity.at(2)
549 <<
" Neutral Had (E) " << hsimInfo[
"eNeutralHad"] <<
" (N) "
550 << multiplicity.at(3) <<
" Charged Had (E) " << hsimInfo[
"eChargedHad"]
551 <<
" (N) " << multiplicity.at(4) <<
" Total (E) " << hsimInfo[
"eTotal"]
552 <<
" (N) " << multiplicity.at(5) <<
" PDG " << hsimInfo[
"pdgMatched"]
553 <<
" Total E " << hsim <<
" NHit " << nSimHits;
568 tree_->SetAutoSave(10000);
574 t_trackP =
new std::vector<double>();
580 t_hCone =
new std::vector<double>();
582 t_eMipDR =
new std::vector<double>();
600 tree_->Branch(
"t_hCone",
"std::vector<double>", &
t_hCone);
628 t_hsim =
new std::vector<double>();
644 tree_->Branch(
"t_hsim",
"std::vector<double>", &
t_hsim);
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
std::vector< double > * t_hConeHB
std::vector< int > * t_hsimInfoNPhoton
constexpr int iphi() const
get the cell iphi
double p() const
momentum vector magnitude
std::vector< double > * t_hsimInfoTotal
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
std::string theTrackQuality_
std::vector< double > * t_hsim
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNMatched
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
TrackQuality
track quality
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
T getUntrackedParameter(std::string const &, T const &) const
edm::ESGetToken< EcalChannelStatus, EcalChannelStatusRcd > tok_ecalChStatus_
std::vector< int > * t_hsimInfoNNeutHad
std::vector< double > * t_eMipDR_2
std::vector< double > * t_hCone
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
double pt() const
track transverse momentum
std::vector< double > * t_trackEta
#define DEFINE_FWK_MODULE(type)
std::vector< double > * t_hsimInfoNeutHad
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)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TrackerHitAssociator::Config trackerHitAssociatorConfig_
std::vector< double > * t_trackPt
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
IsolatedTracksHcalScale(const edm::ParameterSet &)
const Point & position() const
position
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
std::vector< int > * t_hsimInfoNCharHad
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< double > * t_trackP
constexpr int ieta() const
get the cell ieta
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< double > * t_hsimInfoCharHad
~IsolatedTracksHcalScale() override
std::vector< double > * t_eMipDR_1
std::vector< double > * t_conehmaxNearP
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, int useRaw=0, bool debug=false)
spr::trackSelectionParameters selectionParameters_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
std::vector< double > * t_eECALDR_1
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_eECALDR_2
std::vector< double > * t_eHCALDR
reco::TrackBase::TrackQuality minQuality
std::vector< double > * t_eECALDR
std::vector< double > * t_e11x11_20Sig
bool getData(T &iHolder) const
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hsimInfoPdgMatched
edm::ESGetToken< EcalSeverityLevelAlgo, EcalSeverityLevelAlgoRcd > tok_sevlv_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
static TrackQuality qualityByName(const std::string &name)
std::vector< double > * t_eMipDR
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
Log< level::Info, true > LogVerbatim
edm::ESGetToken< CaloTopology, CaloTopologyRecord > tok_caloTopology_
static const std::string kSharedResource
std::vector< double > * t_eHCALDRHB
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_trackHcalEta
std::vector< int > * t_nSimHits
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
std::vector< double > * t_hsimInfoRest
const Vector & momentum() const
track momentum vector
std::vector< double > * t_hsimInfoPhoton
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< double > * t_hsimInfoMatched
T * make(const Args &... args) const
make new ROOT object
std::vector< double > * t_trackPhi