Implements edm::one::EDAnalyzerBase.
Definition at line 311 of file EopElecTreeWriter.cc.
References funct::abs(), edm::HLTGlobalStatus::accept(), SuperClusterShapeAlgo::Calculate_Covariances(), caloGeomToken_, EopElecVariables::charge, EopElecVariables::chi2, debugTriggerSelection_, reco::deltaR(), HGC3DClusterGenMatchSelector_cfi::dR, EopElecVariables::dRto1stSC, EopElecVariables::dRto2ndSC, DetId::Ecal, EcalBarrel, eopUtils::ecalEta(), pwdgSkimBPark_cfi::electrons, edm::HLTGlobalStatus::error(), PVValHelper::eta, EopElecVariables::eta, PV3DBase< T, PVType, FrameType >::eta(), EopElecVariables::etaIn, EopElecVariables::etaOut, SuperClusterShapeAlgo::etaWidth(), electrons_cff::etaWidth, EopElecVariables::EvtNumber, EopElecVariables::fbrem, electrons_cff::fbrem, filters, filterTracks(), EopTriggerType::fired, edm::EventSetup::getData(), CaloGeometry::getPosition(), CaloGeometry::getSubdetectorGeometry(), h_counter1, h_counter2, h_cut_OneSCmatch, h_cut_Ptmin, h_distToClosestSC, h_distToClosestSCgsf, h_EcalEnergy, h_Eop_InnerNegative, h_Eop_InnerPositive, h_fBREM, h_Momentum, h_nEvents, h_nEvents2Elec, h_nEventsHLTelectron, h_nEventsHLTFilter, h_nEventsHLTrejected, h_nEventsTriggered, h_nEventsWithVertex, h_nHLTelectrons, h_nTracks, h_nTracksFiltered, h_nTrkRejectedPerEvt, h_nTrkSelectedPerEvt, HcalEnergy, EopElecVariables::HcalEnergyIn01, EopElecVariables::HcalEnergyIn02, EopElecVariables::HcalEnergyIn03, EopElecVariables::HcalEnergyIn04, EopElecVariables::HcalEnergyIn05, HcalVSEcal, hltConfig_, mps_fire::i, iEvent, EopTriggerType::index, EopElecVariables::innerOk, MultiTrajectoryStateTransform::innerStateOnSurface(), PixelPluginsPhase0_cfi::isBarrel, EopElecVariables::isEcalDriven, electrons_cff::isEcalDriven, GeomDetEnumerators::isEndcap(), edm::Ref< C, T, F >::isNull(), EopElecVariables::isTrackerDriven, TrajectoryStateOnSurface::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, k_etaBarrel, k_etaEndcap, PV3DBase< T, PVType, FrameType >::mag(), magFieldToken_, EopElecVariables::MaxPtIn01, EopElecVariables::MaxPtIn02, EopElecVariables::MaxPtIn03, EopElecVariables::MaxPtIn04, EopElecVariables::MaxPtIn05, HLTConfigProvider::moduleLabels(), multiTrajectoryStateMode::momentumFromModePPhiEta(), EopElecVariables::nHits, EopElecVariables::nLostHits, EopElecVariables::normalizedChi2, EopElecVariables::NoTrackIn0015, EopElecVariables::NoTrackIn0020, EopElecVariables::NoTrackIn0025, EopElecVariables::NoTrackIn0030, EopElecVariables::NoTrackIn0035, EopElecVariables::NoTrackIn0040, EopElecVariables::outerRadius, MultiTrajectoryStateTransform::outerStateOnSurface(), EopElecVariables::p, EopElecVariables::p_rejected_track, phi, PV3DBase< T, PVType, FrameType >::phi(), EopElecVariables::phi, EopElecVariables::phiIn, EopElecVariables::phiOut, SuperClusterShapeAlgo::phiWidth(), electrons_cff::phiWidth, EopElecVariables::pIn, reco::Vertex::position(), EopElecVariables::pOut, EopTriggerType::prescale, HLTConfigProvider::prescaleSize(), HLTConfigProvider::prescaleValue(), DiDispStaMuonMonitor_cfi::pt, EopElecVariables::pt, EopElecVariables::ptError, EopElecVariables::px, EopElecVariables::px_rejected_track, EopElecVariables::py, EopElecVariables::py_rejected_track, EopElecVariables::pz, EopElecVariables::pz_rejected_track, rho, EopElecVariables::RunNumber, EopElecVariables::SC_algoID, EopElecVariables::SC_energy, EopElecVariables::SC_eta, EopElecVariables::SC_etaWidth, EopElecVariables::SC_isBarrel, EopElecVariables::SC_isEndcap, EopElecVariables::SC_nBasicClus, EopElecVariables::SC_phi, EopElecVariables::SC_phiWidth, fileCollector::seed, AlCaHLTBitMon_QueryRunRegistry::string, EopElecVariables::SumPtIn01, EopElecVariables::SumPtIn02, EopElecVariables::SumPtIn03, EopElecVariables::SumPtIn04, EopElecVariables::SumPtIn05, theBarrelSupClusCollectionToken_, theEcalRecHitCollectionToken_, theEndCapSupClusCollectionToken_, theFilter_, theGsfElectronCoreCollectionToken_, theGsfTrackCollectionToken_, theHBHERecHitCollectionToken_, EopElecVariables::theta, theTrigger_, theTriggerEventToken_, theTriggerResultsToken_, theVertexCollectionToken_, tkGeomToken_, HLT_2024v14_cff::track, DiMuonV_cfg::tracks, tree_, treeMemPtr_, PDWG_DiPhoton_SD_cff::triggerEvent, HLTConfigProvider::triggerIndex(), PDWG_DiPhoton_SD_cff::triggerName, triggerNames_, ewkElecDQM_cfi::TrigTag, bphysicsOniaDQM_cfi::vertex, edm::HLTGlobalStatus::wasrun(), and reco::Vertex::z().
315 Double_t EnergyHcalIn01;
316 Double_t EnergyHcalIn02;
317 Double_t EnergyHcalIn03;
318 Double_t EnergyHcalIn04;
319 Double_t EnergyHcalIn05;
333 Bool_t NoTrackIn0015;
336 Bool_t NoTrackIn0020;
339 Bool_t NoTrackIn0025;
342 Bool_t NoTrackIn0030;
345 Bool_t NoTrackIn0035;
346 Bool_t NoTrackIn0040;
348 Double_t dRSC_second;
354 Bool_t isTrackerDriven;
371 edm::LogError(
"EopElecTreeWriter") <<
"Error: no primary vertex found!";
380 if (subGeo ==
nullptr)
381 edm::LogError(
"EopElecTreeWriter") <<
"ERROR: unable to find SubDetector geometry!!!";
389 edm::LogError(
"EopElecTreeWriter") <<
"ERROR: unable to find the EcalRecHit collection !!!";
406 std::map<std::string, EopTriggerType> HLTpaths;
413 for (
unsigned int ps = 0; ps < prescaleSize; ps++) {
415 if (prescaleValue != 1) {
421 if (myTrigger.
index == -1)
430 for (
const auto&
it : HLTpaths) {
431 if (
it.second.fired) {
433 firstFiredPath =
it.first;
447 for (
unsigned int i = 0;
i <
filters.size();
i++) {
462 std::vector<const trigger::TriggerObject*> HLTelectrons;
463 for (
unsigned int i = 0;
i != KEYS_el.size(); ++
i) {
465 HLTelectrons.push_back(triggerObject_el);
470 if (HLTelectrons.empty())
475 unsigned int HighPtIndex = 0;
476 double maxPtHLT = -5.;
477 for (
unsigned int j = 0;
j < HLTelectrons.size();
j++) {
478 if (HLTelectrons[
j]->
pt() > maxPtHLT) {
479 maxPtHLT = HLTelectrons[
j]->pt();
496 reco::deltaR(
track.eta(),
track.phi(), HLTelectrons[HighPtIndex]->eta(), HLTelectrons[HighPtIndex]->phi());
526 if ((elec.gsfTrack())->
pt() < 10.)
530 DELTAR =
reco::deltaR((elec.superCluster())->
eta(), (elec.superCluster())->
phi(), etaGSF, (elec.gsfTrack())->
phi());
542 isTrackerDriven =
false;
565 if (
track->pt() < 10.)
583 etaOut = outMom.
eta();
584 phiOut = outMom.
phi();
585 fbrem = (pin - pout) / pin;
597 for (
const auto&
hcal : *HcalHits) {
599 double phihit = posH.
phi();
600 double etahit = posH.
eta();
605 EnergyHcalIn01 +=
hcal.energy();
607 EnergyHcalIn02 +=
hcal.energy();
609 EnergyHcalIn03 +=
hcal.energy();
611 EnergyHcalIn04 +=
hcal.energy();
613 EnergyHcalIn05 +=
hcal.energy();
621 NoTrackIn0015 =
true;
624 NoTrackIn0020 =
true;
627 NoTrackIn0025 =
true;
630 NoTrackIn0030 =
true;
633 NoTrackIn0035 =
true;
634 NoTrackIn0040 =
true;
647 etaIn1 = inMom1.
eta();
648 phiIn1 = inMom1.
phi();
651 if (etaIn1 == 0 && phiIn1 == 0)
658 NoTrackIn0015 =
false;
660 NoTrackIn0020 =
false;
662 NoTrackIn0025 =
false;
664 NoTrackIn0030 =
false;
666 NoTrackIn0035 =
false;
668 NoTrackIn0040 =
false;
672 SumPtIn01 += track1->pt();
673 if (track1->pt() > MaxPtIn01) {
674 MaxPtIn01 = track1->pt();
679 SumPtIn02 += track1->pt();
680 if (track1->pt() > MaxPtIn02) {
681 MaxPtIn02 = track1->pt();
685 SumPtIn03 += track1->pt();
686 if (track1->pt() > MaxPtIn03) {
687 MaxPtIn03 = track1->pt();
691 SumPtIn04 += track1->pt();
692 if (track1->pt() > MaxPtIn04) {
693 MaxPtIn04 = track1->pt();
697 SumPtIn05 += track1->pt();
698 if (track1->pt() > MaxPtIn05) {
699 MaxPtIn05 = track1->pt();
707 double etaAtEcal = 0;
712 for (
const auto& SC : *BarrelSupClusCollection) {
713 dRSC =
reco::deltaR(SC.eta(), SC.phi(), etaAtEcal, phiIn);
715 if (dRSC < dRSC_first) {
718 else if (dRSC < dRSC_second) {
724 SCShape.Calculate_Covariances(SC);
731 algo_ID = SC.algoID();
732 EnergyEcal = SC.energy();
733 nBasicClus = SC.clustersSize();
742 for (
const auto& SC : *EndcapSupClusCollection) {
743 dRSC =
reco::deltaR(SC.eta(), SC.phi(), etaAtEcal, phiIn);
745 if (dRSC < dRSC_first) {
748 else if (dRSC < dRSC_second) {
754 SCShape.Calculate_Covariances(SC);
761 algo_ID = SC.algoID();
762 EnergyEcal = SC.energy();
763 nBasicClus = SC.clustersSize();
770 if (dRSC_first < 0.1)
777 if (nbSC > 1 || nbSC == 0)
782 edm::LogError(
"EopElecTreeWriter") <<
"Error: Super Cluster double matching!";
790 if (
track->charge() < 0)
792 if (
track->charge() > 0)
798 edm::LogError(
"GsfElectronCore") <<
"The GsfTrack has no seed ?!";
802 edm::LogError(
"GsfElectronCore") <<
"The GsfTrack seed is not an ElectronSeed ?!";
805 isTrackerDriven = elseed->isTrackerDriven();
bool accept() const
Has at least one path accepted the event?
const edm::EDGetTokenT< reco::SuperClusterCollection > theEndCapSupClusCollectionToken_
TH1D * h_Eop_InnerNegative
TH1D * h_nTrkRejectedPerEvt
TH1D * h_nEventsTriggered
unsigned int prescaleSize() const
bool error() const
Has any path encountered an error (exception)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
The single EDProduct to be saved for each event (AOD case)
double z() const
z coordinate
Double_t px_rejected_track
const edm::EDGetTokenT< HBHERecHitCollection > theHBHERecHitCollectionToken_
TH1D * h_nEventsHLTelectron
std::vector< std::string > triggerNames_
const Point & position() const
position
TH1D * h_nEventsWithVertex
Geom::Phi< T > phi() const
std::vector< Vertex > VertexCollection
collection of Vertex objects
float ecalEta(float EtaParticle, float Zvertex, float RhoVertex)
TH1D * h_nEventsHLTFilter
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
Log< level::Error, false > LogError
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
EopElecVariables * treeMemPtr_
std::vector< TPRegexp > filters
bool wasrun() const
Was at least one path run?
T prescaleValue(unsigned int set, const std::string &trigger) const
HLT prescale value in specific prescale set for a specific trigger path.
const edm::EDGetTokenT< EcalRecHitCollection > theEcalRecHitCollectionToken_
const edm::EDGetTokenT< reco::SuperClusterCollection > theBarrelSupClusCollectionToken_
Single trigger physics object (e.g., an isolated muon)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
const edm::EDGetTokenT< reco::GsfElectronCoreCollection > theGsfElectronCoreCollectionToken_
std::vector< SuperCluster > SuperClusterCollection
collection of SuperCluser objectr
static constexpr float k_etaBarrel
const std::vector< std::string > & moduleLabels(unsigned int trigger) const
label(s) of module(s) on a trigger path
std::vector< GsfElectronCore > GsfElectronCoreCollection
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
const edm::EDGetTokenT< reco::VertexCollection > theVertexCollectionToken_
Abs< T >::type abs(const T &t)
const edm::EDGetTokenT< edm::TriggerResults > theTriggerResultsToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
HLTConfigProvider hltConfig_
Double_t p_rejected_track
bool isNull() const
Checks for null.
bool isEndcap(GeomDetEnumerators::SubDetector m)
TH1D * h_distToClosestSCgsf
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Log< level::Info, false > LogInfo
TH1D * h_Eop_InnerPositive
TH1D * h_nTrkSelectedPerEvt
const edm::EDGetTokenT< trigger::TriggerEvent > theTriggerEventToken_
bool debugTriggerSelection_
std::vector< size_type > Keys
Double_t pz_rejected_track
bool momentumFromModePPhiEta(TrajectoryStateOnSurface const &tsos, GlobalVector &momentum)
static constexpr float k_etaEndcap
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
void filterTracks(edm::Handle< std::vector< reco::Track >> tkH, const edm::Handle< std::vector< reco::Muon >> &muons_h, const StringCutObjectSelector< reco::Track > cutTk_, const float tkEnergyCut_, std::vector< bool > &maskTracks)
const edm::EDGetTokenT< reco::GsfTrackCollection > theGsfTrackCollectionToken_
Double_t py_rejected_track
TH1D * h_nEventsHLTrejected