|
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "TLorentzVector.h"
48 #include "GaudiKernel/SystemOfUnits.h"
49 #include "GaudiKernel/PhysicalConstants.h"
61 const T * container{};
62 if (evtStore->contains<
T>(contName)){
64 if(evtStore->retrieve(container,contName).isFailure())
return nullptr;
72 m_region_strings{
"incl",
"barrel",
"eca",
"ecc"},
73 m_triggerChainName(
"NoTriggerSelection")
75 declareProperty(
"tracksName",m_tracksName);
76 declareProperty(
"electronsName",m_electronsName=
"Electrons");
77 declareProperty(
"photonsName",m_photonsName=
"Photons");
78 declareProperty(
"VxPrimContainerName",m_VxPrimContainerName=
"PrimaryVertices");
79 declareProperty(
"emclustersName",m_emclustersName=
"LArClusterEM");
80 declareProperty(
"metName",m_metName=
"MET_Reference_AntiKt4LCTopo");
81 declareProperty(
"METFinalName",m_metRefFinalName=
"FinalClus");
82 declareProperty(
"eoverp_standard_min",m_eoverp_standard_min=0.5);
83 declareProperty(
"eoverp_standard_max",m_eoverp_standard_max=4.0);
84 declareProperty(
"eoverp_tight_min",m_eoverp_tight_min=0.7);
85 declareProperty(
"eoverp_tight_max",m_eoverp_tight_max=1.3);
86 declareProperty(
"CheckRate",m_checkrate=1000);
87 declareProperty(
"triggerChainName",m_triggerChainName);
88 declareProperty(
"rejectSecondCluster",m_rejectSecondCluster =
true);
89 declareProperty(
"electronIDLevel",m_electronIDLevel =
"Tight");
104 ATH_MSG_DEBUG(
"IDPerfMonWenu::Initialize() -- Setting up electron LH tool.");
105 m_LHTool2015=std::make_unique<AsgElectronLikelihoodTool> (
"m_LHTool2015");
111 std::string confDir =
"ElectronPhotonSelectorTools/offline/mc15_20150712/";
113 ATH_MSG_WARNING(
"electronIDLevel is set to empty! No electron ID cuts will be applied.");
117 ATH_MSG_WARNING(
"Unknown electronIDLevel!! (Accepted values: Loose, Medium, Tight)");
123 ATH_MSG_WARNING(
"Failure loading ConfigFile in electron likelihood tool.");
129 ATH_MSG_WARNING(
"Electron likelihood tool initialize() failed! Turning off electron LH cuts!");
132 return StatusCode::SUCCESS;
147 m_Nevents =
new TH1F(
"Nevents",
"Number of events processed", 1, -.5, 0.5);
151 m_Wenu_transmass_sel =
new TH1F(
"Wenu_transmass_sel",
"Transverse mass of the leading em cluster and the met", 90, 0., 180.);
157 m_Wenu_clus_pt =
new TH1F(
"Wenu_cluster_pt",
"Transverse momentum of the leading em cluster",50,0.,100.);
226 for (
int region=0; region!=
Nregions; ++region) {
250 if (region !=
incl)
continue;
252 m_Wenu_eta.push_back(
new TH1F(
"Wenu_eta",
"Eta of Wenu EM-clusters", 15, -3., 3.));
254 m_Wenu_phi.push_back(
new TH1F(
"Wenu_phi",
"Phi of Wenu EM-clusters", 15, -3.15, 3.15));
257 m_Wenu_deta.push_back(
new TH1F(
"Wenu_deta",
"deltaEta(EM-cluster,track) in Wenu events", 50, -0.5, 0.5));
259 m_Wenu_deta_vs_eta.push_back(
new TProfile(
"Wenu_deta_vs_eta",
"deltaEta(EM-cluster,track) vs. eta in Wenu events", 15, -3., 3.));
261 m_Wenu_deta_vs_phi.push_back(
new TProfile(
"Wenu_deta_vs_phi",
"deltaEta(EM-cluster,track) vs. phi in Wenu events", 15, -3.15, 3.15));
265 m_Wenu_absdeta_vs_phi.push_back(
new TProfile(
"Wenu_absdeta_vs_phi",
"Abs(deltaEta(EM-cluster,track)) vs. phi in Wenu events", 15, -3.15, 3.15));
267 m_Wenu_dphi.push_back(
new TH1F(
"Wenu_dphi",
"deltaPhi(EM-cluster,track) in Wenu events", 50, -0.5, 0.5));
269 m_Wenu_dphi_vs_eta.push_back(
new TProfile(
"Wenu_dphi_vs_eta",
"deltaPhi(EM-cluster,track) vs. eta in Wenu events", 15, -3., 3.));
271 m_Wenu_dphi_vs_phi.push_back(
new TProfile(
"Wenu_dphi_vs_phi",
"deltaPhi(EM-cluster,track) vs. phi in Wenu events", 15, -3.15, 3.15));
275 m_Wenu_absdphi_vs_phi.push_back(
new TProfile(
"Wenu_absdphi_vs_phi",
"Abs(deltaPhi(EM-cluster,track)) vs. phi in Wenu events", 15, -3.15, 3.15));
341 m_Wenu_Eop_lt1_gt1.push_back(
new TH1F(
"Wenu_Eop_lt1_gt1",
"E/p below/above 1 for Wenu EM-clusters", 2, 0.5, 1.5));
344 m_Wenu_Eopdiff_vs_p.push_back(
new TProfile(
"Wenu_Eopdiff_vs_p",
"E/p difference (pos-neg) vs p for Wenu EM-clusters", 15, 0., 300.));
348 m_Wenu_Eopdiff_vs_E.push_back(
new TProfile(
"Wenu_Eopdiff_vs_E",
"E/p difference (pos-neg) vs E for Wenu EM-clusters", 15, 0., 300.));
350 m_Wenu_Eopdiff_vs_phi.push_back(
new TProfile(
"Wenu_Eopdiff_vs_phi",
"E/p difference (pos-neg) vs phi for Wenu EM-clusters", 15, -3.15, 3.15));
355 m_Wenu_Eop_lt1_vs_eta.push_back(
new TH1F(
"Wenu_Eop_lt1_vs_eta",
"Eta of Wenu EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3., 3.));
357 m_Wenu_Eop_lt1_vs_phi.push_back(
new TH1F(
"Wenu_Eop_lt1_vs_phi",
"Phi of Wenu EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3.15, 3.15));
359 m_Wenu_Eop_gt1_vs_eta.push_back(
new TH1F(
"Wenu_Eop_gt1_vs_eta",
"Eta of Wenu EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3., 3.));
361 m_Wenu_Eop_gt1_vs_phi.push_back(
new TH1F(
"Wenu_Eop_gt1_vs_phi",
"Phi of Wenu EM-clusters with E/p < 1 (not incl. small E/p)", 15, -3.15, 3.15));
363 m_Wenu_frac_Eop_lt1_vs_eta.push_back(
new TH1F(
"Wenu_frac_Eop_lt1_vs_eta",
"Fraction of Wenu EM-clusters with E/p < 1 (not incl. small E/p) vs Eta", 15, -3., 3.));
365 m_Wenu_frac_Eop_lt1_vs_phi.push_back(
new TH1F(
"Wenu_frac_Eop_lt1_vs_phi",
"Fraction of Wenu EM-clusters with E/p < 1 (not incl. small E/p) vs Phi", 15, -3.15, 3.15));
368 m_Wenu_Eop_05_25.push_back(
new TH1F(
"Wenu_Eop_05_25",
"Number of Wenu events with 0.5 < E/p 2.5", 1, 0., 1.));
370 m_Wenu_Eop_15_25.push_back(
new TH1F(
"Wenu_Eop_15_25",
"Number of Wenu events with 1.5 < E/p 2.5", 1, 0., 1.));
372 m_Wenu_frac_Eop_05_25_15_25.push_back(
new TH1F(
"Wenu_frac_Eop_05_25_15_25",
"Fraction of Wenu EM-clusters with 1.5 < E/p < 2.5 and 0.5 < E/p < 2.5", 1, 0., 1.));
378 return StatusCode::SUCCESS;
382 if (doSumw2)
histo->Sumw2();
384 if (
sc.isFailure() ) {
390 if (
mon.regHist(
histo).isFailure() ) {
396 if (doSumw2)
histo->Sumw2();
397 if (
mon.regHist(
histo).isFailure() ) {
405 const bool firstEvent{
nevents == 1};
407 auto formErrorMessage = [] (
const std::string & contName)->std::string {
408 return std::string(std::string(
"No Collection with name ") + contName + std::string(
" found in StoreGate"));
416 return StatusCode::RECOVERABLE;
421 const std::string & errMsg = formErrorMessage(
m_photonsName);
424 return StatusCode::RECOVERABLE;
432 return StatusCode::RECOVERABLE;
437 const std::string & errMsg = formErrorMessage(
m_tracksName);
440 return StatusCode::RECOVERABLE;
445 const std::string & errMsg = formErrorMessage(
m_metName);
448 return StatusCode::RECOVERABLE;
463 if (LeadingEMcluster) {
464 int leading_eta_region =
etaRegion(LeadingEMcluster->
eta());
468 int selected =
isWenu(LeadingEMcluster, SecondLeadingEMcluster,
met);
475 double cluster_met_transmass =
TransMass(LeadingEMcluster,
MET);
477 double track_met_transmass = 0.;
478 if (track_leading_emcluster ) {
479 track_met_transmass =
TransMass(track_leading_emcluster,
MET);
485 FillHistosPerCluster(LeadingEMcluster, track_leading_emcluster, leading_eta_region, leading_dEta, leading_dPhi);
489 return StatusCode::SUCCESS;
493 h_eff->Divide(h_num,h_denom,1.,1.,
"B");
500 for (
int region=0; region!=1; ++region) {
520 return StatusCode::SUCCESS;
528 if (
cl == omitCluster)
continue;
530 if(
deltaR < 0.005)
continue;
532 if (
cl->pt() > max_pt) {
533 leading_emcluster =
cl;
537 return leading_emcluster;
553 if (
cl == omitCluster)
continue;
555 if (
cl->pt() > max_pt) {
556 leading_emcluster =
cl;
560 return leading_emcluster;
566 double min_dR = 1.0
e+20;
567 for (
const auto track: *tracks) {
568 double deta = cluster->
eta()-
track->eta();
569 double dphi = cluster->
phi()-
track->phi();
570 double dr = std::sqrt(deta*deta + dphi*dphi);
571 if (
dr < min_dR && std::abs(deta) <
dEta && std::abs(dphi) <
dPhi) {
573 matched_track =
track;
576 return matched_track;
581 double min_dEta = 1.0
e+20;
582 for (
const auto track: *tracks) {
583 double deta = std::abs(cluster->
eta()-
track->eta());
584 if (deta < min_dEta && deta <
dEta) {
586 matched_track =
track;
589 double dPhi = 1.0e+20;
596 double min_dPhi = 1.0
e+20;
597 for (
const auto track : *tracks) {
599 if (dphi < min_dPhi && dphi <
dPhi) {
601 matched_track =
track;
604 double dEta = 1.0e+20;
605 if (matched_track !=
nullptr)
dEta = cluster->
eta()-matched_track->
eta();
618 ATH_MSG_DEBUG(
"Event rejected due to second EM cluster w/ pT > 25 GeV");
626 if (
EM1 ==
nullptr ||
EM2 ==
nullptr)
return -99.;
628 if (
EM1->pt() != 0 &&
EM2->pt() != 0.) {
629 TLorentzVector particle1;
630 TLorentzVector particle2;
633 invmass = (particle1+particle2).Mag();
639 if (trk1 ==
nullptr || trk2 ==
nullptr)
return -99.;
641 if (trk1->
pt() != 0 && trk2->
pt() != 0.) {
642 TLorentzVector particle1;
643 TLorentzVector particle2;
646 invmass = (particle1+particle2).Mag();
652 if (
EM ==
nullptr ||
met ==
nullptr)
return -99.;
653 double transmass = 0.;
655 transmass = std::sqrt(2.*
EM->et()*
met->met()*(1.-
std::cos(dphi)));
661 if (
track ==
nullptr ||
met ==
nullptr)
return -99.;
662 double transmass = 0.;
670 if (cluster ==
nullptr ||
track ==
nullptr)
return dr;
671 double deta = cluster->
eta()-
track->eta();
672 double dphi = cluster->
phi()-
track->phi();
673 if(std::abs(dphi) >
M_PI) dphi = 2.*
M_PI-std::abs(dphi);
674 dr = std::sqrt(deta*deta + dphi*dphi);
684 double dphi=phia-phib;
692 if (std::abs(
eta) <= 1.) region =
barrel;
693 else if (
eta > 1.) region =
eca;
694 else if (
eta < -1.) region =
ecc;
700 if (not cluster)
return;
702 throw std::out_of_range(
"Region is negative in IDPerfMonWenu::FillHistosPerCluster");
705 if (region ==
incl) {
709 if (
dEta < 1.0
e+20) {
711 if (std::abs(
dEta) < 0.05) {
718 if (
dPhi < 1.0
e+20) {
720 if (std::abs(
dPhi) < 0.1) {
730 if (
track ==
nullptr)
return;
733 float track_p =
track->pt()*std::cosh(
track->eta());
734 if (track_p != 0.) eoverp = cluster->e()/track_p;
736 if (
track->charge() == 1.) {
739 else if (
track->charge() == -1.) {
742 if (region ==
incl) {
754 if (
track->charge() == 1.) {
763 else if (
track->charge() == -1.) {
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
double deltaR(const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track) const
std::unique_ptr< AsgElectronLikelihoodTool > m_LHTool2015
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
int etaRegion(double eta)
TH1F * m_Wenu_transmass_sel
std::string m_triggerChainName
std::vector< TH1F * > m_Wenu_trackmatched_eta
void makeEffHisto(TH1F *h_num, TH1F *h_denom, TH1F *h_eff)
std::vector< TProfile * > m_Wenu_meanEop_vs_phi_plus
double InvMass(const xAOD::CaloCluster *EM1, const xAOD::CaloCluster *EM2) const
Scalar eta() const
pseudorapidity method
std::vector< TProfile * > m_Wenu_absdeta_vs_phi
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
std::vector< TH1F * > m_Wenu_phi
std::vector< TProfile * > m_Wenu_absdphi_vs_eta
std::vector< TH1F * > m_Wenu_Eop_05_25
std::vector< TProfile * > m_Wenu_meanEop_vs_chargedp
std::vector< TProfile * > m_Wenu_deta_vs_eta
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
const xAOD::TrackParticle * electronTrackMatch(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dEta=0.05, double dPhi=0.1) const
std::vector< TProfile * > m_Wenu_dphi_vs_eta
std::vector< TProfile * > m_Wenu_meanEop_vs_eta
std::vector< TProfile * > m_Wenu_meanEop_vs_phi
std::string m_electronsName
virtual StatusCode initialize()
std::vector< TProfile * > m_Wenu_meanEop_vs_E_plus
std::vector< TH1F * > m_Wenu_trackmatch_eff_vs_phi
std::vector< TH1F * > m_Wenu_tightEopmatch_eff_vs_phi
std::vector< TProfile * > m_Wenu_Eopdiff_vs_E
std::vector< TProfile * > m_Wenu_Eopdiff_vs_invp
std::vector< TProfile * > m_Wenu_meanEop_vs_phi_minus
std::vector< std::string > m_region_strings
std::vector< TH1F * > m_Wenu_trackmatch_eff_vs_eta
std::vector< TProfile * > m_Wenu_meanEop_vs_eta_minus
std::vector< TH1F * > m_Wenu_Eop_gt1_vs_phi
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
std::vector< TH1F * > m_Wenu_Eop_15_25
static Environment_t environment()
Returns the running environment of the monitoring application to help ManagedMonitorToolBase objects ...
double TransMass(const xAOD::CaloCluster *EM, const xAOD::MissingET *met) const
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
std::string m_emclustersName
virtual StatusCode fillHistograms()
An inheriting class should either override this function or fillHists().
Description of a calorimeter cluster.
std::vector< TH1F * > m_Wenu_Eop_gt1_vs_eta
std::string m_VxPrimContainerName
std::vector< TH1F * > m_Wenu_Eop_lt1_vs_eta
std::vector< TH1F * > m_Wenu_dphi
std::vector< TH1F * > m_Wenu_trackmatched_phi
std::vector< TProfile * > m_Wenu_Eopdiff_vs_phi
void FillHistosPerCluster(const xAOD::CaloCluster *cluster, const xAOD::TrackParticle *track, int region, float dEta, float dPhi)
virtual double eta() const
The pseudorapidity ( ) of the particle.
def TProfile(*args, **kwargs)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< TProfile * > m_Wenu_dphi_vs_phi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
std::vector< TProfile * > m_Wenu_meanEop_vs_invp
std::vector< TProfile * > m_Wenu_meanEop_vs_p
std::vector< TH1F * > m_Wenu_deta
std::vector< TH1F * > m_Wenu_Eop
std::vector< TProfile * > m_Wenu_meanEop_vs_p_plus
std::vector< TProfile * > m_Wenu_Eopdiff_vs_p
Principal data object for Missing ET.
double electronTrackMatchPhi(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dPhi=0.1) const
std::string m_photonsName
std::string m_metRefFinalName
IDPerfMonWenu(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
std::vector< TH1F * > m_Wenu_Eop_lt1_gt1
bool m_rejectSecondCluster
std::vector< TProfile * > m_Wenu_absdphi_vs_phi
std::vector< TH1F * > m_Wenu_Eopdiff
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
Container for xAOD::MissingET_v1 objects.
std::vector< TH1F * > m_Wenu_frac_Eop_lt1_vs_phi
std::vector< TH1F * > m_Wenu_trackmatched_Eopmatched_eta
std::vector< TProfile * > m_Wenu_meanEop_vs_E_minus
double m_eoverp_tight_min
virtual double e() const override final
The total energy of the particle.
double signedDeltaPhi(double phi1, double phi2) const
std::vector< TProfile * > m_Wenu_meanEop_vs_invp_plus
std::vector< TProfile * > m_Wenu_meanEop_vs_invp_minus
TH1F * m_Wenu_trk_transmass_sel
std::vector< TH1F * > m_Wenu_eta
std::vector< TH1F * > m_Wenu_trackmatched_tightEopmatched_phi
std::vector< TH1F * > m_Wenu_Eop_lt1_vs_phi
std::vector< TProfile * > m_Wenu_Eopdiff_vs_eta
int isWenu(const xAOD::CaloCluster *em, const xAOD::CaloCluster *em2, double met) const
#define ATH_MSG_WARNING(x)
std::vector< TH1F * > m_Wenu_trackmatched_tightEopmatched_eta
std::vector< TH1F * > m_Wenu_trackmatched_Eopmatched_phi
const xAOD::CaloCluster * getLeadingEMcluster(const xAOD::CaloClusterContainer *clusters, const xAOD::CaloCluster *omitCluster=0) const
std::vector< TProfile * > m_Wenu_meanEop_vs_chargedE
std::vector< TH1F * > m_Wenu_Eopmatch_eff_vs_phi
std::vector< TProfile * > m_Wenu_absdeta_vs_eta
std::vector< TH1F * > m_Wenu_Eop_plus
double m_eoverp_standard_min
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
std::vector< TH1F * > m_Wenu_Eopmatch_eff_vs_eta
Class describing a TrackParticle.
std::vector< TProfile * > m_Wenu_meanEop_vs_eta_plus
std::vector< TProfile * > m_Wenu_deta_vs_phi
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
constexpr int pow(int base, int exp) noexcept
setBGCode setTAP setLVL2ErrorBits bool
std::vector< TProfile * > m_Wenu_meanEop_vs_p_minus
std::vector< TH1F * > m_Wenu_Eop_minus
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
std::vector< TH1F * > m_Wenu_frac_Eop_05_25_15_25
void RegisterHisto(MonGroup &mon, TH1 *histo, bool doSumw2=false)
std::vector< TH1F * > m_Wenu_frac_Eop_lt1_vs_eta
std::vector< TProfile * > m_Wenu_meanEop_vs_E
std::string m_electronIDLevel
double m_eoverp_tight_max
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
TH1F * m_Wenu_trk_transmass_sel_scaled
double electronTrackMatchEta(const xAOD::TrackParticleContainer *tracks, const xAOD::CaloCluster *cluster, double dEta=0.05) const
std::vector< TH1F * > m_Wenu_tightEopmatch_eff_vs_eta