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;
323 std::unique_ptr<TrackerHitAssociator> associate;
335 for (trkDetItr = trkCaloDirections.begin(),nTracks=0; trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
336 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
338 int nRH_eMipDR=0, nRH_eDR=0, nNearTRKs=0, nRecHitsCone=-99;
339 double distFromHotCell=-99.0, distFromHotCell2=-99.0;
340 int ietaHotCell=-99, iphiHotCell=-99;
341 int ietaHotCell2=-99, iphiHotCell2=-99;
342 GlobalPoint gposHotCell(0.,0.,0.), gposHotCell2(0.,0.,0.);
343 std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
344 std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
346 trkDetItr->pointECAL,
348 nRecHitsCone, coneRecHitDetIds,
349 distFromHotCell, ietaHotCell, iphiHotCell,
352 trkDetItr->pointECAL,
354 nRecHitsCone, coneRecHitDetIds,
355 distFromHotCell, ietaHotCell,
356 iphiHotCell, gposHotCell,
360 trkDetItr->directionHCAL, nRecHitsCone,
361 coneRecHitDetIds2, distFromHotCell2,
362 ietaHotCell2, iphiHotCell2, gposHotCell2,
366 trkDetItr->directionHCAL, nRecHitsCone,
367 coneRecHitDetIds2, distFromHotCell2,
368 ietaHotCell2, iphiHotCell2,
374 endcapRecHitsHandle,trkDetItr->pointHCAL,
376 trkDetItr->directionECAL, nRH_eMipDR);
378 endcapRecHitsHandle,trkDetItr->pointHCAL,
380 trkDetItr->directionECAL, nRH_eDR);
382 endcapRecHitsHandle,trkDetItr->pointHCAL,
384 trkDetItr->directionECAL, nRH_eMipDR,
387 endcapRecHitsHandle,trkDetItr->pointHCAL,
389 trkDetItr->directionECAL, nRH_eDR,
392 endcapRecHitsHandle,trkDetItr->pointHCAL,
394 trkDetItr->directionECAL, nRH_eMipDR,
397 endcapRecHitsHandle,trkDetItr->pointHCAL,
399 trkDetItr->directionECAL, nRH_eDR,
407 e11x11_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),5,5, 0.060, 0.300,
tMinE_,
tMaxE_);
408 e15x15_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),7,7, 0.060, 0.300,
tMinE_,
tMaxE_);
433 << pTrack->
pt() <<
" eta " 434 << pTrack->
momentum().eta() <<
" phi " 436 <<
" ieta/iphi (" << closestCell.
ieta()
437 <<
", " << closestCell.
iphi()
438 <<
") Energy in cone " << hCone
439 <<
" Charge Isolation " << conehmaxNearP
440 <<
" eMIP (" << eMipDR <<
", " << eMipDR_1
441 <<
", " << eMipDR_2 <<
")" 442 <<
" Neutral isolation (ECAL) (" 443 << eECALDR-eMipDR <<
", " 444 << eECALDR_1-eMipDR_1 <<
", " 445 << eECALDR_2-eMipDR_2 <<
") (ECAL NxN) " 446 << e15x15_20SigP.first-e11x11_20SigP.first
447 <<
" (HCAL) " << eHCALDR-hCone;
453 std::map<std::string, double> hsimInfo;
454 std::vector<int> multiplicity;
457 trkDetItr->directionHCAL, nSimHits);
458 hsimInfo = spr::eHCALSimInfoCone(iEvent, pcalohh, SimTk, SimVtx,
459 pTrack, *associate, geo,
460 trkDetItr->pointHCAL,
462 trkDetItr->directionHCAL,
480 t_hsim ->push_back(hsim );
485 <<
" (N) " << multiplicity.at(0)
486 <<
" Rest (E) " << hsimInfo[
"eRest"]
487 <<
" (N) " << multiplicity.at(1)
488 <<
" Gamma (E) " << hsimInfo[
"eGamma"]
489 <<
" (N) " << multiplicity.at(2)
490 <<
" Neutral Had (E) " 491 << hsimInfo[
"eNeutralHad"] <<
" (N) " 492 << multiplicity.at(3)
493 <<
" Charged Had (E) " 494 << hsimInfo[
"eChargedHad"] <<
" (N) " 495 << multiplicity.at(4) <<
" Total (E) " 496 << hsimInfo[
"eTotal"] <<
" (N) " 497 << multiplicity.at(5) <<
" PDG " 498 << hsimInfo[
"pdgMatched"] <<
" Total E " 499 << hsim <<
" NHit " << nSimHits;
515 tree_->SetAutoSave(10000);
521 t_trackP =
new std::vector<double>();
527 t_hCone =
new std::vector<double>();
529 t_eMipDR =
new std::vector<double>();
542 tree_->Branch(
"t_trackPt",
"std::vector<double>", &t_trackPt);
543 tree_->Branch(
"t_trackEta",
"std::vector<double>", &t_trackEta);
544 tree_->Branch(
"t_trackPhi",
"std::vector<double>", &t_trackPhi);
545 tree_->Branch(
"t_trackHcalEta",
"std::vector<double>", &t_trackHcalEta);
546 tree_->Branch(
"t_trackHcalPhi",
"std::vector<double>", &t_trackHcalPhi);
547 tree_->Branch(
"t_hCone",
"std::vector<double>", &t_hCone);
548 tree_->Branch(
"t_conehmaxNearP",
"std::vector<double>", &t_conehmaxNearP);
549 tree_->Branch(
"t_eMipDR",
"std::vector<double>", &t_eMipDR);
550 tree_->Branch(
"t_eECALDR",
"std::vector<double>", &t_eECALDR);
551 tree_->Branch(
"t_eHCALDR",
"std::vector<double>", &t_eHCALDR);
552 tree_->Branch(
"t_e11x11_20Sig",
"std::vector<double>", &t_e11x11_20Sig);
553 tree_->Branch(
"t_e15x15_20Sig",
"std::vector<double>", &t_e15x15_20Sig);
554 tree_->Branch(
"t_eMipDR_1",
"std::vector<double>", &t_eMipDR_1);
555 tree_->Branch(
"t_eECALDR_1",
"std::vector<double>", &t_eECALDR_1);
556 tree_->Branch(
"t_eMipDR_2",
"std::vector<double>", &t_eMipDR_2);
557 tree_->Branch(
"t_eECALDR_2",
"std::vector<double>", &t_eECALDR_2);
558 tree_->Branch(
"t_hConeHB",
"std::vector<double>", &t_hConeHB);
559 tree_->Branch(
"t_eHCALDRHB",
"std::vector<double>", &t_eHCALDRHB);
575 t_hsim =
new std::vector<double>();
579 tree_->Branch(
"t_hsimInfoRest",
"std::vector<double>", &t_hsimInfoRest);
580 tree_->Branch(
"t_hsimInfoPhoton",
"std::vector<double>", &t_hsimInfoPhoton);
581 tree_->Branch(
"t_hsimInfoNeutHad",
"std::vector<double>", &t_hsimInfoNeutHad);
582 tree_->Branch(
"t_hsimInfoCharHad",
"std::vector<double>", &t_hsimInfoCharHad);
583 tree_->Branch(
"t_hsimInfoPdgMatched",
"std::vector<double>", &t_hsimInfoPdgMatched);
584 tree_->Branch(
"t_hsimInfoTotal",
"std::vector<double>", &t_hsimInfoTotal);
585 tree_->Branch(
"t_hsimInfoNMatched",
"std::vector<int>", &t_hsimInfoNMatched);
586 tree_->Branch(
"t_hsimInfoNTotal",
"std::vector<int>", &t_hsimInfoNTotal);
587 tree_->Branch(
"t_hsimInfoNNeutHad",
"std::vector<int>", &t_hsimInfoNNeutHad);
588 tree_->Branch(
"t_hsimInfoNCharHad",
"std::vector<int>", &t_hsimInfoNCharHad);
589 tree_->Branch(
"t_hsimInfoNPhoton",
"std::vector<int>", &t_hsimInfoNPhoton);
590 tree_->Branch(
"t_hsimInfoNRest",
"std::vector<int>", &t_hsimInfoNRest);
591 tree_->Branch(
"t_hsim",
"std::vector<double>", &t_hsim);
592 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)