Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

test3.cpp

Go to the documentation of this file.
00001 
00002 // 
00003 // Vertex package test routines
00004 //
00005 // Author : C. Delaere
00006 //
00007 // Date: 2001-08-08
00008 //
00009 //
00011 
00012 #include <fstream>
00013 #include "AlephExManager.h"
00014 #include "AlephCollection.h"
00015 #include <vector>
00016 #include "AlToolBox.h"
00017 #include "AlBjet.h"
00018 
00019 extern ofstream fout;
00020 
00022 //  User Init
00024 
00025 static float mZ = 91.1882; // RPP2000
00026 
00027 void AlephExManager::UserInit()
00028 {
00029         int i;
00030         float f;
00031         theNtupleWriter()->AddOutput(f,"x");
00032         theNtupleWriter()->AddOutput(f,"y");
00033         theNtupleWriter()->AddOutput(f,"z");
00034         theNtupleWriter()->AddOutput(f,"MCx");
00035         theNtupleWriter()->AddOutput(f,"MCy");
00036         theNtupleWriter()->AddOutput(f,"MCz");
00037         theNtupleWriter()->AddOutput(f,"EventPb");
00038         theNtupleWriter()->AddOutput(i,"nJets");
00039         theNtupleWriter()->AddOutput(f,"JetPb");
00040 }
00041 
00044 
00046 //  User Event
00048 bool AlephExManager::UserEvent(AlphaBanks& EventInfo)
00049 {
00050   cerr << ".";
00051 // get pointers to the objects used in the analysis
00052   // Collection of pointers the the MC vertices
00053   AlephCollection<AlVertex *> alMCvtp=EventInfo.MCverticesPV();
00054   // The reconstructed main vertex
00055   AlVertex* alMainV=EventInfo.MainVertexP();
00056 // keep the values (in the output ntuple)
00057   theNtupleWriter()->Keep("x", alMainV->QX());
00058   theNtupleWriter()->Keep("y", alMainV->QY());
00059   theNtupleWriter()->Keep("z", alMainV->QZ());
00060   theNtupleWriter()->Keep("MCx",alMCvtp[0]->QX());
00061   theNtupleWriter()->Keep("MCy",alMCvtp[0]->QY());
00062   theNtupleWriter()->Keep("MCz",alMCvtp[0]->QZ());
00063 // Produce B-Jets using the QIPBTAG algorithm
00064   // instanciate the toolbox
00065   AlToolBox myToolBox;
00066   // call the QIPBTAG-like method
00067   pair<AlephCollection<AlBjet>,vector<float> > output = myToolBox.TagBjets(&EventInfo);
00068   // keep the event probability (in the output ntuple)
00069   theNtupleWriter()->Keep("EventPb", output.second[EventInfo.TrackV().size()]);
00070   // keep the number of jets produced
00071   theNtupleWriter()->Keep("nJets", output.first.size());
00072 // compute the maximum B-Jet probability
00073   // extract the vector of probabilities
00074   vector<float> values;
00075   for(AlephCollection<AlBjet>::iterator bjet_i=output.first.begin();bjet_i<output.first.end();bjet_i++)
00076           values.push_back(bjet_i->getBprobability());
00077   // keep the biggest B probability (min value)
00078   float proba = ( values.size() ? (*min_element(values.begin(),values.end())) : 1);
00079   theNtupleWriter()->Keep("JetPb", proba);
00080 // the event is valid, so fill the ntuple (the tree)
00081   theNtupleWriter()->Fill();
00082   return true;
00083 }
00084 
00087 
00089 //  User Term
00091 void AlephExManager::UserTerm() {}

Generated at Wed Jun 18 17:19:20 2003 for ALPHA++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001