15 #include "TDirectory.h" 18 #include <Math/GenVector/VectorUtil.h> 161 myverbose_(iConfig.getUntrackedParameter<
int>(
"Verbosity",5)),
163 a_mipR_(iConfig.getUntrackedParameter<double>(
"ConeRadiusMIP",14.0)),
164 a_coneR_(iConfig.getUntrackedParameter<double>(
"ConeRadius",34.98)),
165 tMinE_(iConfig.getUntrackedParameter<double>(
"TimeMinCutECAL",-500.)),
166 tMaxE_(iConfig.getUntrackedParameter<double>(
"TimeMaxCutECAL",500.)),
214 <<
"\t a_charIsoR " << a_charIsoR_
217 <<
"\t time Range (" <<
tMinE_ 241 descriptions.
add(
"isolatedTracksHcalScale",desc);
288 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
289 leadPV =
math::XYZPoint( (*recVtxs)[0].
x(),(*recVtxs)[0].
y(), (*recVtxs)[0].
z() );
290 }
else if (beamSpotH.
isValid()) {
300 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
302 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
315 edm::SimTrackContainer::const_iterator simTrkItr;
324 std::unique_ptr<TrackerHitAssociator> associate;
336 for (trkDetItr = trkCaloDirections.begin(),nTracks=0; trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
337 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
339 int nRH_eMipDR=0, nRH_eDR=0, nNearTRKs=0, nRecHitsCone=-99;
340 double distFromHotCell=-99.0, distFromHotCell2=-99.0;
341 int ietaHotCell=-99, iphiHotCell=-99;
342 int ietaHotCell2=-99, iphiHotCell2=-99;
343 GlobalPoint gposHotCell(0.,0.,0.), gposHotCell2(0.,0.,0.);
344 std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
345 std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
347 trkDetItr->pointECAL,
349 nRecHitsCone, coneRecHitDetIds,
350 distFromHotCell, ietaHotCell, iphiHotCell,
353 trkDetItr->pointECAL,
355 nRecHitsCone, coneRecHitDetIds,
356 distFromHotCell, ietaHotCell,
357 iphiHotCell, gposHotCell,
361 trkDetItr->directionHCAL, nRecHitsCone,
362 coneRecHitDetIds2, distFromHotCell2,
363 ietaHotCell2, iphiHotCell2, gposHotCell2,
367 trkDetItr->directionHCAL, nRecHitsCone,
368 coneRecHitDetIds2, distFromHotCell2,
369 ietaHotCell2, iphiHotCell2,
375 endcapRecHitsHandle,trkDetItr->pointHCAL,
377 trkDetItr->directionECAL, nRH_eMipDR);
379 endcapRecHitsHandle,trkDetItr->pointHCAL,
381 trkDetItr->directionECAL, nRH_eDR);
383 endcapRecHitsHandle,trkDetItr->pointHCAL,
385 trkDetItr->directionECAL, nRH_eMipDR,
388 endcapRecHitsHandle,trkDetItr->pointHCAL,
390 trkDetItr->directionECAL, nRH_eDR,
393 endcapRecHitsHandle,trkDetItr->pointHCAL,
395 trkDetItr->directionECAL, nRH_eMipDR,
398 endcapRecHitsHandle,trkDetItr->pointHCAL,
400 trkDetItr->directionECAL, nRH_eDR,
408 e11x11_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),5,5, 0.060, 0.300,
tMinE_,
tMaxE_);
409 e15x15_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),7,7, 0.060, 0.300,
tMinE_,
tMaxE_);
434 << pTrack->
pt() <<
" eta " 435 << pTrack->
momentum().eta() <<
" phi " 437 <<
" ieta/iphi (" << closestCell.
ieta()
438 <<
", " << closestCell.
iphi()
439 <<
") Energy in cone " << hCone
440 <<
" Charge Isolation " << conehmaxNearP
441 <<
" eMIP (" << eMipDR <<
", " << eMipDR_1
442 <<
", " << eMipDR_2 <<
")" 443 <<
" Neutral isolation (ECAL) (" 444 << eECALDR-eMipDR <<
", " 445 << eECALDR_1-eMipDR_1 <<
", " 446 << eECALDR_2-eMipDR_2 <<
") (ECAL NxN) " 447 << e15x15_20SigP.first-e11x11_20SigP.first
448 <<
" (HCAL) " << eHCALDR-hCone;
454 std::map<std::string, double> hsimInfo;
455 std::vector<int> multiplicity;
458 trkDetItr->directionHCAL, nSimHits);
459 hsimInfo = spr::eHCALSimInfoCone(iEvent, pcalohh, SimTk, SimVtx,
460 pTrack, *associate, geo,
461 trkDetItr->pointHCAL,
463 trkDetItr->directionHCAL,
481 t_hsim ->push_back(hsim );
486 <<
" (N) " << multiplicity.at(0)
487 <<
" Rest (E) " << hsimInfo[
"eRest"]
488 <<
" (N) " << multiplicity.at(1)
489 <<
" Gamma (E) " << hsimInfo[
"eGamma"]
490 <<
" (N) " << multiplicity.at(2)
491 <<
" Neutral Had (E) " 492 << hsimInfo[
"eNeutralHad"] <<
" (N) " 493 << multiplicity.at(3)
494 <<
" Charged Had (E) " 495 << hsimInfo[
"eChargedHad"] <<
" (N) " 496 << multiplicity.at(4) <<
" Total (E) " 497 << hsimInfo[
"eTotal"] <<
" (N) " 498 << multiplicity.at(5) <<
" PDG " 499 << hsimInfo[
"pdgMatched"] <<
" Total E " 500 << hsim <<
" NHit " << nSimHits;
516 tree_->SetAutoSave(10000);
522 t_trackP =
new std::vector<double>();
528 t_hCone =
new std::vector<double>();
530 t_eMipDR =
new std::vector<double>();
543 tree_->Branch(
"t_trackPt",
"std::vector<double>", &t_trackPt);
544 tree_->Branch(
"t_trackEta",
"std::vector<double>", &t_trackEta);
545 tree_->Branch(
"t_trackPhi",
"std::vector<double>", &t_trackPhi);
546 tree_->Branch(
"t_trackHcalEta",
"std::vector<double>", &t_trackHcalEta);
547 tree_->Branch(
"t_trackHcalPhi",
"std::vector<double>", &t_trackHcalPhi);
548 tree_->Branch(
"t_hCone",
"std::vector<double>", &t_hCone);
549 tree_->Branch(
"t_conehmaxNearP",
"std::vector<double>", &t_conehmaxNearP);
550 tree_->Branch(
"t_eMipDR",
"std::vector<double>", &t_eMipDR);
551 tree_->Branch(
"t_eECALDR",
"std::vector<double>", &t_eECALDR);
552 tree_->Branch(
"t_eHCALDR",
"std::vector<double>", &t_eHCALDR);
553 tree_->Branch(
"t_e11x11_20Sig",
"std::vector<double>", &t_e11x11_20Sig);
554 tree_->Branch(
"t_e15x15_20Sig",
"std::vector<double>", &t_e15x15_20Sig);
555 tree_->Branch(
"t_eMipDR_1",
"std::vector<double>", &t_eMipDR_1);
556 tree_->Branch(
"t_eECALDR_1",
"std::vector<double>", &t_eECALDR_1);
557 tree_->Branch(
"t_eMipDR_2",
"std::vector<double>", &t_eMipDR_2);
558 tree_->Branch(
"t_eECALDR_2",
"std::vector<double>", &t_eECALDR_2);
559 tree_->Branch(
"t_hConeHB",
"std::vector<double>", &t_hConeHB);
560 tree_->Branch(
"t_eHCALDRHB",
"std::vector<double>", &t_eHCALDRHB);
576 t_hsim =
new std::vector<double>();
580 tree_->Branch(
"t_hsimInfoRest",
"std::vector<double>", &t_hsimInfoRest);
581 tree_->Branch(
"t_hsimInfoPhoton",
"std::vector<double>", &t_hsimInfoPhoton);
582 tree_->Branch(
"t_hsimInfoNeutHad",
"std::vector<double>", &t_hsimInfoNeutHad);
583 tree_->Branch(
"t_hsimInfoCharHad",
"std::vector<double>", &t_hsimInfoCharHad);
584 tree_->Branch(
"t_hsimInfoPdgMatched",
"std::vector<double>", &t_hsimInfoPdgMatched);
585 tree_->Branch(
"t_hsimInfoTotal",
"std::vector<double>", &t_hsimInfoTotal);
586 tree_->Branch(
"t_hsimInfoNMatched",
"std::vector<int>", &t_hsimInfoNMatched);
587 tree_->Branch(
"t_hsimInfoNTotal",
"std::vector<int>", &t_hsimInfoNTotal);
588 tree_->Branch(
"t_hsimInfoNNeutHad",
"std::vector<int>", &t_hsimInfoNNeutHad);
589 tree_->Branch(
"t_hsimInfoNCharHad",
"std::vector<int>", &t_hsimInfoNCharHad);
590 tree_->Branch(
"t_hsimInfoNPhoton",
"std::vector<int>", &t_hsimInfoNPhoton);
591 tree_->Branch(
"t_hsimInfoNRest",
"std::vector<int>", &t_hsimInfoNRest);
592 tree_->Branch(
"t_hsim",
"std::vector<double>", &t_hsim);
593 tree_->Branch(
"t_nSimHits",
"std::vector<int>", &t_nSimHits);
static const std::string kSharedResource
double p() const
momentum vector magnitude
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)
std::vector< double > * t_hsimInfoMatched
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > * t_eHCALDR
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
const unsigned int nTracks(const reco::Vertex &sv)
std::vector< int > * t_hsimInfoNRest
std::vector< double > * t_hCone
std::string theTrackQuality_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
IsolatedTracksHcalScale(const edm::ParameterSet &)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< int > * t_hsimInfoNMatched
TrackQuality
track quality
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< double > * t_hsim
int bunchCrossing() const
std::vector< double > * t_hsimInfoNeutHad
edm::LuminosityBlockNumber_t luminosityBlock() const
T * make(const Args &...args) const
make new ROOT object
std::vector< double > * t_eMipDR_2
std::vector< int > * t_hsimInfoNPhoton
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
const Vector & momentum() const
track momentum vector
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
spr::trackSelectionParameters selectionParameters_
double pt() const
track transverse momentum
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< double > * t_trackEta
int ieta() const
get the cell ieta
std::vector< double > * t_eECALDR_2
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< double > * t_eECALDR
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)
std::vector< double > * t_eMipDR_1
int iphi() const
get the cell iphi
std::vector< double > * t_trackPt
static TrackQuality qualityByName(const std::string &name)
T const * product() const
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
std::vector< double > * t_eECALDR_1
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< double > * t_trackHcalPhi
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_hsimInfoCharHad
reco::TrackBase::TrackQuality minQuality
~IsolatedTracksHcalScale() override
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
std::vector< double > * t_trackPhi
const Point & position() const
position
std::vector< double > * t_eHCALDRHB
std::vector< double > * t_hsimInfoPdgMatched
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
T const * product() const
std::vector< int > * t_nSimHits
std::vector< double > * t_hConeHB
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
std::vector< double > * t_eMipDR
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)