|
ATLAS Offline Software
|
Go to the documentation of this file.
42 TString
fileName =
"/eos/atlas/atlascerngroupdisk/perf-jets/ReferenceFiles/mc16_13TeV.361028.Pythia8EvtGen_A14NNPDF23LO_jetjet_JZ8W.deriv.DAOD_FTAG1.e3569_s3126_r9364_r9315_p3260/DAOD_FTAG1.12133096._000074.pool.root.1";
48 Info(
APP_NAME,
"==============================================" );
52 Info(
APP_NAME,
" $> %s -n X | X = number of events you want to run on",
APP_NAME );
53 Info(
APP_NAME,
" $> %s -e X | X = specific number of the event to run on - for debugging",
APP_NAME );
55 Info(
APP_NAME,
"==============================================" );
59 Info(
APP_NAME,
"No arguments - using default file" );
71 if(
options.find(
"-f")!=std::string::npos){
72 for(
int ipos=0; ipos<
argc ; ipos++ ) {
73 if(std::string(
argv[ipos]).compare(
"-f")==0){
81 if(
options.find(
"-event")!=std::string::npos){
82 for(
int ipos=0; ipos<
argc ; ipos++ ) {
85 Info(
APP_NAME,
"Argument (-event) : Running only on event # %i", ievent );
91 if(
options.find(
"-n")!=std::string::npos){
92 for(
int ipos=0; ipos<
argc ; ipos++ ) {
101 if(
options.find(
"-v")!=std::string::npos){
103 Info(
APP_NAME,
"Argument (-v) : Setting verbose");
112 StatusCode::enableFailure();
115 std::unique_ptr<TFile>
ifile( TFile::Open(
fileName,
"READ" ) );
131 Long64_t
entries =
event.getEntries();
134 std::unique_ptr<TFile>
outputFile(TFile::Open(
"output_JetQGTaggerBDT.root",
"recreate" ));
136 TTree*
Tree =
new TTree(
"tree",
"test_tree" );
138 Tree->Branch(
"pass", &pass,
"pass/I" );
149 std::cout<<
"Initializing QG BDT Tagger"<<std::endl;
153 if(! m_Tagger.
setProperty(
"CalibArea",
"JetQGTaggerBDT/Oct18/") )
return 1;
154 if(! m_Tagger.
setProperty(
"ConfigFile",
"JetQGTaggerBDT50Gluon.dat") )
return 1;
155 if(! m_Tagger.
setProperty(
"UseJetVars", 0) )
return 1;
156 if(! m_Tagger.
retrieve() )
return 1;
165 float w_nGluonTaggedANDisGluon = 0.;
166 float w_nQuarkTaggedANDisQuark = 0.;
167 float w_nGluonTaggedANDisQuark = 0.;
168 float w_nQuarkTaggedANDisGluon = 0.;
169 float eventweight = 0.;
175 event.getEntry(
entry );
182 if(ievent!=-1 &&
static_cast <int> (evtInfo->
eventNumber())!=ievent) {
189 if( !
event.
retrieve( myJets,
"AntiKt4EMTopoJets" ).isSuccess() ) {
195 int truthlabel =
jet->getAttribute<
int>(
"PartonTruthLabelID");
196 if(
jet->pt()<20000 || TMath::Abs(
jet->eta())>2.5 || truthlabel==-1 || truthlabel==5)
198 if(
verbose) std::cout<<std::endl;
202 std::cout <<
"Testing QG BDT Tagger " << std::endl;
203 std::cout <<
"RunningTag : " <<
jet->auxdata<
bool>(
"Tagged") <<
" jet truth label: " << truthlabel << std::endl;
207 switch (truthlabel) {
214 w_nQuark += eventweight;
215 if(
jet->auxdata<
bool>(
"Tagged")==1){
216 w_nQuarkTaggedANDisQuark += eventweight;
219 w_nGluonTaggedANDisQuark += eventweight;
225 w_nGluon += eventweight;
226 if(
jet->auxdata<
bool>(
"Tagged")==1){
227 w_nQuarkTaggedANDisGluon += eventweight;
230 w_nGluonTaggedANDisGluon += eventweight;
238 pass =
jet->auxdata<
bool>(
"Tagged");
243 if(
nevents!=-1 &&
entry%100 == 0) Info(
APP_NAME,
"===>>> done processing event #%i, run #%i %i events processed so far <<<===",
static_cast< int >( evtInfo->
eventNumber() ),
static_cast< int >( evtInfo->
runNumber() ),
static_cast< int >(
entry + 1 ) );
250 std::cout<<
"gluons: "<<w_nGluon<<
"\n";
251 std::cout<<
"lights: "<<w_nQuark<<
"\n";
252 std::cout<<
"efficiencies for gluon WP:"<<
"\n";
253 std::cout<<
"gluon efficiency: "<<w_nGluonTaggedANDisGluon/w_nGluon<<
"\n";
254 std::cout<<
"quark efficiency: "<<w_nGluonTaggedANDisQuark/w_nQuark<<
"\n";
255 std::cout<<
"efficiencies for quark WP:"<<
"\n";
256 std::cout<<
"quark efficiency: "<<w_nQuarkTaggedANDisQuark/w_nQuark<<
"\n";
257 std::cout<<
"gluon efficiency: "<<w_nQuarkTaggedANDisGluon/w_nGluon<<
"\n";
266 std::cout<<std::endl<<std::endl;
267 std::cout<<
"Smart Slimming Checker :"<<std::endl;
269 std::cout<<std::endl<<std::endl;
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
virtual StatusCode tag(const xAOD::Jet &jet) const override
IBoostedJetTagger interface.
uint64_t eventNumber() const
The current event's event number.
ReadStats & stats()
Access the object belonging to the current thread.
@ kAthenaAccess
Access containers/objects like Athena does.
uint32_t runNumber() const
The current event's run number.
POOL::TEvent event(POOL::TEvent::kClassAccess)
static IOStats & instance()
Singleton object accessor.
void printSmartSlimmingBranchList(bool autoIncludeLinks=false) const
Print the accessed variables, formatted for smart slimming.
Class describing the basic event information.
A relatively simple transient store for objects created in analysis.
int main(int argc, char *argv[])
StatusCode retrieve(const T *&obj)
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Error
The different types of error that can be flagged in the L1TopoRDO.
float mcEventWeight(size_t i=0) const
The weight of one specific MC event used in the simulation.
Tool for accessing xAOD files outside of Athena.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.