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();
492 std::vector<const reco::GsfTrack*> filterTracks;
496 reco::deltaR(
track.eta(),
track.phi(), HLTelectrons[HighPtIndex]->eta(), HLTelectrons[HighPtIndex]->phi());
506 filterTracks.push_back(&
track);
517 if (filterTracks.empty())
526 if ((elec.gsfTrack())->
pt() < 10.)
530 DELTAR =
reco::deltaR((elec.superCluster())->
eta(), (elec.superCluster())->
phi(), etaGSF, (elec.gsfTrack())->
phi());
539 for (
const auto&
track : filterTracks) {
541 isEcalDriven =
false;
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;
636 for (
const auto& track1 : filterTracks) {
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 ?!";
804 isEcalDriven = elseed->isEcalDriven();
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
const edm::EDGetTokenT< reco::GsfTrackCollection > theGsfTrackCollectionToken_
Double_t py_rejected_track
TH1D * h_nEventsHLTrejected