|
ATLAS Offline Software
|
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 48 of file testEgChargeCorr.cxx.
51 using namespace asg::testEgChargeCorr;
61 " Usage: %s [xAOD file name] [Correction File name]",
66 double SF_chargeID = 0;
69 double n_chargeID = 0;
70 double n_chargeMisID = 0;
77 const TString corrFileName =
argv[2];
88 "Number of events in the file: %i",
91 std::cout <<
"==" << std::endl;
94 Long64_t
entries =
event.getEntries();
96 const Long64_t
e = atoll(
argv[2]);
104 ANA_CHECK(myEgCorrections.setProperty(
"OutputLevel", mylevel));
109 ANA_CHECK(myEgCorrections.setProperty(
"ForceDataType", 1));
111 ANA_CHECK(myEgCorrections.setProperty(
"DefaultRandomRunNumber",
112 (
unsigned int)311481));
113 ANA_CHECK(myEgCorrections.setProperty(
"UseRandomRunNumber",
false));
119 m_LHToolTight->setProperty(
"primaryVertexContainer",
"PrimaryVertices"));
121 ->setProperty(
"ConfigFile",
122 "ElectronPhotonSelectorTools/offline/mc15_20160512/"
123 "ElectronLikelihoodLooseOfflineConfig2016_CutBL_Smooth.conf")
133 std::cout <<
"==" << std::endl;
142 event.getEntry(
entry);
145 std::cout <<
"=================NEXT EVENT=========================="
156 std::pair<xAOD::ElectronContainer*, xAOD::ShallowAuxContainer*>
168 for (; el_it != el_it_last; ++el_it, ++
i) {
171 if (
el->pt() < 20000)
174 bool LHacc{ m_LHToolTight->
accept(
el) };
175 std::cout <<
"acc: " << LHacc << std::endl;
178 double clusAbsEta = std::abs(
el->caloCluster()->etaBE(2));
179 if ( clusAbsEta > 1.37 && (clusAbsEta < 1.52 || clusAbsEta > 2.47) )
186 if (myEgCorrections.getEfficiencyScaleFactor(*
el,
SF) !=
192 if (myEgCorrections.applyEfficiencyScaleFactor(*
el) !=
198 Info(
APP_NAME,
"===>>> Resulting SF (from get function) %f, (from apply function) %f",
201 SF_chargeID = SF_chargeID +
SF;
203 for (
const auto&
sys : recSysts) {
204 double systematic = 0;
207 ANA_CHECK(myEgCorrections.applySystematicVariation({ sys }));
209 if (myEgCorrections.getEfficiencyScaleFactor(*
el, systematic) ==
212 "%f Result %f Systematic value %f ",
218 ANA_CHECK(myEgCorrections.applySystematicVariation({}));
221 int truthcharge =
false;
223 if (
el->charge() * truthcharge < 0) {
232 Info(
APP_NAME,
"===>>> processed #%d electrons", SF_nevents);
233 Info(
APP_NAME,
"===>>> compared to #%f (from Charge MisId SF)", SF_chargeID);
234 Info(
APP_NAME,
"===>>> compared to #%f and #%f ", n_chargeID, n_chargeMisID);
const float SF[NF]
Cross sections for Fluor.
Class to wrap a set of SystematicVariations.
@ kClassAccess
Access auxiliary data using the aux containers.
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
(Non-const) Iterator class for DataVector/DataList.
std::pair< std::unique_ptr< T >, std::unique_ptr< ShallowAuxContainer > > shallowCopyContainer(const T &cont, [[maybe_unused]] const EventContext &ctx)
Function making a shallow copy of a constant container.
CP::CorrectionCode getEleTruthCharge(const xAOD::Electron &ele, int &truthcharge)
Get the charge of the original electron.
Class describing the basic event information.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
@ Ok
The correction was done successfully.
StatusCode retrieve(const T *&obj)
Error
The different types of error that can be flagged in the L1TopoRDO.
Tool for accessing xAOD files outside of Athena.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.